|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Classes | |
| class | PacketType |
| class | BoardState |
| class | SensorReceiver |
| class | ActuatorTestingWindow |
Functions | |
| float | actuator_counts_to_volts (int data_u32) |
| str | board_state_name (int state) |
| Optional[Tuple[int, int, int]] | parse_packet_header (bytes data) |
| Optional[Tuple[tuple, bytes, int, int, int]] | parse_board_heartbeat_packet (bytes data) |
| Optional[Tuple[dict, List[dict]]] | parse_sensor_data_packet (bytes data) |
| bytes | _make_header (int packet_type) |
| bytes | build_server_heartbeat_packet () |
| bytes | build_minimal_actuator_config_packet () |
| bytes | create_actuator_command_packet (List[Tuple[int, int]] commands) |
| main () | |
Variables | |
| int | DIABLO_COMMS_VERSION = 0 |
| int | MAX_PACKET_SIZE = 512 |
| str | PACKET_HEADER_FORMAT = "<BBI" |
| int | PACKET_HEADER_SIZE = 6 |
| tuple | BOARD_HEARTBEAT_BODY_FORMAT |
| int | BOARD_HEARTBEAT_BODY_SIZE = 35 |
| str | SENSOR_DATA_PACKET_FORMAT = "<BB" |
| int | SENSOR_DATA_PACKET_SIZE = 2 |
| str | SENSOR_DATA_CHUNK_FORMAT = "<I" |
| int | SENSOR_DATA_CHUNK_SIZE = 4 |
| str | SENSOR_DATAPOINT_FORMAT = "<BI" |
| int | SENSOR_DATAPOINT_SIZE = 5 |
| int | ACT_ADC_MAX = 4095 |
| float | ACT_ADC_VREF = 3.3 |
| str | ACTUATOR_COMMAND_PACKET_FORMAT = "<B" |
| int | ACTUATOR_COMMAND_PACKET_SIZE = 1 |
| str | ACTUATOR_COMMAND_FORMAT = "<BB" |
| int | ACTUATOR_COMMAND_SIZE = 2 |
| int | NUM_ACTUATORS = 10 |
| str | DEFAULT_ACTUATOR_IP = "192.168.2.11" |
| int | ACTUATOR_COMMAND_PORT = 5005 |
| int | SENSOR_RECEIVE_PORT = 5006 |
| float | WINDOW_SECONDS = 10.0 |
| int | UPDATE_INTERVAL_MS = 100 |
| int | MAX_POINTS = 50000 |
| float | HEARTBEAT_TIMEOUT_SEC = 2.5 |
| int | HEARTBEAT_RATE_WINDOW = 20 |
| int | SERVER_HEARTBEAT_INTERVAL_MS = 500 |
| list | SENSOR_COLORS |
|
protected |
Definition at line 211 of file actuator_testing_gui.py.
References time.time().
Referenced by build_minimal_actuator_config_packet(), and build_server_heartbeat_packet().
| float actuator_testing_gui.actuator_counts_to_volts | ( | int | data_u32 | ) |
Actuator current-sense datapoint -> volts. Boards send raw 12-bit counts (<= 4095). Firmware from before that sent float volts as bits; any nonzero voltage float encodes far above 4095, so those are still read as floats until every board is reflashed.
Definition at line 46 of file actuator_testing_gui.py.
| str actuator_testing_gui.board_state_name | ( | int | state | ) |
Definition at line 92 of file actuator_testing_gui.py.
| bytes actuator_testing_gui.build_minimal_actuator_config_packet | ( | ) |
DAQv2-Comms ACTUATOR_CONFIG: not abort controller, no actuators/PTs, serial printing on.
Definition at line 221 of file actuator_testing_gui.py.
References _make_header().
Referenced by actuator_testing_gui.ActuatorTestingWindow._send_minimal_actuator_config().
| bytes actuator_testing_gui.build_server_heartbeat_packet | ( | ) |
Server heartbeat: header + 1 byte engine_state (0 = SAFE).
Definition at line 216 of file actuator_testing_gui.py.
References _make_header().
Referenced by actuator_testing_gui.ActuatorTestingWindow._send_server_heartbeat_once().
| bytes actuator_testing_gui.create_actuator_command_packet | ( | List[Tuple[int, int]] | commands | ) |
commands: list of (actuator_id, state) where id is 1-10, state 0/1.
Definition at line 231 of file actuator_testing_gui.py.
References time.time().
Referenced by actuator_testing_gui.ActuatorTestingWindow.on_actuator_toggled().
| actuator_testing_gui.main | ( | void | ) |
Definition at line 762 of file actuator_testing_gui.py.
References main().
| Optional[Tuple[tuple, bytes, int, int, int]] actuator_testing_gui.parse_board_heartbeat_packet | ( | bytes | data | ) |
Definition at line 134 of file actuator_testing_gui.py.
References parse_packet_header().
Referenced by actuator_testing_gui.SensorReceiver.run().
| Optional[Tuple[int, int, int]] actuator_testing_gui.parse_packet_header | ( | bytes | data | ) |
Definition at line 125 of file actuator_testing_gui.py.
Referenced by parse_board_heartbeat_packet(), parse_sensor_data_packet(), and actuator_testing_gui.SensorReceiver.run().
| Optional[Tuple[dict, List[dict]]] actuator_testing_gui.parse_sensor_data_packet | ( | bytes | data | ) |
Definition at line 152 of file actuator_testing_gui.py.
References parse_packet_header().
Referenced by actuator_testing_gui.SensorReceiver.run().
| int actuator_testing_gui.ACT_ADC_MAX = 4095 |
Definition at line 42 of file actuator_testing_gui.py.
| float actuator_testing_gui.ACT_ADC_VREF = 3.3 |
Definition at line 43 of file actuator_testing_gui.py.
| str actuator_testing_gui.ACTUATOR_COMMAND_FORMAT = "<BB" |
Definition at line 60 of file actuator_testing_gui.py.
| str actuator_testing_gui.ACTUATOR_COMMAND_PACKET_FORMAT = "<B" |
Definition at line 58 of file actuator_testing_gui.py.
| int actuator_testing_gui.ACTUATOR_COMMAND_PACKET_SIZE = 1 |
Definition at line 59 of file actuator_testing_gui.py.
| int actuator_testing_gui.ACTUATOR_COMMAND_PORT = 5005 |
Definition at line 66 of file actuator_testing_gui.py.
| int actuator_testing_gui.ACTUATOR_COMMAND_SIZE = 2 |
Definition at line 61 of file actuator_testing_gui.py.
| tuple actuator_testing_gui.BOARD_HEARTBEAT_BODY_FORMAT |
Definition at line 29 of file actuator_testing_gui.py.
| int actuator_testing_gui.BOARD_HEARTBEAT_BODY_SIZE = 35 |
Definition at line 32 of file actuator_testing_gui.py.
| str actuator_testing_gui.DEFAULT_ACTUATOR_IP = "192.168.2.11" |
Definition at line 65 of file actuator_testing_gui.py.
| int actuator_testing_gui.DIABLO_COMMS_VERSION = 0 |
Definition at line 14 of file actuator_testing_gui.py.
| int actuator_testing_gui.HEARTBEAT_RATE_WINDOW = 20 |
Definition at line 74 of file actuator_testing_gui.py.
| float actuator_testing_gui.HEARTBEAT_TIMEOUT_SEC = 2.5 |
Definition at line 73 of file actuator_testing_gui.py.
| int actuator_testing_gui.MAX_PACKET_SIZE = 512 |
Definition at line 15 of file actuator_testing_gui.py.
| int actuator_testing_gui.MAX_POINTS = 50000 |
Definition at line 71 of file actuator_testing_gui.py.
| int actuator_testing_gui.NUM_ACTUATORS = 10 |
Definition at line 63 of file actuator_testing_gui.py.
| str actuator_testing_gui.PACKET_HEADER_FORMAT = "<BBI" |
Definition at line 26 of file actuator_testing_gui.py.
| int actuator_testing_gui.PACKET_HEADER_SIZE = 6 |
Definition at line 27 of file actuator_testing_gui.py.
| list actuator_testing_gui.SENSOR_COLORS |
Definition at line 108 of file actuator_testing_gui.py.
| str actuator_testing_gui.SENSOR_DATA_CHUNK_FORMAT = "<I" |
Definition at line 36 of file actuator_testing_gui.py.
| int actuator_testing_gui.SENSOR_DATA_CHUNK_SIZE = 4 |
Definition at line 37 of file actuator_testing_gui.py.
| str actuator_testing_gui.SENSOR_DATA_PACKET_FORMAT = "<BB" |
Definition at line 34 of file actuator_testing_gui.py.
| int actuator_testing_gui.SENSOR_DATA_PACKET_SIZE = 2 |
Definition at line 35 of file actuator_testing_gui.py.
| str actuator_testing_gui.SENSOR_DATAPOINT_FORMAT = "<BI" |
Definition at line 38 of file actuator_testing_gui.py.
| int actuator_testing_gui.SENSOR_DATAPOINT_SIZE = 5 |
Definition at line 39 of file actuator_testing_gui.py.
| int actuator_testing_gui.SENSOR_RECEIVE_PORT = 5006 |
Definition at line 67 of file actuator_testing_gui.py.
| int actuator_testing_gui.SERVER_HEARTBEAT_INTERVAL_MS = 500 |
Definition at line 75 of file actuator_testing_gui.py.
| int actuator_testing_gui.UPDATE_INTERVAL_MS = 100 |
Definition at line 70 of file actuator_testing_gui.py.
| float actuator_testing_gui.WINDOW_SECONDS = 10.0 |
Definition at line 69 of file actuator_testing_gui.py.