STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
combined_fsw_gui Namespace Reference

Classes

class  PacketType
class  SystemState
class  ConfigManager
class  UDPReceiver
class  ElodinPacketType
class  ElodinPacketHeader
class  ElodinClient
class  PressureBarWidget
class  TopBarWidget
class  StateMachineWidget
class  SensorPlotWidget
class  ActuatorControlWidget
class  CombinedFSWMainWindow

Functions

 get_num_actuators ()
float calculate_pressure (float adc_code, float PT_A, float PT_B, float PT_C, float PT_D)
Dict[int, Tuple[float, float, float, float]] load_pt_calibration_csv (str csv_path)
Dict[int, Tuple[float, float, float, float]] load_pt_calibration_json (str json_path)
Dict[int, Tuple[float, float, float, float]] load_pt_calibration ()
 main ()

Variables

int MAX_PACKET_SIZE = 512
int NUM_SENSORS = 10
int UPDATE_INTERVAL_MS = 50
float DEFAULT_WINDOW_SECONDS = 40.0
int MAX_POINTS = 10000
str DEFAULT_ACTUATOR_IP = "192.168.2.201"
str DEFAULT_SENSOR_IP = "192.168.2.101"
int DEFAULT_ACTUATOR_PORT = 5005
int DEFAULT_RECEIVE_PORT = 5006
str DEFAULT_BIND_ADDRESS = "0.0.0.0"
 PT_CALIBRATION_CSV
str CALIBRATION_JSON_DIR = Path(__file__).parent.parent / "calibration" / "calibrations"
str PACKET_HEADER_FORMAT = "<BBI"
int PACKET_HEADER_SIZE = 6
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
list SENSOR_COLORS
str CONFIG_FILE = Path(__file__).parent / "fsw_gui_config.json"
tuple _STATE_MACHINE_CSV
 CONFIG = ConfigManager()

Detailed Description

FSW Combined Sensor & Actuator Control GUI
Similar to DiabloAvionics combined_gui.py but integrated with FSW stack

Features:
- Real-time sensor data visualization (pressure plots)
- Actuator control (ON/OFF buttons)
- State machine control (Idle, Armed, Fire, Vent, etc.)
- Top bar with pressure gauges and abort buttons
- Integration with Elodin database

Function Documentation

◆ calculate_pressure()

float combined_fsw_gui.calculate_pressure ( float adc_code,
float PT_A,
float PT_B,
float PT_C,
float PT_D )
Compute pressure (psi) from ADC code using cubic polynomial.

Definition at line 223 of file combined_fsw_gui.py.

◆ get_num_actuators()

combined_fsw_gui.get_num_actuators ( )
Get number of actuators dynamically from CSV.

Definition at line 131 of file combined_fsw_gui.py.

Referenced by combined_fsw_gui.ConfigManager.__init__().

◆ load_pt_calibration()

Dict[int, Tuple[float, float, float, float]] combined_fsw_gui.load_pt_calibration ( )
Load PT calibration from CSV or JSON, preferring JSON from calibration framework

Definition at line 301 of file combined_fsw_gui.py.

References load_pt_calibration_csv(), load_pt_calibration_json(), and max.

◆ load_pt_calibration_csv()

Dict[int, Tuple[float, float, float, float]] combined_fsw_gui.load_pt_calibration_csv ( str csv_path)
Load PT calibration coefficients from CSV.
Returns dict: connector_id -> (PT_A, PT_B, PT_C, PT_D)

Definition at line 230 of file combined_fsw_gui.py.

Referenced by load_pt_calibration().

◆ load_pt_calibration_json()

Dict[int, Tuple[float, float, float, float]] combined_fsw_gui.load_pt_calibration_json ( str json_path)
Load PT calibration coefficients from JSON (from calibration GUI).
Returns dict: sensor_id -> (A, B, C, D) polynomial coefficients

Definition at line 269 of file combined_fsw_gui.py.

Referenced by load_pt_calibration().

◆ main()

combined_fsw_gui.main ( )
Main entry point

Definition at line 1801 of file combined_fsw_gui.py.

Variable Documentation

◆ _STATE_MACHINE_CSV

tuple combined_fsw_gui._STATE_MACHINE_CSV
protected
Initial value:
1= (
2 Path(__file__).parent.parent.parent
3 / "config"
4 / "state_machine_actuators.csv"
5)

Definition at line 124 of file combined_fsw_gui.py.

◆ CALIBRATION_JSON_DIR

str combined_fsw_gui.CALIBRATION_JSON_DIR = Path(__file__).parent.parent / "calibration" / "calibrations"

Definition at line 57 of file combined_fsw_gui.py.

◆ CONFIG

combined_fsw_gui.CONFIG = ConfigManager()

Definition at line 216 of file combined_fsw_gui.py.

◆ CONFIG_FILE

str combined_fsw_gui.CONFIG_FILE = Path(__file__).parent / "fsw_gui_config.json"

Definition at line 121 of file combined_fsw_gui.py.

◆ DEFAULT_ACTUATOR_IP

str combined_fsw_gui.DEFAULT_ACTUATOR_IP = "192.168.2.201"

Definition at line 42 of file combined_fsw_gui.py.

◆ DEFAULT_ACTUATOR_PORT

int combined_fsw_gui.DEFAULT_ACTUATOR_PORT = 5005

Definition at line 44 of file combined_fsw_gui.py.

◆ DEFAULT_BIND_ADDRESS

str combined_fsw_gui.DEFAULT_BIND_ADDRESS = "0.0.0.0"

Definition at line 46 of file combined_fsw_gui.py.

◆ DEFAULT_RECEIVE_PORT

int combined_fsw_gui.DEFAULT_RECEIVE_PORT = 5006

Definition at line 45 of file combined_fsw_gui.py.

◆ DEFAULT_SENSOR_IP

str combined_fsw_gui.DEFAULT_SENSOR_IP = "192.168.2.101"

Definition at line 43 of file combined_fsw_gui.py.

◆ DEFAULT_WINDOW_SECONDS

float combined_fsw_gui.DEFAULT_WINDOW_SECONDS = 40.0

Definition at line 38 of file combined_fsw_gui.py.

◆ MAX_PACKET_SIZE

int combined_fsw_gui.MAX_PACKET_SIZE = 512

Definition at line 34 of file combined_fsw_gui.py.

◆ MAX_POINTS

int combined_fsw_gui.MAX_POINTS = 10000

Definition at line 39 of file combined_fsw_gui.py.

◆ NUM_SENSORS

int combined_fsw_gui.NUM_SENSORS = 10

Definition at line 36 of file combined_fsw_gui.py.

◆ PACKET_HEADER_FORMAT

str combined_fsw_gui.PACKET_HEADER_FORMAT = "<BBI"

Definition at line 60 of file combined_fsw_gui.py.

◆ PACKET_HEADER_SIZE

int combined_fsw_gui.PACKET_HEADER_SIZE = 6

Definition at line 61 of file combined_fsw_gui.py.

◆ PT_CALIBRATION_CSV

combined_fsw_gui.PT_CALIBRATION_CSV
Initial value:
1= os.path.join(
2 os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))),
3 "external",
4 "DiabloAvionics",
5 "PT_Board",
6 "Calibration",
7 "PT Calibration Attempt 2026-02-04_test2.csv",
8)

Definition at line 49 of file combined_fsw_gui.py.

◆ SENSOR_COLORS

list combined_fsw_gui.SENSOR_COLORS
Initial value:
1= [
2 (255, 80, 80), # Red
3 (80, 255, 80), # Green
4 (80, 150, 255), # Blue
5 (255, 200, 80), # Orange
6 (200, 80, 255), # Purple
7 (80, 255, 255), # Cyan
8 (255, 150, 150), # Light Red
9 (150, 255, 150), # Light Green
10 (150, 200, 255), # Light Blue
11 (255, 255, 80), # Yellow
12]

Definition at line 84 of file combined_fsw_gui.py.

◆ SENSOR_DATA_CHUNK_FORMAT

str combined_fsw_gui.SENSOR_DATA_CHUNK_FORMAT = "<I"

Definition at line 64 of file combined_fsw_gui.py.

◆ SENSOR_DATA_CHUNK_SIZE

int combined_fsw_gui.SENSOR_DATA_CHUNK_SIZE = 4

Definition at line 65 of file combined_fsw_gui.py.

◆ SENSOR_DATA_PACKET_FORMAT

str combined_fsw_gui.SENSOR_DATA_PACKET_FORMAT = "<BB"

Definition at line 62 of file combined_fsw_gui.py.

◆ SENSOR_DATA_PACKET_SIZE

int combined_fsw_gui.SENSOR_DATA_PACKET_SIZE = 2

Definition at line 63 of file combined_fsw_gui.py.

◆ SENSOR_DATAPOINT_FORMAT

str combined_fsw_gui.SENSOR_DATAPOINT_FORMAT = "<BI"

Definition at line 66 of file combined_fsw_gui.py.

◆ SENSOR_DATAPOINT_SIZE

int combined_fsw_gui.SENSOR_DATAPOINT_SIZE = 5

Definition at line 67 of file combined_fsw_gui.py.

◆ UPDATE_INTERVAL_MS

int combined_fsw_gui.UPDATE_INTERVAL_MS = 50

Definition at line 37 of file combined_fsw_gui.py.