Index: dialin/common/msg_defs.py =================================================================== diff -u -r9b9432752672e3043ea3bec982cbdb62dc81e615 -rab24503836ed04ff6e3f14b80fc9de92efb557b5 --- dialin/common/msg_defs.py (.../msg_defs.py) (revision 9b9432752672e3043ea3bec982cbdb62dc81e615) +++ dialin/common/msg_defs.py (.../msg_defs.py) (revision ab24503836ed04ff6e3f14b80fc9de92efb557b5) @@ -97,7 +97,6 @@ MsgIds.MSG_ID_DG_SWITCHES_DATA.value, MsgIds.MSG_ID_HD_SWITCHES_DATA.value, MsgIds.MSG_ID_HD_FANS_DATA.value, - MsgIds.MSG_ID_DG_DIALYSATE_FLOW_METER_DATA.value, MsgIds.MSG_ID_DG_ALARM_INFO.value, MsgIds.MSG_ID_HD_RESERVOIRS_DATA.value, MsgIds.MSG_ID_DG_CPLD_STATUS.value Index: dialin/common/msg_ids.py =================================================================== diff -u -rf63e2670e05176a9dc2167e7edbf3088595aaf1a -rab24503836ed04ff6e3f14b80fc9de92efb557b5 --- dialin/common/msg_ids.py (.../msg_ids.py) (revision f63e2670e05176a9dc2167e7edbf3088595aaf1a) +++ dialin/common/msg_ids.py (.../msg_ids.py) (revision ab24503836ed04ff6e3f14b80fc9de92efb557b5) @@ -186,13 +186,13 @@ MSG_ID_HD_FANS_DATA = 0xA3 MSG_ID_HD_EVENT = 0xA4 MSG_ID_DG_EVENT = 0xA5 - MSG_ID_DG_DIALYSATE_FLOW_METER_DATA = 0xA6 + MSG_ID_HD_SET_SERVICE_TIME = 0xA6 MSG_ID_DG_ALARM_INFO = 0xA7 MSG_ID_HD_RESERVOIRS_DATA = 0xA8 MSG_ID_HD_REQUEST_DG_CONCENTRATE_MIXING_RATIOS = 0xA9 MSG_ID_DG_CONCENTRATE_MIXING_RATIOS_DATA = 0xAA MSG_ID_DG_SCHEDULED_RUNS_DATA = 0xAB - MSG_ID_DG_SCHEDULED_RUNS_INFO = 0xAC + MSG_ID_DG_SET_SERVICE_TIME = 0xAC MSG_ID_UI_INSTALLATION_CONFIRM_RESPONSE = 0xAD MSG_ID_DG_FILL_MODE_DATA = 0xAE MSG_ID_DG_GEN_IDLE_DATA = 0xAF @@ -351,6 +351,7 @@ MSG_ID_HD_DIAL_IN_SET_PWM = 0x8086 MSG_ID_HD_DIAL_OUT_SET_PWM = 0x8087 MSG_ID_DIALYSATE_INLET_PUMP_ROTOR_COUNT_OVERRIDE = 0x8088 + MSG_ID_HD_NV_RECORD_CRC_OVERRIDE = 0x8089 MSG_ID_DG_TESTER_LOGIN_REQUEST = 0xA000 MSG_ID_DG_ALARM_STATE_OVERRIDE = 0xA001 @@ -443,6 +444,7 @@ MSG_ID_DG_DRAIN_PUMP_DIRECTION_OVERRIDE = 0xA05A MSG_ID_DG_RO_FEEDBACK_VOLTAGE_OVERRIDE = 0xA05B MSG_ID_DG_DIALYSATE_FILL_INTEGRATED_VOLUME_OVERRIDE = 0xA05C + MSG_ID_DG_NV_RECORD_CRC_OVERRIDE = 0xA05D MSG_ID_HD_DEBUG_EVENT = 0xFFF1 MSG_ID_DG_DEBUG_EVENT = 0xFFF2 Index: dialin/hd/ui_proxy.py =================================================================== diff -u -rbc2938a08b77bf1a26d1d6de59797aaa2a5124fc -rab24503836ed04ff6e3f14b80fc9de92efb557b5 --- dialin/hd/ui_proxy.py (.../ui_proxy.py) (revision bc2938a08b77bf1a26d1d6de59797aaa2a5124fc) +++ dialin/hd/ui_proxy.py (.../ui_proxy.py) (revision ab24503836ed04ff6e3f14b80fc9de92efb557b5) @@ -1655,6 +1655,32 @@ self.logger.debug("Sending setting standby submode to wait for disinfect to HD.") self.can_interface.send(message, 0) + def cmd_ui_set_hd_service_time(self) -> None: + """ + Constructs and sends a ui message to set the HD service time + + @return: none + """ + + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_hd_ch_id, + message_id=MsgIds.MSG_ID_HD_SET_SERVICE_TIME.value) + + self.logger.debug("Setting HD service time.") + self.can_interface.send(message, 0) + + def cmd_ui_set_dg_service_time(self) -> None: + """ + Constructs and sends a ui message to set the DG service time + + @return: none + """ + + message = DenaliMessage.build_message(channel_id=DenaliChannels.dialin_to_dg_ch_id, + message_id=MsgIds.MSG_ID_DG_SET_SERVICE_TIME.value) + + self.logger.debug("Setting DG service time.") + self.can_interface.send(message, 0) + @publish(["disinfects_hd_submode", "disinfects_dg_mode"]) def _handler_disinfects_data_publish(self, message: dict) -> None: """ Index: tests/dg_tests.py =================================================================== diff -u -re049454cdcc0fe9e4beccc9d87a8f60d97d47b4c -rab24503836ed04ff6e3f14b80fc9de92efb557b5 --- tests/dg_tests.py (.../dg_tests.py) (revision e049454cdcc0fe9e4beccc9d87a8f60d97d47b4c) +++ tests/dg_tests.py (.../dg_tests.py) (revision ab24503836ed04ff6e3f14b80fc9de92efb557b5) @@ -91,7 +91,7 @@ def get_hd_run_info(): info = ('HD_op_mode, {}, HD_sub_mode, {}, Top_alarm, {}, Target_UF_ml, {:5.3f}, Meas_UF_ml, {:5.3f}, ' 'Wet_test_state, {}, Post_tx_state, {}, Post_tx_drain_state, {}, Prime_state, {}, Pre_Tx_rsrvr_state, {}, ' - 'Pre_Tx_dry_state, {}, Arterial_press, {:5.3f}, Venous_press, {:5.3f}, Blood_press, {:5.3f}, ' + 'Pre_Tx_dry_state, {}, ' .format(HDOpModes(hd.hd_operation_mode).name, hd.hd_operation_sub_mode, hd.alarms.alarm_top, hd.dialysate_outlet_flow.reference_dialysate_outlet_uf_volume, hd.dialysate_outlet_flow.measured_dialysate_outlet_uf_volume, @@ -100,14 +100,12 @@ HDPostTreatmentDrainStates(hd.post_treatment.post_treatment_drain_state).name, hd.pretreatment.pre_treatment_prime_state, PreTreatmentRsrvrState(hd.pretreatment.pre_treatment_reservoir_state).name, - PreTreatmentDrySelfTestsStates(hd.pretreatment.pre_treatment_dry_self_test_state).name, - hd.pressure_occlusion.arterial_pressure, hd.pressure_occlusion.venous_pressure, - hd.pressure_occlusion.blood_pump_occlusion)) + PreTreatmentDrySelfTestsStates(hd.pretreatment.pre_treatment_dry_self_test_state).name)) return info def get_hd_occlusion_pressures_info(): - info = ('Art_pres, {:5.3f}, Venous_pres, {:5.3f}, Blood_pump_pres, {}, DialIn_pres, {}, DialOut_pres, {}, ' + info = ('Art_pres, {:5.3f}, Venous_pres, {:5.3f}, Blood_pump_pres, {:5.3f}, DialIn_pres, {}, DialOut_pres, {}, ' .format(hd.pressure_occlusion.arterial_pressure, hd.pressure_occlusion.venous_pressure, hd.pressure_occlusion.blood_pump_occlusion, hd.pressure_occlusion.dialysate_inlet_pump_occlusion, hd.pressure_occlusion.dialysate_outlet_pump_occlusion)) @@ -175,9 +173,9 @@ def get_load_cells_info(): - info = ('A1, {:5.3f}, A2, {:5.3f}, B1, {:5.3f}, B2, {:5.3f}, '. - format(dg.load_cells.load_cell_A1, dg.load_cells.load_cell_A2, dg.load_cells.load_cell_B1, - dg.load_cells.load_cell_B2)) + info = ('A1, {:5.3f}, A2, {:5.3f}, B1, {:5.3f}, B2, {:5.3f}, ' + .format(dg.load_cells.load_cell_A1, dg.load_cells.load_cell_A2, dg.load_cells.load_cell_B1, + dg.load_cells.load_cell_B2)) return info @@ -319,8 +317,11 @@ return info -def get_hd_valves_info(): - info = ('Air_trap' ) +def get_hd_air_trap_info(): + info = ('Air_trap_high_level, {}, Air_trap_low_level, {}, Air_trap_valve, {}, Air_bubble_status, {}, ' + .format(hd.air_trap.upper_level, hd.air_trap.lower_level, hd.valves.hd_air_trap_status, + hd.air_bubbles.air_bubbles_status)) + return info def get_dg_idle_bad_fill_info(): @@ -441,31 +442,13 @@ idle_bad_fill = get_dg_idle_bad_fill_info() uv = get_uv_reactors_info() hd_fans = get_hd_fans_info() + hd_pressures = get_hd_occlusion_pressures_info() + air_trap = get_hd_air_trap_info() var = str(datetime.now()) + ', ' + hd_run + dg_run + hd_rsrvrs + dg_rsrvrs + load_cell + drain + ro + \ - temp + heaters + conc_pumps + dg_fans + valves + blood_leak + hd_pumps + fill_info + uv + hd_fans + '\r' + temp + heaters + conc_pumps + dg_fans + valves + blood_leak + hd_pumps + fill_info + uv + hd_fans + \ + hd_pressures + air_trap + '\r' - if hd.alarms.get_alarm_state(97) and start is False: - dg.conductivity_sensors.cmd_conductivity_sensor_override(ConductivitySensorsEnum.CD2.value, 13700.00) - sleep(0.2) - dg.conductivity_sensors.cmd_conductivity_sensor_override(ConductivitySensorsEnum.CD1.value, 11600.00) - start = True - - """ - var = str(datetime.now()) + ', ' + hd_run + dg_run + load_cell + drain + ro + conc_pumps + valves + \ - idle_bad_fill + fill_info + '\r' - - if dg.dg_operation_mode == 6 and dg.dg_operation_sub_mode == 4 and start is False: - #dg.conductivity_sensors.cmd_conductivity_sensor_override(ConductivitySensorsEnum.CD2.value, 12000.00) - dg.pressures.cmd_pressure_override(dg.pressures.PRESSURE_SENSOR_RO_PUMP_INLET, 14) - start = True - - if start is True: - counter += 1 - - if 10 < counter < 14: - dg.pressures.cmd_pressure_override(dg.pressures.PRESSURE_SENSOR_RO_PUMP_INLET, 14, reset=1) - """ print(var) f.write(var) sleep(sleep_time) @@ -474,30 +457,6 @@ f.close() -def collect_hd_treatment(): - f = open("/home/fw/projects/dialin/tests/treatment_run_hd.log", "w") - - #hd.cmd_hd_software_reset_request() - - hd.dialysate_inlet_flow.cmd_dialysate_inlet_flow_broadcast_interval_override(50) - sleep(1) - hd.dialysate_outlet_flow.cmd_dialysate_outlet_flow_broadcast_interval_override(50) - sleep(1) - hd.voltages.cmd_monitored_voltages_broadcast_interval_override(50) - - try: - while True: - hd_run = get_hd_run_info() - pumps_info = get_hd_pumps_info() - voltages = get_voltages_info() - var = hd_run + pumps_info + voltages + '\r' - print(var) - f.write(var) - sleep(0.05) - except KeyboardInterrupt: - f.close() - - def run_heat_disinfect(): complete_counter = 1 f = open("/home/fw/projects/dialin/tests/Heat_disinfect.log", "w") @@ -650,25 +609,6 @@ dg.drain_pump.cmd_drain_pump_set_rpm(0) -def test_conc_pumps(): - dg.concentrate_pumps.cmd_concentrate_pump_state_change_request(0, True) - sleep(1) - #dg.concentrate_pumps.cmd_concentrate_pump_state_change_request(1, True) - # sleep(1) - dg.concentrate_pumps.cmd_concentrate_pump_target_speed_override(0, 35) - #sleep(1) - #dg.concentrate_pumps.cmd_concentrate_pump_target_speed_override(1, 20) - - try: - while True: - print(get_concentrate_pumps_info()) - sleep(1) - except KeyboardInterrupt: - dg.concentrate_pumps.cmd_concentrate_pump_state_change_request(0, False) - sleep(0.5) - dg.concentrate_pumps.cmd_concentrate_pump_state_change_request(1, False) - - def test_hd_valves(): while True: @@ -731,20 +671,6 @@ #test_hd_valves() - #while True: - # print(get_heaters_info()) - # sleep(1) + #hd.ui.cmd_ui_set_dg_service_time() - #dg.flow_sensors.cmd_measured_flow_sensor_value_lpm_override(1, 0.8, reset=1) - #dg.heaters.cmd_set_primary_and_trimmer_heaters_target_temperature(primary_target_temp=40, trimmer_target_temp=52) - #sleep(1) - #dg.heaters.cmd_start_stop_trimmer_heater(0) - - #dg.valves.cmd_valve_sensed_state_override(4, 1, reset=0) - - #while True: - # print(get_dg_valves_states()) - # sleep(1) - - Index: tests/hd_nvm_scripts.py =================================================================== diff -u -re049454cdcc0fe9e4beccc9d87a8f60d97d47b4c -rab24503836ed04ff6e3f14b80fc9de92efb557b5 --- tests/hd_nvm_scripts.py (.../hd_nvm_scripts.py) (revision e049454cdcc0fe9e4beccc9d87a8f60d97d47b4c) +++ tests/hd_nvm_scripts.py (.../hd_nvm_scripts.py) (revision ab24503836ed04ff6e3f14b80fc9de92efb557b5) @@ -50,12 +50,12 @@ # It creates a folder called HD_NV_Records in the destination that is called # If no address is provided, the default location is one folder above the dialin folder wherever it is installed # in your computer. - #hd.calibration_record.cmd_get_hd_calibration_record_report() + hd.calibration_record.cmd_get_hd_calibration_record_report() # Use cmd_set_hd_calibration_excel_to_fw() set the changes back to firmware # This function requires an address for the excel report. Use the absolute address of your excel report like the # example below - hd.calibration_record.cmd_set_hd_calibration_excel_to_fw('/home/fw/projects/HD_NV_Records/2022-08-13-HD-Record.xlsx') + #hd.calibration_record.cmd_set_hd_calibration_excel_to_fw('/home/fw/projects/HD_NV_Records/2022-08-13-HD-Record.xlsx') # For resetting the calibration record to benign values, use the function below hd.calibration_record.cmd_reset_hd_calibration_record() @@ -68,7 +68,7 @@ # This function gets an address to locate the report there (i.e. /home/fw/projects/) # It creates a folder called DG_NV_Records in the destination that is called # If no address is provided, the default location is one folder above the dialin folder wherever it is installed - # in you computer. + # in your computer. #hd.system_record.cmd_get_hd_system_record_report() hd.system_record.cmd_set_hd_system_record_excel_to_fw('/home/fw/projects/HD_NV_Records/2022-09-26-HD-Record.xlsx') @@ -77,17 +77,51 @@ #hd.system_record.cmd_reset_hd_system_record() +def run_usage_info_commands(): + # Comment and un-comment any of the functions that you would like to use or you can use your own scripts. + + # Use cmd_get_dg_system_record_report() to get the system record in an excel + # This function gets an address to locate the report there (i.e. /home/fw/projects/) + # It creates a folder called DG_NV_Records in the destination that is called + # If no address is provided, the default location is one folder above the dialin folder wherever it is installed + # in your computer. + hd.usage_record.cmd_get_hd_usage_info_record() + + #hd.usage_record.cmd_set_dg_usage_info_excel_to_fw('/home/fw/projects/HD_NV_Records/2022-12-07-HD-Record.xlsx') + + #hd.usage_record.cmd_reset_hd_usage_info_record() + + +def run_service_commands(): + # Comment and un-comment any of the functions that you would like to use or you can use your own scripts. + + # Use cmd_get_dg_system_record_report() to get the system record in an excel + # This function gets an address to locate the report there (i.e. /home/fw/projects/) + # It creates a folder called DG_NV_Records in the destination that is called + # If no address is provided, the default location is one folder above the dialin folder wherever it is installed + # in your computer. + hd.service_record.cmd_get_hd_service_record() + + #hd.service_record.cmd_set_dg_service_record_excel_to_fw('/home/fw/projects/HD_NV_Records/2022-12-07-HD-Record.xlsx') + + #hd.service_record.cmd_reset_hd_service_record() + + if __name__ == "__main__": hd = HD(log_level="DEBUG") if hd.cmd_log_in_to_hd(): # Comment this function if not needed - run_sw_configs_commands() + #run_sw_configs_commands() # Comment this function if not needed #run_calibration_commands() #run_system_commands() + run_usage_info_commands() + + #run_service_commands() +