feat(tui): implement bridge, live scanner, operations menu, and pocs tui CLI#1454
Open
wtgee wants to merge 5 commits into
Open
feat(tui): implement bridge, live scanner, operations menu, and pocs tui CLI#1454wtgee wants to merge 5 commits into
wtgee wants to merge 5 commits into
Conversation
…tui CLI command Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## v1.0.0 #1454 +/- ##
==========================================
+ Coverage 71.36% 73.45% +2.08%
==========================================
Files 124 130 +6
Lines 11179 12579 +1400
Branches 913 1010 +97
==========================================
+ Hits 7978 9240 +1262
- Misses 2991 3110 +119
- Partials 210 229 +19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- 110 tests covering actions, bridge, scanner, theme, cmdlog, layout, panels/dashboard, panels/help, panels/operations - Coverage: 42% → 83% overall; 100% for model/layout/cmdlog/input/theme - Mock curses screens for rendering tests (no initscr needed) - Inject mock TelemetryClient for scanner._scan tests Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Scanner._scan_direct() reads state directly from in-process POCS instance (mount booleans from live properties, cameras from observatory.cameras, observation from status dict with correct 'observation' / 'exptime' key names) - _scan() now prefers _scan_direct() when pocs is available, avoiding the need for a running telemetry server - Pass pocs to Scanner in __main__.main() so direct reads activate - curses_main() removes all loguru sinks before entering curses and restores an error-only stderr sink on exit, preventing log lines from corrupting the terminal display - Added 7 new TestScannerDirect tests covering the direct-read path Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…bility curses.curs_set(0) raises _curses.error on many terminals (macOS iTerm2, xterm etc.), which propagated out of main() and caused the TUI to exit immediately with a blank screen. Wrap the call in try/except curses.error. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
pocs.status builds the status dict but then inserts it into the DB
(telemetry server on port 6562). When no server is running the insert
raises ConnectionError, pocs.status catches it and returns {}, leaving
the TUI with all-default values.
Fix: _scan_direct() now reads POCS/Observatory state directly from
live Python properties, bypassing pocs.status entirely:
- pocs.state / pocs.next_state / pocs.do_states
- observatory.can_observe, mount.is_initialized, mount.is_parked, etc.
- observatory.cameras iterated directly
- observatory.current_observation.status for observation info
- Camera attributes wrapped per-field in try/except (cam.temperature
raises on the simulator)
Updated TestScannerDirect fixtures: added can_observe, _MockObservation
with status property, _MockCamera.temperature works via try/except.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements phases 2–4 of the POCS TUI as defined in
docs/tui_plan.md.What's new
bridge.py— in-process command channel from TUI to POCS; runs blocking POCS calls inThreadPoolExecutor; supportsinitialize,start_run,stop_run,park,abort_exposure,power_down,get_config,set_configscanner.pynow reads fromTelemetryClient(lazy init, graceful fallback when server is down)ModalModel,ConfigEditorModel,run_activeflag onSystemModellayout_compute()implemented; newOPERATIONSandCONFIGview constantsdashboard.py,operations.py,help.pypanels__main__.py— tab bar, view routing, modal confirmation overlaypocs tuiCLI command —--config-file,--no-pocs(monitor-only),--simulatorflagsTests
15 tests pass covering model, bridge, actions, scanner, operations menu, input handling, and layout.
Closes part of #1449