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

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

Detailed Description

Definition at line 360 of file actuator_testing_gui.py.

Constructor & Destructor Documentation

◆ __init__()

actuator_testing_gui.ActuatorTestingWindow.__init__ ( self)

Definition at line 361 of file actuator_testing_gui.py.

References __init__(), and array.resize().

Referenced by __init__().

Member Function Documentation

◆ _build_ui()

actuator_testing_gui.ActuatorTestingWindow._build_ui ( self)
protected

Definition at line 413 of file actuator_testing_gui.py.

◆ _on_board_heartbeat()

actuator_testing_gui.ActuatorTestingWindow._on_board_heartbeat ( self,
float timestamp,
int board_id,
int board_state,
int engine_state,
str source_ip,
bytes firmware_hash )
protected

◆ _on_send_heartbeat_changed()

actuator_testing_gui.ActuatorTestingWindow._on_send_heartbeat_changed ( self,
int state )
protected

Definition at line 590 of file actuator_testing_gui.py.

References _server_heartbeat_timer, start(), and stop().

◆ _send_minimal_actuator_config()

actuator_testing_gui.ActuatorTestingWindow._send_minimal_actuator_config ( self)
protected

◆ _send_server_heartbeat_once()

actuator_testing_gui.ActuatorTestingWindow._send_server_heartbeat_once ( self)
protected

◆ _update_board_status_labels()

actuator_testing_gui.ActuatorTestingWindow._update_board_status_labels ( self)
protected

◆ closeEvent()

◆ on_actuator_toggled()

actuator_testing_gui.ActuatorTestingWindow.on_actuator_toggled ( self,
int actuator_id,
bool checked )

◆ on_channel_toggled()

actuator_testing_gui.ActuatorTestingWindow.on_channel_toggled ( self,
int actuator_id,
int state )

◆ on_sensor_data()

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().

◆ on_show_current_toggled()

actuator_testing_gui.ActuatorTestingWindow.on_show_current_toggled ( self,
int state )

◆ update_plots()

Member Data Documentation

◆ _on_board_heartbeat

actuator_testing_gui.ActuatorTestingWindow._on_board_heartbeat
protected

Definition at line 403 of file actuator_testing_gui.py.

◆ _on_send_heartbeat_changed

actuator_testing_gui.ActuatorTestingWindow._on_send_heartbeat_changed
protected

Definition at line 455 of file actuator_testing_gui.py.

◆ _send_server_heartbeat_once

actuator_testing_gui.ActuatorTestingWindow._send_server_heartbeat_once
protected

Definition at line 397 of file actuator_testing_gui.py.

◆ _send_sock

◆ _server_heartbeat_timer

actuator_testing_gui.ActuatorTestingWindow._server_heartbeat_timer = QtCore.QTimer(self)
protected

◆ _shared_sock

Optional[socket.socket] actuator_testing_gui.ActuatorTestingWindow._shared_sock = None
protected

Definition at line 389 of file actuator_testing_gui.py.

◆ _t0

actuator_testing_gui.ActuatorTestingWindow._t0 = t0
protected

Definition at line 646 of file actuator_testing_gui.py.

◆ board_id

◆ board_id_label

actuator_testing_gui.ActuatorTestingWindow.board_id_label = QtWidgets.QLabel("Board ID: —")

◆ board_ip_label

actuator_testing_gui.ActuatorTestingWindow.board_ip_label = QtWidgets.QLabel("Source: —")

◆ board_source_ip

Optional[str] actuator_testing_gui.ActuatorTestingWindow.board_source_ip = None

◆ board_state

◆ board_state_label

actuator_testing_gui.ActuatorTestingWindow.board_state_label = QtWidgets.QLabel("Board state: —")

◆ button_map

dict actuator_testing_gui.ActuatorTestingWindow.button_map = {}

Definition at line 502 of file actuator_testing_gui.py.

◆ channel_checkboxes

dict actuator_testing_gui.ActuatorTestingWindow.channel_checkboxes = {}

◆ connection_label

actuator_testing_gui.ActuatorTestingWindow.connection_label = QtWidgets.QLabel("Connection: —")

◆ curves

◆ device_ip

◆ device_port

◆ firmware_hash

Optional[bytes] actuator_testing_gui.ActuatorTestingWindow.firmware_hash = None

◆ firmware_hash_label

actuator_testing_gui.ActuatorTestingWindow.firmware_hash_label = QtWidgets.QLabel("Firmware hash: —")

◆ heartbeat_rate_label

actuator_testing_gui.ActuatorTestingWindow.heartbeat_rate_label = QtWidgets.QLabel("Heartbeat rate: — Hz")

◆ heartbeat_timestamps

◆ ip_edit

actuator_testing_gui.ActuatorTestingWindow.ip_edit = QtWidgets.QLineEdit(self.device_ip)

◆ last_heartbeat_time

Optional[float] actuator_testing_gui.ActuatorTestingWindow.last_heartbeat_time = None

◆ on_sensor_data

actuator_testing_gui.ActuatorTestingWindow.on_sensor_data

Definition at line 402 of file actuator_testing_gui.py.

◆ on_show_current_toggled

actuator_testing_gui.ActuatorTestingWindow.on_show_current_toggled

Definition at line 496 of file actuator_testing_gui.py.

◆ plot_enabled

◆ plot_widget

◆ port_spin

actuator_testing_gui.ActuatorTestingWindow.port_spin = QtWidgets.QSpinBox()

◆ receiver

◆ send_actuator_config_btn

actuator_testing_gui.ActuatorTestingWindow.send_actuator_config_btn
Initial value:
= QtWidgets.QPushButton(
"Send actuator config (minimal)"
)

Definition at line 458 of file actuator_testing_gui.py.

◆ send_heartbeat_cb

actuator_testing_gui.ActuatorTestingWindow.send_heartbeat_cb = QtWidgets.QCheckBox("Send server heartbeat")

Definition at line 454 of file actuator_testing_gui.py.

◆ show_current

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().

◆ show_current_cb

actuator_testing_gui.ActuatorTestingWindow.show_current_cb = QtWidgets.QCheckBox("Show current (A)")

Definition at line 492 of file actuator_testing_gui.py.

◆ status_label

◆ update_plots

actuator_testing_gui.ActuatorTestingWindow.update_plots

◆ update_timer

actuator_testing_gui.ActuatorTestingWindow.update_timer = QtCore.QTimer(self)

◆ voltage_history

dict actuator_testing_gui.ActuatorTestingWindow.voltage_history
Initial value:
= {
i: deque(maxlen=MAX_POINTS) for i in range(1, NUM_ACTUATORS + 1)
}

Definition at line 372 of file actuator_testing_gui.py.

Referenced by update_plots().

◆ voltage_labels

dict actuator_testing_gui.ActuatorTestingWindow.voltage_labels = {}

Definition at line 503 of file actuator_testing_gui.py.

◆ window_seconds


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