|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Public Member Functions | |
| __init__ (self) | |
| on_actuator_toggled (self, int actuator_id, bool checked) | |
| on_sensor_data (self, dict header, List[dict] chunks, str source_ip) | |
| on_channel_toggled (self, int actuator_id, int state) | |
| on_show_current_toggled (self, int state) | |
| update_plots (self) | |
| closeEvent (self, QtGui.QCloseEvent event) | |
Public Attributes | |
| device_ip = DEFAULT_ACTUATOR_IP | |
| device_port = ACTUATOR_COMMAND_PORT | |
| window_seconds = WINDOW_SECONDS | |
| bool | show_current = False |
| dict | voltage_history |
| dict | plot_enabled |
| deque | heartbeat_timestamps = deque(maxlen=HEARTBEAT_RATE_WINDOW) |
| Optional[float] | last_heartbeat_time = None |
| Optional[int] | board_id = None |
| Optional[int] | board_state = None |
| Optional[str] | board_source_ip = None |
| Optional[bytes] | firmware_hash = None |
| receiver = SensorReceiver(SENSOR_RECEIVE_PORT, sock=self._shared_sock) | |
| on_sensor_data | |
| update_timer = QtCore.QTimer(self) | |
| update_plots | |
| ip_edit = QtWidgets.QLineEdit(self.device_ip) | |
| port_spin = QtWidgets.QSpinBox() | |
| connection_label = QtWidgets.QLabel("Connection: —") | |
| heartbeat_rate_label = QtWidgets.QLabel("Heartbeat rate: — Hz") | |
| board_state_label = QtWidgets.QLabel("Board state: —") | |
| board_id_label = QtWidgets.QLabel("Board ID: —") | |
| board_ip_label = QtWidgets.QLabel("Source: —") | |
| firmware_hash_label = QtWidgets.QLabel("Firmware hash: —") | |
| send_heartbeat_cb = QtWidgets.QCheckBox("Send server heartbeat") | |
| send_actuator_config_btn | |
| dict | channel_checkboxes = {} |
| show_current_cb = QtWidgets.QCheckBox("Show current (A)") | |
| on_show_current_toggled | |
| dict | button_map = {} |
| dict | voltage_labels = {} |
| status_label = QtWidgets.QLabel("Ready") | |
| plot_widget = pg.PlotWidget(background="#1e1e1e") | |
| dict | curves = {} |
Protected Member Functions | |
| _build_ui (self) | |
| _on_board_heartbeat (self, float timestamp, int board_id, int board_state, int engine_state, str source_ip, bytes firmware_hash) | |
| _on_send_heartbeat_changed (self, int state) | |
| _send_server_heartbeat_once (self) | |
| _send_minimal_actuator_config (self) | |
| _update_board_status_labels (self) | |
Protected Attributes | |
| _send_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
| Optional[socket.socket] | _shared_sock = None |
| _server_heartbeat_timer = QtCore.QTimer(self) | |
| _send_server_heartbeat_once | |
| _on_board_heartbeat | |
| _on_send_heartbeat_changed | |
| _t0 = t0 | |
Definition at line 360 of file actuator_testing_gui.py.
| actuator_testing_gui.ActuatorTestingWindow.__init__ | ( | self | ) |
Definition at line 361 of file actuator_testing_gui.py.
References __init__(), and array.resize().
Referenced by __init__().
|
protected |
Definition at line 413 of file actuator_testing_gui.py.
|
protected |
Definition at line 569 of file actuator_testing_gui.py.
References board_id, SensorHotfire::CoreState.board_id, board_source_ip, board_state, firmware_hash, firmware_hash_label, heartbeat_timestamps, ip_edit, and last_heartbeat_time.
|
protected |
Definition at line 590 of file actuator_testing_gui.py.
References _server_heartbeat_timer, start(), and stop().
|
protected |
Definition at line 609 of file actuator_testing_gui.py.
References _send_sock, actuator_testing_gui.build_minimal_actuator_config_packet(), ip_edit, port_spin, status_label, lc_calibration_gui.LCPlotWindow.status_label, and pt_multi_gui.PTPlotWindow.status_label.
|
protected |
Definition at line 596 of file actuator_testing_gui.py.
References _send_sock, actuator_testing_gui.build_server_heartbeat_packet(), ip_edit, port_spin, status_label, lc_calibration_gui.LCPlotWindow.status_label, and pt_multi_gui.PTPlotWindow.status_label.
|
protected |
Definition at line 688 of file actuator_testing_gui.py.
References board_id_label, board_ip_label, board_state, board_state_label, connection_label, heartbeat_rate_label, heartbeat_timestamps, last_heartbeat_time, and time.time().
Referenced by update_plots().
| actuator_testing_gui.ActuatorTestingWindow.closeEvent | ( | self, | |
| QtGui.QCloseEvent | event ) |
Definition at line 749 of file actuator_testing_gui.py.
References _send_sock, _server_heartbeat_timer, receiver, anonymous_namespace{idle_e2e.cpp}::World.receiver, lc_calibration_gui.LCPlotWindow.receiver, pt_multi_gui.PTPlotWindow.receiver, stop(), update_timer, and pt_multi_gui.PTPlotWindow.update_timer.
| actuator_testing_gui.ActuatorTestingWindow.on_actuator_toggled | ( | self, | |
| int | actuator_id, | ||
| bool | checked ) |
Definition at line 622 of file actuator_testing_gui.py.
References _send_sock, actuator_testing_gui.create_actuator_command_packet(), device_ip, ip_edit, port_spin, status_label, lc_calibration_gui.LCPlotWindow.status_label, and pt_multi_gui.PTPlotWindow.status_label.
| actuator_testing_gui.ActuatorTestingWindow.on_channel_toggled | ( | self, | |
| int | actuator_id, | ||
| int | state ) |
Definition at line 672 of file actuator_testing_gui.py.
References curves, gui.App.curves, lc_calibration_gui.LCPlotWindow.curves, plot_enabled, and pt_multi_gui.PTPlotWindow.plot_enabled.
| actuator_testing_gui.ActuatorTestingWindow.on_sensor_data | ( | self, | |
| dict | header, | ||
| List[dict] | chunks, | ||
| str | source_ip ) |
Definition at line 637 of file actuator_testing_gui.py.
References time.time().
| actuator_testing_gui.ActuatorTestingWindow.on_show_current_toggled | ( | self, | |
| int | state ) |
Definition at line 679 of file actuator_testing_gui.py.
References plot_widget, pt_multi_gui.PTPlotWindow.plot_widget, show_current, update_plots, and pt_multi_gui.PTPlotWindow.update_plots.
| actuator_testing_gui.ActuatorTestingWindow.update_plots | ( | self | ) |
Definition at line 724 of file actuator_testing_gui.py.
References _update_board_status_labels(), curves, gui.App.curves, lc_calibration_gui.LCPlotWindow.curves, max, plot_enabled, pt_multi_gui.PTPlotWindow.plot_enabled, show_current, voltage_history, window_seconds, gui.App.window_seconds, lc_calibration_gui.LCPlotWindow.window_seconds, and pt_multi_gui.PTPlotWindow.window_seconds.
Referenced by smart_calibration_gui.SmartCalibrationGUI.update_gui().
|
protected |
Definition at line 403 of file actuator_testing_gui.py.
|
protected |
Definition at line 455 of file actuator_testing_gui.py.
|
protected |
Definition at line 397 of file actuator_testing_gui.py.
|
protected |
Definition at line 386 of file actuator_testing_gui.py.
Referenced by sense_testing_gui.SenseTestingGUIWindow._send_header_only(), _send_minimal_actuator_config(), sense_testing_gui.SenseTestingGUIWindow._send_sensor_config(), _send_server_heartbeat_once(), sense_testing_gui.SenseTestingGUIWindow._send_server_heartbeat_once(), closeEvent(), sense_testing_gui.SenseTestingGUIWindow.closeEvent(), and on_actuator_toggled().
|
protected |
Definition at line 396 of file actuator_testing_gui.py.
Referenced by _on_send_heartbeat_changed(), sense_testing_gui.SenseTestingGUIWindow._on_send_heartbeat_changed(), closeEvent(), and sense_testing_gui.SenseTestingGUIWindow.closeEvent().
|
protected |
Definition at line 389 of file actuator_testing_gui.py.
|
protected |
Definition at line 646 of file actuator_testing_gui.py.
| Optional[int] actuator_testing_gui.ActuatorTestingWindow.board_id = None |
Definition at line 381 of file actuator_testing_gui.py.
Referenced by board_simulator.SimulatedBoard._generate_data(), _on_board_heartbeat(), sense_testing_gui.SenseTestingGUIWindow._on_board_heartbeat(), and board_simulator.SimulatedBoard._send_heartbeat().
| actuator_testing_gui.ActuatorTestingWindow.board_id_label = QtWidgets.QLabel("Board ID: —") |
Definition at line 447 of file actuator_testing_gui.py.
Referenced by _update_board_status_labels(), and sense_testing_gui.SenseTestingGUIWindow._update_plots().
| actuator_testing_gui.ActuatorTestingWindow.board_ip_label = QtWidgets.QLabel("Source: —") |
Definition at line 449 of file actuator_testing_gui.py.
Referenced by _update_board_status_labels(), and sense_testing_gui.SenseTestingGUIWindow._update_plots().
| Optional[str] actuator_testing_gui.ActuatorTestingWindow.board_source_ip = None |
Definition at line 383 of file actuator_testing_gui.py.
Referenced by _on_board_heartbeat(), and sense_testing_gui.SenseTestingGUIWindow._on_board_heartbeat().
| Optional[int] actuator_testing_gui.ActuatorTestingWindow.board_state = None |
Definition at line 382 of file actuator_testing_gui.py.
Referenced by board_simulator.SimulatedBoard._check_for_sensor_config(), _on_board_heartbeat(), sense_testing_gui.SenseTestingGUIWindow._on_board_heartbeat(), board_simulator.SimulatedBoard._run(), board_simulator.SimulatedBoard._send_heartbeat(), board_simulator.SimulatedBoard._step_ball_valve(), _update_board_status_labels(), sense_testing_gui.SenseTestingGUIWindow._update_plots(), ball_valve_gui.BallValveGui.board_active(), ball_valve_gui.BallValveGui.on_board_heartbeat(), ball_valve_gui.BallValveGui.refresh_status(), and board_simulator.SimulatedBoard.start().
| actuator_testing_gui.ActuatorTestingWindow.board_state_label = QtWidgets.QLabel("Board state: —") |
Definition at line 445 of file actuator_testing_gui.py.
Referenced by _update_board_status_labels(), and sense_testing_gui.SenseTestingGUIWindow._update_plots().
| dict actuator_testing_gui.ActuatorTestingWindow.button_map = {} |
Definition at line 502 of file actuator_testing_gui.py.
| dict actuator_testing_gui.ActuatorTestingWindow.channel_checkboxes = {} |
Definition at line 474 of file actuator_testing_gui.py.
Referenced by sense_testing_gui.SenseTestingGUIWindow._on_sensor_data().
| actuator_testing_gui.ActuatorTestingWindow.connection_label = QtWidgets.QLabel("Connection: —") |
Definition at line 439 of file actuator_testing_gui.py.
Referenced by _update_board_status_labels(), and sense_testing_gui.SenseTestingGUIWindow._update_plots().
| dict actuator_testing_gui.ActuatorTestingWindow.curves = {} |
Definition at line 555 of file actuator_testing_gui.py.
Referenced by feedtwin.model.spec.ComponentSpec.__post_init__(), on_channel_toggled(), feedtwin.model.catalog.Part.to_dict(), feedtwin.model.component.ComponentInstance.to_dict(), update_plots(), and feedtwin.model.spec.ComponentSpec.validate_curves().
| actuator_testing_gui.ActuatorTestingWindow.device_ip = DEFAULT_ACTUATOR_IP |
Definition at line 366 of file actuator_testing_gui.py.
Referenced by solenoid_characterization_gui.SolenoidCharacterizationWindow._on_send_ip_changed(), solenoid_characterization_gui.SolenoidCharacterizationWindow._send_actuator_command(), on_actuator_toggled(), solenoid_characterization_gui.SolenoidCharacterizationWindow.on_pwm_go_clicked(), combined_gui.ActuatorControlWidget.on_sensor_data(), and combined_gui.ActuatorControlWidget.send_actuator_command().
| actuator_testing_gui.ActuatorTestingWindow.device_port = ACTUATOR_COMMAND_PORT |
Definition at line 367 of file actuator_testing_gui.py.
Referenced by solenoid_characterization_gui.SolenoidCharacterizationWindow._send_actuator_command(), solenoid_characterization_gui.SolenoidCharacterizationWindow.on_pwm_go_clicked(), and combined_gui.ActuatorControlWidget.send_actuator_command().
| Optional[bytes] actuator_testing_gui.ActuatorTestingWindow.firmware_hash = None |
Definition at line 384 of file actuator_testing_gui.py.
Referenced by _on_board_heartbeat(), and sense_testing_gui.SenseTestingGUIWindow._on_board_heartbeat().
| actuator_testing_gui.ActuatorTestingWindow.firmware_hash_label = QtWidgets.QLabel("Firmware hash: —") |
Definition at line 451 of file actuator_testing_gui.py.
Referenced by _on_board_heartbeat(), and sense_testing_gui.SenseTestingGUIWindow._on_board_heartbeat().
| actuator_testing_gui.ActuatorTestingWindow.heartbeat_rate_label = QtWidgets.QLabel("Heartbeat rate: — Hz") |
Definition at line 442 of file actuator_testing_gui.py.
Referenced by _update_board_status_labels(), and sense_testing_gui.SenseTestingGUIWindow._update_plots().
| actuator_testing_gui.ActuatorTestingWindow.heartbeat_timestamps = deque(maxlen=HEARTBEAT_RATE_WINDOW) |
Definition at line 379 of file actuator_testing_gui.py.
Referenced by _on_board_heartbeat(), sense_testing_gui.SenseTestingGUIWindow._on_board_heartbeat(), _update_board_status_labels(), and sense_testing_gui.SenseTestingGUIWindow._update_plots().
| actuator_testing_gui.ActuatorTestingWindow.ip_edit = QtWidgets.QLineEdit(self.device_ip) |
Definition at line 424 of file actuator_testing_gui.py.
Referenced by _on_board_heartbeat(), _send_minimal_actuator_config(), _send_server_heartbeat_once(), on_actuator_toggled(), ball_valve_gui.BallValveGui.on_board_heartbeat(), and ball_valve_gui.BallValveGui.send().
| Optional[float] actuator_testing_gui.ActuatorTestingWindow.last_heartbeat_time = None |
Definition at line 380 of file actuator_testing_gui.py.
Referenced by _on_board_heartbeat(), sense_testing_gui.SenseTestingGUIWindow._on_board_heartbeat(), _update_board_status_labels(), and sense_testing_gui.SenseTestingGUIWindow._update_plots().
| actuator_testing_gui.ActuatorTestingWindow.on_sensor_data |
Definition at line 402 of file actuator_testing_gui.py.
| actuator_testing_gui.ActuatorTestingWindow.on_show_current_toggled |
Definition at line 496 of file actuator_testing_gui.py.
| dict actuator_testing_gui.ActuatorTestingWindow.plot_enabled |
Definition at line 375 of file actuator_testing_gui.py.
Referenced by sense_testing_gui.SenseTestingGUIWindow._on_add_max_force_to_leaderboard(), sense_testing_gui.SenseTestingGUIWindow._on_channel_toggled(), combined_gui.SensorPlotWidget._on_plot_toggle(), sense_testing_gui.SenseTestingGUIWindow._on_sensor_data(), sense_testing_gui.SenseTestingGUIWindow._update_plots(), combined_gui.SensorPlotWidget.add_sensor_plot(), on_channel_toggled(), update_plots(), and combined_gui.SensorPlotWidget.update_plots().
| actuator_testing_gui.ActuatorTestingWindow.plot_widget = pg.PlotWidget(background="#1e1e1e") |
Definition at line 539 of file actuator_testing_gui.py.
Referenced by solenoid_characterization_gui.FullPlotWindow._draw_event_lines(), solenoid_characterization_gui.FullPlotWindow._mouse_moved(), sense_testing_gui.SenseTestingGUIWindow._on_sensor_data(), sense_testing_gui.SenseTestingGUIWindow._update_plots(), solenoid_characterization_gui.FullPlotWindow.on_reset_view(), on_show_current_toggled(), solenoid_characterization_gui.FullPlotWindow.on_toggle_mode(), and combined_gui.SensorDebugDialog.refresh().
| actuator_testing_gui.ActuatorTestingWindow.port_spin = QtWidgets.QSpinBox() |
Definition at line 431 of file actuator_testing_gui.py.
Referenced by _send_minimal_actuator_config(), _send_server_heartbeat_once(), and on_actuator_toggled().
| actuator_testing_gui.ActuatorTestingWindow.receiver = SensorReceiver(SENSOR_RECEIVE_PORT, sock=self._shared_sock) |
Definition at line 401 of file actuator_testing_gui.py.
Referenced by calibration_orchestrator.CalibrationOrchestrator._drain_queue(), combined_gui.SensorPlotWidget._send_demo_packet(), sense_testing_gui.SenseTestingGUIWindow._update_plots(), closeEvent(), sense_testing_gui.SenseTestingGUIWindow.closeEvent(), calibration_orchestrator.CalibrationOrchestrator.start_receiver(), calibration_orchestrator.CalibrationOrchestrator.stop(), and combined_gui.SensorPlotWidget.update_statistics().
| actuator_testing_gui.ActuatorTestingWindow.send_actuator_config_btn |
Definition at line 458 of file actuator_testing_gui.py.
| actuator_testing_gui.ActuatorTestingWindow.send_heartbeat_cb = QtWidgets.QCheckBox("Send server heartbeat") |
Definition at line 454 of file actuator_testing_gui.py.
| bool actuator_testing_gui.ActuatorTestingWindow.show_current = False |
Definition at line 370 of file actuator_testing_gui.py.
Referenced by on_show_current_toggled(), and update_plots().
| actuator_testing_gui.ActuatorTestingWindow.show_current_cb = QtWidgets.QCheckBox("Show current (A)") |
Definition at line 492 of file actuator_testing_gui.py.
| actuator_testing_gui.ActuatorTestingWindow.status_label = QtWidgets.QLabel("Ready") |
Definition at line 531 of file actuator_testing_gui.py.
Referenced by combined_gui.SensorPlotWidget._apply_demo_mode(), sense_testing_gui.SenseTestingGUIWindow._on_add_max_force_to_leaderboard(), solenoid_characterization_gui.SolenoidCharacterizationWindow._on_receive_ip_changed(), solenoid_characterization_gui.SolenoidCharacterizationWindow._on_send_ip_changed(), _send_minimal_actuator_config(), _send_server_heartbeat_once(), combined_gui.CalibrationWindow.fit_calibration(), on_actuator_toggled(), solenoid_characterization_gui.SolenoidCharacterizationWindow.on_pwm_go_clicked(), combined_gui.SensorPlotWidget.on_status_update(), solenoid_characterization_gui.SolenoidCharacterizationWindow.on_status_update(), combined_gui.CalibrationWindow.perform_zero_point_calibration(), and combined_gui.CalibrationWindow.record_calibration_point().
| actuator_testing_gui.ActuatorTestingWindow.update_plots |
Definition at line 408 of file actuator_testing_gui.py.
Referenced by on_show_current_toggled(), combined_gui.SensorPlotWidget.reload_pt_calibration(), and smart_calibration_gui.SmartCalibrationGUI.update_gui().
| actuator_testing_gui.ActuatorTestingWindow.update_timer = QtCore.QTimer(self) |
Definition at line 407 of file actuator_testing_gui.py.
Referenced by closeEvent(), and sense_testing_gui.SenseTestingGUIWindow.closeEvent().
| dict actuator_testing_gui.ActuatorTestingWindow.voltage_history |
Definition at line 372 of file actuator_testing_gui.py.
Referenced by update_plots().
| dict actuator_testing_gui.ActuatorTestingWindow.voltage_labels = {} |
Definition at line 503 of file actuator_testing_gui.py.
| actuator_testing_gui.ActuatorTestingWindow.window_seconds = WINDOW_SECONDS |
Definition at line 369 of file actuator_testing_gui.py.
Referenced by sense_testing_gui.SenseTestingGUIWindow._on_add_max_force_to_leaderboard(), sense_testing_gui.SenseTestingGUIWindow._on_window_seconds_changed(), solenoid_characterization_gui.SolenoidCharacterizationWindow._on_window_slider_changed(), sense_testing_gui.SenseTestingGUIWindow._update_plots(), combined_gui.SensorPlotWidget.update_buffer_size(), solenoid_characterization_gui.SolenoidCharacterizationWindow.update_plot(), update_plots(), and combined_gui.SensorPlotWidget.update_plots().