|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Public Member Functions | |
| __init__ (self, receiver, str device_ip=None, int device_port=None, parent=None) | |
| init_ui (self) | |
| open_pwm_control (self) | |
| update_label_display (self, actuator_id, text) | |
| on_label_changed (self, int actuator_id, str text) | |
| update_actuator_visibility (self) | |
| on_status_update (self, str message) | |
| on_sensor_data (self, dict header, List[dict] chunks, str source_ip) | |
| update_button_highlight (self, int array_idx, int actuator_state) | |
| set_actuator_state (self, int actuator_id, int gui_state, bool force=False) | |
| send_actuator_command (self, int actuator_id, int hardware_command) | |
| update_current_display (self) | |
| close_socket (self) | |
Public Attributes | |
| receiver = receiver | |
| device_ip = CONFIG.config["network"]["actuator_ip"] | |
| device_port = CONFIG.config["network"]["actuator_port"] | |
| list | actuator_states = [0] * get_num_actuators() |
| dict | actuator_types |
| main_window_ref = None | |
| pwm_window = None | |
| bool | manual_control_enabled = False |
| list | voltage_readings = [0.0] * get_num_actuators() |
| dict | actuator_labels |
| only_show_actuators_with_roles | |
| command_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
| on_sensor_data | |
| on_status_update | |
| update_timer = QtCore.QTimer(self) | |
| update_current_display | |
| grid_container = QtWidgets.QWidget() | |
| grid_layout = QtWidgets.QGridLayout(self.grid_container) | |
| list | actuator_widgets = [] |
| pwm_btn = QtWidgets.QPushButton("PWM CONTROL") | |
| open_pwm_control | |
Reusable actuator control panel. Used in ActuatorControlWindow and CombinedMainWindow.
Definition at line 2283 of file combined_gui.py.
| combined_gui.ActuatorControlWidget.__init__ | ( | self, | |
| receiver, | |||
| str | device_ip = None, | ||
| int | device_port = None, | ||
| parent = None ) |
| combined_gui.ActuatorControlWidget.close_socket | ( | self | ) |
| combined_gui.ActuatorControlWidget.init_ui | ( | self | ) |
Initialize the user interface
Definition at line 2344 of file combined_gui.py.
| combined_gui.ActuatorControlWidget.on_label_changed | ( | self, | |
| int | actuator_id, | ||
| str | text ) |
Update local actuator label and display (config is written via set_actuator_role in settings).
Definition at line 2544 of file combined_gui.py.
References actuator_labels, only_show_actuators_with_roles, update_actuator_visibility(), and update_label_display().
| combined_gui.ActuatorControlWidget.on_sensor_data | ( | self, | |
| dict | header, | ||
| List[dict] | chunks, | ||
| str | source_ip ) |
Handle received sensor data (actuator current-sense voltage readings).
Definition at line 2602 of file combined_gui.py.
References combined_gui.actuator_counts_to_volts(), actuator_testing_gui.ActuatorTestingWindow.device_ip, device_ip, combined_gui.get_num_actuators(), and voltage_readings.
| combined_gui.ActuatorControlWidget.on_status_update | ( | self, | |
| str | message ) |
Handle status updates from receiver thread
Definition at line 2598 of file combined_gui.py.
| combined_gui.ActuatorControlWidget.open_pwm_control | ( | self | ) |
Open the PWM control window, creating it lazily.
Definition at line 2523 of file combined_gui.py.
References main_window_ref, combined_gui.SensorPlotWidget.main_window_ref, open_pwm_control, and pwm_window.
Referenced by combined_gui.SensorPlotWidget.on_navigation_requested().
| combined_gui.ActuatorControlWidget.send_actuator_command | ( | self, | |
| int | actuator_id, | ||
| int | hardware_command ) |
Send an actuator command packet to the device. hardware_command: 0 = OFF, 1 = ON (hardware level)
Definition at line 2716 of file combined_gui.py.
References actuator_states, command_sock, combined_gui.create_actuator_command_packet(), actuator_testing_gui.ActuatorTestingWindow.device_ip, device_ip, actuator_testing_gui.ActuatorTestingWindow.device_port, and device_port.
Referenced by set_actuator_state().
| combined_gui.ActuatorControlWidget.set_actuator_state | ( | self, | |
| int | actuator_id, | ||
| int | gui_state, | ||
| bool | force = False ) |
Set actuator state and send command packet. gui_state: 0 = CLOSED, 1 = OPEN (from GUI button) force: If True, bypass manual control lock (used by state machine) Converts to hardware command based on NC/NO type: - NC: OPEN (1) -> hardware ON (1), CLOSED (0) -> hardware OFF (0) - NO: OPEN (1) -> hardware OFF (0), CLOSED (0) -> hardware ON (1)
Definition at line 2678 of file combined_gui.py.
References actuator_labels, actuator_states, actuator_types, main_window_ref, combined_gui.SensorPlotWidget.main_window_ref, manual_control_enabled, send_actuator_command(), and update_button_highlight().
| combined_gui.ActuatorControlWidget.update_actuator_visibility | ( | self | ) |
Update visibility of actuator widgets based on whether they have roles. When filtering is enabled, reflow visible actuators in order: row1 vents, row2 press, row3 mains; col1 fuel, col2 lox.
Definition at line 2552 of file combined_gui.py.
References actuator_widgets, combined_gui.get_num_actuators(), grid_layout, and only_show_actuators_with_roles.
Referenced by on_label_changed().
| combined_gui.ActuatorControlWidget.update_button_highlight | ( | self, | |
| int | array_idx, | ||
| int | actuator_state ) |
Update button highlighting based on actuator state. Selected OPEN = saturated green, selected CLOSED = saturated red.
Definition at line 2630 of file combined_gui.py.
References actuator_widgets.
Referenced by set_actuator_state().
| combined_gui.ActuatorControlWidget.update_current_display | ( | self | ) |
Update the voltage reading display for all actuators
Definition at line 2746 of file combined_gui.py.
References actuator_widgets, combined_gui.get_num_actuators(), and voltage_readings.
| combined_gui.ActuatorControlWidget.update_label_display | ( | self, | |
| actuator_id, | |||
| text ) |
External method to update label display when changed in settings
Definition at line 2537 of file combined_gui.py.
References actuator_widgets.
Referenced by on_label_changed().
| dict combined_gui.ActuatorControlWidget.actuator_labels |
Definition at line 2320 of file combined_gui.py.
Referenced by on_label_changed(), and set_actuator_state().
| list combined_gui.ActuatorControlWidget.actuator_states = [0] * get_num_actuators() |
Definition at line 2297 of file combined_gui.py.
Referenced by send_actuator_command(), and set_actuator_state().
| dict combined_gui.ActuatorControlWidget.actuator_types |
Definition at line 2301 of file combined_gui.py.
Referenced by set_actuator_state().
| list combined_gui.ActuatorControlWidget.actuator_widgets = [] |
Definition at line 2366 of file combined_gui.py.
Referenced by update_actuator_visibility(), update_button_highlight(), update_current_display(), and update_label_display().
| combined_gui.ActuatorControlWidget.command_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) |
Definition at line 2331 of file combined_gui.py.
Referenced by solenoid_characterization_gui.SolenoidCharacterizationWindow._send_actuator_command(), close_socket(), solenoid_characterization_gui.SolenoidCharacterizationWindow.closeEvent(), solenoid_characterization_gui.SolenoidCharacterizationWindow.on_pwm_go_clicked(), and send_actuator_command().
| combined_gui.ActuatorControlWidget.device_ip = CONFIG.config["network"]["actuator_ip"] |
Definition at line 2292 of file combined_gui.py.
Referenced by solenoid_characterization_gui.SolenoidCharacterizationWindow._on_send_ip_changed(), solenoid_characterization_gui.SolenoidCharacterizationWindow._send_actuator_command(), solenoid_characterization_gui.SolenoidCharacterizationWindow.on_pwm_go_clicked(), on_sensor_data(), and send_actuator_command().
| combined_gui.ActuatorControlWidget.device_port = CONFIG.config["network"]["actuator_port"] |
Definition at line 2293 of file combined_gui.py.
Referenced by solenoid_characterization_gui.SolenoidCharacterizationWindow._send_actuator_command(), solenoid_characterization_gui.SolenoidCharacterizationWindow.on_pwm_go_clicked(), and send_actuator_command().
| combined_gui.ActuatorControlWidget.grid_container = QtWidgets.QWidget() |
Definition at line 2352 of file combined_gui.py.
| combined_gui.ActuatorControlWidget.grid_layout = QtWidgets.QGridLayout(self.grid_container) |
Definition at line 2353 of file combined_gui.py.
Referenced by update_actuator_visibility().
| combined_gui.ActuatorControlWidget.main_window_ref = None |
Definition at line 2307 of file combined_gui.py.
Referenced by open_pwm_control(), and set_actuator_state().
| bool combined_gui.ActuatorControlWidget.manual_control_enabled = False |
Definition at line 2313 of file combined_gui.py.
Referenced by set_actuator_state().
| combined_gui.ActuatorControlWidget.on_sensor_data |
Definition at line 2336 of file combined_gui.py.
| combined_gui.ActuatorControlWidget.on_status_update |
Definition at line 2337 of file combined_gui.py.
| combined_gui.ActuatorControlWidget.only_show_actuators_with_roles |
Definition at line 2326 of file combined_gui.py.
Referenced by on_label_changed(), and update_actuator_visibility().
| combined_gui.ActuatorControlWidget.open_pwm_control |
Definition at line 2499 of file combined_gui.py.
Referenced by combined_gui.SensorPlotWidget.on_navigation_requested(), and open_pwm_control().
| combined_gui.ActuatorControlWidget.pwm_btn = QtWidgets.QPushButton("PWM CONTROL") |
Definition at line 2475 of file combined_gui.py.
| combined_gui.ActuatorControlWidget.pwm_window = None |
Definition at line 2310 of file combined_gui.py.
Referenced by open_pwm_control().
| combined_gui.ActuatorControlWidget.receiver = receiver |
Definition at line 2290 of file combined_gui.py.
Referenced by calibration_orchestrator.CalibrationOrchestrator._drain_queue(), sense_testing_gui.SenseTestingGUIWindow._update_plots(), sense_testing_gui.SenseTestingGUIWindow.closeEvent(), calibration_orchestrator.CalibrationOrchestrator.start_receiver(), and calibration_orchestrator.CalibrationOrchestrator.stop().
| combined_gui.ActuatorControlWidget.update_current_display |
Definition at line 2341 of file combined_gui.py.
| combined_gui.ActuatorControlWidget.update_timer = QtCore.QTimer(self) |
Definition at line 2340 of file combined_gui.py.
Referenced by sense_testing_gui.SenseTestingGUIWindow.closeEvent().
| list combined_gui.ActuatorControlWidget.voltage_readings = [0.0] * get_num_actuators() |
Definition at line 2317 of file combined_gui.py.
Referenced by on_sensor_data(), and update_current_display().