STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
combined_gui.TopBarWidget Class Reference
Inheritance diagram for combined_gui.TopBarWidget:
[legend]
Collaboration diagram for combined_gui.TopBarWidget:
[legend]

Public Member Functions

 __init__ (self, parent=None)
 resizeEvent (self, event)
 showEvent (self, event)
 on_debug_clicked (self)
 update_button_states (self, str current_state)
 on_mode_button_clicked (self, idx)
 request_state (self, str mode_name)
 abort (self, str abort_type="ABORT")
 toggle_view (self)

Public Attributes

 lbl_time = QtWidgets.QLabel()
 lbl_countdown = QtWidgets.QLabel()
 bar_gn2
 bar_eth
 bar_lox
 mode_button_group = QtWidgets.QButtonGroup(self)
list mode_buttons = []
 state_transitions
str current_state = None
tuple unlock_states
 quick_fire_to_gn2_timer = QtCore.QTimer(self)
 abort_vent_to_abort_timer = QtCore.QTimer(self)
 get_state_color = get_state_color
 get_state_selected_color = get_state_selected_color
 text_color_for_bg = text_color_for_bg
 btn_abort = QtWidgets.QPushButton("ABORT")
 btn_emergency = QtWidgets.QPushButton("EMERGENCY ABORT")
 nav_btn = QtWidgets.QPushButton("SETTINGS")
 toggle_view
 debug_btn = QtWidgets.QPushButton("DEBUG")
 on_debug_clicked
 current_state_label = QtWidgets.QLabel("CURRENT STATE: —")

Static Public Attributes

 navigation_requested = QtCore.pyqtSignal(str)
 mode_changed = QtCore.pyqtSignal(str)
 debug_toggled = QtCore.pyqtSignal(bool)

Protected Member Functions

 _update_clock (self)
 _update_global_line_ys (self)
 _update_current_state_display (self)
str _lighten_color (self, str hex_color, int amount)
str _darken_color (self, str hex_color, int amount)
 _on_quick_fire_3s_elapsed (self)
 _on_abort_vent_5s_elapsed (self)
 _clear_mode_button_selection (self)
 _apply_abort_state (self)

Protected Attributes

 _clock_timer = QtCore.QTimer(self)
 _update_clock
 _on_quick_fire_3s_elapsed
 _on_abort_vent_5s_elapsed

Static Protected Attributes

 _COUNTDOWN_TARGET_UTC

Detailed Description

Definition at line 3193 of file combined_gui.py.

Constructor & Destructor Documentation

◆ __init__()

combined_gui.TopBarWidget.__init__ ( self,
parent = None )

Definition at line 3203 of file combined_gui.py.

References __init__().

Referenced by __init__().

Member Function Documentation

◆ _apply_abort_state()

combined_gui.TopBarWidget._apply_abort_state ( self)
protected
Set GUI and emitted state to Abort (used by EMERGENCY ABORT and by 5s Vent→Abort timer).

Definition at line 3823 of file combined_gui.py.

References _clear_mode_button_selection(), _update_current_state_display(), abort_vent_to_abort_timer, current_state, EngineFSM.current_state, emit(), mode_changed, quick_fire_to_gn2_timer, stop(), and update_button_states().

Referenced by _on_abort_vent_5s_elapsed(), and abort().

◆ _clear_mode_button_selection()

combined_gui.TopBarWidget._clear_mode_button_selection ( self)
protected
Clear selection of all mode buttons so none appear selected (e.g. for Abort/Vent-from-abort).

Definition at line 3816 of file combined_gui.py.

References mode_button_group, and mode_buttons.

Referenced by _apply_abort_state(), and abort().

◆ _darken_color()

str combined_gui.TopBarWidget._darken_color ( self,
str hex_color,
int amount )
protected
Darken a hex color by the given amount

Definition at line 3750 of file combined_gui.py.

References max.

◆ _lighten_color()

str combined_gui.TopBarWidget._lighten_color ( self,
str hex_color,
int amount )
protected
Lighten a hex color by the given amount

Definition at line 3742 of file combined_gui.py.

References min.

Referenced by update_button_states().

◆ _on_abort_vent_5s_elapsed()

combined_gui.TopBarWidget._on_abort_vent_5s_elapsed ( self)
protected
After 5s in Vent (from ABORT button), auto-transition to Abort.

Definition at line 3812 of file combined_gui.py.

References _apply_abort_state().

◆ _on_quick_fire_3s_elapsed()

combined_gui.TopBarWidget._on_quick_fire_3s_elapsed ( self)
protected
After 3s in Quick Fire, auto-transition to GN2 Press.

Definition at line 3807 of file combined_gui.py.

References current_state, EngineFSM.current_state, and request_state().

◆ _update_clock()

combined_gui.TopBarWidget._update_clock ( self)
protected
Update the current-time label and the countdown-to-launch label.

Definition at line 3579 of file combined_gui.py.

References _COUNTDOWN_TARGET_UTC, lbl_countdown, and lbl_time.

◆ _update_current_state_display()

combined_gui.TopBarWidget._update_current_state_display ( self)
protected
Update the CURRENT STATE label to reflect self.current_state.

Definition at line 3622 of file combined_gui.py.

References current_state, EngineFSM.current_state, and current_state_label.

Referenced by _apply_abort_state(), abort(), on_mode_button_clicked(), and request_state().

◆ _update_global_line_ys()

combined_gui.TopBarWidget._update_global_line_ys ( self)
protected
Compute bar rect once from first bar; set same y20,y40,y60,y80 (parent coords) on all three bars.

Definition at line 3599 of file combined_gui.py.

References bar_eth, bar_gn2, and bar_lox.

Referenced by resizeEvent(), and showEvent().

◆ abort()

combined_gui.TopBarWidget.abort ( self,
str abort_type = "ABORT" )
Trigger Abort state (CSV) and log the event.
ABORT: go to Vent first, then after 5s automatically go to Abort.
EMERGENCY ABORT: go to Abort immediately, no matter what state or mode (including DEBUG).

Definition at line 3867 of file combined_gui.py.

References _apply_abort_state(), _clear_mode_button_selection(), _update_current_state_display(), abort_vent_to_abort_timer, current_state, EngineFSM.current_state, emit(), mode_changed, path.parent(), quick_fire_to_gn2_timer, start(), stop(), and update_button_states().

◆ on_debug_clicked()

combined_gui.TopBarWidget.on_debug_clicked ( self)
Handle DEBUG button click (toggle) - unlocks states and manual actuator control

Definition at line 3627 of file combined_gui.py.

References current_state, EngineFSM.current_state, debug_btn, debug_toggled, emit(), unlock_states, and update_button_states().

◆ on_mode_button_clicked()

combined_gui.TopBarWidget.on_mode_button_clicked ( self,
idx )

◆ request_state()

combined_gui.TopBarWidget.request_state ( self,
str mode_name )
Programmatically switch to a state (e.g. for automatic pressure-based transitions). Bypasses transition check.

Definition at line 3833 of file combined_gui.py.

References _update_current_state_display(), abort_vent_to_abort_timer, current_state, EngineFSM.current_state, emit(), mode_buttons, mode_changed, quick_fire_to_gn2_timer, start(), stop(), and update_button_states().

Referenced by _on_quick_fire_3s_elapsed().

◆ resizeEvent()

combined_gui.TopBarWidget.resizeEvent ( self,
event )

Definition at line 3614 of file combined_gui.py.

References _update_global_line_ys(), and resizeEvent().

Referenced by resizeEvent().

◆ showEvent()

combined_gui.TopBarWidget.showEvent ( self,
event )

Definition at line 3618 of file combined_gui.py.

References _update_global_line_ys(), and showEvent().

Referenced by showEvent().

◆ toggle_view()

combined_gui.TopBarWidget.toggle_view ( self)

Definition at line 3893 of file combined_gui.py.

References emit(), nav_btn, and navigation_requested.

◆ update_button_states()

combined_gui.TopBarWidget.update_button_states ( self,
str current_state )
Update button enabled/disabled states and styles based on allowed transitions

Definition at line 3638 of file combined_gui.py.

References _lighten_color(), get_state_color, get_state_selected_color, mode_buttons, state_transitions, text_color_for_bg, and unlock_states.

Referenced by _apply_abort_state(), abort(), on_debug_clicked(), on_mode_button_clicked(), and request_state().

Member Data Documentation

◆ _clock_timer

combined_gui.TopBarWidget._clock_timer = QtCore.QTimer(self)
protected

Definition at line 3244 of file combined_gui.py.

◆ _COUNTDOWN_TARGET_UTC

combined_gui.TopBarWidget._COUNTDOWN_TARGET_UTC
staticprotected
Initial value:
= QtCore.QDateTime(
QtCore.QDate(2026, 3, 6), QtCore.QTime(20, 0, 0), QtCore.Qt.TimeSpec.UTC
)

Definition at line 3199 of file combined_gui.py.

Referenced by _update_clock().

◆ _on_abort_vent_5s_elapsed

combined_gui.TopBarWidget._on_abort_vent_5s_elapsed
protected

Definition at line 3356 of file combined_gui.py.

◆ _on_quick_fire_3s_elapsed

combined_gui.TopBarWidget._on_quick_fire_3s_elapsed
protected

Definition at line 3352 of file combined_gui.py.

◆ _update_clock

combined_gui.TopBarWidget._update_clock
protected

Definition at line 3246 of file combined_gui.py.

◆ abort_vent_to_abort_timer

combined_gui.TopBarWidget.abort_vent_to_abort_timer = QtCore.QTimer(self)

Definition at line 3354 of file combined_gui.py.

Referenced by _apply_abort_state(), abort(), on_mode_button_clicked(), and request_state().

◆ bar_eth

combined_gui.TopBarWidget.bar_eth
Initial value:
= PressureBarWidget(
"ETH",
nop_eth,
meop_eth,
pop_eth,
thresh=thresh_eth,
fixed_color=QtGui.QColor("#ff9f43"),
)

Definition at line 3275 of file combined_gui.py.

Referenced by _update_global_line_ys().

◆ bar_gn2

combined_gui.TopBarWidget.bar_gn2
Initial value:
= PressureBarWidget(
"GN2",
nop_gn2,
meop_gn2,
pop_gn2,
thresh=thresh_gn2,
fixed_color=QtGui.QColor("#27ae60"),
)

Definition at line 3267 of file combined_gui.py.

Referenced by _update_global_line_ys().

◆ bar_lox

combined_gui.TopBarWidget.bar_lox
Initial value:
= PressureBarWidget(
"LOX",
nop_lox,
meop_lox,
pop_lox,
thresh=thresh_lox,
fixed_color=QtGui.QColor("#74b9ff"),
)

Definition at line 3283 of file combined_gui.py.

Referenced by _update_global_line_ys().

◆ btn_abort

combined_gui.TopBarWidget.btn_abort = QtWidgets.QPushButton("ABORT")

Definition at line 3443 of file combined_gui.py.

◆ btn_emergency

combined_gui.TopBarWidget.btn_emergency = QtWidgets.QPushButton("EMERGENCY ABORT")

Definition at line 3468 of file combined_gui.py.

◆ current_state

combined_gui.TopBarWidget.current_state = None

◆ current_state_label

combined_gui.TopBarWidget.current_state_label = QtWidgets.QLabel("CURRENT STATE: —")

Definition at line 3572 of file combined_gui.py.

Referenced by _update_current_state_display().

◆ debug_btn

combined_gui.TopBarWidget.debug_btn = QtWidgets.QPushButton("DEBUG")

Definition at line 3530 of file combined_gui.py.

Referenced by on_debug_clicked().

◆ debug_toggled

combined_gui.TopBarWidget.debug_toggled = QtCore.pyqtSignal(bool)
static

Definition at line 3196 of file combined_gui.py.

Referenced by on_debug_clicked().

◆ get_state_color

combined_gui.TopBarWidget.get_state_color = get_state_color

Definition at line 3375 of file combined_gui.py.

Referenced by update_button_states().

◆ get_state_selected_color

combined_gui.TopBarWidget.get_state_selected_color = get_state_selected_color

Definition at line 3394 of file combined_gui.py.

Referenced by update_button_states().

◆ lbl_countdown

combined_gui.TopBarWidget.lbl_countdown = QtWidgets.QLabel()

Definition at line 3221 of file combined_gui.py.

Referenced by _update_clock().

◆ lbl_time

combined_gui.TopBarWidget.lbl_time = QtWidgets.QLabel()

Definition at line 3215 of file combined_gui.py.

Referenced by _update_clock().

◆ mode_button_group

combined_gui.TopBarWidget.mode_button_group = QtWidgets.QButtonGroup(self)

Definition at line 3315 of file combined_gui.py.

Referenced by _clear_mode_button_selection().

◆ mode_buttons

combined_gui.TopBarWidget.mode_buttons = []

◆ mode_changed

combined_gui.TopBarWidget.mode_changed = QtCore.pyqtSignal(str)
static

Definition at line 3195 of file combined_gui.py.

Referenced by _apply_abort_state(), abort(), on_mode_button_clicked(), and request_state().

◆ nav_btn

combined_gui.TopBarWidget.nav_btn = QtWidgets.QPushButton("SETTINGS")

Definition at line 3498 of file combined_gui.py.

Referenced by toggle_view().

◆ navigation_requested

combined_gui.TopBarWidget.navigation_requested = QtCore.pyqtSignal(str)
static

Definition at line 3194 of file combined_gui.py.

Referenced by toggle_view().

◆ on_debug_clicked

combined_gui.TopBarWidget.on_debug_clicked

Definition at line 3534 of file combined_gui.py.

◆ quick_fire_to_gn2_timer

combined_gui.TopBarWidget.quick_fire_to_gn2_timer = QtCore.QTimer(self)

Definition at line 3350 of file combined_gui.py.

Referenced by _apply_abort_state(), abort(), on_mode_button_clicked(), and request_state().

◆ state_transitions

combined_gui.TopBarWidget.state_transitions
Initial value:
= load_state_transitions_csv(
CONFIG.get_state_transitions_csv_path()
)

Definition at line 3341 of file combined_gui.py.

Referenced by update_button_states().

◆ text_color_for_bg

combined_gui.TopBarWidget.text_color_for_bg = text_color_for_bg

Definition at line 3406 of file combined_gui.py.

Referenced by update_button_states().

◆ toggle_view

combined_gui.TopBarWidget.toggle_view

Definition at line 3521 of file combined_gui.py.

◆ unlock_states

tuple combined_gui.TopBarWidget.unlock_states
Initial value:
= (
False # Track whether state transitions are unlocked (via DEBUG button)
)

Definition at line 3345 of file combined_gui.py.

Referenced by on_debug_clicked(), on_mode_button_clicked(), and update_button_states().


The documentation for this class was generated from the following file: