ui.screens.wfl ============== .. py:module:: ui.screens.wfl .. autoapi-nested-parse:: Wait-for-light screens: calibration (legacy) and auto-detection. Classes ------- .. autoapisummary:: ui.screens.wfl.WFLMeasureResult ui.screens.wfl.WFLMeasureScreen ui.screens.wfl.WFLConfirmResult ui.screens.wfl.WFLConfirmScreen ui.screens.wfl.WFLDetectScreen Module Contents --------------- .. py:class:: WFLMeasureResult Result from WFLMeasureScreen. .. py:attribute:: value :type: float .. py:class:: WFLMeasureScreen(port: int, is_on: bool) Bases: :py:obj:`ui.screen.UIScreen`\ [\ :py:obj:`WFLMeasureResult`\ ] Measure light on or off state for wait-for-light calibration. Shows light bulb visualization and real-time sensor reading. Returns sensor value when button is pressed. .. py:attribute:: title :value: 'Wait for Light Calibration' .. py:attribute:: port .. py:attribute:: is_on .. py:method:: build() -> ui.widgets.Widget Build the screen layout. Called on every render. Return a Widget tree describing what to display. .. py:method:: on_press() :async: .. py:class:: WFLConfirmResult Result from WFLConfirmScreen. .. py:attribute:: confirmed :type: bool .. py:attribute:: light_off :type: float .. py:attribute:: light_on :type: float .. py:property:: threshold :type: float .. py:class:: WFLConfirmScreen(port: int, light_off: float, light_on: float) Bases: :py:obj:`ui.screen.UIScreen`\ [\ :py:obj:`WFLConfirmResult`\ ] Confirm wait-for-light calibration values. Shows measured values (editable), threshold, and difference. User can confirm or retry. .. py:attribute:: title :value: 'Wait for Light Calibration' .. py:attribute:: port .. py:attribute:: light_off .. py:attribute:: light_on .. py:property:: threshold :type: float .. py:property:: difference :type: float .. py:property:: is_good :type: bool .. py:method:: build() -> ui.widgets.Widget Build the screen layout. Called on every render. Return a Widget tree describing what to display. .. py:method:: on_off_change(value: float) :async: .. py:method:: on_on_change(value: float) :async: .. py:method:: on_retry() :async: .. py:method:: on_confirm() :async: .. py:class:: WFLDetectScreen Bases: :py:obj:`ui.screen.UIScreen`\ [\ :py:obj:`None`\ ] Status display for automatic wait-for-light detection. Shows the current sensor value, Kalman-filtered baseline, trigger threshold, and detection status. Supports an interactive test mode where the user verifies the lamp would trigger before the system is truly armed. States: WARMING UP — collecting baseline samples TEST MODE — detects lamp but will NOT start the mission TRIGGERED — lamp detected during test (big confirmation) ARMED — fully armed, real trigger starts the mission GO! — lamp detected for real, mission starting .. py:attribute:: title :value: 'Wait for Light' .. py:attribute:: status :type: str :value: 'WARMING UP' .. py:attribute:: status_color :type: str :value: 'amber' .. py:attribute:: raw_value :type: int :value: 0 .. py:attribute:: baseline :type: float :value: 0.0 .. py:attribute:: threshold :type: float :value: 0.0 .. py:attribute:: test_count :type: int :value: 0 .. py:attribute:: hint :type: str :value: '' .. py:attribute:: request_test_mode :type: bool :value: False .. py:attribute:: request_reinit :type: bool :value: False .. py:method:: build() -> ui.widgets.Widget Build the screen layout. Called on every render. Return a Widget tree describing what to display. .. py:method:: on_test() :async: .. py:method:: on_reinit() :async: