Index: leahi_dialin/common/dd_defs.py =================================================================== diff -u -re7d16bd6881619e5fc2a0bc1a7fd578a9978498e -r956757fac807b52aec078e84127089db5dff069f --- leahi_dialin/common/dd_defs.py (.../dd_defs.py) (revision e7d16bd6881619e5fc2a0bc1a7fd578a9978498e) +++ leahi_dialin/common/dd_defs.py (.../dd_defs.py) (revision 956757fac807b52aec078e84127089db5dff069f) @@ -19,36 +19,36 @@ @unique class DDOpModes(DialinEnum): - MODE_FAUL = 0 - MODE_SERV = 1 - MODE_INIT = 2 - MODE_STAN = 3 - MODE_PREG = 4 - MODE_GEND = 5 - MODE_POSG = 6 - MODE_HEAT = 7 - MODE_HCOL = 8 - MODE_ROPS = 9 - MODE_NLEG = 10 - NUM_OF_DD_MODES = 11 + MODE_FAUL = 0 # Fault Mode + MODE_SERV = 1 # Service Mode + MODE_INIT = 2 # Initialization Mode + MODE_STAN = 3 # Standby Mode + MODE_PREG = 4 # Pre-generate Dialysate Mode + MODE_GEND = 5 # Generate Dialysate Mode + MODE_POSG = 6 # Post-generate Dialysate Mode + MODE_HEAT = 7 # Heat Mode + MODE_HCOL = 8 # Cooling Mode + MODE_ROPS = 9 # RO Permeate Sample Mode + MODE_NLEG = 10 # Non-legal Mode - an illegitimate mode transition has occurred + NUM_OF_DD_MODES = 11 # Number of Modes for the DD @unique class DDPostStates(DialinEnum): - DD_POST_STATE_START = 0 - DD_POST_STATE_FW_COMPATIBILITY = 1 - DD_POST_STATE_FW_INTEGRITY = 2 - DD_POST_STATE_FPGA = 3 - DD_POST_STATE_NVDATAMGMT = 4 - DD_POST_STATE_TEMPERATURE_SENSORS = 5 - DD_POST_STATE_PRESSURES = 6 - DD_POST_STATE_DIALYSATE_PUMPS = 7 - DD_POST_STATE_CONCENTRATE_PUMPS = 8 - DD_POST_STATE_CONDUCTIVITY_SENSORS = 9 - DD_POST_STATE_WATCHDOG = 10 - DD_POST_STATE_SAFETY_SHUTDOWN = 11 - DD_POST_STATE_COMPLETED = 12 - DD_POST_STATE_FAILED = 13 - NUM_OF_DD_POST_STATES = 14 + DD_POST_STATE_START = 0 # Post Generate Dialysate Start State + DD_POST_STATE_FW_COMPATIBILITY = 1 # Firmware Compatibility State + DD_POST_STATE_FW_INTEGRITY = 2 # Firmware Integrity State + DD_POST_STATE_FPGA = 3 # FPGA State + DD_POST_STATE_NVDATAMGMT = 4 # Non-volatile Data Management State + DD_POST_STATE_TEMPERATURE_SENSORS = 5 # Temperature Sensors State + DD_POST_STATE_PRESSURES = 6 # Pressure Sensors State + DD_POST_STATE_DIALYSATE_PUMPS = 7 # Dialysate Pumps State + DD_POST_STATE_CONCENTRATE_PUMPS = 8 # Concentrate Pumps State + DD_POST_STATE_CONDUCTIVITY_SENSORS = 9 # Conductivity Sensors State + DD_POST_STATE_WATCHDOG = 10 # Watchdog State + DD_POST_STATE_SAFETY_SHUTDOWN = 11 # Safety Shutdown State + DD_POST_STATE_COMPLETED = 12 # Post Generate Dialysate Completed State + DD_POST_STATE_FAILED = 13 # Post Generate Dialysate Fail State + NUM_OF_DD_POST_STATES = 14 # Number of Post Generate Dialysate States @unique class DDFaultStates(DialinEnum): @@ -98,17 +98,17 @@ @unique class DDEventDataType(DialinEnum): - EVENT_DATA_TYPE_NONE = 0 - EVENT_DATA_TYPE_U32 = 1 - EVENT_DATA_TYPE_S32 = 2 - EVENT_DATA_TYPE_F32 = 3 - EVENT_DATA_TYPE_BOOL = 4 - NUM_OF_EVENT_DATA_TYPES = 5 + EVENT_DATA_TYPE_NONE = 0 # No Event Data Type + EVENT_DATA_TYPE_U32 = 1 # Unsigned 32bit Event Data Type + EVENT_DATA_TYPE_S32 = 2 # Signed 32bit Event Data Type + EVENT_DATA_TYPE_F32 = 3 # Float 32bit Event Data Type + EVENT_DATA_TYPE_BOOL = 4 # Boolean Event Data Type + NUM_OF_EVENT_DATA_TYPES = 5 # Number of Event Data Types @unique class DDServiceModesStates(DialinEnum): - DD_SERVICE_STATE_START = 0 # Start service mode state - NUM_OF_DD_SERVICE_STATES = 1 # Number of service mode states + DD_SERVICE_STATE_START = 0 # Start service mode state + NUM_OF_DD_SERVICE_STATES = 1 # Number of service mode states @unique class DDBalancingChamberStates(DialinEnum): @@ -129,67 +129,66 @@ @unique class ConcentratePumpsEnum(DialinEnum): - D11_CP1_ACID = 0 - D10_CP2_BICARB = 1 - D76_UF = 2 - NUM_OF_CONCENTRATE_PUMPS = 3 + D11_CP1_ACID = 0 # Acid Concentrate Pump + D10_CP2_BICARB = 1 # Bicarbonate Concentrate Pump + D76_UF = 2 # Ultrafiltration Concentrate Pump + NUM_OF_CONCENTRATE_PUMPS = 3 # Number of Concentrate Pumps @unique class DDConcentratePumpsStates(DialinEnum): - CONCENTRATE_PUMP_OFF_STATE = 0 - CONCENTRATE_PUMP_RAMP_TO_TARGET_SPEED_STATE = 1 - CONCENTRATE_PUMP_CONTROL_TARGET_SPEED_STATE = 2 - NUM_OF_CONCENTRATE_PUMP_STATES = 3 + CONCENTRATE_PUMP_OFF_STATE = 0 # Concentrate Pump Off State + CONCENTRATE_PUMP_RAMP_TO_TARGET_SPEED_STATE = 1 # Ramp to Target Speed Concentrate Pump State + CONCENTRATE_PUMP_CONTROL_TARGET_SPEED_STATE = 2 # Control Target Speed Concentrate Pump State + NUM_OF_CONCENTRATE_PUMP_STATES = 3 # Number of Concentrate Pump States @unique class DDConcentratePumpAttributesEnum(DialinEnum): - CURRENT_STATE = 0 - CURRENT_SET_SPEED = 1 - MEASURED_SPEED = 2 - TARGET_SPEED = 3 - PULSE_US = 4 - TARGET_REV_COUNT = 5 - MEASURED_REV_COUNT = 6 - NUM_OF_D76_CONCENTRATE_PUMP_ATTRIBUTES = 7 - PARKED = NUM_OF_D76_CONCENTRATE_PUMP_ATTRIBUTES - PARK_FAULT = 8 - NUM_OF_D10_D11_CONCENTRATE_PUMP_ATTRIBUTES = 9 + CURRENT_STATE = 0 # Current State Concentrate Pump Attribute + CURRENT_SET_SPEED = 1 # Current Set Speed Concentrate Pump Attribute + MEASURED_SPEED = 2 # Measured Speed Concentrate Pump Attribute + TARGET_SPEED = 3 # Target Speed Concentrate Pump Attribute + PULSE_US = 4 # Hall Sensor Pulse Width (in micro seconds) Concentrate Pump Attribute + TARGET_REV_COUNT = 5 # Target Revolutions Concentrate Pump Attribute + MEASURED_REV_COUNT = 6 # Measured Revolutions Concentrate Pump Attribute + PARKED = 7 # Parked Concentrate Pump Attribute + PARK_FAULT = 8 # Park Fault Concentrate Pump Attribute + NUM_OF_D10_D11_CONCENTRATE_PUMP_ATTRIBUTES = 9 # Number of Acid (D11) and Bicarbonate (D10) Concentrate Pump Attributes @unique class ConductivitySensorsEnum(DialinEnum): - D17_COND = 0 - D27_COND = 1 - D29_COND = 2 - D43_COND = 3 - D74_COND = 4 - NUM_OF_CONDUCTIVITY_SENSORS = 5 + D17_COND = 0 # Closed Loop Control of Dosing for D74 Conductivity Sensor + D27_COND = 1 # Closed Loop Control of Dosing for D29 Conductivity Sensor + D29_COND = 2 # Water, Bicarbonate, and Acid Collective Conductivity Sensor + D43_COND = 3 # Self Test Conductivity Sensor (not used for dialysate conductivity) + D74_COND = 4 # Water and Bicarbonate Collective Conductivity Sensor + NUM_OF_CONDUCTIVITY_SENSORS = 5 # Number of Conductivity Sensors @unique class DialysatePumpsEnum(DialinEnum): - D12_PUMP = 0 # Fresh Dialysate Pump - D48_PUMP = 1 # Spent Dialysate Pump - NUM_OF_DIALYSATE_PUMPS = 2 + D12_PUMP = 0 # Fresh Dialysate Pump + D48_PUMP = 1 # Spent Dialysate Pump + NUM_OF_DIALYSATE_PUMPS = 2 # Number of Dialysate Pumps @unique class DialysatePumpAttributesEnum(DialinEnum): - TARGET_RPM = 0 - MEASURED_SPEED = 1 - CURRENT_SPEED = 2 - STATE = 3 - TARGET_PRESSURE = 4 - MEASURED_PRESSURE = 5 - MEASURED_CURRENT = 6 - CONTROL = 7 - DIRECTION_ERROR_COUNT = 8 - MEASURED_DIRECTION = 9 - NUM_OF_DIALYSATE_PUMP_ATTRIBUTES = 10 + TARGET_RPM = 0 # Target RPM Dialysate Pump Attribute + MEASURED_SPEED = 1 # Measured Speed Dialysate Pump Attribute + CURRENT_SPEED = 2 # Current Speed Dialysate Pump Attribute + STATE = 3 # State to command Dialysate Pump Attribute + TARGET_PRESSURE = 4 # Target Pressure Dialysate Pump Attribute + MEASURED_PRESSURE = 5 # Measured Pressure Dialysate Pump Attribute + MEASURED_CURRENT = 6 # Measured Current Dialysate Pump Attribute + CONTROL = 7 # Pump Run/Stop Control Pump Attribute + DIRECTION_ERROR_COUNT = 8 # Direction Error Count Dialysate Pump Attribute + MEASURED_DIRECTION = 9 # Measured Direction Dialysate Pump Attribute + NUM_OF_DIALYSATE_PUMP_ATTRIBUTES = 10 # Number of Dialysate Pump Attributes @unique class DDDialysatePumpsStates(DialinEnum): - DIALYSATE_PUMP_OFF_STATE = 0 - DIALYSATE_PUMP_RAMP_UP_STATE = 1 - DIALYSATE_PUMP_CONTROL_TO_TARGET_STATE = 2 - NUM_OF_DIALYSATE_PUMP_STATES = 3 + DIALYSATE_PUMP_OFF_STATE = 0 # Dialysate Pump Off State + DIALYSATE_PUMP_RAMP_UP_STATE = 1 # Dialysate Pump Ramp Up State + DIALYSATE_PUMP_CONTROL_TO_TARGET_STATE = 2 # Dialysate Pump Control to Target State + NUM_OF_DIALYSATE_PUMP_STATES = 3 # Number of Dialysate Pump States @unique class HeatersStartStop(DialinEnum): @@ -198,70 +197,70 @@ @unique class HeatersState(DialinEnum): - HEATER_EXEC_STATE_OFF = 0 - HEATER_EXEC_STATE_RAMP_TO_TARGET = 1 - HEATER_EXEC_STATE_CONTROL_TO_TARGET = 2 - HEATER_EXEC_STATE_CONTROL_TO_DISINFECT_TARGET = 3 + HEATER_EXEC_STATE_OFF = 0 # Heater Execution Off State + HEATER_EXEC_STATE_RAMP_TO_TARGET = 1 # Heater Execution Ramp to Target State + HEATER_EXEC_STATE_CONTROL_TO_TARGET = 2 # Heater Execution Control to Target State + HEATER_EXEC_STATE_CONTROL_TO_DISINFECT_TARGET = 3 # Heater Execution Control to Disinfection State NUM_OF_HEATERS_STATE = 4 @unique class HeatersNames(DialinEnum): - D5_HEAT = 0 - D45_HEAT = 1 - NUM_OF_DD_HEATERS = 2 + D5_HEAT = 0 # Primary heater + D45_HEAT = 1 # Trimmer heater + NUM_OF_DD_HEATERS = 2 # Number of Heaters @unique class HeatersAttributesEnum(DialinEnum): - HEAT_DUTY_CYCLE = 0 - HEAT_TARGET_TEMP = 1 - HEAT_STATE = 2 - DUTY_CYCLE_COUNT = 3 - PWM_PERIOD = 4 - ADJUSTED_TARGET_TEMP = 5 - TARGET_TEMP_TD = 6 - NUM_OF_DD_HEATER_ATTRIBUTES = 7 + HEAT_DUTY_CYCLE = 0 # Heat Duty Cycle Attribute for Heaters + HEAT_TARGET_TEMP = 1 # Target Temperature Attribute for Heaters + HEAT_STATE = 2 # State to command Attribute for Heaters + DUTY_CYCLE_COUNT = 3 # Duty Cycle Count Attribute for Heaters + PWM_PERIOD = 4 # Pulse Width Modulation Attribute for Heaters + ADJUSTED_TARGET_TEMP = 5 # Adjusted Target Temperature Attribute for Heaters + TARGET_TEMP_TD = 6 # Target Temperature Attribute for Heaters + NUM_OF_DD_HEATER_ATTRIBUTES = 7 # Number of Heater Attributes @unique class DDLevelSensorEnum(DialinEnum): - D6_LEVEL = 0 # floater switch low, medium and high status - D63_LEVEL = 1 # bicarb level low or high status - D46_LEVEL = 2 # Spent dialysate air separation chamber level low or high status - NUM_OF_LEVELS = 3 + D6_LEVEL = 0 # floater switch low, medium and high status + D63_LEVEL = 1 # bicarb level low or high status + D46_LEVEL = 2 # Spent dialysate air separation chamber level low or high status + NUM_OF_LEVELS = 3 # Number of Level Sensors @unique class DDPistonPumpsEnum(DialinEnum): - ACID = 0 # Acid piston pump - BICARB = 1 # Bicarbonate piston pump - UF = 2 # Ultrafilteration piston pump - NUM_OF_PISTON_PUMPS = 3 # Number of piston pumps + ACID = 0 # Acid piston pump + BICARB = 1 # Bicarbonate piston pump + UF = 2 # Ultrafiltration piston pump + NUM_OF_PISTON_PUMPS = 3 # Number of piston pumps @unique class DDPistonPumpAttributesEnum(DialinEnum): - CONTROL_STATE = 0, - SW_COUNTER = 1, - CYCLE_COUNTER = 2 - NUM_OF_PISTON_PUMP_ATTRIBUTES = 3 + CONTROL_STATE = 0 # Control State for the Piston Pumps + SW_COUNTER = 1 # Software counter attribute for the Piston Pumps + CYCLE_COUNTER = 2 # Cycle Counter for the Piston Pumps + NUM_OF_PISTON_PUMP_ATTRIBUTES = 3 # Number of Piston Pump Attributes @unique class PressureNames(DialinEnum): # Pressure Sensor IDs - M1_PRES = 0 # Water Inlet pressure before regulator (PRi) - M3_PRES = 1 # Water Inlet pressure after regulator (PRo) - D9_PRES = 2 # Hydraulics outlet pressure (PHo/Pn) - D66_PRES = 3 # Dry Bicarb pressure (PDB/PCb) - D51_PRES = 4 # Spent Dialysate pressure (PDs) - D18_PRES = 5 # Fresh Dialysate pressure (PDf) - D41_PRES = 6 # Transmembrane pressure (Ptm) - BARO_PRES = 7 # Barometric pressure sensor - NUM_OF_PRESSURE_SENSORS = 8 + M1_PRES = 0 # Water Inlet pressure before regulator (PRi) + M3_PRES = 1 # Water Inlet pressure after regulator (PRo) + D9_PRES = 2 # Hydraulics outlet pressure (PHo/Pn) + D66_PRES = 3 # Dry Bicarb pressure (PDB/PCb) + D51_PRES = 4 # Spent Dialysate pressure (PDs) + D18_PRES = 5 # Fresh Dialysate pressure (PDf) + D41_PRES = 6 # Transmembrane pressure (Ptm) + BARO_PRES = 7 # Barometric pressure sensor + NUM_OF_PRESSURE_SENSORS = 8 # Number of pressure sensors @unique class PressureAttributesEnum (DialinEnum): - PRES = 0 - TEMP = 1 - NUM_OF_PRES_SENSOR_ATTRIBUTES = 2 + PRES = 0 # Pressure Attribute for Pressure Sensors + TEMP = 1 # Temperature Attribute for Pressure Sensors + NUM_OF_PRES_SENSOR_ATTRIBUTES = 2 # Number of Pressure Sensor Attributes -COND_SENSOR_INDEX_OFFSET = 5 +COND_SENSOR_INDEX_OFFSET = 5 # Conductivity Sensor Index Offset for the Temperature Sensors @unique class DDTemperaturesNames(DialinEnum): @@ -283,37 +282,37 @@ @unique class DDValveStates(DialinEnum): - VALVE_STATE_CLOSED = 0 - VALVE_STATE_OPEN = 1 + VALVE_STATE_CLOSED = 0 # Valve Closed State + VALVE_STATE_OPEN = 1 # Valve Open State @unique class DDValveNames(DialinEnum): - D14_VALV = 0 # Valve Hydraulics Outlet (D14) - D52_VALV = 1 # Valve Thermal Disinfect (D52) - D8_VALV = 2 # Valve Hydraulics Bypass (D8) - D54_VALV = 3 # Valve Rinse Port (D54) - D53_VALV = 4 # Valve Drain (D53) - D34_VALV = 5 # Valve Dialyzer Bypass (D34) - D64_VALV = 6 # Valve Purge 1 (D64) - D31_VALV = 7 # Valve Pressure Test (D31) - D65_VALV = 8 # Valve DryBcarb Inlet (D65) - D35_VALV = 9 # Valve Dialyzer Inlet (D35) - D40_VALV = 10 # Valve Dialyzer Outlet (D40) - D47_VALV = 11 # Valve Dialysate Out Purge 2 (D47) - D3_VALV = 12 # Valve Hydraulics Inlet (D3) - M4_VALV = 13 # Valve Water Inlet (M4) - RSRVD_SPACE1 = 14 # This space has been reserved - RSRVD_SPACE2 = 15 # This space has been reserved - D23_VALV = 16 # Balancing chamber Valve 1 (D23) - D19_VALV = 17 # Balancing chamber Valve 2 (D19) - D25_VALV = 18 # Balancing chamber Valve 3 (D25) - D26_VALV = 19 # Balancing chamber Valve 7 (D26) - D24_VALV = 20 # Balancing chamber Valve 5 (D24) - D20_VALV = 21 # Balancing chamber Valve 6 (D20) - D21_VALV = 22 # Balancing chamber Valve 4 (D21) - D22_VALV = 23 # Balancing chamber Valve 8 (D22) - D69_VALV = 24 # Ultrafiltration Valve 1 Inlet (D69) - D71_VALV = 25 # Ultrafiltration Valve 2 Inlet (D71) - D70_VALV = 26 # Ultrafiltration Valve 1 Outlet (D70) - D72_VALV = 27 # Ultrafiltration Valve 2 Outlet (D72) - NUM_OF_DD_VALVES = 28 \ No newline at end of file + D14_VALV = 0 # Valve Hydraulics Outlet (D14) + D52_VALV = 1 # Valve Thermal Disinfect (D52) + D8_VALV = 2 # Valve Hydraulics Bypass (D8) + D54_VALV = 3 # Valve Rinse Port (D54) + D53_VALV = 4 # Valve Drain (D53) + D34_VALV = 5 # Valve Dialyzer Bypass (D34) + D64_VALV = 6 # Valve Purge 1 (D64) + D31_VALV = 7 # Valve Pressure Test (D31) + D65_VALV = 8 # Valve DryBcarb Inlet (D65) + D35_VALV = 9 # Valve Dialyzer Inlet (D35) + D40_VALV = 10 # Valve Dialyzer Outlet (D40) + D47_VALV = 11 # Valve Dialysate Out Purge 2 (D47) + D3_VALV = 12 # Valve Hydraulics Inlet (D3) + M4_VALV = 13 # Valve Water Inlet (M4) + RSRVD_SPACE1 = 14 # This space has been reserved + RSRVD_SPACE2 = 15 # This space has been reserved + D23_VALV = 16 # Balancing chamber Valve 1 (D23) + D19_VALV = 17 # Balancing chamber Valve 2 (D19) + D25_VALV = 18 # Balancing chamber Valve 3 (D25) + D26_VALV = 19 # Balancing chamber Valve 7 (D26) + D24_VALV = 20 # Balancing chamber Valve 5 (D24) + D20_VALV = 21 # Balancing chamber Valve 6 (D20) + D21_VALV = 22 # Balancing chamber Valve 4 (D21) + D22_VALV = 23 # Balancing chamber Valve 8 (D22) + D69_VALV = 24 # Ultrafiltration Valve 1 Inlet (D69) + D71_VALV = 25 # Ultrafiltration Valve 2 Inlet (D71) + D70_VALV = 26 # Ultrafiltration Valve 1 Outlet (D70) + D72_VALV = 27 # Ultrafiltration Valve 2 Outlet (D72) + NUM_OF_DD_VALVES = 28 # Number of Valves for the DD \ No newline at end of file Index: leahi_dialin/common/fp_defs.py =================================================================== diff -u -re7d16bd6881619e5fc2a0bc1a7fd578a9978498e -r956757fac807b52aec078e84127089db5dff069f --- leahi_dialin/common/fp_defs.py (.../fp_defs.py) (revision e7d16bd6881619e5fc2a0bc1a7fd578a9978498e) +++ leahi_dialin/common/fp_defs.py (.../fp_defs.py) (revision 956757fac807b52aec078e84127089db5dff069f) @@ -47,76 +47,82 @@ FP_EVENT_OP_MODE_CHANGE = 1 # FP Op mode change event FP_EVENT_SUB_MODE_CHANGE = 2 # FP Op sub-mode change event NUM_OF_FP_EVENT_IDS = 3 # Total number of FP events + @unique class FPEventDataType(DialinEnum): - EVENT_DATA_TYPE_NONE = 0 - EVENT_DATA_TYPE_U32 = 1 - EVENT_DATA_TYPE_S32 = 2 - EVENT_DATA_TYPE_F32 = 3 - EVENT_DATA_TYPE_BOOL = 4 - NUM_OF_EVENT_DATA_TYPES = 5 + EVENT_DATA_TYPE_NONE = 0 # No Event Data Type + EVENT_DATA_TYPE_U32 = 1 # Unsigned 32bit Event Data Type + EVENT_DATA_TYPE_S32 = 2 # Signed 32bit Event Data Type + EVENT_DATA_TYPE_F32 = 3 # Float 32bit Event Data Type + EVENT_DATA_TYPE_BOOL = 4 # Boolean Event Data Type + NUM_OF_EVENT_DATA_TYPES = 5 # Number of Event Data Types @unique +class BoostPumpNames(DialinEnum): + P40_PUMP = 0 # FP Boost Pump + NUM_OF_BOOST_PUMPS = 1 # Number of FP Boost Pumps + +@unique class FPConductivitySensorsEnum(DialinEnum): - P9_COND = 0 # CPi (P9) conductivity sensor value - P18_COND = 1 # CPo (P18) conductivity sensor value - NUM_OF_FP_CONDUCTIVITY = 2 + P9_COND = 0 # CPi (P9) conductivity sensor value + P18_COND = 1 # CPo (P18) conductivity sensor value + NUM_OF_FP_CONDUCTIVITY = 2 # Number of Conductivity sensors @unique class FPFlowSensorNames(DialinEnum): - P7_FLOW = 0 # Water inlet flow sensor (FMS P7) - P16_FLOW = 1 # RO outlet flow sensor (FMP P16) - NUM_OF_FP_FLOW_SENSORS = 2 + P7_FLOW = 0 # Water inlet flow sensor (FMS P7) + P16_FLOW = 1 # RO outlet flow sensor (FMP P16) + NUM_OF_FP_FLOW_SENSORS = 2 # Number of FP Flow Sensors @unique class FPFlowSensorAttributesEnum(DialinEnum): - FLOW = 0 - TEMP = 1 - NUM_OF_FP_FLOW_ATTRIBUTES = 2 + FLOW = 0 # Flow attribute for FP Flow Sensors + TEMP = 1 # Temperature attribute for FP Flow Sensors + NUM_OF_FP_FLOW_ATTRIBUTES = 2 # Number of FP Flow Sensor attributes @unique class FPFloaterLevels(DialinEnum): - LEVEL_STATE_LOW = 0 - LEVEL_STATE_MEDIUM = 1 - LEVEL_STATE_HIGH = 2 - LEVEL_STATE_ILLEGAL = 3 - NUM_OF_LEVEL_STATES = 4 + LEVEL_STATE_LOW = 0 # Low level for the FP Floater Level Sensors + LEVEL_STATE_MEDIUM = 1 # Medium level for the FP Floater Level Sensors + LEVEL_STATE_HIGH = 2 # High level for the FP Floater Level Sensors + LEVEL_STATE_ILLEGAL = 3 # Illegal level for FP Floater Level Sensor (indicates investigation) + NUM_OF_LEVEL_STATES = 4 # Number of Level States @unique class FPFloaterLevelSensorNames(DialinEnum): - P25_LEVEL = 0 - NUM_OF_FP_LEVEL_SENSORS = 1 + P25_LEVEL = 0 # P25 Level sensor + NUM_OF_FP_LEVEL_SENSORS = 1 # Number of FP Level Sensors @unique class FPPressureSensorNames(DialinEnum): - M1_PRES = 0 - M3_PRES = 1 - P8_PRES = 2 - P13_PRES = 3 - P17_PRES = 4 - X1_PRES = 5 - X2_PRES = 6 - X3_PRES = 7 - X4_PRES = 8 - NUM_OF_FP_PRES_SENSORS = 9 + M1_PRES = 0 # Water inlet pressure before regulator + M3_PRES = 1 # Water inlet pressure after regulator + P8_PRES = 2 # Water inlet pressure before the conductivity sensor + P13_PRES = 3 # Pressure before the RO filter + P17_PRES = 4 # Pressure after the RO filter + X1_PRES = 5 # Pressure before RO pump + X2_PRES = 6 # Pressure of RO Concentrate + X3_PRES = 7 # Pressure after P32, concentrate drop + X4_PRES = 8 # Pressure Drain Drop + NUM_OF_FP_PRES_SENSORS = 9 # Number of Pressure Sensors @unique class ROPumpNames(DialinEnum): - P12_PUMP = 0 - NUM_OF_RO_PUMPS = 1 + P12_PUMP = 0 # P12 RO Pump + NUM_OF_RO_PUMPS = 1 # Number of RO Pumps @unique -class ROPumpAttributes(DialinEnum): - STATE = 0 - DUTY_CYCLE = 1 - FB_DUTY_CYCLE = 2 - SPEED = 3 - TARGET_PRES = 4 - TARGET_FLOW = 5 - TARGET_DUTY_CYCLE = 6 - DUTY_CYCLE_PCT = 7 - FB_DUTY_CYCLE_PCT = 8 - NUM_OF_RO_PUMP_ATTRIBUTES = 9 +class FPPumpAttributes(DialinEnum): + STATE = 0 # State to command attribute for Pumps + DUTY_CYCLE = 1 # Duty Cycle attribute for Pumps + FB_DUTY_CYCLE = 2 # Feedback Duty Cycle attribute for Pumps + SPEED = 3 # Current Speed attribute for pumps + TARGET_PRES = 4 # Target Pressure attribute for pumps + TARGET_FLOW = 5 # Target Flow attribute for pumps + TARGET_DUTY_CYCLE = 6 # Target Duty Cycle attribute for pumps + DUTY_CYCLE_PCT = 7 # Duty Cycle Percentage attribute for pumps + FB_DUTY_CYCLE_PCT = 8 # Feedback Duty Cycle Percentage attribute for pumps + NUM_OF_RO_PUMP_ATTRIBUTES = 9 # Number of pump attributes @unique class FPTemperaturesNames(DialinEnum): @@ -137,24 +143,24 @@ @unique class FPValveStates(DialinEnum): - VALVE_STATE_CLOSED = 0 - VALVE_STATE_OPEN = 1 + VALVE_STATE_CLOSED = 0 # Valve Closed State + VALVE_STATE_OPEN = 1 # Valve Open State @unique class FPValveNames(DialinEnum): - M4_VALV = 0 # Valve (M4 VWi) - P39_VALV = 1 # Valve (P39 VROd) - P6_VALV = 2 # Valve (P6 VFF) - P11_VALV = 3 # Valve (P11 VPi) - P33_VALV = 4 # Valve (P33 VCr) - P34_VALV = 5 # Valve (P34 VCb) - P37_VALV = 6 # Valve (P37 VCd) - M7_VALV = 7 # Valve (M7) - P20_VALV = 8 # Valve (P20) - P43_VALV = 9 # Valve (P43) - NUM_OF_VALVES = 10 # Number of valves + M4_VALV = 0 # Valve (M4 VWi) + P39_VALV = 1 # Valve (P39 VROd) + P6_VALV = 2 # Valve (P6 VFF) + P11_VALV = 3 # Valve (P11 VPi) + P33_VALV = 4 # Valve (P33 VCr) + P34_VALV = 5 # Valve (P34 VCb) + P37_VALV = 6 # Valve (P37 VCd) + M7_VALV = 7 # Valve (M7) + P20_VALV = 8 # Valve (P20) + P43_VALV = 9 # Valve (P43) + NUM_OF_VALVES = 10 # Number of valves @unique class FPPumpNames(DialinEnum): - P12_PUMP_RO = 0 - P40_PUMP_BOOSTER = 1 \ No newline at end of file + P12_PUMP_RO = 0 # RO Pump + P40_PUMP_BOOSTER = 1 # Booster Pump \ No newline at end of file Index: leahi_dialin/common/td_defs.py =================================================================== diff -u -re7d16bd6881619e5fc2a0bc1a7fd578a9978498e -r956757fac807b52aec078e84127089db5dff069f --- leahi_dialin/common/td_defs.py (.../td_defs.py) (revision e7d16bd6881619e5fc2a0bc1a7fd578a9978498e) +++ leahi_dialin/common/td_defs.py (.../td_defs.py) (revision 956757fac807b52aec078e84127089db5dff069f) @@ -172,43 +172,163 @@ @unique class TDEventDataType(DialinEnum): - EVENT_DATA_TYPE_NONE = 0 - EVENT_DATA_TYPE_U32 = 1 - EVENT_DATA_TYPE_S32 = 2 - EVENT_DATA_TYPE_F32 = 3 - EVENT_DATA_TYPE_BOOL = 4 - NUM_OF_EVENT_DATA_TYPES = 5 + EVENT_DATA_TYPE_NONE = 0 # No Event Data Type + EVENT_DATA_TYPE_U32 = 1 # Unsigned 32bit Event Data Type + EVENT_DATA_TYPE_S32 = 2 # Signed 32bit Event Data Type + EVENT_DATA_TYPE_F32 = 3 # Float 32bit Event Data Type + EVENT_DATA_TYPE_BOOL = 4 # Boolean Event Data Type + NUM_OF_EVENT_DATA_TYPES = 5 # Number of Event Data Types @unique class TDAirPumpNames(DialinEnum): - H12_AIR_PUMP = 0 - NUM_OF_AIR_PUMPS = 1 + H12_AIR_PUMP = 0 # TD Air Pump + NUM_OF_AIR_PUMPS = 1 # Number of TD Air pumps @unique class TDAirPumpAttributes(DialinEnum): - STATE = 0 - POWER = 1 - NUM_OF_AIR_PUMP_ATTRIBUTES = 2 + STATE = 0 # TD Air Pump State to command attribute + POWER = 1 # TD Air Pump Power attribute + NUM_OF_AIR_PUMP_ATTRIBUTES = 2 # Number of Air Pump attributes @unique class AirTrapValves(DialinEnum): - H13_VALV = 0 # Air trap intake valve - H20_VALV = 1 # Air trap outlet valve - NUM_OF_AIR_TRAP_VALVES = 2 + H13_VALV = 0 # Air trap intake valve + H20_VALV = 1 # Air trap outlet valve + NUM_OF_AIR_TRAP_VALVES = 2 # Number of Air Trap Valves @unique class AirTrapLevelSensors(DialinEnum): - H17_LEVEL = 0 # Lower Level Sensor - H16_LEVEL = 1 # Upper Level Sensor - NUM_OF_AIR_TRAP_LEVEL_SENSORS = 2 + H17_LEVEL = 0 # Lower Level Sensor + H16_LEVEL = 1 # Upper Level Sensor + NUM_OF_AIR_TRAP_LEVEL_SENSORS = 2 # Number of TD Air Trap Level Sensors @unique class AirTrapLevelSensorsAttributes(DialinEnum): - LEVEL = 0 - RAW = 1 - NUM_OF_AIR_TRAP_LEVEL_SENSOR_ATTRIBUTES = 2 + LEVEL = 0 # Level attribute for Air Trap Level Sensor + RAW = 1 # Raw reading attribute for Air Trap Level Sensor + NUM_OF_AIR_TRAP_LEVEL_SENSOR_ATTRIBUTES = 2 # Number of Air Trap Level Sensor attributes @unique class AirTrapState(DialinEnum): - STATE_CLOSED = 0 - STATE_OPEN = 1 \ No newline at end of file + STATE_CLOSED = 0 # Closed state for Air Trap + STATE_OPEN = 1 # Open state for Air Trap + +@unique +class BloodFlowMotorAttributes(DialinEnum): + SET_BLOOD_FLOW_RATE = 0 # Set Blood Flow Rate for Blood Flow Motor + MEASURED_BLOOD_FLOW_RATE = 1 # Measured Blood Flow Rate for Blood Flow Motor + MEASURED_BLOOD_PUMP_ROTOR_SPEED = 2 # Measured Bloop Pump Rotor Speed for Blood Flow Motor + MEASURED_BLOOD_PUMP_SPEED = 3 # Measured Blood Pump Speed for Blood Flow Motor + MEASURED_BLOOD_PUMP_MOTOR_CURRENT = 4 # Measured Blood Pump Motor Current for Blood Flow Motor + SET_RPM = 5 # Set Revolutions per minute for Blood Flow Motor + ROTOR_COUNT = 6 # Rotor Count for Blood Flow Motor + PRES_BLOOD_FLOW_RATE = 7 # Pressure Blood Flow Rate for Blood Flow Motor + ROTOR_HALL_STATE = 8 # Rotor Hall State for Blood Flow Motor + NUM_OF_BLOOD_FLOW_MOTOR_ATTRIBUTES = 9 # Number of Blood Flow Motor Attributes + +@unique +class TDAirBubbleDetectorNames(DialinEnum): + H18_ADV = 0 # H18 Air Bubble Detector Venous + NUM_OF_AIR_BUBBLE_DETECTORS = 1 # Number of Air Bubble Detectors + +@unique +class TDAirBubbleDetectorAttributes(DialinEnum): + STATUS = 0 # Status of the Air Bubble Detector + STATE = 1 # State of the Air Bubble Detector + NUM_OF_AIR_BUBBLE_DETECTOR_ATTRIBUTES = 2 # Number of Air Bubble Detector Attributes + +@unique +class EjectorNames(DialinEnum): + H5_MOTOR = 0 # TD Ejector Motor + NUM_OF_EJECTOR_MOTORS = 1 # Number of Ejector Motors + +@unique +class EjectorAttributes(DialinEnum): + STATE = 0 # Ejector State to command + SET_SPEED = 1 # Ejector Set Speed + NUM_OF_EJECTOR_ATTRIBUTES = 2 # Number of Ejector Attributes + +@unique +class TDPressureSensorNames(DialinEnum): + H2_PRES = 0 # Arterial Pressure Sensor + H14_PRES = 1 # Venous Pressure Sensor + NUM_OF_PRESSURE_SENSORS = 2 # Number of Pressure Sensors + +@unique +class TDPressureSensorAttributes(DialinEnum): + PRES = 0 # Pressure attribute of pressure sensor + LONG_FILTERED_PRESSURE = 1 # Long Filtered Pressure attribute of pressure sensor + PRES_LIMIT_MIN = 2 # Pressure Minimum Limit attribute of pressure sensor + PRES_LIMIT_MAX = 3 # Pressure Maximum Limit attribute of pressure sensor + NUM_OF_PRESSURE_ATTRIBUTES = 4 # Number of Pressure Sensor Attributes + +@unique +class TDSwitchStatus(DialinEnum): + CLOSED = 0 # Closed State of the TD Switch + OPEN = 1 # Open State of the TD Switch + +@unique +class TDSwitchesNames(DialinEnum): + H9_FRONT_DOOR = 0 # Front Door Switch for TD + NUM_OF_DOORS_AND_SWITCHES = 1 # Number of Doors and Switches + +@unique +class TDTreatmentParameters(DialinEnum): + TREATMENT_PARAM_BLOOD_FLOW = 0 # Blood flow rate (in mL/min) + TREATMENT_PARAM_DIALYSATE_FLOW = 1 # Dialysate flow rate (in mL/min) + TREATMENT_PARAM_TREATMENT_DURATION = 2 # Treatment duration (in minutes) + TREATMENT_PARAM_SALINE_BOLUS_VOLUME = 3 # Saline bolus volume (in mL) + TREATMENT_PARAM_HEPARIN_STOP_TIME = 4 # Heparin stop time (in minutes) + TREATMENT_PARAM_HEPARIN_TYPE = 5 # Heparin type (enum) + TREATMENT_PARAM_ACID_CONCENTRATE = 6 # Acid concentrate type (enum) + TREATMENT_PARAM_BICARB_CONCENTRATE = 7 # Bicarbonate concentrate type (enum) + TREATMENT_PARAM_DIALYZER_TYPE = 8 # Dialysate type (enum) + TREATMENT_PARAM_BP_MEAS_INTERVAL = 9 # Blood pressure measurement interval (in minutes) + TREATMENT_PARAM_RINSEBACK_FLOW_RATE = 10 # Rinseback flow rate (in mL/min) + TREATMENT_PARAM_RINSEBACK_VOLUME = 11 # Rinseback volume (in mL) + TREATMENT_PARAM_ART_PRES_LIMIT_WINDOW = 12 # Arterial pressure alarm limit window (in mmHg) + TREATMENT_PARAM_VEN_PRES_LIMIT_WINDOW = 13 # Venous pressure alarm limit window (in mmHg) + TREATMENT_PARAM_VEN_PRES_LIMIT_ASYMMETRIC = 14 # Venous pressure alarm limit asymmetric (in mmHg) + TREATMENT_PARAM_TMP_PRES_LIMIT_WINDOW = 15 # TMP alarm limit window (in mmHg) + TREATMENT_PARAM_DIALYSATE_TEMPERATURE = 16 # Dialysate temperature (in degC) + TREATMENT_PARAM_HEPARIN_DISPENSE_RATE = 17 # Heparin dispense rate (in mL/hr) + TREATMENT_PARAM_HEPARIN_BOLUS_VOLUME = 18 # Heparin bolus volume (in mL) + TREATMENT_PARAM_UF_VOLUME = 19 # Ultrafiltration volume (in liters) - provided separately by UI + NUM_OF_TREATMENT_PARAMS = 20 # Total number of treatment parameters + +@unique +class ValvesEnum(DialinEnum): + H1_VALV = 0 # H1 Valve for TD + H19_VALV = 1 # H19 Valve for TD + +@unique +class ValvesPositions(DialinEnum): + VALVE_POSITION_NOT_IN_POSITION = 0 # Valve not in Position + VALVE_POSITION_A_INSERT_EJECT = 1 # Insert/Eject Valve Position + VALVE_POSITION_B_OPEN = 2 # Open Valve Position + VALVE_POSITION_C_CLOSE = 3 # Closed Valve Position + +@unique +class ValvesStates(DialinEnum): + VALVE_STATE_WAIT_FOR_POST = 0 # Waiting for POST Valve State + VALVE_STATE_HOMING_NOT_STARTED = 1 # Homing not started Valve State + VALVE_STATE_HOMING_FIND_ENERGIZED_EDGE = 2 # Homing Find Energized Edge Valve State + VALVE_STATE_HOMING_FIND_DEENERGIZED_EDGE = 3 # Homing Find De-energized Edge Valve State + VALVE_STATE_IDLE = 4 # Idle Valve State + VALVE_STATE_IN_TRANSITION = 5 # Valve state in transition + +# Monitored voltages +@unique +class TDMonitoredVoltages(DialinEnum): + MONITORED_LINE_1_2V = 0 # Processor voltage (1.2V) + MONITORED_LINE_3_3V = 1 # Logic voltage (3.3V) + MONITORED_LINE_5V_LOGIC = 2 # Logic voltage (5V) + MONITORED_LINE_5V_SENSORS = 3 # Sensors voltage (5V) + MONITORED_LINE_24V = 4 # Actuators voltage (24V) + MONITORED_LINE_24V_REGEN = 5 # Actuators regen voltage (24V) + MONITORED_LINE_FPGA_REF_V = 6 # FPGA ADC reference voltage (1V) + MONITORED_LINE_PBA_REF_V = 7 # PBA ADC reference voltage (3V) + MONITORED_LINE_FPGA_VCC_V = 8 # FPGA Vcc (3V) + MONITORED_LINE_FPGA_AUX_V = 9 # FPGA Vaux (3V) + MONITORED_LINE_FPGA_PVN_V = 10 # FPGA Vpvn (1V) + NUM_OF_MONITORED_VOLTAGE_LINES = 11 # Number of TD operation modes \ No newline at end of file Index: leahi_dialin/dd/modules/concentrate_pump.py =================================================================== diff -u -re7d16bd6881619e5fc2a0bc1a7fd578a9978498e -r956757fac807b52aec078e84127089db5dff069f --- leahi_dialin/dd/modules/concentrate_pump.py (.../concentrate_pump.py) (revision e7d16bd6881619e5fc2a0bc1a7fd578a9978498e) +++ leahi_dialin/dd/modules/concentrate_pump.py (.../concentrate_pump.py) (revision 956757fac807b52aec078e84127089db5dff069f) @@ -77,7 +77,9 @@ DDConcentratePumpAttributesEnum.TARGET_SPEED.name: 0.0, DDConcentratePumpAttributesEnum.PULSE_US.name: 0.0, DDConcentratePumpAttributesEnum.TARGET_REV_COUNT.name: 0, - DDConcentratePumpAttributesEnum.MEASURED_REV_COUNT.name: 0 + DDConcentratePumpAttributesEnum.MEASURED_REV_COUNT.name: 0, + DDConcentratePumpAttributesEnum.PARKED.name: None, # D76 doesn't utilize this attribute + DDConcentratePumpAttributesEnum.PARK_FAULT.name: None # D76 doesn't utilize this attribute } } Index: leahi_dialin/dd/modules/heaters.py =================================================================== diff -u -re7d16bd6881619e5fc2a0bc1a7fd578a9978498e -r956757fac807b52aec078e84127089db5dff069f --- leahi_dialin/dd/modules/heaters.py (.../heaters.py) (revision e7d16bd6881619e5fc2a0bc1a7fd578a9978498e) +++ leahi_dialin/dd/modules/heaters.py (.../heaters.py) (revision 956757fac807b52aec078e84127089db5dff069f) @@ -57,7 +57,11 @@ HeatersNames.D45_HEAT.name: { HeatersAttributesEnum.HEAT_DUTY_CYCLE.name: 0.0, HeatersAttributesEnum.HEAT_TARGET_TEMP.name: 0.0, - HeatersAttributesEnum.HEAT_STATE.name: 0 + HeatersAttributesEnum.HEAT_STATE.name: 0, + HeatersAttributesEnum.DUTY_CYCLE_COUNT.name: None, # D45 Heater doesn't use this attribute + HeatersAttributesEnum.PWM_PERIOD.name: None, # D45 Heater doesn't use this attribute + HeatersAttributesEnum.ADJUSTED_TARGET_TEMP.name: None, # D45 Heater doesn't use this attribute + HeatersAttributesEnum.TARGET_TEMP_TD.name: None # D45 Heater doesn't use this attribute } } Index: leahi_dialin/fp/modules/boost_pump.py =================================================================== diff -u -rcf5e82faaf502b2828ffb6e43c2a64b71f6e31f2 -r956757fac807b52aec078e84127089db5dff069f --- leahi_dialin/fp/modules/boost_pump.py (.../boost_pump.py) (revision cf5e82faaf502b2828ffb6e43c2a64b71f6e31f2) +++ leahi_dialin/fp/modules/boost_pump.py (.../boost_pump.py) (revision 956757fac807b52aec078e84127089db5dff069f) @@ -21,6 +21,7 @@ from leahi_dialin.utils.base import DialinEnum from .constants import RESET, NO_RESET from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions +from leahi_dialin.common.fp_defs import BoostPumpNames, FPPumpAttributes from leahi_dialin.protocols.CAN import DenaliMessage, DenaliChannels from leahi_dialin.utils.base import AbstractSubSystem, publish, DialinEnum from leahi_dialin.utils.checks import check_broadcast_interval_override_ms @@ -45,19 +46,21 @@ self.can_interface.register_receiving_publication_function(channel_id, msg_id, self._handler_pump_sync) self.boost_pump_timestamp = 0.0 - self.p40_pump_state = 0 - self.p40_pump_duty_cycle = 0 - self.p40_pump_fb_duty_cycle = 0 - self.p40_pump_speed = 0.0 - self.p40_target_pressure = 0.0 - self.p40_target_flow = 0.0 - self.p40_target_duty_cycle = 0.0 - self.p40_pump_duty_cycle_pct = 0.0 - self.p40_pump_fb_duty_cycle_pct = 0.0 + self.boost_pump = { + BoostPumpNames.P40_PUMP.name: { + FPPumpAttributes.STATE.name: 0, + FPPumpAttributes.DUTY_CYCLE.name: 0, + FPPumpAttributes.FB_DUTY_CYCLE.name: 0, + FPPumpAttributes.SPEED: 0.0, + FPPumpAttributes.TARGET_PRESSURE: 0.0, + FPPumpAttributes.TARGET_FLOW: 0.0, + FPPumpAttributes.TARGET_DUTY_CYCLE: 0.0, + FPPumpAttributes.DUTY_CYCLE_PCT: 0.0, + FPPumpAttributes.FB_DUTY_CYCLE_PCT: 0.0 + } + } - @publish(["ro_pump_timestamp", "p40_pump_state", "p40_pump_duty_cycle", "p40_pump_fb_duty_cycle", - "p40_pump_speed", "p40_target_pressure", "p40_target_flow", "p40_target_duty_cycle", - "p40_pump_duty_cycle_pct", "p40_pump_fb_duty_cycle_pct" ]) + @publish(["boost_pump_timestamp", "boost_pump" ]) def _handler_pump_sync(self, message, timestamp=0.0): """ Handles published FP ro pump data messages. FP ro pump data is captured @@ -67,23 +70,23 @@ @return: none """ - self.p40_pump_state = struct.unpack('i', bytearray( + self.boost_pump[BoostPumpNames.P40_PUMP.name][FPPumpAttributes.STATE.name] = struct.unpack('i', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] - self.p40_pump_duty_cycle = struct.unpack('i', bytearray( + self.boost_pump[BoostPumpNames.P40_PUMP.name][FPPumpAttributes.DUTY_CYCLE.name] = struct.unpack('i', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_2:MsgFieldPositions.END_POS_FIELD_2]))[0] - self.p40_pump_fb_duty_cycle = struct.unpack('i', bytearray( + self.boost_pump[BoostPumpNames.P40_PUMP.name][FPPumpAttributes.FB_DUTY_CYCLE.name] = struct.unpack('i', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_3:MsgFieldPositions.END_POS_FIELD_3]))[0] - self.p40_pump_speed = struct.unpack('f', bytearray( + self.boost_pump[BoostPumpNames.P40_PUMP.name][FPPumpAttributes.SPEED.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_4:MsgFieldPositions.END_POS_FIELD_4]))[0] - self.p40_target_pressure = struct.unpack('f', bytearray( + self.boost_pump[BoostPumpNames.P40_PUMP.name][FPPumpAttributes.TARGET_PRESSURE.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_5:MsgFieldPositions.END_POS_FIELD_5]))[0] - self.p40_target_flow = struct.unpack('f', bytearray( + self.boost_pump[BoostPumpNames.P40_PUMP.name][FPPumpAttributes.TARGET_FLOW.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_6:MsgFieldPositions.END_POS_FIELD_6]))[0] - self.p40_target_duty_cycle = struct.unpack('f', bytearray( + self.boost_pump[BoostPumpNames.P40_PUMP.name][FPPumpAttributes.TARGET_DUTY_CYCLE.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_7:MsgFieldPositions.END_POS_FIELD_7]))[0] - self.p40_pump_duty_cycle_pct = struct.unpack('f', bytearray( + self.boost_pump[BoostPumpNames.P40_PUMP.name][FPPumpAttributes.DUTY_CYCLE_PCT.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_8:MsgFieldPositions.END_POS_FIELD_8]))[0] - self.p40_pump_fb_duty_cycle_pct = struct.unpack('f', bytearray( + self.boost_pump[BoostPumpNames.P40_PUMP.name][FPPumpAttributes.FB_DUTY_CYCLE_PCT.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_9:MsgFieldPositions.END_POS_FIELD_9]))[0] self.boost_pump_timestamp = timestamp Index: leahi_dialin/fp/modules/ro_pump.py =================================================================== diff -u -re7d16bd6881619e5fc2a0bc1a7fd578a9978498e -r956757fac807b52aec078e84127089db5dff069f --- leahi_dialin/fp/modules/ro_pump.py (.../ro_pump.py) (revision e7d16bd6881619e5fc2a0bc1a7fd578a9978498e) +++ leahi_dialin/fp/modules/ro_pump.py (.../ro_pump.py) (revision 956757fac807b52aec078e84127089db5dff069f) @@ -21,7 +21,7 @@ from leahi_dialin.utils.base import DialinEnum from .constants import RESET, NO_RESET from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions -from leahi_dialin.common.fp_defs import ROPumpNames, ROPumpAttributes +from leahi_dialin.common.fp_defs import ROPumpNames, FPPumpAttributes from leahi_dialin.protocols.CAN import DenaliMessage, DenaliChannels from leahi_dialin.utils.base import AbstractSubSystem, publish, DialinEnum from leahi_dialin.utils.checks import check_broadcast_interval_override_ms @@ -48,15 +48,15 @@ self.ro_pump = { ROPumpNames.P12_PUMP.name: { - ROPumpAttributes.STATE.name: 0, - ROPumpAttributes.DUTY_CYCLE.name: 0, - ROPumpAttributes.FB_DUTY_CYCLE.name: 0, - ROPumpAttributes.SPEED.name: 0.0, - ROPumpAttributes.TARGET_PRES.name: 0.0, - ROPumpAttributes.TARGET_FLOW.name: 0.0, - ROPumpAttributes.TARGET_DUTY_CYCLE.name: 0.0, - ROPumpAttributes.DUTY_CYCLE_PCT.name: 0.0, - ROPumpAttributes.FB_DUTY_CYCLE_PCT.name: 0.0 + FPPumpAttributes.STATE.name: 0, + FPPumpAttributes.DUTY_CYCLE.name: 0, + FPPumpAttributes.FB_DUTY_CYCLE.name: 0, + FPPumpAttributes.SPEED.name: 0.0, + FPPumpAttributes.TARGET_PRES.name: 0.0, + FPPumpAttributes.TARGET_FLOW.name: 0.0, + FPPumpAttributes.TARGET_DUTY_CYCLE.name: 0.0, + FPPumpAttributes.DUTY_CYCLE_PCT.name: 0.0, + FPPumpAttributes.FB_DUTY_CYCLE_PCT.name: 0.0 } } @@ -72,23 +72,23 @@ @return: none """ - self.ro_pump[ROPumpNames.P12_PUMP.name][ROPumpAttributes.STATE.name] = struct.unpack('i', bytearray( + self.ro_pump[ROPumpNames.P12_PUMP.name][FPPumpAttributes.STATE.name] = struct.unpack('i', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] - self.ro_pump[ROPumpNames.P12_PUMP.name][ROPumpAttributes.DUTY_CYCLE.name] = struct.unpack('i', bytearray( + self.ro_pump[ROPumpNames.P12_PUMP.name][FPPumpAttributes.DUTY_CYCLE.name] = struct.unpack('i', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_2:MsgFieldPositions.END_POS_FIELD_2]))[0] - self.ro_pump[ROPumpNames.P12_PUMP.name][ROPumpAttributes.FB_DUTY_CYCLE.name] = struct.unpack('i', bytearray( + self.ro_pump[ROPumpNames.P12_PUMP.name][FPPumpAttributes.FB_DUTY_CYCLE.name] = struct.unpack('i', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_3:MsgFieldPositions.END_POS_FIELD_3]))[0] - self.ro_pump[ROPumpNames.P12_PUMP.name][ROPumpAttributes.SPEED.name] = struct.unpack('f', bytearray( + self.ro_pump[ROPumpNames.P12_PUMP.name][FPPumpAttributes.SPEED.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_4:MsgFieldPositions.END_POS_FIELD_4]))[0] - self.ro_pump[ROPumpNames.P12_PUMP.name][ROPumpAttributes.TARGET_PRES.name] = struct.unpack('f', bytearray( + self.ro_pump[ROPumpNames.P12_PUMP.name][FPPumpAttributes.TARGET_PRES.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_5:MsgFieldPositions.END_POS_FIELD_5]))[0] - self.ro_pump[ROPumpNames.P12_PUMP.name][ROPumpAttributes.TARGET_FLOW.name] = struct.unpack('f', bytearray( + self.ro_pump[ROPumpNames.P12_PUMP.name][FPPumpAttributes.TARGET_FLOW.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_6:MsgFieldPositions.END_POS_FIELD_6]))[0] - self.ro_pump[ROPumpNames.P12_PUMP.name][ROPumpAttributes.TARGET_DUTY_CYCLE.name] = struct.unpack('f', bytearray( + self.ro_pump[ROPumpNames.P12_PUMP.name][FPPumpAttributes.TARGET_DUTY_CYCLE.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_7:MsgFieldPositions.END_POS_FIELD_7]))[0] - self.ro_pump[ROPumpNames.P12_PUMP.name][ROPumpAttributes.DUTY_CYCLE_PCT.name] = struct.unpack('f', bytearray( + self.ro_pump[ROPumpNames.P12_PUMP.name][FPPumpAttributes.DUTY_CYCLE_PCT.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_8:MsgFieldPositions.END_POS_FIELD_8]))[0] - self.ro_pump[ROPumpNames.P12_PUMP.name][ROPumpAttributes.FB_DUTY_CYCLE_PCT.name] = struct.unpack('f', bytearray( + self.ro_pump[ROPumpNames.P12_PUMP.name][FPPumpAttributes.FB_DUTY_CYCLE_PCT.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_9:MsgFieldPositions.END_POS_FIELD_9]))[0] self.ro_pump_timestamp = timestamp Index: leahi_dialin/td/modules/blood_flow.py =================================================================== diff -u -r114a63e63523618b7b3be66cad703bb89c7b34b0 -r956757fac807b52aec078e84127089db5dff069f --- leahi_dialin/td/modules/blood_flow.py (.../blood_flow.py) (revision 114a63e63523618b7b3be66cad703bb89c7b34b0) +++ leahi_dialin/td/modules/blood_flow.py (.../blood_flow.py) (revision 956757fac807b52aec078e84127089db5dff069f) @@ -19,6 +19,7 @@ from .constants import PUMP_CONTROL_MODE_CLOSED_LOOP, PUMP_CONTROL_MODE_OPEN_LOOP from .constants import RESET, NO_RESET from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions +from leahi_dialin.common.td_defs import BloodFlowMotorAttributes from leahi_dialin.protocols.CAN import DenaliMessage, DenaliChannels from leahi_dialin.utils.base import AbstractSubSystem, publish from leahi_dialin.utils.checks import check_broadcast_interval_override_ms @@ -44,20 +45,19 @@ self.can_interface.register_receiving_publication_function(channel_id, msg_id, self._handler_blood_flow_sync) self.td_blood_flow_timestamp = 0.0 - self.h4_set_blood_flow_rate = 0 - self.h4_measured_blood_flow_rate = 0.0 - self.h4_measured_blood_pump_rotor_speed = 0.0 - self.h4_measured_blood_pump_speed = 0.0 - self.h4_measured_blood_pump_motor_current = 0.0 - self.h4_set_rpm = 0.0 - self.h4_rotor_count = 0 - self.h4_pres_blood_flow_rate = 0 - self.h4_rotor_hall_state = 0 + self.h4_motor = { + BloodFlowMotorAttributes.SET_BLOOD_FLOW_RATE.name: 0, + BloodFlowMotorAttributes.MEASURED_BLOOD_FLOW_RATE.name: 0.0, + BloodFlowMotorAttributes.MEASURED_BLOOD_PUMP_ROTOR_SPEED.name: 0.0, + BloodFlowMotorAttributes.MEASURED_BLOOD_PUMP_SPEED.name: 0.0, + BloodFlowMotorAttributes.MEASURED_BLOOD_PUMP_MOTOR_CURRENT.name: 0.0, + BloodFlowMotorAttributes.SET_RPM.name: 0.0, + BloodFlowMotorAttributes.ROTOR_COUNT.name: 0, + BloodFlowMotorAttributes.PRES_BLOOD_FLOW_RATE.name: 0, + BloodFlowMotorAttributes.ROTOR_HALL_STATE.name: 0 + } - - @publish(["td_blood_flow_timestamp", "h4_set_blood_flow_rate", "h4_measured_blood_flow_rate", "h4_measured_blood_pump_rotor_speed", - "h4_measured_blood_pump_speed", "h4_measured_blood_pump_motor_current", "h4_set_rpm", - "h4_rotor_count", "h4_pres_blood_flow_rate", "h4_rotor_hall_state"]) + @publish(["td_blood_flow_timestamp", "h4_motor"]) def _handler_blood_flow_sync(self, message, timestamp=0.0): """ Handles published blood flow data messages. Blood flow data are captured @@ -67,23 +67,23 @@ @return: none """ - self.h4_set_blood_flow_rate = struct.unpack('i', bytearray( + self.h4_motor[BloodFlowMotorAttributes.SET_BLOOD_FLOW_RATE.name] = struct.unpack('i', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] - self.h4_measured_blood_flow_rate = struct.unpack('f', bytearray( + self.h4_motor[BloodFlowMotorAttributes.MEASURED_BLOOD_FLOW_RATE.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_2:MsgFieldPositions.END_POS_FIELD_2]))[0] - self.h4_measured_blood_pump_rotor_speed = struct.unpack('f', bytearray( + self.h4_motor[BloodFlowMotorAttributes.MEASURED_BLOOD_PUMP_ROTOR_SPEED.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_3:MsgFieldPositions.END_POS_FIELD_3]))[0] - self.h4_measured_blood_pump_speed = struct.unpack('f', bytearray( + self.h4_motor[BloodFlowMotorAttributes.MEASURED_BLOOD_PUMP_SPEED.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_4:MsgFieldPositions.END_POS_FIELD_4]))[0] - self.h4_measured_blood_pump_motor_current = struct.unpack('f', bytearray( + self.h4_motor[BloodFlowMotorAttributes.MEASURED_BLOOD_PUMP_MOTOR_CURRENT.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_5:MsgFieldPositions.END_POS_FIELD_5]))[0] - self.h4_set_rpm = struct.unpack('f', bytearray( + self.h4_motor[BloodFlowMotorAttributes.SET_RPM.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_6:MsgFieldPositions.END_POS_FIELD_6]))[0] - self.h4_rotor_count = struct.unpack('I', bytearray( + self.h4_motor[BloodFlowMotorAttributes.ROTOR_COUNT.name] = struct.unpack('I', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_7:MsgFieldPositions.END_POS_FIELD_7]))[0] - self.h4_pres_blood_flow_rate = struct.unpack('I', bytearray( + self.h4_motor[BloodFlowMotorAttributes.PRES_BLOOD_FLOW_RATE.name] = struct.unpack('I', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_8:MsgFieldPositions.END_POS_FIELD_8]))[0] - self.h4_rotor_hall_state = struct.unpack('I', bytearray( + self.h4_motor[BloodFlowMotorAttributes.ROTOR_HALL_STATE.name] = struct.unpack('I', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_9:MsgFieldPositions.END_POS_FIELD_9]))[0] self.td_blood_flow_timestamp = timestamp Index: leahi_dialin/td/modules/bubble_detector.py =================================================================== diff -u -r51b54b55fd498d481061cb3e02e312354e970242 -r956757fac807b52aec078e84127089db5dff069f --- leahi_dialin/td/modules/bubble_detector.py (.../bubble_detector.py) (revision 51b54b55fd498d481061cb3e02e312354e970242) +++ leahi_dialin/td/modules/bubble_detector.py (.../bubble_detector.py) (revision 956757fac807b52aec078e84127089db5dff069f) @@ -18,6 +18,7 @@ from .constants import RESET, NO_RESET from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions +from leahi_dialin.common.td_defs import TDAirBubbleDetectorNames, TDAirBubbleDetectorAttributes from leahi_dialin.protocols.CAN import DenaliMessage, DenaliChannels from leahi_dialin.utils.base import AbstractSubSystem, publish from leahi_dialin.utils.conversions import integer_to_bytearray @@ -59,13 +60,16 @@ self._handler_air_bubbles_data_sync) self.td_air_bubbles_timestamp = 0.0 - # Initialize status of ADV air bubble detectors to fluid (no air bubble) detected - self.h18_air_bubbles_status = [self.FLUID_DETECTED_STATUS] + self.h18_pump = { + TDAirBubbleDetectorNames.H18_ADV.name: { + # Initialize status of ADV air bubble detectors to fluid (no air bubble) detected + TDAirBubbleDetectorAttributes.STATUS.name: self.FLUID_DETECTED_STATUS, + # Initialize state of ADV air bubble detectors state machine to normal + TDAirBubbleDetectorAttributes.STATE.name: self.AIR_BUBBLE_NORMAL_STATE + } + } - # Initialize state of ADV air bubble detectors state machine to normal - self.h18_air_bubbles_state = [self.AIR_BUBBLE_NORMAL_STATE] - - @publish(["td_air_bubbles_timestamp", "h18_air_bubbles_status", "h18_air_bubbles_state"]) + @publish(["td_air_bubbles_timestamp", "h18_pump"]) def _handler_air_bubbles_data_sync(self, message, timestamp=0.0): """ Handles published air bubbles data messages. Air bubble status and state are captured. @@ -74,9 +78,9 @@ @return: None """ - self.h18_air_bubbles_status = struct.unpack('i', bytearray( + self.h18_pump[TDAirBubbleDetectorNames.H18_ADV.name][TDAirBubbleDetectorAttributes.STATUS.name] = struct.unpack('i', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] - self.h18_air_bubbles_state = struct.unpack('i', bytearray( + self.h18_pump[TDAirBubbleDetectorNames.H18_ADV.name][TDAirBubbleDetectorAttributes.STATE.name] = struct.unpack('i', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_2:MsgFieldPositions.END_POS_FIELD_2]))[0] self.td_air_bubbles_timestamp = timestamp Index: leahi_dialin/td/modules/ejector.py =================================================================== diff -u -r9ccbc0c7610d431e94566f93014f3a9663c4488c -r956757fac807b52aec078e84127089db5dff069f --- leahi_dialin/td/modules/ejector.py (.../ejector.py) (revision 9ccbc0c7610d431e94566f93014f3a9663c4488c) +++ leahi_dialin/td/modules/ejector.py (.../ejector.py) (revision 956757fac807b52aec078e84127089db5dff069f) @@ -19,6 +19,7 @@ from .constants import RESET, NO_RESET from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions +from leahi_dialin.common.td_defs import EjectorNames, EjectorAttributes from leahi_dialin.protocols.CAN import DenaliMessage, DenaliChannels from leahi_dialin.utils.base import AbstractSubSystem, publish from leahi_dialin.utils.checks import check_broadcast_interval_override_ms @@ -47,22 +48,25 @@ self.can_interface.register_receiving_publication_function(channel_id, msg_id, self._handler_ejector_sync) - - self.h5_state = 0 - self.h5_set_speed = 0.0 + self.h5_motor = { + EjectorNames.H5_MOTOR.name: { + EjectorAttributes.STATE.name: 0, + EjectorAttributes.SET_SPEED.name: 0.0 + } + } self.td_ejector_timestamp = 0 - @publish(["td_ejector_timestamp", "h5_state", "h5_set_speed"]) + @publish(["td_ejector_timestamp", "h5_motor"]) def _handler_ejector_sync(self, message, timestamp=0.0): """ Handles published ejector data messages. @param message: published ejector data message as: ejector state @return: None """ - self.h5_state = struct.unpack('i', bytearray( + self.h5_motor[EjectorNames.H5_MOTOR.name][EjectorAttributes.STATE.name] = struct.unpack('i', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_1:MsgFieldPositions.END_POS_FIELD_1]))[0] - self.h5_set_speed = struct.unpack('f', bytearray( + self.h5_motor[EjectorNames.H5_MOTOR.name][EjectorAttributes.SET_SPEED.name] = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_2:MsgFieldPositions.END_POS_FIELD_2]))[0] self.td_ejector_timestamp = timestamp Index: leahi_dialin/td/modules/pressure_sensors.py =================================================================== diff -u -rb11534af2a1823d4054f8d134807d21054d5a6fa -r956757fac807b52aec078e84127089db5dff069f --- leahi_dialin/td/modules/pressure_sensors.py (.../pressure_sensors.py) (revision b11534af2a1823d4054f8d134807d21054d5a6fa) +++ leahi_dialin/td/modules/pressure_sensors.py (.../pressure_sensors.py) (revision 956757fac807b52aec078e84127089db5dff069f) @@ -18,6 +18,7 @@ from .constants import RESET, NO_RESET from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions +from leahi_dialin.common.td_defs import TDPressureSensorNames, TDPressureSensorAttributes from leahi_dialin.protocols.CAN import DenaliMessage, DenaliChannels from leahi_dialin.utils.base import AbstractSubSystem, publish from leahi_dialin.utils.checks import check_broadcast_interval_override_ms @@ -45,30 +46,29 @@ self._handler_pressure_sync) self.td_pressure_timestamp = 0.0 - self.h2_arterial_pressure = 0.0 - self.h14_venous_pressure = 0.0 - self.h2_arterial_long_filtered_pressure = 0.0 - self.h14_venous_long_filtered_pressure = 0.0 + self.td_pressure_sensors = { + TDPressureSensorNames.H2_PRES.name: { + TDPressureSensorAttributes.PRES.name: 0.0, + TDPressureSensorAttributes.LONG_FILTERED_PRESSURE.name: 0.0, + TDPressureSensorAttributes.PRES_LIMIT_MIN.name: 0, + TDPressureSensorAttributes.PRES_LIMIT_MAX.name: 0 + }, + TDPressureSensorNames.H14_PRES.name: { + TDPressureSensorAttributes.PRES.name: 0.0, + TDPressureSensorAttributes.LONG_FILTERED_PRESSURE.name: 0.0, + TDPressureSensorAttributes.PRES_LIMIT_MIN.name: 0, + TDPressureSensorAttributes.PRES_LIMIT_MAX.name: 0 + } + } self.pressure_limits_state = 0 - self.arterial_pressure_limit_min = 0 - self.arterial_pressure_limit_max = 0 - self.venous_pressure_limit_min = 0 - self.venous_pressure_limit_max = 0 self.tmp_pressure = 0.0 self.tmp_min_limit = 0.0 self.tmp_max_limit = 0.0 @publish([ "td_pressure_timestamp", - "h2_arterial_pressure", - "h14_venous_pressure", + "td_pressure_sensors", "pressure_limits_state", - "arterial_pressure_limit_min", - "arterial_pressure_limit_max", - "venous_pressure_limit_min", - "venous_pressure_limit_max", - "h2_arterial_long_filtered_pressure", - "h14_venous_long_filtered_pressure", "tmp_pressure", "tmp_min_limit", "tmp_max_limit", @@ -107,15 +107,15 @@ tmax = struct.unpack('f', bytearray( message['message'][MsgFieldPositions.START_POS_FIELD_9:MsgFieldPositions.END_POS_FIELD_9])) - self.h2_arterial_pressure = art[0] - self.h14_venous_pressure = ven[0] + self.td_pressure_sensors[TDPressureSensorNames.H2_PRES.name][TDPressureSensorAttributes.PRES.name] = art[0] + self.td_pressure_sensors[TDPressureSensorNames.H14_PRES.name][TDPressureSensorAttributes.PRES.name] = ven[0] self.pressure_limits_state = pls[0] - self.arterial_pressure_limit_min = apl[0] - self.arterial_pressure_limit_max = apu[0] - self.venous_pressure_limit_min = vpl[0] - self.venous_pressure_limit_max = vpu[0] - self.h2_arterial_long_filtered_pressure = lfa[0] - self.h14_venous_long_filtered_pressure = lfv[0] + self.td_pressure_sensors[TDPressureSensorNames.H2_PRES.name][TDPressureSensorAttributes.PRES_LIMIT_MIN.name] = apl[0] + self.td_pressure_sensors[TDPressureSensorNames.H2_PRES.name][TDPressureSensorAttributes.PRES_LIMIT_MAX.name] = apu[0] + self.td_pressure_sensors[TDPressureSensorNames.H14_PRES.name][TDPressureSensorAttributes.PRES_LIMIT_MIN.name] = vpl[0] + self.td_pressure_sensors[TDPressureSensorNames.H14_PRES.name][TDPressureSensorAttributes.PRES_LIMIT_MAX.name] = vpu[0] + self.td_pressure_sensors[TDPressureSensorNames.H2_PRES.name][TDPressureSensorAttributes.LONG_FILTERED_PRESSURE.name] = lfa[0] + self.td_pressure_sensors[TDPressureSensorNames.H14_PRES.name][TDPressureSensorAttributes.LONG_FILTERED_PRESSURE.name] = lfv[0] self.tmp_pressure = tps[0] self.tmp_min_limit = tmin[0] self.tmp_max_limit = tmax[0] Index: leahi_dialin/td/modules/switches.py =================================================================== diff -u -r7f463d8649e41b995e1a94cc001ffc50541cafb7 -r956757fac807b52aec078e84127089db5dff069f --- leahi_dialin/td/modules/switches.py (.../switches.py) (revision 7f463d8649e41b995e1a94cc001ffc50541cafb7) +++ leahi_dialin/td/modules/switches.py (.../switches.py) (revision 956757fac807b52aec078e84127089db5dff069f) @@ -20,25 +20,13 @@ from leahi_dialin.utils.conversions import integer_to_bytearray from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions +from leahi_dialin.common.td_defs import TDSwitchStatus, TDSwitchesNames from .constants import RESET, NO_RESET from leahi_dialin.protocols.CAN import DenaliMessage, DenaliChannels from leahi_dialin.utils.base import AbstractSubSystem, publish, DialinEnum from leahi_dialin.utils.checks import check_broadcast_interval_override_ms -@unique -class TDSwitchStatus(DialinEnum): - CLOSED = 0 - OPEN = 1 - - - -@unique -class TDSwitchesNames(DialinEnum): - H9_FRONT_DOOR = 0 - NUM_OF_DOORS_AND_SWITCHES = 1 - - class TDSwitches(AbstractSubSystem): """ @brief Treatment Device (TD) Dialin API sub-class for TD switches related commands. Index: leahi_dialin/td/modules/treatment.py =================================================================== diff -u -r0ca34ba27790b8aeb6c368190cc770ca3f345184 -r956757fac807b52aec078e84127089db5dff069f --- leahi_dialin/td/modules/treatment.py (.../treatment.py) (revision 0ca34ba27790b8aeb6c368190cc770ca3f345184) +++ leahi_dialin/td/modules/treatment.py (.../treatment.py) (revision 956757fac807b52aec078e84127089db5dff069f) @@ -15,40 +15,16 @@ ############################################################################ import struct from logging import Logger -from enum import unique from .constants import RESET, NO_RESET from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions +from leahi_dialin.common.td_defs import TDTreatmentParameters from leahi_dialin.protocols.CAN import DenaliMessage, DenaliChannels from leahi_dialin.utils.base import AbstractSubSystem, publish, DialinEnum from leahi_dialin.utils.checks import check_broadcast_interval_override_ms from leahi_dialin.utils.conversions import integer_to_bytearray, float_to_bytearray -@unique -class TDTreatmentParameters(DialinEnum): - TREATMENT_PARAM_BLOOD_FLOW = 0 # Blood flow rate (in mL/min) - TREATMENT_PARAM_DIALYSATE_FLOW = 1 # Dialysate flow rate (in mL/min) - TREATMENT_PARAM_TREATMENT_DURATION = 2 # Treatment duration (in minutes) - TREATMENT_PARAM_SALINE_BOLUS_VOLUME = 3 # Saline bolus volume (in mL) - TREATMENT_PARAM_HEPARIN_STOP_TIME = 4 # Heparin stop time (in minutes) - TREATMENT_PARAM_HEPARIN_TYPE = 5 # Heparin type (enum) - TREATMENT_PARAM_ACID_CONCENTRATE = 6 # Acid concentrate type (enum) - TREATMENT_PARAM_BICARB_CONCENTRATE = 7 # Bicarbonate concentrate type (enum) - TREATMENT_PARAM_DIALYZER_TYPE = 8 # Dialysate type (enum) - TREATMENT_PARAM_BP_MEAS_INTERVAL = 9 # Blood pressure measurement interval (in minutes) - TREATMENT_PARAM_RINSEBACK_FLOW_RATE = 10 # Rinseback flow rate (in mL/min) - TREATMENT_PARAM_RINSEBACK_VOLUME = 11 # Rinseback volume (in mL) - TREATMENT_PARAM_ART_PRES_LIMIT_WINDOW = 12 # Arterial pressure alarm limit window (in mmHg) - TREATMENT_PARAM_VEN_PRES_LIMIT_WINDOW = 13 # Venous pressure alarm limit window (in mmHg) - TREATMENT_PARAM_VEN_PRES_LIMIT_ASYMMETRIC = 14 # Venous pressure alarm limit asymmetric (in mmHg) - TREATMENT_PARAM_TMP_PRES_LIMIT_WINDOW = 15 # TMP alarm limit window (in mmHg) - TREATMENT_PARAM_DIALYSATE_TEMPERATURE = 16 # Dialysate temperature (in degC) - TREATMENT_PARAM_HEPARIN_DISPENSE_RATE = 17 # Heparin dispense rate (in mL/hr) - TREATMENT_PARAM_HEPARIN_BOLUS_VOLUME = 18 # Heparin bolus volume (in mL) - TREATMENT_PARAM_UF_VOLUME = 19 # Ultrafiltration volume (in liters) - provided separately by UI - NUM_OF_TREATMENT_PARAMS = 20 # Total number of treatment parameters - class TDTreatment(AbstractSubSystem): """ Treatment Delivery (TD) Dialin API sub-class for treatment related commands. Index: leahi_dialin/td/modules/valves.py =================================================================== diff -u -r7f463d8649e41b995e1a94cc001ffc50541cafb7 -r956757fac807b52aec078e84127089db5dff069f --- leahi_dialin/td/modules/valves.py (.../valves.py) (revision 7f463d8649e41b995e1a94cc001ffc50541cafb7) +++ leahi_dialin/td/modules/valves.py (.../valves.py) (revision 956757fac807b52aec078e84127089db5dff069f) @@ -21,35 +21,13 @@ from .constants import NO_RESET from leahi_dialin.common import MsgIds +from leahi_dialin.common.td_defs import ValvesEnum, ValvesPositions, ValvesStates from leahi_dialin.protocols.CAN import DenaliMessage, DenaliChannels from leahi_dialin.utils.base import AbstractSubSystem, publish, DialinEnum from leahi_dialin.utils.checks import check_broadcast_interval_override_ms from leahi_dialin.utils.conversions import integer_to_bytearray, short_to_bytearray -@unique -class ValvesEnum(DialinEnum): - H1_VALV = 0 - H19_VALV = 1 - - -@unique -class ValvesPositions(DialinEnum): - VALVE_POSITION_NOT_IN_POSITION = 0 - VALVE_POSITION_A_INSERT_EJECT = 1 - VALVE_POSITION_B_OPEN = 2 - VALVE_POSITION_C_CLOSE = 3 - - -@unique -class ValvesStates(DialinEnum): - VALVE_STATE_WAIT_FOR_POST = 0 - VALVE_STATE_HOMING_NOT_STARTED = 1 - VALVE_STATE_HOMING_FIND_ENERGIZED_EDGE = 2 - VALVE_STATE_HOMING_FIND_DEENERGIZED_EDGE = 3 - VALVE_STATE_IDLE = 4 - VALVE_STATE_IN_TRANSITION = 5 - class TDValves(AbstractSubSystem): """ Index: leahi_dialin/td/modules/voltages.py =================================================================== diff -u -rd28c8c54ba1f74adf348d1db6f5bfe034628c812 -r956757fac807b52aec078e84127089db5dff069f --- leahi_dialin/td/modules/voltages.py (.../voltages.py) (revision d28c8c54ba1f74adf348d1db6f5bfe034628c812) +++ leahi_dialin/td/modules/voltages.py (.../voltages.py) (revision 956757fac807b52aec078e84127089db5dff069f) @@ -23,24 +23,9 @@ from leahi_dialin.utils.conversions import integer_to_bytearray, float_to_bytearray from leahi_dialin.utils.checks import check_broadcast_interval_override_ms from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions +from leahi_dialin.common.td_defs import TDMonitoredVoltages -# Monitored voltages -@unique -class TDMonitoredVoltages(DialinEnum): - MONITORED_LINE_1_2V = 0 # Processor voltage (1.2V) - MONITORED_LINE_3_3V = 1 # Logic voltage (3.3V) - MONITORED_LINE_5V_LOGIC = 2 # Logic voltage (5V) - MONITORED_LINE_5V_SENSORS = 3 # Sensors voltage (5V) - MONITORED_LINE_24V = 4 # Actuators voltage (24V) - MONITORED_LINE_24V_REGEN = 5 # Actuators regen voltage (24V) - MONITORED_LINE_FPGA_REF_V = 6 # FPGA ADC reference voltage (1V) - MONITORED_LINE_PBA_REF_V = 7 # PBA ADC reference voltage (3V) - MONITORED_LINE_FPGA_VCC_V = 8 # FPGA Vcc (3V) - MONITORED_LINE_FPGA_AUX_V = 9 # FPGA Vaux (3V) - MONITORED_LINE_FPGA_PVN_V = 10 # FPGA Vpvn (1V) - NUM_OF_MONITORED_VOLTAGE_LINES = 11 # Number of TD operation modes - class TDVoltages(AbstractSubSystem): """ Treatment Delivery (TD) Dialin API sub-class for voltage monitor related commands and data.