Index: leahi_dialin/common/dd_defs.py =================================================================== diff -u -r35e8d930cb1a45457de87d93728fe60c7cb10ab5 -ra2aad87f17d5f85922b458ca2b73d20fb4f49c3a --- leahi_dialin/common/dd_defs.py (.../dd_defs.py) (revision 35e8d930cb1a45457de87d93728fe60c7cb10ab5) +++ leahi_dialin/common/dd_defs.py (.../dd_defs.py) (revision a2aad87f17d5f85922b458ca2b73d20fb4f49c3a) @@ -33,7 +33,7 @@ NUM_OF_DD_MODES = 11 # Number of Modes for the DD @unique -class DDPostStates(DialinEnum): +class DDInitStates(DialinEnum): 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 @@ -52,12 +52,19 @@ @unique class DDFaultStates(DialinEnum): - DD_FAULT_STATE_START = 0 # DD fault start state - DD_FAULT_STATE_RUN_NV_POSTS = 1 # DD fault run RTC and NV data management post - DD_FAULT_STATE_COMPLETE = 2 # DD fault complete - NUM_OF_DD_FAULT_STATES = 3 # Number of fault mode states + DD_FAULT_STATE_START = 0 # DD fault start state + DD_FAULT_DEENERGIZED_STATE = 1 # DD fault de-energized state + DD_FAULT_ENERGIZED_STATE_ = 2 # DD fault energized state + NUM_OF_DD_FAULT_STATES = 3 # Number of fault mode states @unique +class DDFaultNVDataStates(DialinEnum): + DD_FAULT_STATE_START = 0 # DD fault start state + DD_FAULT_STATE_RUN_NV_POSTS = 1 # DD fault run RTC and NV data management post + DD_FAULT_STATE_COMPLETE = 2 # DD fault complete + NUM_OF_DD_FAULT_NVDATA_STATES = 3 # Number of fault mode NV Data management states + +@unique class DDStandByModeStates(DialinEnum): DD_STANDBY_MODE_STATE_IDLE = 0 # Idle standby mode state DD_STANDBY_MODE_STATE_PAUSE = 1 # Pause state @@ -66,17 +73,20 @@ @unique class DDPreGenDialysateStates(DialinEnum): DD_PRE_GEN_DIALYSATE_HYD_CHAMBER_FILL_CHECK = 0, # DD Pre-Gen Dialysate hyrochamber fill check - DD_PRE_GEN_DIALYSATE_WAIT_FOR_GEND = 1 # DD Pre-Gen Dialysate Wait for Gen Dialysate state transition - NUM_OF_DD_PRE_GEN_DIALYSATE_STATES = 2 # Number of Pre-Gen Dialysate mode states + DD_PRE_GEN_WET_SELF_TEST = 1 # DD Pre-Gen Wet Self Test + DD_PRE_GEN_DIALYSATE_WAIT_FOR_GEND = 2 # DD Pre-Gen Dialysate Wait for Gen Dialysate state transition + NUM_OF_DD_PRE_GEN_DIALYSATE_STATES = 3 # Number of Pre-Gen Dialysate mode states @unique class DDGenDialysateModeStates(DialinEnum): DD_GEND_STATE_START = 0 # Gen dialysate start state DD_GEND_DIALYSATE_BYPASS_STATE = 1 # Gen dialysate - Bypass dialysate state DD_GEND_DIALYSATE_DELIVERY_STATE = 2 # Gen dialysate - deliver dialysate state - DD_GEND_DIALYSATE_DELIVERY_PAUSE = 3 # Gen dialysate - dialysate delivery pause state - DD_GEND_ISOLATED_UF_STATE = 4 # Gen dialysate - Isolated ultrafiltration state - NUM_OF_DD_GEND_MODE_STATES = 5 # Number of gen dialysate states + DD_GEND_ISOLATED_UF_STATE = 3 # Gen dialysate - Isolated ultrafiltration state + DD_GEND_SPENT_CHAMBER_FILL_STATE = 4 # Gen dialysate - spent chamber fill state + DD_GEND_BICARB_CHAMBER_FILL_STATE = 5 # Gen dialysate - bicarb chamber fill state + DD_GEND_DIALYSATE_DELIVERY_PAUSE = 6 # Gen dialysate - dialysate delivery pause state + NUM_OF_DD_GEND_MODE_STATES = 7 # Number of gen dialysate states @unique class DDPostGenDialysateState(DialinEnum): @@ -94,7 +104,12 @@ DD_EVENT_D63_LEVL_CHANGE = 5 # DD bicarb level change event DD_EVENT_D46_LEVL_CHANGE = 6 # DD spent dialysate air seperation level change event DD_EVENT_TD_COMMUNICATION_LOSS = 7 # DD TD communication loss - NUM_OF_DD_EVENT_IDS = 8 # Total number of DD events + DD_EVENT_TEMPERATURE_DRIFT = 8 # DD dialysate temperature drift + DD_EVENT_BLOOD_LEAK_ZEROING_REQUEST = 9 # DD blood leak zeroing request + DD_EVENT_BLOOD_LEAK_ZEROING_REQUIRED = 10 # DD blood leak zeroing required + DD_EVENT_BLOOD_LEAK_NUM_OF_SET_POINT_CHECK_FAILURES = 11 # DD blood leak number of setpoint check failures + DD_EVENT_BLOOD_LEAK_SELF_TEST_RESULT = 12 # DD blood leak self test result + NUM_OF_DD_EVENT_IDS = 13 # Total number of DD events @unique class DDEventDataType(DialinEnum): @@ -211,11 +226,17 @@ @unique class DDHeatersState(DialinEnum): + DD_HEAT_DISINFECT_STATE_START = 0 # Heat disinfect, start mode state + DD_HEAT_DISINFECT_STATE_COMPLETE = 1 # Heat disinfect, complete state + NUM_OF_DD_HEAT_DISINFECT_STATES = 2 # Number of heat disinfect mode states + +@unique +class DDHeatersExecState(DialinEnum): 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 + NUM_OF_HEATERS_EXEC_STATE = 4 @unique class DDHeatersNames(DialinEnum): @@ -235,6 +256,10 @@ NUM_OF_DD_HEATER_ATTRIBUTES = 7 # Number of Heater Attributes @unique +class DDHeatersCoolingStates(DialinEnum): + NUM_OF_DD_HEAT_COOL_STATES = 0 # TODO: populate with heater cooling states + +@unique class DDLevelSensorEnum(DialinEnum): D6_LEVEL = 0 # floater switch low, medium and high status D63_LEVEL = 1 # bicarb level low or high status @@ -265,6 +290,10 @@ D41_PRES = 4 # Transmembrane pressure (Ptm) NUM_OF_PRESSURE_SENSORS = 5 # Number of pressure sensors +@unique +class DDROPermeateStates(DialinEnum): + NUM_OF_RO_PERMEATE_STATES = 0 # TODO: populate with RO Permeate states + COND_SENSOR_INDEX_OFFSET = 6 # Conductivity Sensor Index Offset for the Temperature Readings PRES_SENSOR_INDEX_OFFSET = 15 # Pressure Sensors Offset for Temperature Readings @@ -334,6 +363,10 @@ NUM_OF_DD_VALVES = 32 # Number of Valves for the DD @unique +class DDNotLegalStates(DialinEnum): + NUM_OF_NOT_LEGAL_STATES = 0 # TODO: populate with Not Legal states + +@unique class DDMonitoredVoltages(DialinEnum): MONITORED_LINE_1_2V = 0 # Processor voltage (1.2V) MONITORED_LINE_3_3V = 1 # Logic voltage (3.3V) Index: leahi_dialin/common/fp_defs.py =================================================================== diff -u -r35e8d930cb1a45457de87d93728fe60c7cb10ab5 -ra2aad87f17d5f85922b458ca2b73d20fb4f49c3a --- leahi_dialin/common/fp_defs.py (.../fp_defs.py) (revision 35e8d930cb1a45457de87d93728fe60c7cb10ab5) +++ leahi_dialin/common/fp_defs.py (.../fp_defs.py) (revision a2aad87f17d5f85922b458ca2b73d20fb4f49c3a) @@ -24,10 +24,16 @@ MODE_STAN = 3 # Standby mode MODE_PRE_GENP = 4 # Pre Generate Permeate Mode MODE_GENP = 5 # Generate Permeate Mode - MODE_NLEG = 6 # Not legal - an illegal mode transition occurred - NUM_OF_FP_MODES = 7 # Number of TD operation modes - + MODE_DPGP = 6 # Defeatured Pre-Generate Permeate Mode + MODE_DEGP = 7 # Defeatured Generate Permeate Mode + MODE_NLEG = 8 # Not legal - an illegal mode transition occurred + NUM_OF_FP_MODES = 9 # Number of TD operation modes + @unique +class FPServiceStates(DialinEnum): + NUM_OF_FP_SERV_STATES = 0 # TODO populate with FP service states + +@unique class FPPostStates(DialinEnum): FP_POST_STATE_START = 0 # Start initialize & POST mode state FP_POST_STATE_FW_INTEGRITY = 1 # Run firmware integrity test state @@ -40,13 +46,65 @@ FP_POST_STATE_COMPLETED = 8 # POST self-tests completed state FP_POST_STATE_FAILED = 9 # POST self-tests failed state NUM_OF_FP_POST_STATES = 10 # Number of initialize & POST mode states - + @unique +class FPFaultStates(DialinEnum): + FP_FAULT_STATE_START = 0 # FP Fault Start State + FP_FAULT_DEENERGIZED_STATE = 1 # FP Fault De-energized State + FP_FAULT_ENERGIZED_STATE = 2 # FP Fault Energized State + NUM_OF_FP_FAULT_STATES = 3 # Number of Fault Mode State + +@unique +class FPStandbyStates(DialinEnum): + FP_STANDBY_MODE_STATE_IDLE = 0 # Idle standby mode state + NUM_OF_FP_STANDBY_MODE_STATES = 1 # Number of standby mode states + +@unique +class FPPreGenPermeateStates(DialinEnum): + FP_PRE_GENP_INLET_PRES_CHECK = 0 # FP Pre Gen Permeate Inlet Pressure Check State + FP_PRE_GENP_FILTER_FLUSH = 1 # FP Pre Gen Permeate Filter Flush State + FP_PRE_GENP_PERMEATE_FLUSH = 2 # FP Pre Gen Permeate Permeate Flush State + FP_PRE_GENP_CONCENTRATE_FLUSH = 3 # FP Pre Gen Permeate Concentrate Flush State + FP_PRE_GENP_VERIFY_WATER = 4 # FP Pre Gen Permeate Verify Water State + FP_PRE_GENP_PAUSED = 5 # FP Pre Gen Permeate Paused State + NUM_OF_FP_PRE_GENP_MODE_STATES = 6 # Number of Pre-Gen Permeate mode states + +@unique +class FPPreGenPDefStates(DialinEnum): + FP_PRE_GENP_DEF_FLUSH = 0 # Pre Gen Permeate Defeatured Flush state + FP_PRE_GENP_DEF_INLET_WATER_CHECK = 1 # Pre Gen Permeate Defeatured Inlet Water Check state + FP_PRE_GENP_DEF_PAUSED = 2 # Defeatured Pre Gen Permeate Paused state + NUM_OF_FP_PRE_GENP_DEF_MODE_STATES = 3 # Number of Defeatured Pre Gen Permeate states + +@unique +class FPGenPermeateStates(DialinEnum): + FP_GENP_TANK_FILL_STATE = 0 # Gen Permeate Tank Fill low state + FP_GENP_TANK_FULL_STATE = 1 # Gen Permeate Tank Full state + NUM_OF_FP_GENP_MODE_STATES = 2 # Number of Gen permeate states + +@unique +class FPGenPermeateDefStates(DialinEnum): + FP_GENP_DEF_SUPPLY_WATER = 0 # Gen Permeate Defeatured Supply Water state + FP_GENP_DEF_PAUSED = 1 # Gen Permeate Defeatured Paused state + NUM_OF_FP_GENP_DEF_MODE_STATES = 2 # Number of gen Permeate states + +@unique +class FPNotLegalStates(DialinEnum): + NUM_OF_NOT_LEGAL_STATES = 0 # TODO: populate with Not Legal states + +@unique class FPEventList(DialinEnum): FP_EVENT_STARTUP = 0 # FP startup event 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 + FP_EVENT_PRE_GEN_RO_SET_PWM = 3 # FP gen permeate ro set pwm event + FP_EVENT_GENP_BOOST_SET_PWM = 4 # FP gen permeate boost set pwm event + FP_EVENT_GENP_CHANGE = 5 # FP gen permeate state change + FP_EVENT_PRE_GEN_CHANGE = 6 # FP pre gen state change + FP_EVENT_PRE_GEN_DEF_CHANGE = 7 # FP defeatured pre gen state change + FP_EVENT_GENP_DEF_CHANGE = 8 # FP defeatured pre gen state change + FP_EVENT_FAULT_ALARM_TRIGGER = 9 # FP event for alarms that would trigger + NUM_OF_FP_EVENT_IDS = 10 # Total number of FP events @unique class FPEventDataType(DialinEnum): Index: leahi_dialin/common/msg_ids.py =================================================================== diff -u -r8e3ce4e082f70e12b48d796c518994662f7668b3 -ra2aad87f17d5f85922b458ca2b73d20fb4f49c3a --- leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision 8e3ce4e082f70e12b48d796c518994662f7668b3) +++ leahi_dialin/common/msg_ids.py (.../msg_ids.py) (revision a2aad87f17d5f85922b458ca2b73d20fb4f49c3a) @@ -190,6 +190,7 @@ MSG_ID_TD_AIR_PUMP_POWER_RAISE_OVERRIDE_REQUEST = 0x803D MSG_ID_TD_AIR_PUMP_POWER_LOWER_OVERRIDE_REQUEST = 0x803E MSG_ID_TD_HARD_STOP_BLOOD_PUMP = 0x803F + MSG_ID_TD_TRAINING_TEST_OVERRIDE_REQUEST = 0x8999 MSG_ID_DD_TESTER_LOGIN_REQUEST = 0xA000 MSG_ID_DD_SOFTWARE_RESET_REQUEST = 0xA001 Index: leahi_dialin/dd/dialysate_delivery.py =================================================================== diff -u -r8e3ce4e082f70e12b48d796c518994662f7668b3 -ra2aad87f17d5f85922b458ca2b73d20fb4f49c3a --- leahi_dialin/dd/dialysate_delivery.py (.../dialysate_delivery.py) (revision 8e3ce4e082f70e12b48d796c518994662f7668b3) +++ leahi_dialin/dd/dialysate_delivery.py (.../dialysate_delivery.py) (revision a2aad87f17d5f85922b458ca2b73d20fb4f49c3a) @@ -22,6 +22,7 @@ from .modules.conductivity_sensors import DDConductivitySensors from .modules.constants import NO_RESET, RESET from .modules.dialysate_pump import DDDialysatePumps +from .modules.events import DDEvents from .modules.gen_dialysate import DDGenDialysate from .modules.heaters import DDHeaters from .modules.levels import DDLevels @@ -121,6 +122,7 @@ self.concentrate_pumps = DDConcentratePumps(self.can_interface, self.logger) self.conductivity_sensors = DDConductivitySensors(self.can_interface, self.logger) self.dialysate_pumps = DDDialysatePumps(self.can_interface, self.logger) + self.events = DDEvents(self.can_interface, self.logger) self.gen_dialysate = DDGenDialysate(self.can_interface, self.logger) self.heaters = DDHeaters(self.can_interface, self.logger) self.levels = DDLevels(self.can_interface, self.logger) Index: leahi_dialin/fp/modules/temperatures.py =================================================================== diff -u -r35e8d930cb1a45457de87d93728fe60c7cb10ab5 -ra2aad87f17d5f85922b458ca2b73d20fb4f49c3a --- leahi_dialin/fp/modules/temperatures.py (.../temperatures.py) (revision 35e8d930cb1a45457de87d93728fe60c7cb10ab5) +++ leahi_dialin/fp/modules/temperatures.py (.../temperatures.py) (revision a2aad87f17d5f85922b458ca2b73d20fb4f49c3a) @@ -174,7 +174,7 @@ message_id=MsgIds.MSG_ID_FP_PRESSURE_TEMP_OVERRIDE_REQUEST.value, payload=payload) - self.logger.debug("Setting sensor {} to {} C".format(FPTemperaturesNames[str(sensor_index)].name, sensor_value)) + self.logger.debug("Setting sensor {} to {} C".format(list(self.fp_temperatures.keys())[sensor_index], sensor_value)) # Send message received_message = self.can_interface.send(message)