Fisheye: Tag 967521dff94783ce48b50abc8db6bcd67bb501bf refers to a dead (removed) revision in file `simulator/plugins/GeneralProgressMessage/interface.ui'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 967521dff94783ce48b50abc8db6bcd67bb501bf refers to a dead (removed) revision in file `simulator/plugins/GeneralProgressMessage/loader.py'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 967521dff94783ce48b50abc8db6bcd67bb501bf refers to a dead (removed) revision in file `simulator/plugins/GeneralResponseMessage/interface.ui'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 967521dff94783ce48b50abc8db6bcd67bb501bf refers to a dead (removed) revision in file `simulator/plugins/GeneralResponseMessage/loader.py'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 967521dff94783ce48b50abc8db6bcd67bb501bf refers to a dead (removed) revision in file `simulator/plugins/HDOpMode/interface.ui'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 967521dff94783ce48b50abc8db6bcd67bb501bf refers to a dead (removed) revision in file `simulator/plugins/HDOpMode/loader.py'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 967521dff94783ce48b50abc8db6bcd67bb501bf refers to a dead (removed) revision in file `simulator/plugins/PostTreatment/interface.ui'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 967521dff94783ce48b50abc8db6bcd67bb501bf refers to a dead (removed) revision in file `simulator/plugins/PostTreatment/loader.py'. Fisheye: No comparison available. Pass `N' to diff? Index: simulator/plugins/__poweroff/loader.py =================================================================== diff -u -red2d7cb5c8c2059444fd17cd4e1c0975461a903c -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/__poweroff/loader.py (.../loader.py) (revision ed2d7cb5c8c2059444fd17cd4e1c0975461a903c) +++ simulator/plugins/__poweroff/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -9,7 +9,8 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator, TXStates +from simulator.interface import SimulationInterface +from dialin.ui.hd_simulator import TXStates # plugin specific # -- None -- @@ -28,8 +29,8 @@ requested_state: TXStates - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) self.requested_state = TXStates.HEPARIN_STATE_PAUSED def _init_loader(self): @@ -76,7 +77,7 @@ else: self.requested_state = TXStates.HEPARIN_STATE_DISPENSING - self.hd_simulator.cmd_set_heparin_pause_resume_response(True, 0, self.requested_state) + self.interface.hd.cmd_set_heparin_pause_resume_response(True, 0, self.requested_state) self.lblAction.setText('Accepted ') @Slot() @@ -86,7 +87,7 @@ :return: none """ reason = self.spnRejectReason.value() - self.hd_simulator.cmd_set_heparin_pause_resume_response(False, reason, self.requested_state) + self.interface.hd.cmd_set_heparin_pause_resume_response(False, reason, self.requested_state) self.lblAction.setText('Rejected ' + "{}".format(reason)) @Slot() @@ -97,5 +98,5 @@ :return: none """ volume = value * 0.1 - self.hd_simulator.cmd_set_treatment_heparin_data(volume) + self.interface.hd.cmd_set_treatment_heparin_data(volume) self.lblCumulative.setNum(volume) Index: simulator/plugins/accelerometer/loader.py =================================================================== diff -u -red2d7cb5c8c2059444fd17cd4e1c0975461a903c -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/accelerometer/loader.py (.../loader.py) (revision ed2d7cb5c8c2059444fd17cd4e1c0975461a903c) +++ simulator/plugins/accelerometer/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -10,7 +10,7 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator +from simulator.interface import SimulationInterface # plugin specific # -- none -- @@ -40,8 +40,8 @@ sldDGYTilt: QtWidgets.QSlider sldDGZTilt: QtWidgets.QSlider - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) def _init_loader(self): """ @@ -114,7 +114,7 @@ sld_hd_x_tilt = self.sldHDXTilt.value() sld_hd_y_tilt = self.sldHDYTilt.value() sld_hd_z_tilt = self.sldHDZTilt.value() - self.hd_simulator.cmd_send_accelerometer_hd_data( + self.interface.hd.cmd_send_accelerometer_hd_data( sld_hd_x, sld_hd_y, sld_hd_z, @@ -142,7 +142,7 @@ sld_dg_x_tilt = self.sldDGXTilt.value() sld_dg_y_tilt = self.sldDGYTilt.value() sld_dg_z_tilt = self.sldDGZTilt.value() - self.hd_simulator.cmd_send_accelerometer_dg_data( + self.interface.dg.cmd_send_accelerometer_dg_data( sld_dg_x, sld_dg_y, sld_dg_z, Index: simulator/plugins/alarms/loader.py =================================================================== diff -u -rd0b375c0743a71e5fb0e3211ad15cc9404e5aa5d -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/alarms/loader.py (.../loader.py) (revision d0b375c0743a71e5fb0e3211ad15cc9404e5aa5d) +++ simulator/plugins/alarms/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -10,7 +10,7 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator +from simulator.interface import SimulationInterface # plugin specific from dialin.common.prs_defs import AlarmPriority @@ -95,9 +95,8 @@ AlarmPriority.ALARM_HIGH: 'rgb(239, 41, 41)' } - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) - self.alarm = hd_simulator.alarm() + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) def _init_loader(self): """ @@ -237,7 +236,7 @@ mute_out = self.spnMuteTimeout.value() if alarm_id >= 0: self.set_flags() - self.alarm.cmd_activate_alarm_id( + self.interface.alarm.cmd_activate_alarm_id( self.priority, alarm_id, escalate, @@ -263,9 +262,10 @@ data_field_2 = "0" if alarm_id: - self.alarm.cmd_set_alarm_triggered(alarm_id, - field_descriptor_1, data_field_1, - field_descriptor_2, data_field_2) + self.interface.alarm.cmd_set_alarm_triggered( + alarm_id, + field_descriptor_1, data_field_1, + field_descriptor_2, data_field_2) self.__append_triggered_row(alarm_id) @Slot() @@ -275,7 +275,7 @@ :return: none """ [alarm_id, row] = self.alarm_id() - self.alarm.cmd_set_alarm_cleared(alarm_id) + self.interface.alarm.cmd_set_alarm_cleared(alarm_id) self.tblTriggeredIDs.removeRow(row) @Slot() @@ -285,7 +285,7 @@ :return: none """ [alarm_id, row] = self.alarm_id() - self.alarm.cmd_set_alarm_cleared_condition(alarm_id) + self.interface.alarm.cmd_set_alarm_cleared_condition(alarm_id) self.tblTriggeredIDs.item(row, self.eColID).setBackground(self.colors[AlarmPriority.ALARM_NONE]) self.tblTriggeredIDs.item(row, self.eColID).setSelected(False) @@ -318,7 +318,7 @@ a7 = self.spnP7.value() a8 = self.spnP8.value() a9 = self.spnP9.value() - self.alarm.cmd_send_active_list_response(True, 0, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) + self.interface.alarm.cmd_send_active_list_response(True, 0, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) @Slot() def do_active_list_reject(self): @@ -327,7 +327,7 @@ :return: none """ reason = self.spnReason.value() - self.alarm.cmd_send_active_list_response(False, reason) + self.interface.alarm.cmd_send_active_list_response(False, reason) @Slot() def on_status_ids_item_clicked(self, item: QtWidgets.QTableWidgetItem): Index: simulator/plugins/bloodPrime/loader.py =================================================================== diff -u -red2d7cb5c8c2059444fd17cd4e1c0975461a903c -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/bloodPrime/loader.py (.../loader.py) (revision ed2d7cb5c8c2059444fd17cd4e1c0975461a903c) +++ simulator/plugins/bloodPrime/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -10,7 +10,7 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator +from simulator.interface import SimulationInterface # plugin specific # -- none -- @@ -23,8 +23,8 @@ sldTarget: QtWidgets.QSlider sldCurrent: QtWidgets.QSlider - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) def _init_loader(self): """ @@ -60,4 +60,4 @@ """ target = self.sldTarget.value() current = self.sldCurrent.value() - self.hd_simulator.cmd_send_treatment_blood_prime_data(target, current) + self.interface.hd.cmd_send_treatment_blood_prime_data(target, current) Index: simulator/plugins/createtreatment/loader.py =================================================================== diff -u -r587822f6461dce6f46302875b09abb552532f698 -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/createtreatment/loader.py (.../loader.py) (revision 587822f6461dce6f46302875b09abb552532f698) +++ simulator/plugins/createtreatment/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -9,7 +9,7 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator +from simulator.interface import SimulationInterface from dialin.ui.hd_simulator import RequestRejectReasons # plugin specific # -- None -- @@ -31,8 +31,8 @@ spnUFVolumeRejectReason: QtWidgets.QSpinBox sldUFVolume: QtWidgets.QSlider - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) def _init_loader(self): """ @@ -74,7 +74,7 @@ the slot for accept button :return: none """ - self.hd_simulator.cmd_send_treatment_parameter_manual_validation_response([ + self.interface.hd.cmd_send_treatment_parameter_manual_validation_response([ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -90,7 +90,7 @@ """ reason = self.spnCreateRejectReason.value() print(reason) - self.hd_simulator.cmd_send_treatment_parameter_manual_validation_response([ + self.interface.hd.cmd_send_treatment_parameter_manual_validation_response([ reason, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -105,7 +105,7 @@ :return: none """ volume = self.sldUFVolume.value() - self.hd_simulator.cmd_send_uf_treatment_response(True, 0, volume) + self.interface.hd.cmd_send_uf_treatment_response(True, 0, volume) self.lblCreateAction.setText('Accepted ') @Slot() @@ -116,5 +116,5 @@ """ reason = self.spnUFVolumeRejectReason.value() volume = self.sldUFVolume.value() - self.hd_simulator.cmd_send_uf_treatment_response(False, reason, volume) + self.interface.hd.cmd_send_uf_treatment_response(False, reason, volume) self.lblCreateAction.setText('Rejected ' + "{}".format(reason)) Index: simulator/plugins/disinfection/loader.py =================================================================== diff -u -r1b402ab005844b85b8361ae611664731cfa39e0b -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/disinfection/loader.py (.../loader.py) (revision 1b402ab005844b85b8361ae611664731cfa39e0b) +++ simulator/plugins/disinfection/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -9,7 +9,7 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator +from simulator.interface import SimulationInterface # plugin specific # -- none -- @@ -38,8 +38,8 @@ sldTimeoutTotalChemical: QtWidgets.QSlider sldTimeoutCountDownChemical: QtWidgets.QSlider - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) def _init_loader(self): """ @@ -98,7 +98,7 @@ the slot for accept button :return: none """ - self.hd_simulator.cmd_send_hd_disinfect_response(True, 0) + self.interface.hd.cmd_send_hd_disinfect_response(True, 0) self.lblActionDisinfect.setText('Accepted ') @Slot() @@ -108,7 +108,7 @@ :return: none """ reason = self.spnReasonDisinfect.value() - self.hd_simulator.cmd_send_hd_disinfect_response(False, reason) + self.interface.hd.cmd_send_hd_disinfect_response(False, reason) self.lblActionDisinfect.setText('Rejected ' + "{}".format(reason)) @Slot() @@ -117,8 +117,8 @@ the slot for accept button :return: none """ - self.hd_simulator.cmd_send_hd_disinfect_chemical_confirm(True, 0) - self.lblAction.setText('Accepted ') + self.interface.hd.cmd_send_hd_disinfect_chemical_confirm(True, 0) + self.lblActionChemical.setText('Accepted ') @Slot() def do_reject_chemical(self): @@ -127,8 +127,8 @@ :return: none """ reason = self.spnReasonDisinfect.value() - self.hd_simulator.cmd_send_hd_disinfect_chemical_confirm(False, reason) - self.lblActionDisinfect.setText('Rejected ' + "{}".format(reason)) + self.interface.hd.cmd_send_hd_disinfect_chemical_confirm(False, reason) + self.lblActionChemical.setText('Rejected ' + "{}".format(reason)) @Slot() def do_data_flush(self): @@ -139,7 +139,7 @@ """ timeout_total = self.sldTimeoutTotalFlush.value() timeout_countdown = self.sldTimeoutCountDownFlush.value() - self.hd_simulator.cmd_send_dg_disinfect_progress_time_flush(timeout_total, timeout_countdown) + self.interface.dg.cmd_send_dg_disinfect_progress_time_flush(timeout_total, timeout_countdown) @Slot() def do_data_heat(self): @@ -150,7 +150,7 @@ """ timeout_total = self.sldTimeoutTotalHeat.value() timeout_countdown = self.sldTimeoutCountDownHeat.value() - self.hd_simulator.cmd_send_dg_disinfect_progress_time_heat(timeout_total, timeout_countdown) + self.interface.dg.cmd_send_dg_disinfect_progress_time_heat(timeout_total, timeout_countdown) @Slot() def do_data_chemical(self): @@ -161,4 +161,4 @@ """ timeout_total = self.sldTimeoutTotalChemical.value() timeout_countdown = self.sldTimeoutCountDownChemical.value() - self.hd_simulator.cmd_send_dg_disinfect_progress_time_checmical(timeout_total, timeout_countdown) + self.interface.dg.cmd_send_dg_disinfect_progress_time_checmical(timeout_total, timeout_countdown) Index: simulator/plugins/disinfectionstates/interface.ui =================================================================== diff -u -rae63fbc76b4638ffdcdaad7b69648beeee3340c3 -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/disinfectionstates/interface.ui (.../interface.ui) (revision ae63fbc76b4638ffdcdaad7b69648beeee3340c3) +++ simulator/plugins/disinfectionstates/interface.ui (.../interface.ui) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -6,8 +6,8 @@ 0 0 - 726 - 669 + 608 + 731 @@ -59,14 +59,20 @@ - - + + - 320 - 95 + 0 + 200 + + + 16777215 + 200 + + 8 @@ -99,7 +105,7 @@ false - 3 + 8 2 @@ -108,7 +114,7 @@ true - 125 + 330 true @@ -137,9 +143,34 @@ 2 + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + 7 + + - 0 : DG Disinfec Mode + 3 : Chemical @@ -149,119 +180,100 @@ - DG_DISINFECT_FLUSH + CHEM_DISINFECT_UI_STATE_NOT_RUNNING - Disinfect Flush Mode + Chemical disinfect UI, not running state - DG_DISINFECT_HEAT + CHEM_DISINFECT_UI_STATE_FLUSH_BEFORE_DISINFECT - Disinfect Heat Mode + Chemical disinfect UI, flush before disinfect state - DG_DISINFECT_CHEM + CHEM_DISINFECT_UI_STATE_MIX_WATER_AND_ACID - Disinfect Chenical Mode + Chemical disinfect UI, mix water and acid state - - - - - - - 320 - 95 - - - - - 8 - 50 - false - - - - Qt::ScrollBarAlwaysOff - - - Qt::ScrollBarAlwaysOff - - - QAbstractItemView::NoEditTriggers - - - true - - - QAbstractItemView::SingleSelection - - - QAbstractItemView::SelectRows - - - true - - - false - - - 0 - - - 2 - - - true - - - 125 - - - true - - - true - - - 18 - - - 21 - - + - 1 : Flush + CHEM_DISINFECT_UI_STATE_REMOVE_ACID - - + + - Description + Chemical disinfect UI, remove acid state - + + + + CHEM_DISINFECT_UI_STATE_DISINFECT_DEVICE + + + + + Chemical disinfect UI, disinfect device state + + + + + CHEM_DISINFECT_UI_STATE_FLUSH_AFTER_DISINFECT + + + + + Chemical disinfect UI, flush after disinfect state + + + + + CHEM_DISINFECT_UI_STATE_CANCEL_DISINFECT + + + + + Chemical disinfect UI, cancel disinfect state + + + + + CHEM_DISINFECT_UI_STATE_COMPLETE + + + + + Chemical disinfect UI, complete state + + - + - 350 - 510 + 0 + 200 + + + 16777215 + 200 + + 8 @@ -294,7 +306,7 @@ false - 23 + 8 2 @@ -357,81 +369,6 @@ 7 - - - 8 - - - - - 9 - - - - - 10 - - - - - 11 - - - - - 12 - - - - - 13 - - - - - 14 - - - - - 15 - - - - - 16 - - - - - 17 - - - - - 18 - - - - - 19 - - - - - 20 - - - - - 21 - - - - - 22 - - 2 : Heat @@ -444,244 +381,226 @@ - DG_HEAT_DISINFECT_STATE_START + HEAT_DISINFECT_UI_STATE_NOT_RUNNING - Heat disinfect, start mode state + Heat disinfect UI, not running state - DG_HEAT_DISINFECT_STATE_DRAIN_R1 + HEAT_DISINFECT_UI_STATE_FLUSH_BEFORE_DISINFECT - Heat disinfect, drain R1 state + Heat disinfect UI, flush before disinfect state - DG_HEAT_DISINFECT_STATE_DRAIN_R2 + HEAT_DISINFECT_UI_STATE_HEAT_UP_WATER - Heat disinfect, drain R2 state + Heat disinfect UI, heat up water state - DG_HEAT_DISINFECT_STATE_FLUSH_DRAIN + HEAT_DISINFECT_UI_STATE_DISINFECT_DEVICE - Heat disinfect, flush drain state + Heat disinfect UI, disinfect device state - DG_HEAT_DISINFECT_STATE_FLUSH_CIRCULATION + HEAT_DISINFECT_UI_STATE_COOL_DOWN_DEVICE - Heat disinfect, flush circulation state + Heat disinfect UI, cool down device state - DG_HEAT_DISINFECT_STATE_FLUSH_R1_AND_R2 + HEAT_DISINFECT_UI_STATE_FLUSH_AFTER_DISINFECT - Heat disinfect, flush R1 and R2 state + Heat disinfect UI, flush after disinfect state - DG_HEAT_DISINFECT_STATE_FLUSH_R2_AND_DRAIN_R1 + HEAT_DISINFECT_UI_STATE_CANCEL_DISINFECT - Heat disinfect, flush R2 and drain R1 state + Heat disinfect UI, cancel disinfect state - DG_HEAT_DISINFECT_STATE_FLUSH_DRAIN_R2 + HEAT_DISINFECT_UI_STATE_COMPLETE - Heat disinfect, flush drain R2 state + Heat disinfect UI, complete state - + + + + + + + 0 + 80 + + + + + 16777215 + 80 + + + + + 8 + 50 + false + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + false + + + 3 + + + 2 + + + true + + + 125 + + + true + + + true + + + 18 + + + 21 + + - DG_HEAT_DISINFECT_STATE_FLUSH_DRAIN_R1 + 0 - - + + - Heat disinfect, flush drain R1 state + 1 - - + + - DG_HEAT_DISINFECT_STATE_FILL_WITH_WATER + 2 - - + + - Heat disinfect, fill with water state + 0 : DG Disinfec Mode - - + + - DG_HEAT_DISINFECT_STATE_DISINFECT_R1_TO_R2 + Description - - + + - Heat disinfect, disinfect R1 to R2 state + DG_DISINFECT_FLUSH - + - DG_HEAT_DISINFECT_STATE_FILL_R2_WITH_HOT_WATER + Disinfect Flush Mode - + - Heat disinfect, fill R2 with hot water state + DG_DISINFECT_HEAT - + - DG_HEAT_DISINFECT_STATE_DISINFECT_R2_TO_R1 + Disinfect Heat Mode - + - Heat disinfect, disinfect R2 to R1 state + DG_DISINFECT_CHEM - + - DG_HEAT_DISINFECT_STATE_COOL_DOWN_HEATERS + Disinfect Chenical Mode - - - Heat disinfect, cool down heaters state - - - - - DG_HEAT_DISINFECT_STATE_COOL_DOWN_RO_FILTER - - - - - Heat disinfect, cool down RO filter state - - - - - DG_HEAT_DISINFECT_STATE_MIX_DRAIN_R1 - - - - - Heat disinfect, mix drain R1 state - - - - - DG_HEAT_DISINFECT_STATE_MIX_DRAIN_R2 - - - - - Heat disinfect, mix drain R2 state - - - - - DG_HEAT_DISINFECT_STATE_RINSE_R1_TO_R2 - - - - - Heat disinfect, rinse R1 to R2 state - - - - - DG_HEAT_DISINFECT_STATE_RINSE_R2_TO_R1_AND_DRAIN_R1 - - - - - Heat disinfect, rinse R2 to R1 and drain R1 state - - - - - DG_HEAT_DISINFECT_STATE_RINSE_CIRCULATION - - - - - Heat disinfect, rinse circulation state - - - - - DG_HEAT_DISINFECT_STATE_CANCEL_BASIC_PATH - - - - - Heat disinfect, cancel mode basic path state - - - - - DG_HEAT_DISINFECT_STATE_CANCEL_WATER_PATH - - - - - Heat disinfect, cancel mode water path state - - - - - DG_HEAT_DISINFECT_STATE_COMPLETE - - - - - Heat disinfect, complete state - - - - + + - 350 - 510 + 0 + 175 + + + 16777215 + 175 + + 8 @@ -714,7 +633,7 @@ false - 0 + 7 2 @@ -737,16 +656,121 @@ 21 + + + 0 + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + - 3 : Chemical + 1 : Flush Description + + + FLUSH_UI_STATE_NOT_RUNNING + + + + + Flush UI, not running state + + + + + FLUSH_UI_STATE_DRAIN_DEVICE + + + + + Flush UI, drain device state + + + + + FLUSH_UI_STATE_FLUSH_RESERVOIRS + + + + + Flush UI, flush reservoirs + + + + + FLUSH_UI_STATE_DRAIN_RESERVOIRS + + + + + Flush UI, drain reservoirs + + + + + FLUSH_UI_STATE_FLUSH_RECIRCULATION_PATH + + + + + Flush UI, flush recirculation path + + + + + FLUSH_UI_STATE_CANCEL_FLUSH + + + + + Flush UI, cancel flush state + + + + + FLUSH_UI_STATE_COMPLETE + + + + + Flush UI, complete state + + Index: simulator/plugins/disinfectionstates/loader.py =================================================================== diff -u -rae63fbc76b4638ffdcdaad7b69648beeee3340c3 -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/disinfectionstates/loader.py (.../loader.py) (revision ae63fbc76b4638ffdcdaad7b69648beeee3340c3) +++ simulator/plugins/disinfectionstates/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -9,10 +9,8 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator +from simulator.interface import SimulationInterface # plugin specific -from dialin.common.hd_defs import HDDefs -from dialin.common.hd_defs import HD_Standby_States class Loader(DynamicLoader): @@ -26,8 +24,8 @@ tblHeatMode: QtWidgets.QTableWidget tblChemicalMode: QtWidgets.QTableWidget - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) def _init_loader(self): """ @@ -59,10 +57,10 @@ initializes the widgets' properties :return: none """ - self.tblSubMode.setCurrentCell(0, 0) # not defined in FwCommon yet - self.tblFlushMode.setCurrentCell(0, 0) # not defined in FwCommon yet - self.tblHeatMode.setCurrentCell(HD_Standby_States.STANDBY_START_STATE.value, 0) - self.tblChemicalMode.setCurrentCell(0, 0) # not defined in FwCommon yet + self.tblSubMode.setCurrentCell(0, 0) + self.tblFlushMode.setCurrentCell(0, 0) + self.tblHeatMode.setCurrentCell(0, 0) + self.tblChemicalMode.setCurrentCell(0, 0) self.tblSubMode.horizontalHeaderItem(0).setTextAlignment(QtCore.Qt.AlignLeft) self.tblFlushMode.horizontalHeaderItem(0).setTextAlignment(QtCore.Qt.AlignLeft) self.tblHeatMode.horizontalHeaderItem(0).setTextAlignment(QtCore.Qt.AlignLeft) @@ -75,10 +73,10 @@ :return: none """ sub_mode = int(self.tblSubMode.verticalHeaderItem(self.tblSubMode.currentRow()).text()) - flush_mode = 0 # int(self.tblFlushMode.verticalHeaderItem(self.tblFlushMode.currentRow()).text()) + flush_mode = int(self.tblFlushMode.verticalHeaderItem(self.tblFlushMode.currentRow()).text()) heat_mode = int(self.tblHeatMode.verticalHeaderItem(self.tblHeatMode.currentRow()).text()) - chemical_mode = 0 # int(self.tblChemicalMode.verticalHeaderItem(self.tblChemicalMode.currentRow()).text()) - self.hd_simulator.cmd_send_dg_disinfection_state( + chemical_mode = int(self.tblChemicalMode.verticalHeaderItem(self.tblChemicalMode.currentRow()).text()) + self.interface.dg.cmd_send_dg_disinfection_state( sub_mode, flush_mode, heat_mode, Index: simulator/plugins/disposablesPrime/loader.py =================================================================== diff -u -reb6acf9c1a4748852875c350568192999be9d3dd -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/disposablesPrime/loader.py (.../loader.py) (revision eb6acf9c1a4748852875c350568192999be9d3dd) +++ simulator/plugins/disposablesPrime/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -10,7 +10,7 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator +from simulator.interface import SimulationInterface # plugin specific # -- none -- @@ -23,8 +23,8 @@ sldTimeout: QtWidgets.QSlider sldCountdown: QtWidgets.QSlider - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) def _init_loader(self): """ @@ -60,4 +60,4 @@ """ timeout = self.sldTimeout.value() countdown = self.sldCountdown.value() - self.hd_simulator.cmd_send_pre_treatment_disposables_prime_progress_data(timeout, countdown) + self.interface.hd.cmd_send_pre_treatment_disposables_prime_progress_data(timeout, countdown) Index: simulator/plugins/filterFlush/loader.py =================================================================== diff -u -reb6acf9c1a4748852875c350568192999be9d3dd -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/filterFlush/loader.py (.../loader.py) (revision eb6acf9c1a4748852875c350568192999be9d3dd) +++ simulator/plugins/filterFlush/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -10,7 +10,7 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator +from simulator.interface import SimulationInterface # plugin specific # -- none -- @@ -23,8 +23,8 @@ sldTimeout: QtWidgets.QSlider sldCountdown: QtWidgets.QSlider - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) def _init_loader(self): """ @@ -60,4 +60,4 @@ """ timeout = self.sldTimeout.value() countdown = self.sldCountdown.value() - self.hd_simulator.cmd_send_pre_treatment_filter_flush_progress_data(timeout, countdown) + self.interface.dg.cmd_send_dg_pre_treatment_filter_flush_progress_data(timeout, countdown) Index: simulator/plugins/generalProgressMessage/interface.ui =================================================================== diff -u --- simulator/plugins/generalProgressMessage/interface.ui (revision 0) +++ simulator/plugins/generalProgressMessage/interface.ui (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -0,0 +1,299 @@ + + + ui_interface + + + + 0 + 0 + 375 + 182 + + + + &9 General/&1 Progress Message + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + + + 10 + + + + Qt::Horizontal + + + + + + + + + + 30 + 0 + + + + + 10 + + + + 0 + + + Qt::AlignCenter + + + + + + + D000 + + + 96 + + + + + + + Decimal + + + + + + + MsgID + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + Timeout + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + Countdown + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + sldCountdown + + + + + + + + 0 + 0 + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(46, 52, 54); + + + Progress data + + + Qt::AlignCenter + + + + + + + + 10 + + + + 0 + + + 300 + + + 300 + + + Qt::Horizontal + + + + + + + + 10 + + + + 0 + + + 300 + + + 300 + + + Qt::Horizontal + + + + + + + + 0 + 0 + + + + + 50 + 16777215 + + + + + 10 + + + + D000 + + + 300 + + + Qt::AlignCenter + + + + + + + HD + + + true + + + + + + + DG + + + + + + + + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(46, 52, 54); + + + General Progress Message + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + sldCountdown + valueChanged(int) + lblCountdown + setNum(int) + + + 485 + 106 + + + 541 + 99 + + + + + Index: simulator/plugins/generalProgressMessage/loader.py =================================================================== diff -u --- simulator/plugins/generalProgressMessage/loader.py (revision 0) +++ simulator/plugins/generalProgressMessage/loader.py (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -0,0 +1,82 @@ +""" +The Disposable Prime ui loader class +""" + +# Python +import os +# Qt +from PySide2 import QtWidgets +from PySide2.QtCore import Slot +# parent +from simulator.dynamicloader import DynamicLoader +# hd Simulator +from simulator.interface import SimulationInterface +# plugin specific +# -- none -- + + +class Loader(DynamicLoader): + """ + The Saline Bolus ui loader class + """ + rbHD: QtWidgets.QRadioButton + rbDG: QtWidgets.QRadioButton + leMessageID: QtWidgets.QLineEdit + leTargetMax: QtWidgets.QLineEdit + sldTimeout: QtWidgets.QSlider + sldCountdown: QtWidgets.QSlider + + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) + + def _init_loader(self): + """ + finds and creates widgets + :return: none + """ + self.rbHD = self.find_radio_button('rbHD') + self.rbDG = self.find_radio_button('rbDG') + self.leMessageID = self.find_line_edit('leMessageID') + self.leTargetMax = self.find_line_edit('leTargetMax') + self.sldTimeout = self.find_slider('sldTimeout') + self.sldCountdown = self.find_slider('sldCountdown') + + def _init_widgets(self): + """ + initializes the widgets' properties + :return: none + """ + pass + + def _init_connections(self): + """ + initializes the widgets connections + :return: + """ + self.leTargetMax.textChanged.connect(self.do_set_target_maximum) + self.sldTimeout.valueChanged.connect(self.do_data) + self.sldCountdown.valueChanged.connect(self.do_data) + + @Slot() + def do_set_target_maximum(self, value): + """ + sets the target slider maximum to the value of value + :return: none + """ + self.sldTimeout.setMaximum(int(value)) + self.sldCountdown.setMaximum(int(value)) + + @Slot() + def do_data(self): + """ + the slot which is called to send the data + by calling the denaliMessage API cmd_send_treatment_blood_prime_data + :return: none + """ + message_id = self.leMessageID.text() + timeout = self.sldTimeout.value() + countdown = self.sldCountdown.value() + if self.rbHD.isChecked(): + self.interface.hd.cmd_send_general_hd_progress_data(int(message_id), timeout, countdown) + else: + self.interface.dg.cmd_send_general_dg_progress_data(int(message_id), timeout, countdown) Index: simulator/plugins/generalResponseMessage/interface.ui =================================================================== diff -u --- simulator/plugins/generalResponseMessage/interface.ui (revision 0) +++ simulator/plugins/generalResponseMessage/interface.ui (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -0,0 +1,841 @@ + + + ui_interface + + + + 0 + 0 + 1198 + 281 + + + + &9 General/&0 Response Message + + + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(46, 52, 54); + + + General Response Message + + + Qt::AlignCenter + + + + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(46, 52, 54); + + + Response Message + + + Qt::AlignCenter + + + + + + + + + + + HD + + + true + + + + + + + DG + + + + + + + Data + + + + + + + + + + + MsgID + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 65535 + + + + + + + Decimal + + + + + + + + + Accept + + + + + + + Reject + + + + + + + 999 + + + + + + + Reason + + + + + + + + + Ack + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + 2147483647 + + + + + + + Sequence + + + + + + + Send + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 0 + 0 + + + + + 10 + + + + QFrame::StyledPanel + + + QFrame::Plain + + + + + + + + + + 2 + + + 0 + + + + + P0 + + + + + + + P1 + + + + + + + P2 + + + + + + + P3 + + + + + + + P4 + + + + + + + P5 + + + + + + + P6 + + + + + + + P7 + + + + + + + P8 + + + + + + + P9 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + F0 + + + + + + + F1 + + + + + + + F2 + + + + + + + F3 + + + + + + + F4 + + + + + + + F5 + + + + + + + F6 + + + + + + + F7 + + + + + + + F8 + + + + + + + F9 + + + + + + + + + 2 + + + 0 + + + + + P10 + + + + + + + P11 + + + + + + + P12 + + + + + + + P13 + + + + + + + P14 + + + + + + + P15 + + + + + + + P16 + + + + + + + P17 + + + + + + + P18 + + + + + + + P19 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + 2147483647 + + + + + + + F10 + + + + + + + F11 + + + + + + + F12 + + + + + + + F13 + + + + + + + F14 + + + + + + + F15 + + + + + + + F16 + + + + + + + F17 + + + + + + + F18 + + + + + + + F19 + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + rbHD + rbDG + chkP0 + spnP0 + chkP1 + spnP1 + chkP2 + spnP2 + chkP3 + spnP3 + chkP4 + spnP4 + chkP5 + spnP5 + chkP6 + spnP6 + chkP7 + spnP7 + chkP8 + spnP8 + chkP9 + spnP9 + + + + + chkP9 + toggled(bool) + chkP8 + setChecked(bool) + + + 633 + 183 + + + 570 + 183 + + + + + chkP8 + toggled(bool) + chkP7 + setChecked(bool) + + + 570 + 174 + + + 507 + 175 + + + + + chkP7 + toggled(bool) + chkP6 + setChecked(bool) + + + 507 + 189 + + + 444 + 188 + + + + + chkP6 + toggled(bool) + chkP5 + setChecked(bool) + + + 444 + 176 + + + 381 + 178 + + + + + chkP5 + toggled(bool) + chkP4 + setChecked(bool) + + + 381 + 190 + + + 318 + 189 + + + + + chkP4 + toggled(bool) + chkP3 + setChecked(bool) + + + 318 + 177 + + + 255 + 176 + + + + + chkP3 + toggled(bool) + chkP2 + setChecked(bool) + + + 255 + 190 + + + 192 + 191 + + + + + chkP2 + toggled(bool) + chkP1 + setChecked(bool) + + + 192 + 172 + + + 129 + 175 + + + + + chkP1 + toggled(bool) + chkP0 + setChecked(bool) + + + 115 + 190 + + + 48 + 188 + + + + + Index: simulator/plugins/generalResponseMessage/loader.py =================================================================== diff -u --- simulator/plugins/generalResponseMessage/loader.py (revision 0) +++ simulator/plugins/generalResponseMessage/loader.py (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -0,0 +1,374 @@ +""" +The ui loader class +""" +# Python +import os +# Qt + +from PySide2 import QtWidgets +from PySide2.QtCore import Slot +# parent +from simulator.dynamicloader import DynamicLoader +# hd Simulator +from simulator.interface import SimulationInterface +from dialin.utils.conversions import integer_to_bytearray, float_to_bytearray + +# plugin specific +# -- None -- + + +class Loader(DynamicLoader): + """ + The ui loader class + """ + rbHD: QtWidgets.QRadioButton + rbDG: QtWidgets.QRadioButton + + chkData: QtWidgets.QCheckBox + spnMessageID: QtWidgets.QSpinBox + + btnAccept: QtWidgets.QPushButton + btnReject: QtWidgets.QPushButton + lblAction: QtWidgets.QLabel + spnReason: QtWidgets.QSpinBox + + btnAcknow: QtWidgets.QPushButton + spnSequence: QtWidgets.QSpinBox + + spnP0: QtWidgets.QSpinBox + spnP1: QtWidgets.QSpinBox + spnP2: QtWidgets.QSpinBox + spnP3: QtWidgets.QSpinBox + spnP4: QtWidgets.QSpinBox + spnP5: QtWidgets.QSpinBox + spnP6: QtWidgets.QSpinBox + spnP7: QtWidgets.QSpinBox + spnP8: QtWidgets.QSpinBox + spnP9: QtWidgets.QSpinBox + chkP0: QtWidgets.QCheckBox + chkP1: QtWidgets.QCheckBox + chkP2: QtWidgets.QCheckBox + chkP3: QtWidgets.QCheckBox + chkP4: QtWidgets.QCheckBox + chkP5: QtWidgets.QCheckBox + chkP6: QtWidgets.QCheckBox + chkP7: QtWidgets.QCheckBox + chkP8: QtWidgets.QCheckBox + chkP9: QtWidgets.QCheckBox + chkF0: QtWidgets.QCheckBox + chkF1: QtWidgets.QCheckBox + chkF2: QtWidgets.QCheckBox + chkF3: QtWidgets.QCheckBox + chkF4: QtWidgets.QCheckBox + chkF5: QtWidgets.QCheckBox + chkF6: QtWidgets.QCheckBox + chkF7: QtWidgets.QCheckBox + chkF8: QtWidgets.QCheckBox + chkF9: QtWidgets.QCheckBox + spnP10: QtWidgets.QSpinBox + spnP11: QtWidgets.QSpinBox + spnP12: QtWidgets.QSpinBox + spnP13: QtWidgets.QSpinBox + spnP14: QtWidgets.QSpinBox + spnP15: QtWidgets.QSpinBox + spnP16: QtWidgets.QSpinBox + spnP17: QtWidgets.QSpinBox + spnP18: QtWidgets.QSpinBox + spnP19: QtWidgets.QSpinBox + chkP10: QtWidgets.QCheckBox + chkP11: QtWidgets.QCheckBox + chkP12: QtWidgets.QCheckBox + chkP13: QtWidgets.QCheckBox + chkP14: QtWidgets.QCheckBox + chkP15: QtWidgets.QCheckBox + chkP16: QtWidgets.QCheckBox + chkP17: QtWidgets.QCheckBox + chkP18: QtWidgets.QCheckBox + chkP19: QtWidgets.QCheckBox + chkF10: QtWidgets.QCheckBox + chkF11: QtWidgets.QCheckBox + chkF12: QtWidgets.QCheckBox + chkF13: QtWidgets.QCheckBox + chkF14: QtWidgets.QCheckBox + chkF15: QtWidgets.QCheckBox + chkF16: QtWidgets.QCheckBox + chkF17: QtWidgets.QCheckBox + chkF18: QtWidgets.QCheckBox + chkF19: QtWidgets.QCheckBox + + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) + + def _init_loader(self): + """ + finds and creates widgets + :return: none + """ + self.rbHD = self.find_radio_button('rbHD') + self.rbDG = self.find_radio_button('rbDG') + self.chkData = self.find_checkbox('chkData') + + self.spnMessageID = self.find_spinbox('spnMessageID') + self.btnAccept = self.find_button('btnAccept') + self.btnReject = self.find_button('btnReject') + self.lblAction = self.find_label('lblAction') + self.spnReason = self.find_spinbox('spnReason') + + self.btnAcknow = self.find_button('btnAcknow') + self.spnSequence = self.find_spinbox('spnSequence') + + self.spnP0 = self.find_spinbox('spnP0') + self.spnP1 = self.find_spinbox('spnP1') + self.spnP2 = self.find_spinbox('spnP2') + self.spnP3 = self.find_spinbox('spnP3') + self.spnP4 = self.find_spinbox('spnP4') + self.spnP5 = self.find_spinbox('spnP5') + self.spnP6 = self.find_spinbox('spnP6') + self.spnP7 = self.find_spinbox('spnP7') + self.spnP8 = self.find_spinbox('spnP8') + self.spnP9 = self.find_spinbox('spnP9') + self.chkP0 = self.find_checkbox('chkP0') + self.chkP1 = self.find_checkbox('chkP1') + self.chkP2 = self.find_checkbox('chkP2') + self.chkP3 = self.find_checkbox('chkP3') + self.chkP4 = self.find_checkbox('chkP4') + self.chkP5 = self.find_checkbox('chkP5') + self.chkP6 = self.find_checkbox('chkP6') + self.chkP7 = self.find_checkbox('chkP7') + self.chkP8 = self.find_checkbox('chkP8') + self.chkP9 = self.find_checkbox('chkP9') + self.chkF0 = self.find_checkbox('chkF0') + self.chkF1 = self.find_checkbox('chkF1') + self.chkF2 = self.find_checkbox('chkF2') + self.chkF3 = self.find_checkbox('chkF3') + self.chkF4 = self.find_checkbox('chkF4') + self.chkF5 = self.find_checkbox('chkF5') + self.chkF6 = self.find_checkbox('chkF6') + self.chkF7 = self.find_checkbox('chkF7') + self.chkF8 = self.find_checkbox('chkF8') + self.chkF9 = self.find_checkbox('chkF9') + self.spnP10 = self.find_spinbox('spnP10') + self.spnP11 = self.find_spinbox('spnP11') + self.spnP12 = self.find_spinbox('spnP12') + self.spnP13 = self.find_spinbox('spnP13') + self.spnP14 = self.find_spinbox('spnP14') + self.spnP15 = self.find_spinbox('spnP15') + self.spnP16 = self.find_spinbox('spnP16') + self.spnP17 = self.find_spinbox('spnP17') + self.spnP18 = self.find_spinbox('spnP18') + self.spnP19 = self.find_spinbox('spnP19') + self.chkP10 = self.find_checkbox('chkP10') + self.chkP11 = self.find_checkbox('chkP11') + self.chkP12 = self.find_checkbox('chkP12') + self.chkP13 = self.find_checkbox('chkP13') + self.chkP14 = self.find_checkbox('chkP14') + self.chkP15 = self.find_checkbox('chkP15') + self.chkP16 = self.find_checkbox('chkP16') + self.chkP17 = self.find_checkbox('chkP17') + self.chkP18 = self.find_checkbox('chkP18') + self.chkP19 = self.find_checkbox('chkP19') + self.chkF10 = self.find_checkbox('chkF10') + self.chkF11 = self.find_checkbox('chkF11') + self.chkF12 = self.find_checkbox('chkF12') + self.chkF13 = self.find_checkbox('chkF13') + self.chkF14 = self.find_checkbox('chkF14') + self.chkF15 = self.find_checkbox('chkF15') + self.chkF16 = self.find_checkbox('chkF16') + self.chkF17 = self.find_checkbox('chkF17') + self.chkF18 = self.find_checkbox('chkF18') + self.chkF19 = self.find_checkbox('chkF19') + + def _init_widgets(self): + """ + initializes the widgets' properties + :return: none + """ + pass + + def _init_connections(self): + """ + initializes the widgets connections + :return: + """ + self.btnAccept.clicked.connect(self.do_accept) + self.btnReject.clicked.connect(self.do_reject) + self.btnAcknow.clicked.connect(self.do_acknow) + + def _make_parameters_payload(self): + self.parameters_payload_len = 0 + self.parameters_payload = 0x00 + if self.chkP0.isChecked(): + if self.chkF0.isChecked(): + self.parameters_payload = float_to_bytearray(self.spnP0.value()) + else: + self.parameters_payload = integer_to_bytearray(self.spnP0.value()) + self.parameters_payload_len = 1 + if self.chkP1.isChecked(): + if self.chkF1.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP1.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP1.value()) + self.parameters_payload_len = 2 + if self.chkP2.isChecked(): + if self.chkF2.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP2.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP2.value()) + self.parameters_payload_len = 3 + if self.chkP3.isChecked(): + if self.chkF3.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP3.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP3.value()) + self.parameters_payload_len = 4 + if self.chkP4.isChecked(): + if self.chkF4.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP4.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP4.value()) + self.parameters_payload_len = 5 + if self.chkP5.isChecked(): + if self.chkF5.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP5.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP5.value()) + self.parameters_payload_len = 6 + if self.chkP6.isChecked(): + if self.chkF6.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP6.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP6.value()) + self.parameters_payload_len = 7 + if self.chkP7.isChecked(): + if self.chkF7.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP7.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP7.value()) + self.parameters_payload_len = 8 + if self.chkP8.isChecked(): + if self.chkF8.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP8.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP8.value()) + self.parameters_payload_len = 9 + if self.chkP9.isChecked(): + if self.chkF9.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP9.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP9.value()) + self.parameters_payload_len = 10 + if self.chkP10.isChecked(): + if self.chkF10.isChecked(): + self.parameters_payload = float_to_bytearray(self.spnP10.value()) + else: + self.parameters_payload = integer_to_bytearray(self.spnP10.value()) + self.parameters_payload_len = 11 + if self.chkP11.isChecked(): + if self.chkF11.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP11.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP11.value()) + self.parameters_payload_len = 12 + if self.chkP12.isChecked(): + if self.chkF12.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP12.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP12.value()) + self.parameters_payload_len = 13 + if self.chkP13.isChecked(): + if self.chkF13.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP13.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP13.value()) + self.parameters_payload_len = 14 + if self.chkP14.isChecked(): + if self.chkF14.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP14.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP14.value()) + self.parameters_payload_len = 15 + if self.chkP15.isChecked(): + if self.chkF15.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP15.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP15.value()) + self.parameters_payload_len = 16 + if self.chkP16.isChecked(): + if self.chkF16.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP16.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP16.value()) + self.parameters_payload_len = 17 + if self.chkP17.isChecked(): + if self.chkF17.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP17.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP17.value()) + self.parameters_payload_len = 18 + if self.chkP18.isChecked(): + if self.chkF18.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP18.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP18.value()) + self.parameters_payload_len = 19 + if self.chkP19.isChecked(): + if self.chkF19.isChecked(): + self.parameters_payload += float_to_bytearray(self.spnP19.value()) + else: + self.parameters_payload += integer_to_bytearray(self.spnP19.value()) + self.parameters_payload_len = 20 + + @Slot() + def do_accept(self): + """ + the slot for accept button + :return: none + """ + message_id = self.spnMessageID.text() + self._make_parameters_payload() + if self.rbHD.isChecked(): + self.interface.hd.cmd_send_hd_general_response(int(message_id), True, 0, + self.chkData.isChecked(), + self.parameters_payload_len > 0, + self.parameters_payload) + else: + self.interface.dg.cmd_send_dg_general_response(int(message_id), True, 0, + self.chkData.isChecked(), + self.parameters_payload_len > 0, + self.parameters_payload) + + self.lblAction.setText('Accepted ') + + @Slot() + def do_reject(self): + """ + the slot for reject button + :return: none + """ + message_id = self.spnMessageID.text() + reason = self.spnReason.value() + self._make_parameters_payload() + if self.rbHD.isChecked(): + self.interface.hd.cmd_send_hd_general_response(int(message_id), False, reason, + self.chkData.isChecked(), + self.parameters_payload_len > 0, + self.parameters_payload) + else: + self.interface.dg.cmd_send_dg_general_response(int(message_id), False, reason, + self.chkData.isChecked(), + self.parameters_payload_len > 0, + self.parameters_payload) + + self.lblAction.setText('Rejected ' + "{}".format(reason)) + + @Slot() + def do_acknow(self): + """ + sends the message acknowledge by the sequence number spnSequence + :return: None + """ + seq = self.spnSequence.value() + if self.rbHD.isChecked(): + self.interface.hd.cmd_send_hd_ack(seq) + else: + self.interface.dg.cmd_send_dg_ack(seq) Index: simulator/plugins/hdOpMode/interface.ui =================================================================== diff -u --- simulator/plugins/hdOpMode/interface.ui (revision 0) +++ simulator/plugins/hdOpMode/interface.ui (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -0,0 +1,462 @@ + + + ui_interface + + + + 0 + 0 + 745 + 273 + + + + &1 States/&1 HD Op Mode + + + + + + + + + 0 + 0 + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(52, 105, 2); + + + 37 : [0x2500] : HD Op Mode + + + Qt::AlignCenter + + + + + + + reset + + + + + + + Send + + + + + + + + + + + + 320 + 215 + + + + + 8 + 50 + false + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + false + + + 9 + + + 2 + + + true + + + 85 + + + true + + + true + + + 18 + + + 21 + + + + 0 + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 6 + + + + + 7 + + + + + 8 + + + + + 0 : HD OP Mode + + + + + Description + + + + + MODE_FAUL + + + + + fault mode + + + + + MODE_SERV + + + + + Service mode + + + + + MODE_INIT + + + + + Initialization & POST mode + + + + + MODE_STAN + + + + + Standby mode + + + + + MODE_TPAR + + + + + Treatment Parameters (Validation) mode + + + + + MODE_PRET + + + + + Pre-Treatment mode + + + + + MODE_TREA + + + + + Treatment mode + + + + + MODE_POST + + + + + Post-Treatment mode + + + + + MODE_NLEG + + + + + illegale mode transition + + + + + + + + + 320 + 215 + + + + + 8 + 50 + false + + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + QAbstractItemView::NoEditTriggers + + + true + + + QAbstractItemView::SingleSelection + + + QAbstractItemView::SelectRows + + + true + + + false + + + 6 + + + 2 + + + true + + + 285 + + + true + + + true + + + 18 + + + 21 + + + + 0 + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + 1 : SubMode [StandBy] + + + + + Description + + + + + STANDBY_START_STATE + + + + + Start standby + + + + + STANDBY_WAIT_FOR_TREATMENT_STATE + + + + + Wait for treatment + + + + + STANDBY_WAIT_FOR_DISINFECT_STATE + + + + + Wait for disinfection + + + + + STANDBY_DG_FLUSH_IN_PROGRESS_STATE + + + + + DG flush operation is in progress + + + + + STANDBY_DG_HEAT_DISINFECT_IN_PROGRESS_STATE + + + + + DG heat disinfection operation is in progress + + + + + STANDBY_DG_CHEM_DISINFECT_IN_PROGRESS_STATE + + + + + DG chemical disinfection operation is in progress + + + + + + + + + + Qt::Vertical + + + + 20 + 3 + + + + + + + + tbSend + tbReset + tblOpMode + tblSubMode + + + + Index: simulator/plugins/hdOpMode/loader.py =================================================================== diff -u --- simulator/plugins/hdOpMode/loader.py (revision 0) +++ simulator/plugins/hdOpMode/loader.py (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -0,0 +1,72 @@ +""" + The HD Op Mode ui loader +""" +# Python +import os +# Qt +from PySide2 import QtCore, QtWidgets +from PySide2.QtCore import Slot +# parent +from simulator.dynamicloader import DynamicLoader +# hd Simulator +from simulator.interface import SimulationInterface +# plugin specific +from dialin.common.hd_defs import HDOpModes +from dialin.common.hd_defs import HD_Standby_States + + +class Loader(DynamicLoader): + """ + The HD Op Mode ui loader + """ + tbReset: QtWidgets.QToolButton + tbSend: QtWidgets.QToolButton + tblOpMode: QtWidgets.QTableWidget + tblSubMode: QtWidgets.QTableWidget + + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) + + def _init_loader(self): + """ + finds and creates widgets + :return: none + """ + self.tbReset = self.find_tool_button('tbReset') + self.tbSend = self.find_tool_button('tbSend') + self.tblOpMode = self.find_table_widget('tblOpMode') + self.tblSubMode = self.find_table_widget('tblSubMode') + + def _init_connections(self): + """ + initializes the widgets connections + :return: none + """ + self.tbReset.clicked.connect(self._init_widgets) + self.tbSend.clicked.connect(self.do_treatment_states) + self.tblOpMode.currentCellChanged.connect(self.do_treatment_states) + self.tblSubMode.currentCellChanged.connect(self.do_treatment_states) + + @Slot() + def _init_widgets(self): + """ + initializes the widgets' properties + :return: none + """ + self.tblOpMode.setCurrentCell(HDOpModes.MODE_INIT.value, 0) + self.tblOpMode.horizontalHeaderItem(0).setTextAlignment(QtCore.Qt.AlignLeft) + self.tblSubMode.setCurrentCell(HD_Standby_States.STANDBY_START_STATE.value, 0) + self.tblSubMode.horizontalHeaderItem(0).setTextAlignment(QtCore.Qt.AlignLeft) + + @Slot() + def do_treatment_states(self): + """ + the slot for state change + :return: none + """ + op_mode = int(self.tblOpMode.verticalHeaderItem(self.tblOpMode.currentRow()).text()) + sub_mode = int(self.tblSubMode.verticalHeaderItem(self.tblSubMode.currentRow()).text()) + self.interface.hd.cmd_send_hd_operation_mode( + op_mode, + sub_mode + ) Index: simulator/plugins/heparin/loader.py =================================================================== diff -u -red2d7cb5c8c2059444fd17cd4e1c0975461a903c -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/heparin/loader.py (.../loader.py) (revision ed2d7cb5c8c2059444fd17cd4e1c0975461a903c) +++ simulator/plugins/heparin/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -9,7 +9,8 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator, TXStates +from simulator.interface import SimulationInterface +from dialin.ui.hd_simulator import TXStates # plugin specific # -- None -- @@ -28,8 +29,8 @@ requested_state: TXStates - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) self.requested_state = TXStates.HEPARIN_STATE_PAUSED def _init_loader(self): @@ -76,7 +77,7 @@ else: self.requested_state = TXStates.HEPARIN_STATE_DISPENSING - self.hd_simulator.cmd_set_heparin_pause_resume_response(True, 0, self.requested_state) + self.interface.hd.cmd_set_heparin_pause_resume_response(True, 0, self.requested_state) self.lblAction.setText('Accepted ') @Slot() @@ -86,7 +87,7 @@ :return: none """ reason = self.spnRejectReason.value() - self.hd_simulator.cmd_set_heparin_pause_resume_response(False, reason, self.requested_state) + self.interface.hd.cmd_set_heparin_pause_resume_response(False, reason, self.requested_state) self.lblAction.setText('Rejected ' + "{}".format(reason)) @Slot() @@ -97,5 +98,5 @@ :return: none """ volume = value * 0.1 - self.hd_simulator.cmd_set_treatment_heparin_data(volume) + self.interface.hd.cmd_set_treatment_heparin_data(volume) self.lblCumulative.setNum(volume) Index: simulator/plugins/inlinebloodpressures/loader.py =================================================================== diff -u -red2d7cb5c8c2059444fd17cd4e1c0975461a903c -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/inlinebloodpressures/loader.py (.../loader.py) (revision ed2d7cb5c8c2059444fd17cd4e1c0975461a903c) +++ simulator/plugins/inlinebloodpressures/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -9,7 +9,8 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator, TXStates +from simulator.interface import SimulationInterface +from dialin.ui.hd_simulator import TXStates # plugin specific from dialin.common import Ranges @@ -38,8 +39,8 @@ sldArterialValue: QtWidgets.QSlider sldVenousValue: QtWidgets.QSlider - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) self.saline_requested_state = TXStates.SALINE_BOLUS_STATE_IDLE def _init_loader(self): @@ -126,7 +127,7 @@ sends the pressures values message with given value on the screen :return: none """ - self.hd_simulator.cmd_set_pressure_occlusion_data( + self.interface.hd.cmd_set_pressure_occlusion_data( self.sldArterialValue.value(), self.sldVenousValue.value(), 0, 0, 0 @@ -139,7 +140,7 @@ :return: none """ # vAccepted, vReason, vArterialLow, vArterialHigh, vVenousLow, vVenousHigh - self.hd_simulator.cmd_send_treatment_adjust_pressures_limit_response( + self.interface.hd.cmd_send_treatment_adjust_pressures_limit_response( True, 0, self.spnArterialLimitLow.value(), self.spnArterialLimitHigh.value(), @@ -155,7 +156,7 @@ :return: none """ reason = self.spnAVPressuresRejectReason.value() - self.hd_simulator.cmd_send_treatment_adjust_pressures_limit_response( + self.interface.hd.cmd_send_treatment_adjust_pressures_limit_response( False, reason, self.spnArterialLimitLow.value(), self.spnArterialLimitHigh.value(), Index: simulator/plugins/postTreatment/interface.ui =================================================================== diff -u --- simulator/plugins/postTreatment/interface.ui (revision 0) +++ simulator/plugins/postTreatment/interface.ui (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -0,0 +1,3401 @@ + + + ui_interface + + + + 0 + 0 + 1042 + 978 + + + + &5 Post-Treatment/&0 Treatment Log + + + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(191, 64, 105); + + + Post Treatment + + + Qt::AlignCenter + + + + + + + + + + + + + + + + 0 + 0 + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(191, 64, 105); + + + Treatment Log Alarm + + + Qt::AlignCenter + + + + + + + + 10 + + + + Send + + + + + + + + + + + + 165 + 0 + + + + + 165 + 16777215 + + + + + Courier + + + + 1(U32) Alarm ID + + + leTreatmentDateTime + + + + + + + + Courier + + + + 9999999999 + + + 0 + + + 10 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 165 + 0 + + + + + 165 + 16777215 + + + + + Courier + + + + 2(F32) Param 1 + + + leBloodFlowRate + + + + + + + + Courier + + + + 9999999999.999 + + + 41.1 + + + 14 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + + + 165 + 0 + + + + + 165 + 16777215 + + + + + Courier + + + + 3(F32) Param 2 + + + leBloodFlowRate + + + + + + + + Courier + + + + 9999999999.999 + + + 42.2 + + + 14 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + + + 0 + 0 + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(191, 64, 105); + + + Treatment Log Event + + + Qt::AlignCenter + + + + + + + + 10 + + + + Send + + + + + + + + + + + + 165 + 0 + + + + + 165 + 16777215 + + + + + Courier + + + + 1(U32) Event ID + + + leTreatmentDateTime + + + + + + + + Courier + + + + 9999999999 + + + 0 + + + 10 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 165 + 0 + + + + + 165 + 16777215 + + + + + Courier + + + + 2(F32) Old + + + leBloodFlowRate + + + + + + + + Courier + + + + 9999999999.999 + + + 51.1 + + + 14 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + 165 + 0 + + + + + 165 + 16777215 + + + + + Courier + + + + 3(F32) New + + + leBloodFlowRate + + + + + + + + Courier + + + + 9999999999.999 + + + 51.2 + + + 14 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + 295 + 0 + + + + + 295 + 16777215 + + + + + Courier + + + + 26(U32)Heparin Concentration + + + leHeparinConcentration + + + + + + + + Courier + + + + 9999999999 + + + 24 + + + 10 + + + + + + + + 80 + 0 + + + + + Courier + + + + (IU/mL) + + + + + + + + + + + + 315 + 0 + + + + + 315 + 16777215 + + + + + Courier + + + + 5(U32)Treatment Duration + + + leTreatmentDuration + + + + + + + + Courier + + + + 9999999999 + + + 480 + + + 10 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (min) + + + + + + + + + + + + 295 + 0 + + + + + 295 + 16777215 + + + + + Courier + + + + 20(F32)Target UF Volume + + + leTargetUFVolume + + + + + + + + Courier + + + + 99999.999 + + + 18.678 + + + 9 + + + + + + + + 80 + 0 + + + + + Courier + + + + (L) + + + + + + + + + + + + 315 + 0 + + + + + 315 + 16777215 + + + + + Courier + + + + 17(F32)Average Dialysate Flow + + + leAverageDialysateFlow + + + + + + + + Courier + + + + 99999.999 + + + 15.345 + + + 9 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL/min) + + + + + + + + + + + + 295 + 0 + + + + + 295 + 16777215 + + + + + Courier + + + + 28(F32)Heparin Dispense Rate + + + leHeparinDispenseRate + + + + + + + + Courier + + + + 99999.999 + + + 26.234 + + + 9 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL/hr) + + + + + + + + + + + + 295 + 0 + + + + + 295 + 16777215 + + + + + Courier + + + + 23(F32)Actual UF Rate + + + leActualUFRate + + + + + + + + Courier + + + + 99999.999 + + + 21.912 + + + 9 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL/min) + + + + + + + + + + + + 295 + 0 + + + + + 295 + 16777215 + + + + + Courier + + + + 30(F32)Heparin Delivered Volume + + + leHeparinDeliveredVolume + + + + + + + + Courier + + + + 99999.999 + + + 28.345 + + + 9 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL) + + + + + + + + + + + + 315 + 0 + + + + + 315 + 16777215 + + + + + Courier + + + + 11(U32)Bicarbonate Concentration + + + leBicarbonateConcentration + + + + + + + + Courier + + + + 9999999999 + + + 9 + + + 10 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mEq/L) + + + + + + + + + + + + 315 + 0 + + + + + 315 + 16777215 + + + + + Courier + + + + 8(U32)Bicarbonate Concentrate Type + + + leBicarbonateConcentrateType + + + + + + + + Courier + + + + 9999999999 + + + 0 + + + 10 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + _ + + + + + + + + + + + + 295 + 0 + + + + + 295 + 16777215 + + + + + Courier + + + + 31(F32)Average Arterial Pressure + + + leAverageArterialPressure + + + + + + + + Courier + + + + 99999.999 + + + 29.456 + + + 9 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mmHg) + + + + + + + + + + + + 315 + 0 + + + + + 315 + 16777215 + + + + + Courier + + + + 13(F32)Dialysate Temperature + + + leDialysateTemperature + + + + + + + + Courier + + + + 99999.999 + + + 11.123 + + + 9 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (Celsius) + + + + + + + + + + + + 295 + 0 + + + + + 295 + 16777215 + + + + + Courier + + + + 34(U32)Device ID + + + leDeviceID + + + + + + + + Courier + + + + 9999 + + + 1234 + + + 4 + + + + + + + + 80 + 0 + + + + + Courier + + + + _ + + + + + + + + + + + + 295 + 0 + + + + + 295 + 16777215 + + + + + Courier + + + + 33(U32)End Treatment Early Alarm + + + leEndTreatmentEarlyAlarm + + + + + + + + Courier + + + + 9999999999 + + + 31 + + + 10 + + + + + + + + 80 + 0 + + + + + Courier + + + + _ + + + + + + + + + + + + 295 + 0 + + + + + 295 + 16777215 + + + + + Courier + + + + 29(U32)Heparin Stop + + + leHeparinPreStop + + + + + + + + Courier + + + + 9999999999 + + + 27 + + + 10 + + + + + + + + 80 + 0 + + + + + Courier + + + + (min) + + + + + + + + + + + + 315 + 0 + + + + + 315 + 16777215 + + + + + Courier + + + + 19(F32)Average Dialysate Temp + + + leAverageDialysateTemp + + + + + + + + Courier + + + + 99999.999 + + + 17.567 + + + 9 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (Celsius) + + + + + + + + + + + + 315 + 0 + + + + + 315 + 16777215 + + + + + Courier + + + + 4(U32)Dialysate Flow Rate + + + leDialysateFlowRate + + + + + + + + Courier + + + + 9999999999 + + + 2 + + + 10 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL/min) + + + + + + + + + + + + 295 + 0 + + + + + 295 + 16777215 + + + + + Courier + + + + 35(U32)Water Sample Test Result + + + leWaterSampleTestResult + + + + + + + + Courier + + + + 9999999999 + + + 0 + + + 10 + + + + + + + + 80 + 0 + + + + + Courier + + + + _ + + + + + + + + + + + + 315 + 0 + + + + + 315 + 16777215 + + + + + Courier + + + + 14(U32)Dialyzer Type + + + leDialyzerType + + + + + + + + Courier + + + + 9999999999 + + + 0 + + + 10 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + _ + + + + + + + + + + + + 315 + 0 + + + + + 315 + 16777215 + + + + + Courier + + + + 7(U32)Acid Concentrate Type + + + leAcidConcentrateType + + + + + + + + Courier + + + + 9999999999 + + + 0 + + + 10 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + _ + + + + + + + + + + + + 315 + 0 + + + + + 315 + 16777215 + + + + + Courier + + + + 6(U32)Actual Treatment Duration + + + leActualTreatmentDuration + + + + + + + + Courier + + + + 9999999999 + + + 120 + + + 10 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (min) + + + + + + + + + + + + 315 + 0 + + + + + 315 + 16777215 + + + + + Courier + + + + 10(U32)Calcium Concentration + + + leCalciumConcentration + + + + + + + + Courier + + + + 9999999999 + + + 8 + + + 10 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mEq/L) + + + + + + + + + + + + 315 + 0 + + + + + 315 + 16777215 + + + + + Courier + + + + 12(U32)Sodium Concentration + + + leSodiumConcentration + + + + + + + + Courier + + + + 9999999999 + + + 10 + + + 10 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mEq/L) + + + + + + + + + + + + 315 + 0 + + + + + 315 + 16777215 + + + + + Courier + + + + 16(F32)Average Blood Flow + + + leAverageBloodFlow + + + + + + + + Courier + + + + 99999.999 + + + 14.234 + + + 9 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL/min) + + + + + + + + + + + + 315 + 0 + + + + + 315 + 16777215 + + + + + Courier + + + + 18(F32)Dialysate Volume Used + + + leDialysateVolumeUsed + + + + + + + + Courier + + + + 99999.999 + + + 16.456 + + + 9 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (L) + + + + + + + + + + + + + + 0 + 0 + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(191, 64, 105); + + + Treatment Log Data + + + Qt::AlignCenter + + + + + + + + 10 + + + + Send + + + + + + + + + + + + 245 + 0 + + + + + 245 + 16777215 + + + + + Courier + + + + 1(U32) Blood Flow Rate + + + leBloodFlowRate + + + + + + + + Courier + + + + 9999999999 + + + 1 + + + 10 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL/min) + + + + + + + + + + + + 245 + 0 + + + + + 245 + 16777215 + + + + + Courier + + + + 2(U32) Dialysate Flow Rate + + + leDialysateFlowRate + + + + + + + + Courier + + + + 9999999999 + + + 2 + + + 10 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL/min) + + + + + + + + + + + + 245 + 0 + + + + + 245 + 16777215 + + + + + Courier + + + + 3(F32) UF Rate + + + leTargetUFRate + + + + + + + + Courier + + + + 99999.999 + + + 20.891 + + + 9 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL/min) + + + + + + + + + + + + 245 + 0 + + + + + 245 + 16777215 + + + + + Courier + + + + 4(F32) Arterial Pressure + + + leAverageArterialPressure + + + + + + + + Courier + + + + 99999.999 + + + 29.456 + + + 9 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mmHg) + + + + + + + + + + + + 245 + 0 + + + + + 245 + 16777215 + + + + + Courier + + + + 5(F32) Venous Pressure + + + leAverageVenousPressure + + + + + + + + Courier + + + + 99999.999 + + + 30.567 + + + 9 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mmHg) + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + 295 + 0 + + + + + 295 + 16777215 + + + + + Courier + + + + 32(F32)Average Venous Pressure + + + leAverageVenousPressure + + + + + + + + Courier + + + + 99999.999 + + + 30.567 + + + 9 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mmHg) + + + + + + + + + + + + 315 + 0 + + + + + 315 + 16777215 + + + + + Courier + + + + 3(U32)Blood Flow Rate + + + leBloodFlowRate + + + + + + + + Courier + + + + 9999999999 + + + 1 + + + 10 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL/min) + + + + + + + + + + + + 295 + 0 + + + + + 295 + 16777215 + + + + + Courier + + + + 25(U32)Heparin Type + + + leHeparinType + + + + + + + + Courier + + + + 9999999999 + + + 0 + + + 10 + + + + + + + + 80 + 0 + + + + + Courier + + + + _ + + + + + + + + + + + + 315 + 0 + + + + + 315 + 16777215 + + + + + Courier + + + + 15(U32)Treatment Date and Time + + + leTreatmentDateTime + + + + + + + + Courier + + + + 9999999999 + + + 1620913600 + + + 10 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + _ + + + + + + + + + + + + 295 + 0 + + + + + 295 + 16777215 + + + + + Courier + + + + 21(F32)Actual UF Volume + + + leActualUFVolume + + + + + + + + Courier + + + + 99999.999 + + + 19.789 + + + 9 + + + + + + + + 80 + 0 + + + + + Courier + + + + (L) + + + + + + + + + + + + 315 + 0 + + + + + 315 + 16777215 + + + + + Courier + + + + 9(U32)Potassium Concentration + + + lePotassiumConcentration + + + + + + + + Courier + + + + 9999999999 + + + 0 + + + 10 + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 80 + 0 + + + + + Courier + + + + (mEq/L) + + + + + + + + + + + + 295 + 0 + + + + + 295 + 16777215 + + + + + Courier + + + + 22(F32)Target UF Rate + + + leTargetUFRate + + + + + + + + Courier + + + + 99999.999 + + + 20.891 + + + 9 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL/min) + + + + + + + + + + + + 295 + 0 + + + + + 295 + 16777215 + + + + + Courier + + + + 27(F32)Heparin Bolus Volume + + + leHeparinBolusVolume + + + + + + + + Courier + + + + 99999.999 + + + 25.123 + + + 9 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL) + + + + + + + + + + + + 295 + 0 + + + + + 295 + 16777215 + + + + + Courier + + + + 24(U32)Saline Bolus Volume + + + leSalineBolusVolume + + + + + + + + Courier + + + + 9999999999 + + + 22 + + + 10 + + + + + + + + 80 + 0 + + + + + Courier + + + + (mL) + + + + + + + + + Qt::Vertical + + + + + + + + + + 10 + + + + Accept + + + + + + + + 0 + 0 + + + + + 10 + + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + reason + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 10 + + + + QFrame::StyledPanel + + + QFrame::Plain + + + + + + + + + + + 10 + + + + Reject + + + + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(191, 64, 50); + + + Disposables Removal Confirm Response + + + Qt::AlignCenter + + + + + + + + + + + + 10 + + + + Accept + + + + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(191, 64, 105); + + + Treatment Log Data Response + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 50 + 0 + + + + reason + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + 10 + + + + Reject + + + + + + + + 0 + 0 + + + + + 10 + + + + QFrame::StyledPanel + + + QFrame::Plain + + + + + + + + + + + 0 + 0 + + + + + 10 + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + btnAcceptDisposableConfirm + btnRejectDisposableConfirm + spnReasonDisposableConfirm + btnAcceptTxLog + btnRejectTxLog + spnReasonTxLog + leBloodFlowRate + leDialysateFlowRate + leTreatmentDuration + leActualTreatmentDuration + leAcidConcentrateType + leBicarbonateConcentrateType + lePotassiumConcentration + leCalciumConcentration + leBicarbonateConcentration + leSodiumConcentration + leDialysateTemperature + leDialyzerType + leTreatmentDateTime + leAverageBloodFlow + leAverageDialysateFlow + leDialysateVolumeUsed + leAverageDialysateTemp + leTargetUFVolume + leActualUFVolume + leTargetUFRate + leActualUFRate + leSalineBolusVolume + leHeparinType + leHeparinConcentration + leHeparinBolusVolume + leHeparinDispenseRate + leHeparinPreStop + leHeparinDeliveredVolume + leAverageArterialPressure + leAverageVenousPressure + leEndTreatmentEarlyAlarm + leDeviceID + leWaterSampleTestResult + + + + Index: simulator/plugins/postTreatment/loader.py =================================================================== diff -u --- simulator/plugins/postTreatment/loader.py (revision 0) +++ simulator/plugins/postTreatment/loader.py (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -0,0 +1,297 @@ +""" +The ui loader class +""" +# Python +import os +# Qt +from PySide2 import QtWidgets +from PySide2.QtCore import Slot +# parent +from simulator.dynamicloader import DynamicLoader +# hd Simulator +from simulator.interface import SimulationInterface +from dialin.ui.hd_simulator import RequestRejectReasons + +# plugin specific +# -- None -- + + +class Loader(DynamicLoader): + """ + The ui loader class + """ + btnAcceptDisposableConfirm: QtWidgets.QPushButton + btnRejectDisposableConfirm: QtWidgets.QPushButton + spnReasonDisposableConfirm: QtWidgets.QSpinBox + lblActionDisposableConfirm: QtWidgets.QLabel + + btnAcceptTxLog: QtWidgets.QPushButton + btnRejectTxLog: QtWidgets.QPushButton + spnReasonTxLog: QtWidgets.QSpinBox + lblActionTxLog: QtWidgets.QLabel + + leBloodFlowRate: QtWidgets.QLineEdit + leDialysateFlowRate: QtWidgets.QLineEdit + leTreatmentDuration: QtWidgets.QLineEdit + leActualTreatmentDuration: QtWidgets.QLineEdit + leAcidConcentrateType: QtWidgets.QLineEdit + leBicarbonateConcentrateType: QtWidgets.QLineEdit + lePotassiumConcentration: QtWidgets.QLineEdit + leCalciumConcentration: QtWidgets.QLineEdit + leBicarbonateConcentration: QtWidgets.QLineEdit + leSodiumConcentration: QtWidgets.QLineEdit + leDialysateTemperature: QtWidgets.QLineEdit + leDialyzerType: QtWidgets.QLineEdit + leTreatmentDateTime: QtWidgets.QLineEdit + leAverageBloodFlow: QtWidgets.QLineEdit + leAverageDialysateFlow: QtWidgets.QLineEdit + leDialysateVolumeUsed: QtWidgets.QLineEdit + leAverageDialysateTemp: QtWidgets.QLineEdit + + leTargetUFVolume: QtWidgets.QLineEdit + leActualUFVolume: QtWidgets.QLineEdit + leTargetUFRate: QtWidgets.QLineEdit + leActualUFRate: QtWidgets.QLineEdit + leSalineBolusVolume: QtWidgets.QLineEdit + leHeparinType: QtWidgets.QLineEdit + leHeparinConcentration: QtWidgets.QLineEdit + leHeparinBolusVolume: QtWidgets.QLineEdit + leHeparinDispenseRate: QtWidgets.QLineEdit + leHeparinPreStop: QtWidgets.QLineEdit + leHeparinDeliveredVolume: QtWidgets.QLineEdit + leAverageArterialPressure: QtWidgets.QLineEdit + leAverageVenousPressure: QtWidgets.QLineEdit + leEndTreatmentEarlyAlarm: QtWidgets.QLineEdit + leDeviceID: QtWidgets.QLineEdit + leWaterSampleTestResult: QtWidgets.QLineEdit + + btnTxLogDataSend: QtWidgets.QPushButton + leTxLogDataBloodFlowRate: QtWidgets.QLineEdit + leTxLogDataDialysateFlowRate: QtWidgets.QLineEdit + leTxLogDataUFRate: QtWidgets.QLineEdit + leTxLogDataArterialPressure: QtWidgets.QLineEdit + leTxLogDataVenousPressure: QtWidgets.QLineEdit + + btnTxLogAlarmSend: QtWidgets.QPushButton + leTxLogAlarmID: QtWidgets.QLineEdit + leTxLogAlarmP1: QtWidgets.QLineEdit + leTxLogAlarmP2: QtWidgets.QLineEdit + + btnTxLogEventSend: QtWidgets.QPushButton + leTxLogEventID: QtWidgets.QLineEdit + leTxLogEventOld: QtWidgets.QLineEdit + leTxLogEventNew: QtWidgets.QLineEdit + + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) + + def _init_loader(self): + """ + finds and creates widgets + :return: none + """ + self.btnAcceptDisposableConfirm = self.find_button('btnAcceptDisposableConfirm') + self.btnRejectDisposableConfirm = self.find_button('btnRejectDisposableConfirm') + self.spnReasonDisposableConfirm = self.find_spinbox('spnReasonDisposableConfirm') + self.lblActionDisposableConfirm = self.find_label('lblActionDisposableConfirm') + + self.btnAcceptTxLog = self.find_button('btnAcceptTxLog') + self.btnRejectTxLog = self.find_button('btnRejectTxLog') + self.spnReasonTxLog = self.find_spinbox('spnReasonTxLog') + self.lblActionTxLog = self.find_label('lblActionTxLog') + + self.leBloodFlowRate = self.find_line_edit('leBloodFlowRate') + self.leDialysateFlowRate = self.find_line_edit('leDialysateFlowRate') + self.leTreatmentDuration = self.find_line_edit('leTreatmentDuration') + self.leActualTreatmentDuration = self.find_line_edit('leActualTreatmentDuration') + self.leAcidConcentrateType = self.find_line_edit('leAcidConcentrateType') + self.leBicarbonateConcentrateType = self.find_line_edit('leBicarbonateConcentrateType') + self.lePotassiumConcentration = self.find_line_edit('lePotassiumConcentration') + self.leCalciumConcentration = self.find_line_edit('leCalciumConcentration') + self.leBicarbonateConcentration = self.find_line_edit('leBicarbonateConcentration') + self.leSodiumConcentration = self.find_line_edit('leSodiumConcentration') + self.leDialysateTemperature = self.find_line_edit('leDialysateTemperature') + self.leDialyzerType = self.find_line_edit('leDialyzerType') + self.leTreatmentDateTime = self.find_line_edit('leTreatmentDateTime') + self.leAverageBloodFlow = self.find_line_edit('leAverageBloodFlow') + self.leAverageDialysateFlow = self.find_line_edit('leAverageDialysateFlow') + self.leDialysateVolumeUsed = self.find_line_edit('leDialysateVolumeUsed') + self.leAverageDialysateTemp = self.find_line_edit('leAverageDialysateTemp') + + self.leTargetUFVolume = self.find_line_edit('leTargetUFVolume') + self.leActualUFVolume = self.find_line_edit('leActualUFVolume') + self.leTargetUFRate = self.find_line_edit('leTargetUFRate') + self.leActualUFRate = self.find_line_edit('leActualUFRate') + self.leSalineBolusVolume = self.find_line_edit('leSalineBolusVolume') + self.leHeparinType = self.find_line_edit('leHeparinType') + self.leHeparinConcentration = self.find_line_edit('leHeparinConcentration') + self.leHeparinBolusVolume = self.find_line_edit('leHeparinBolusVolume') + self.leHeparinDispenseRate = self.find_line_edit('leHeparinDispenseRate') + self.leHeparinPreStop = self.find_line_edit('leHeparinPreStop') + self.leHeparinDeliveredVolume = self.find_line_edit('leHeparinDeliveredVolume') + self.leAverageArterialPressure = self.find_line_edit('leAverageArterialPressure') + self.leAverageVenousPressure = self.find_line_edit('leAverageVenousPressure') + self.leEndTreatmentEarlyAlarm = self.find_line_edit('leEndTreatmentEarlyAlarm') + self.leDeviceID = self.find_line_edit('leDeviceID') + self.leWaterSampleTestResult = self.find_line_edit('leWaterSampleTestResult') + + self.btnTxLogDataSend = self.find_button('btnTxLogDataSend') + self.leTxLogDataBloodFlowRate = self.find_line_edit('leTxLogDataBloodFlowRate') + self.leTxLogDataDialysateFlowRate = self.find_line_edit('leTxLogDataDialysateFlowRate') + self.leTxLogDataUFRate = self.find_line_edit('leTxLogDataUFRate') + self.leTxLogDataArterialPressure = self.find_line_edit('leTxLogDataArterialPressure') + self.leTxLogDataVenousPressure = self.find_line_edit('leTxLogDataVenousPressure') + + self.btnTxLogAlarmSend = self.find_button('btnTxLogAlarmSend') + self.leTxLogAlarmID = self.find_line_edit('leTxLogAlarmID') + self.leTxLogAlarmP1 = self.find_line_edit('leTxLogAlarmP1') + self.leTxLogAlarmP2 = self.find_line_edit('leTxLogAlarmP2') + + self.btnTxLogEventSend = self.find_button('btnTxLogEventSend') + self.leTxLogEventID = self.find_line_edit('leTxLogEventID') + self.leTxLogEventOld = self.find_line_edit('leTxLogEventOld') + self.leTxLogEventNew = self.find_line_edit('leTxLogEventNew') + + def _init_widgets(self): + """ + initializes the widgets' properties + :return: none + """ + pass + + def _init_connections(self): + """ + initializes the widgets connections + :return: + """ + self.btnAcceptDisposableConfirm.clicked.connect(self.do_accept_disposable_confirm) + self.btnRejectDisposableConfirm.clicked.connect(self.do_reject_disposable_confirm) + + self.btnTxLogDataSend.clicked.connect(self.do_send_tx_log_data) + self.btnTxLogAlarmSend.clicked.connect(self.do_send_tx_log_alarm) + self.btnTxLogEventSend.clicked.connect(self.do_send_tx_log_event) + + self.btnAcceptTxLog.clicked.connect(self.do_accept_tx_log) + self.btnRejectTxLog.clicked.connect(self.do_reject_tx_log) + + @Slot() + def do_send_tx_log_data(self): + """ + sends the treatment log data (Average 30 min) values + :return: + """ + tx_log_data_blood_flow_rate = int(self.leTxLogDataBloodFlowRate.text()) + tx_log_data_dialysate_flow_rate = int(self.leTxLogDataDialysateFlowRate.text()) + tx_log_data_uf_rate = float(self.leTxLogDataUFRate.text()) + tx_log_data_arterial_pressure = float(self.leTxLogDataArterialPressure.text()) + tx_log_data_venous_pressure = float(self.leTxLogDataVenousPressure.text()) + self.interface.hd.cmd_send_treatment_log_data(tx_log_data_blood_flow_rate, + tx_log_data_dialysate_flow_rate, + tx_log_data_uf_rate, + tx_log_data_arterial_pressure, + tx_log_data_venous_pressure) + + @Slot() + def do_send_tx_log_alarm(self): + """ + sends the treatment log alarm list of values + :return: + """ + tx_log_alarm_id = int(self.leTxLogAlarmID.text()) + tx_log_alarm_parameter1 = float(self.leTxLogAlarmP1.text()) + tx_log_alarm_parameter2 = float(self.leTxLogAlarmP2.text()) + self.interface.hd.cmd_send_treatment_log_alarm(tx_log_alarm_id, + tx_log_alarm_parameter1, + tx_log_alarm_parameter2) + + @Slot() + def do_send_tx_log_event(self): + """ + sends the treatment log event list of values + :return: + """ + tx_log_event_id = int(self.leTxLogEventID.text()) + tx_log_event_old_value = float(self.leTxLogEventOld.text()) + tx_log_event_new_value = float(self.leTxLogEventNew.text()) + self.interface.hd.cmd_send_treatment_log_event(tx_log_event_id, + tx_log_event_old_value, + tx_log_event_new_value) + + @Slot() + def do_accept_disposable_confirm(self): + """ + the slot for accept button + :return: none + """ + self.interface.hd.cmd_send_post_treatment_disposable_removal_confirm_response(True, 0) + self.lblActionDisposableConfirm.setText('Accepted') + + @Slot() + def do_reject_disposable_confirm(self): + """ + the slot for reject button + :return: none + """ + reason = self.spnReasonDisposableConfirm.value() + self.interface.hd.cmd_send_post_treatment_disposable_removal_confirm_response(False, reason) + self.lblActionDisposableConfirm.setText('Rejected ' + "{}".format(reason)) + + @Slot() + def do_accept_tx_log(self): + """ + the slot for accept button + :return: none + """ + self.interface.hd.cmd_send_post_treatment_log_response(True, 0, + # column 1 + int(self.leBloodFlowRate.text()), + int(self.leDialysateFlowRate.text()), + int(self.leTreatmentDuration.text()), + int(self.leActualTreatmentDuration.text()), + int(self.leAcidConcentrateType.text()), + int(self.leBicarbonateConcentrateType.text()), + int(self.lePotassiumConcentration.text()), + int(self.leCalciumConcentration.text()), + int(self.leBicarbonateConcentration.text()), + int(self.leSodiumConcentration.text()), + float(self.leDialysateTemperature.text()), + int(self.leDialyzerType.text()), + int(self.leTreatmentDateTime.text()), + float(self.leAverageBloodFlow.text()), + float(self.leAverageDialysateFlow.text()), + float(self.leDialysateVolumeUsed.text()), + float(self.leAverageDialysateTemp.text()), + # column 2 + float(self.leTargetUFVolume.text()), + float(self.leActualUFVolume.text()), + float(self.leTargetUFRate.text()), + float(self.leActualUFRate.text()), + int(self.leSalineBolusVolume.text()), + int(self.leHeparinType.text()), + int(self.leHeparinConcentration.text()), + float(self.leHeparinBolusVolume.text()), + float(self.leHeparinDispenseRate.text()), + int(self.leHeparinPreStop.text()), + float(self.leHeparinDeliveredVolume.text()), + float(self.leAverageArterialPressure.text()), + float(self.leAverageVenousPressure.text()), + int(self.leEndTreatmentEarlyAlarm.text()), + int(self.leDeviceID.text()), + int(self.leWaterSampleTestResult.text()) + ) + self.lblActionTxLog.setText('Accepted ') + + @Slot() + def do_reject_tx_log(self): + """ + the slot for reject button + :return: none + """ + reason = self.spnReasonTxLog.value() + self.interface.hd.cmd_send_post_treatment_log_response(False, reason, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0 + ) + self.lblActionTxLog.setText('Rejected ' + "{}".format(reason)) Index: simulator/plugins/pretreatmentstates/loader.py =================================================================== diff -u -rae63fbc76b4638ffdcdaad7b69648beeee3340c3 -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/pretreatmentstates/loader.py (.../loader.py) (revision ae63fbc76b4638ffdcdaad7b69648beeee3340c3) +++ simulator/plugins/pretreatmentstates/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -9,7 +9,7 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator +from simulator.interface import SimulationInterface # plugin specific from dialin.common.hd_defs import * @@ -31,8 +31,8 @@ tblRecirculateStates: QtWidgets.QTableWidget tblPatientConnectionStates: QtWidgets.QTableWidget - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) def _init_loader(self): """ @@ -113,7 +113,7 @@ prime = int(self.tblPrimeStates.verticalHeaderItem(self.tblPrimeStates.currentRow()).text()) recirculate = int(self.tblRecirculateStates.verticalHeaderItem(self.tblRecirculateStates.currentRow()).text()) patient_connection = int(self.tblPatientConnectionStates.verticalHeaderItem(self.tblPatientConnectionStates.currentRow()).text()) - self.hd_simulator.cmd_send_pre_treatment_state_data( + self.interface.hd.cmd_send_pre_treatment_state_data( sub_mode, water_sample, consumables_self_test, Index: simulator/plugins/recirculate/loader.py =================================================================== diff -u -red2d7cb5c8c2059444fd17cd4e1c0975461a903c -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/recirculate/loader.py (.../loader.py) (revision ed2d7cb5c8c2059444fd17cd4e1c0975461a903c) +++ simulator/plugins/recirculate/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -9,7 +9,8 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator, TXStates +from simulator.interface import SimulationInterface +from dialin.ui.hd_simulator import TXStates # plugin specific # -- none -- @@ -28,8 +29,8 @@ requested_state: TXStates - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) self.requested_state = TXStates.RINSEBACK_STOP_INIT_STATE def _init_loader(self): @@ -72,7 +73,7 @@ the slot for accept button :return: none """ - self.hd_simulator.cmd_send_treatment_adjust_recirculate_response(True, 0) + self.interface.hd.cmd_send_treatment_adjust_recirculate_response(True, 0) self.lblAction.setText('Accepted ') @Slot() @@ -82,7 +83,7 @@ :return: none """ reason = self.spnRejectReason.value() - self.hd_simulator.cmd_send_treatment_adjust_recirculate_response(False, reason) + self.interface.hd.cmd_send_treatment_adjust_recirculate_response(False, reason) self.lblAction.setText('Rejected ' + "{}".format(reason)) @Slot() @@ -94,4 +95,4 @@ """ timeout_total = self.sldTimeoutTotal.value() timeout_countdown = self.sldTimeoutCountDown.value() - self.hd_simulator.cmd_send_treatment_recirculate_data(timeout_total, timeout_countdown) + self.interface.hd.cmd_send_treatment_recirculate_data(timeout_total, timeout_countdown) Index: simulator/plugins/rinseback/loader.py =================================================================== diff -u -red2d7cb5c8c2059444fd17cd4e1c0975461a903c -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/rinseback/loader.py (.../loader.py) (revision ed2d7cb5c8c2059444fd17cd4e1c0975461a903c) +++ simulator/plugins/rinseback/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -9,7 +9,8 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator, TXStates +from simulator.interface import SimulationInterface +from dialin.ui.hd_simulator import TXStates # plugin specific # -- none -- @@ -31,8 +32,8 @@ requested_state: TXStates - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) self.requested_state = TXStates.RINSEBACK_STOP_INIT_STATE def _init_loader(self): @@ -80,7 +81,7 @@ the slot for accept button :return: none """ - self.hd_simulator.cmd_send_treatment_adjust_rinseback_response(True, 0) + self.interface.hd.cmd_send_treatment_adjust_rinseback_response(True, 0) self.lblAction.setText('Accepted ') @Slot() @@ -90,7 +91,7 @@ :return: none """ reason = self.spnRejectReason.value() - self.hd_simulator.cmd_send_treatment_adjust_rinseback_response(False, reason) + self.interface.hd.cmd_send_treatment_adjust_rinseback_response(False, reason) self.lblAction.setText('Rejected ' + "{}".format(reason)) @Slot() @@ -106,4 +107,4 @@ timeout_total = self.sldTimeoutTotal.value() timeout_countdown = self.sldTimeoutCountDown.value() - self.hd_simulator.cmd_send_treatment_rinseback_data(target, current, rate, timeout_total, timeout_countdown) + self.interface.hd.cmd_send_treatment_rinseback_data(target, current, rate, timeout_total, timeout_countdown) Index: simulator/plugins/salinebolus/loader.py =================================================================== diff -u -red2d7cb5c8c2059444fd17cd4e1c0975461a903c -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/salinebolus/loader.py (.../loader.py) (revision ed2d7cb5c8c2059444fd17cd4e1c0975461a903c) +++ simulator/plugins/salinebolus/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -9,7 +9,8 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator, TXStates +from simulator.interface import SimulationInterface +from dialin.ui.hd_simulator import TXStates # plugin specific # -- none -- @@ -30,8 +31,8 @@ saline_requested_state: TXStates - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) self.saline_requested_state = TXStates.SALINE_BOLUS_STATE_IDLE def _init_loader(self): @@ -83,7 +84,7 @@ self.saline_requested_state = TXStates.SALINE_BOLUS_STATE_IN_PROGRESS target = self.cmbSalineAcceptTarget.currentText() - self.hd_simulator.cmd_set_saline_bolus_response( + self.interface.hd.cmd_set_saline_bolus_response( True, 0, int(target), self.saline_requested_state ) self.lblSalineAction.setText('Accepted ' + target) @@ -95,7 +96,7 @@ :return: none """ reason = self.spnSalineRejectReason.value() - self.hd_simulator.cmd_set_saline_bolus_response( + self.interface.hd.cmd_set_saline_bolus_response( False, reason, 0, self.saline_requested_state ) self.lblSalineAction.setText('Rejected ' + "{}".format(reason)) @@ -107,7 +108,7 @@ by calling the denaliMessage API setTreatmentSalineBolusData :return: none """ - self.hd_simulator.cmd_set_treatment_saline_bolus_data( + self.interface.hd.cmd_set_treatment_saline_bolus_data( self.sldSalineTarget.value(), self.sldSalineCumulative.value(), self.sldSalineVolume.value() Index: simulator/plugins/selftestDry/loader.py =================================================================== diff -u -reb6acf9c1a4748852875c350568192999be9d3dd -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/selftestDry/loader.py (.../loader.py) (revision eb6acf9c1a4748852875c350568192999be9d3dd) +++ simulator/plugins/selftestDry/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -10,7 +10,7 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator +from simulator.interface import SimulationInterface # plugin specific # -- none -- @@ -23,8 +23,8 @@ sldTimeout: QtWidgets.QSlider sldCountdown: QtWidgets.QSlider - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) def _init_loader(self): """ @@ -60,4 +60,4 @@ """ timeout = self.sldTimeout.value() countdown = self.sldCountdown.value() - self.hd_simulator.cmd_send_pre_treatment_self_test_dry_progress_data(timeout, countdown) + self.interface.hd.cmd_send_pre_treatment_self_test_dry_progress_data(timeout, countdown) Index: simulator/plugins/selftestNoCartridge/loader.py =================================================================== diff -u -reb6acf9c1a4748852875c350568192999be9d3dd -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/selftestNoCartridge/loader.py (.../loader.py) (revision eb6acf9c1a4748852875c350568192999be9d3dd) +++ simulator/plugins/selftestNoCartridge/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -10,7 +10,7 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator +from simulator.interface import SimulationInterface # plugin specific # -- none -- @@ -23,8 +23,8 @@ sldTimeout: QtWidgets.QSlider sldCountdown: QtWidgets.QSlider - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) def _init_loader(self): """ @@ -60,4 +60,4 @@ """ timeout = self.sldTimeout.value() countdown = self.sldCountdown.value() - self.hd_simulator.cmd_send_pre_treatment_self_test_no_cartridge_progress_data(timeout, countdown) + self.interface.hd.cmd_send_pre_treatment_self_test_no_cartridge_progress_data(timeout, countdown) Index: simulator/plugins/treatmentend/loader.py =================================================================== diff -u -red2d7cb5c8c2059444fd17cd4e1c0975461a903c -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/treatmentend/loader.py (.../loader.py) (revision ed2d7cb5c8c2059444fd17cd4e1c0975461a903c) +++ simulator/plugins/treatmentend/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -9,7 +9,7 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator +from simulator.interface import SimulationInterface # plugin specific # -- none -- @@ -24,8 +24,8 @@ lblAction: QtWidgets.QLabel spnRejectReason: QtWidgets.QSpinBox - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) def _init_loader(self): """ @@ -58,7 +58,7 @@ the slot for accept treatment end button :return: none """ - self.hd_simulator.cmd_send_treatment_adjust_end_response(True, 0) + self.interface.hd.cmd_send_treatment_adjust_end_response(True, 0) self.lblAction.setText('Accepted ') @Slot() @@ -68,5 +68,5 @@ :return: none """ reason = self.spnRejectReason.value() - self.hd_simulator.cmd_send_treatment_adjust_end_response(False, reason) + self.interface.hd.cmd_send_treatment_adjust_end_response(False, reason) self.lblAction.setText('Rejected ' + "{}".format(reason)) Index: simulator/plugins/treatmentranges/loader.py =================================================================== diff -u -r7f0678d0f61fa99a35a1f34fac6c36e12ba93f20 -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/treatmentranges/loader.py (.../loader.py) (revision 7f0678d0f61fa99a35a1f34fac6c36e12ba93f20) +++ simulator/plugins/treatmentranges/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -10,7 +10,7 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator +from simulator.interface import SimulationInterface # plugin specific # -- none -- @@ -30,8 +30,8 @@ spnUFVolumeMax: QtWidgets.QSpinBox sldDurationValue: QtWidgets.QSlider - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) def _init_loader(self): """ @@ -73,7 +73,7 @@ """ if self.chkRangesBroadcast.isChecked(): value = self.sldDurationValue.value() - self.hd_simulator.cmd_set_treatment_time( + self.interface.hd.cmd_set_treatment_time( self.spnDurationMax.value() * 60, value ) @@ -89,7 +89,7 @@ self.sldDurationValue.setMinimum(duration_min * 60) self.sldDurationValue.setMaximum(duration_max * 60) - self.hd_simulator.cmd_set_treatment_parameter_ranges( + self.interface.hd.cmd_set_treatment_parameter_ranges( duration_min, duration_max, self.spnUFVolumeMin.value(), Index: simulator/plugins/treatmentstates/loader.py =================================================================== diff -u -r2204a65b0af94e7e555f0f4207fd2701c164d1d5 -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/treatmentstates/loader.py (.../loader.py) (revision 2204a65b0af94e7e555f0f4207fd2701c164d1d5) +++ simulator/plugins/treatmentstates/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -9,7 +9,8 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator, TXStates +from simulator.interface import SimulationInterface +from dialin.ui.hd_simulator import TXStates # plugin specific # -- none -- @@ -31,8 +32,8 @@ tblTreatmentEndStates: QtWidgets.QTableWidget tblTreatmentStopStates: QtWidgets.QTableWidget - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) def _init_loader(self): """ @@ -103,7 +104,7 @@ blood_prime = int(self.tblBloodPrimeStates.verticalHeaderItem(self.tblBloodPrimeStates.currentRow()).text()) treatment_end = int(self.tblTreatmentEndStates.verticalHeaderItem(self.tblTreatmentEndStates.currentRow()).text()) treatment_stop = int(self.tblTreatmentStopStates.verticalHeaderItem(self.tblTreatmentStopStates.currentRow()).text()) - self.hd_simulator.cmd_set_treatment_states_data( + self.interface.hd.cmd_set_treatment_states_data( sub_mode, uf_state, saline, Index: simulator/plugins/ultrafiltration/loader.py =================================================================== diff -u -red2d7cb5c8c2059444fd17cd4e1c0975461a903c -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/ultrafiltration/loader.py (.../loader.py) (revision ed2d7cb5c8c2059444fd17cd4e1c0975461a903c) +++ simulator/plugins/ultrafiltration/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -9,7 +9,8 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator, TXStates +from simulator.interface import SimulationInterface +from dialin.ui.hd_simulator import TXStates # plugin specific # -- none -- @@ -36,8 +37,8 @@ spnUfResumeRejectReason: QtWidgets.QSpinBox sldUfVolume: QtWidgets.QSlider - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) def _init_loader(self): """ Index: simulator/plugins/version/interface.ui =================================================================== diff -u -reb6acf9c1a4748852875c350568192999be9d3dd -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/version/interface.ui (.../interface.ui) (revision eb6acf9c1a4748852875c350568192999be9d3dd) +++ simulator/plugins/version/interface.ui (.../interface.ui) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -6,51 +6,61 @@ 0 0 - 548 - 320 + 444 + 351 &0 Device/&Versions - - - - - 10 - + + + + Qt::Vertical - - color: rgb(238, 238, 236); -background-color: rgb(32, 74, 135); + + + 20 + 40 + - - Versions - - - Qt::AlignCenter - - + - - + + 0 0 - FPGA id + Build Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + 0 + 0 + + + + Major + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + @@ -83,6 +93,9 @@ + + + @@ -99,38 +112,78 @@ - - + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(239, 41, 41); + + + HD Vession + + + Qt::AlignCenter + + + + + 0 0 - Major + Minor Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - + + + + + + + + + + + + + + + + + 0 0 - Minor + FPGA id Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + @@ -147,154 +200,184 @@ + + + + + 0 + 0 + + + + Serial + + + + + + + + 0 + 0 + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + HD12345678 + + + 10 + + + + + + + + + + - + 10 color: rgb(238, 238, 236); -background-color: rgb(239, 41, 41); +background-color: rgb(41, 41, 239); - HD Vession + DG Version Qt::AlignCenter - - + + 0 0 - Build + FPGA Lab Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - + + + + + 0 + 0 + + + + Major + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + - - - - - - - - - - - - - + - - - - - - - - - - - - + + - - + + + + + 0 0 - FPGA Lab + Minor Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - + + 0 0 - FPGA id + FPGA Major Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - + + 0 0 - Build + FPGA Minor Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - + + - - - - - - - - + + 0 0 - FPGA Major + FPGA id Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - @@ -311,91 +394,104 @@ - - + + + + + + + + 0 0 - Major + Build Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - + + 0 0 - FPGA Minor + Serial - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - + + - + 0 0 - - Minor + + + 100 + 0 + - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 100 + 16777215 + - - - - - - - - - - 10 - - - - color: rgb(238, 238, 236); -background-color: rgb(41, 41, 239); - - DG Version + DG12345678 - - Qt::AlignCenter + + 10 - - - - Qt::Vertical + + + + + 10 + - - - 20 - 40 - + + color: rgb(238, 238, 236); +background-color: rgb(32, 74, 135); - + + Versions + + + Qt::AlignCenter + + + + + + send + + + + + + + Send + + + Index: simulator/plugins/version/loader.py =================================================================== diff -u -red2d7cb5c8c2059444fd17cd4e1c0975461a903c -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/plugins/version/loader.py (.../loader.py) (revision ed2d7cb5c8c2059444fd17cd4e1c0975461a903c) +++ simulator/plugins/version/loader.py (.../loader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -10,7 +10,7 @@ # parent from simulator.dynamicloader import DynamicLoader # hd Simulator -from dialin.ui.hd_simulator import HDSimulator +from simulator.interface import SimulationInterface # plugin specific # -- none -- @@ -37,9 +37,15 @@ sbDGFPGAMinor: QtWidgets.QSpinBox sbDGFPGALab: QtWidgets.QSpinBox - def __init__(self, hd_simulator: HDSimulator): - super().__init__(os.path.dirname(__file__), hd_simulator) + leHDSerial: QtWidgets.QLineEdit + leDGSerial: QtWidgets.QLineEdit + pbHDSend: QtWidgets.QPushButton + pbDGSend: QtWidgets.QPushButton + + def __init__(self, interface: SimulationInterface): + super().__init__(os.path.dirname(__file__), interface) + def _init_loader(self): """ finds and creates widgets @@ -63,6 +69,12 @@ self.sbDGFPGAMinor = self.find_spinbox('sbDGFPGAMinor') self.sbDGFPGALab = self.find_spinbox('sbDGFPGALab') + self.leHDSerial = self.find_line_edit('leHDSerial') + self.leDGSerial = self.find_line_edit('leDGSerial') + + self.pbHDSend = self.find_button('pbHDSend') + self.pbDGSend = self.find_button('pbDGSend') + def _init_widgets(self): """ initializes the widgets' properties @@ -75,26 +87,13 @@ initializes the widgets connections :return: """ - self.sbHDMajor.valueChanged.connect(self.do_hd_data) - self.sbHDMinor.valueChanged.connect(self.do_hd_data) - self.sbHDMicro.valueChanged.connect(self.do_hd_data) - self.sbHDBuild.valueChanged.connect(self.do_hd_data) - self.sbHDFPGAid.valueChanged.connect(self.do_hd_data) - self.sbHDFPGAMajor.valueChanged.connect(self.do_hd_data) - self.sbHDFPGAMinor.valueChanged.connect(self.do_hd_data) - self.sbHDFPGALab.valueChanged.connect(self.do_hd_data) + self.pbHDSend.clicked.connect(self.do_hd_version_data) + self.pbDGSend.clicked.connect(self.do_dg_version_data) + self.pbHDSend.clicked.connect(self.do_hd_serial_data) + self.pbDGSend.clicked.connect(self.do_dg_serial_data) - self.sbDGMajor.valueChanged.connect(self.do_dg_data) - self.sbDGMinor.valueChanged.connect(self.do_dg_data) - self.sbDGMicro.valueChanged.connect(self.do_dg_data) - self.sbDGBuild.valueChanged.connect(self.do_dg_data) - self.sbDGFPGAid.valueChanged.connect(self.do_dg_data) - self.sbDGFPGAMajor.valueChanged.connect(self.do_dg_data) - self.sbDGFPGAMinor.valueChanged.connect(self.do_dg_data) - self.sbDGFPGALab.valueChanged.connect(self.do_dg_data) - @Slot() - def do_hd_data(self): + def do_hd_version_data(self): """ the slot which is called to send the data by calling the denaliMessage API cmd_send_version_hd_data @@ -108,7 +107,7 @@ sb_hd_fpga_major = self.sbHDFPGAMajor.value() sb_hd_fpga_minor = self.sbHDFPGAMinor.value() sb_hd_fpga_lab = self.sbHDFPGALab.value() - self.hd_simulator.cmd_send_version_hd_data( + self.interface.hd.cmd_send_version_hd_data( sb_hd_major, sb_hd_minor, sb_hd_micro, @@ -120,7 +119,7 @@ ) @Slot() - def do_dg_data(self): + def do_dg_version_data(self): """ the slot which is called to send the data by calling the denaliMessage API cmd_send_version_dg_data @@ -135,7 +134,7 @@ sb_dg_fpga_major = self.sbDGFPGAMajor.value() sb_dg_fpga_minor = self.sbDGFPGAMinor.value() sb_dg_fpga_lab = self.sbDGFPGALab.value() - self.hd_simulator.cmd_send_version_dg_data( + self.interface.dg.cmd_send_version_dg_data( sb_dg_major, sb_dg_minor, sb_dg_micro, @@ -145,3 +144,25 @@ sb_dg_fpga_minor, sb_dg_fpga_lab, ) + + @Slot() + def do_hd_serial_data(self): + """ + the slot which is called to send the data + by calling the denaliMessage API cmd_send_serial_hd_data + :return: none + """ + self.interface.hd.cmd_send_serial_hd_data( + self.leHDSerial.text() + ) + + @Slot() + def do_dg_serial_data(self): + """ + the slot which is called to send the data + by calling the denaliMessage API cmd_send_serial_dg_data + :return: none + """ + self.interface.dg.cmd_send_serial_dg_data( + self.leDGSerial.text() + ) Index: simulator/run.py =================================================================== diff -u -r313132b681260cc0761c65d46200adb40b72f478 -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/run.py (.../run.py) (revision 313132b681260cc0761c65d46200adb40b72f478) +++ simulator/run.py (.../run.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -5,9 +5,8 @@ import sys from dialin.ui import utils from PySide2 import QtCore, QtWidgets -from simulator.loader import Simulator -from dialin.ui.hd_simulator import HDSimulator -from dialin.ui.hd_simulator_alarms import HDAlarmsSimulator, HIGH +from simulator.simulator import Simulator +from simulator.interface import SimulationInterface def main(): @@ -23,30 +22,16 @@ simulator = Simulator() simulator.show() - hd_simulator_instance_counter_check() + SimulationInterface.hd_instance_counter_check() + SimulationInterface.dg_instance_counter_check() + SimulationInterface.alarm_instance_counter_check() utils.tstDone() # start qt application main loop sys.exit(app.exec_()) -def hd_simulator_instance_counter_check(): - """ - Checks to make sure only one instance of the HDSimulator has been created. - this code shall be part of the HDSimulator __init__ but other codes are not ready for this. - so only the simulator is checking it now. - """ - if HDSimulator.instanceCount > 1: - raise Exception("more than one instance of HDSimulator shall not be created.") - else: - if HDAlarmsSimulator.instanceCount > 1: - raise Exception("more than one instance of HDAlarmsSimulator shall not be created.") - else: - print("HDAlarmsSimulator number of instances is ", HDAlarmsSimulator.instanceCount) - print("HDSimulator number of instances is ", HDSimulator.instanceCount) - - if __name__ == "__main__": QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_ShareOpenGLContexts) main() Index: simulator/simulator/dynamicloader.py =================================================================== diff -u -r26b852b6e979e73cf806699b050401065b5f8fb2 -r967521dff94783ce48b50abc8db6bcd67bb501bf --- simulator/simulator/dynamicloader.py (.../dynamicloader.py) (revision 26b852b6e979e73cf806699b050401065b5f8fb2) +++ simulator/simulator/dynamicloader.py (.../dynamicloader.py) (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -5,7 +5,7 @@ from PySide2.QtUiTools import QUiLoader from PySide2.QtCore import QFile, QObject from PySide2 import QtWidgets -from dialin import HDSimulator +from simulator.interface import SimulationInterface class DynamicLoader(QObject): @@ -20,13 +20,13 @@ loader: QUiLoader window: QtWidgets.QWidget - hd_simulator: HDSimulator = None + interface: SimulationInterface = None - def __init__(self, location: str, hd_simulator: HDSimulator): + def __init__(self, location: str, interface: SimulationInterface): super().__init__(None) self.location = location self.loader = QUiLoader() - self.hd_simulator = hd_simulator + self.interface = interface self.__load_ui() self._init_loader() self._init_widgets() Index: simulator/simulator/interface.py =================================================================== diff -u --- simulator/simulator/interface.py (revision 0) +++ simulator/simulator/interface.py (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -0,0 +1,59 @@ +""" +the simulator's objects container class +""" + +from dialin.ui.hd_simulator import HDSimulator +from dialin.ui.dg_simulator import DGSimulator +from dialin.ui.hd_simulator_alarms import HDAlarmsSimulator + + +class SimulationInterface(): + """ + the main simulator object which will be passed to all the plugins ans it contains all the simulator objects. + """ + hd: HDSimulator = None + dg: DGSimulator = None + alarm: HDAlarmsSimulator = None + + def __init__(self): + self.hd = HDSimulator(console_out=True, passive_mode=True) + self.dg = DGSimulator(console_out=True, passive_mode=True) + self.alarm = HDAlarmsSimulator(self.hd.can_interface, self.hd.logger) + + @staticmethod + def hd_instance_counter_check(): + """ + Checks to make sure only one instance of the HDSimulator has been created. + this code shall be part of the HDSimulator __init__ but other codes are not ready for this. + so only the simulator is checking it now. + """ + if HDSimulator.instance_count > 1: + raise Exception("more than one instance of HDSimulator shall not be created.") + else: + print("HDSimulator number of instances is ", HDSimulator.instance_count) + + @staticmethod + def alarm_instance_counter_check(): + """ + Checks to make sure only one instance of the HDSimulator has been created. + this code shall be part of the HDSimulator __init__ but other codes are not ready for this. + so only the simulator is checking it now. + """ + if HDAlarmsSimulator.instance_count > 1: + raise Exception("more than one instance of HDAlarmsSimulator shall not be created.") + else: + print("HDAlarmsSimulator number of instances is ", HDAlarmsSimulator.instance_count) + + @staticmethod + def dg_instance_counter_check(): + """ + Checks to make sure only one instance of the DGSimulator has been created. + this code shall be part of the DGSimulator __init__ but other codes are not ready for this. + so only the simulator is checking it now. + """ + if DGSimulator.instance_count > 1: + raise Exception("more than one instance of DGSimulator shall not be created.") + else: + print("DGSimulator number of instances is ", DGSimulator.instance_count) + + Fisheye: Tag 967521dff94783ce48b50abc8db6bcd67bb501bf refers to a dead (removed) revision in file `simulator/simulator/loader.py'. Fisheye: No comparison available. Pass `N' to diff? Index: simulator/simulator/simulator.py =================================================================== diff -u --- simulator/simulator/simulator.py (revision 0) +++ simulator/simulator/simulator.py (revision 967521dff94783ce48b50abc8db6bcd67bb501bf) @@ -0,0 +1,167 @@ +""" +the plugin loader class +""" +import os + +from dialin.ui.utils import check_can0 + +from PySide2 import QtWidgets +from PySide2.QtCore import Qt + +from simulator.dynamicloader import DynamicLoader + +# it loads all the classes in plugin folder dynamically +# so used * in here to load all +from plugins import * + +from simulator.interface import SimulationInterface + + +class Simulator(DynamicLoader): + """ + The simulator class which loads the ui file dynamically and initializes the objects + and can be eventually shown. + Note: this class is growing fast and seems like needs to be multiple classes + """ + mdiArea: QtWidgets.QMdiArea + menuBar: QtWidgets.QMenuBar + menuWindows: QtWidgets.QMenu + lblStatusCANBus: QtWidgets.QLabel + lblStatusMessages: QtWidgets.QLabel + + plugins = [] + + def __init__(self): + super().__init__(os.path.dirname(__file__), SimulationInterface()) + + if self.__check_can_bus(): + self.__init_plugins() + self.__init_actions() + + def _init_loader(self): + """ + initializes the class by calling it's initializer methods to make objects ready + :return: none + """ + self.lblStatusCANBus = self.find_label('lblStatusCANBus') + self.lblStatusMessages = self.find_label('lblStatusMessages') + self.mdiArea = self.find_widget(QtWidgets.QMdiArea, 'mdiArea') + self.menuBar = self.find_widget(QtWidgets.QMenuBar, 'menuBar') + self.menuWindows = self.find_widget(QtWidgets.QMenu, 'menuWindows') + self.action_show_all = self.find_action('actionShowAll') + + def _init_widgets(self): + pass + + def _init_connections(self): + pass + + def __init_plugins(self): + """ + initializes the widgets' properties + :return: none + """ + # loading/registering plugins + # the loaded_plugins has been filled and exposed + # from within the __init__.py in the plugins folder + # folders with '__' and '.' have been ignored. + for plugin in available_plugins: + self.plugins.append(eval(plugin)(self.interface)) + self.__register_plugin() + + def __init_actions(self): + """ + initializes the widgets connections + :return: none + """ + self.action_show_all.toggled.connect(self.set_all_windows_visible) + + def __create_actions(self, name: str, window: QtWidgets.QWidget): + """ + creates a menu action item with the name/title name and set to show/hide the plugin form object + :param name: the action menu title + :param window: the object to show/hide + :return: false if the object is None + """ + if window is None: + return False + + top_menu_name = "View" + sub_menu_name = name + names = name.split("/") + if len(names) > 1: + top_menu_name = names[0] + sub_menu_name = names[1] + + menu = None + if top_menu_name != "": + found = False + for item in self.menuBar.actions(): + if item.text().replace('&', '').strip().lower() == top_menu_name.replace('&', '').strip().lower(): + menu = item.menu() + found = True + break + + if not found: + menu = self.menuBar.addMenu(top_menu_name) + + action = menu.addAction(sub_menu_name) + action.triggered.connect(lambda: self.__action_triggered(window)) + self.action_show_all.toggled.connect(action.setChecked) + + def __action_triggered(self, window): + if window.isVisible(): + if self.mdiArea.activeSubWindow() == window: + window.setVisible(False) + else: + self.mdiArea.setActiveSubWindow(window) + else: + window.setVisible(True) + + def __register_plugin(self): + """ + creates the plugin object and adds it to the mdi and creates an action menu for it + :param obj: the plugin object + :return: False if the passed obj is None + """ + + titles = {} + for obj in self.plugins: + titles[obj.window.windowTitle()] = obj + + for title in sorted(titles): + wgt = titles[title].window + sub = self.mdiArea.addSubWindow(wgt) + + sub.setWindowFlags(Qt.WindowMinimizeButtonHint | Qt.WindowTitleHint) + sub.setWindowFlag(Qt.WindowMaximizeButtonHint, obj.canMaximize) + sub.setVisible(obj.isVisible) + + self.__create_actions(title, sub) + wgt.setWindowTitle(wgt.setWindowTitle(title.replace('&', ''))) + + def set_all_windows_visible(self, visible: bool): + """ + sets all the windows (in)visible + :param visible: if true the windows are set to visible + :return: None + """ + for sub in self.mdiArea.subWindowList(): + sub.setVisible(visible) + self.mdiArea.cascadeSubWindows() + + def __check_can_bus(self): + """ + checks if CANBus can0 presents + :return: False if CANBus can0 is not present. + """ + ok, msg = check_can0() + print(ok, msg) + + if ok: + self.lblStatusCANBus.setStyleSheet('color: rgb(78, 154, 6);') + self.lblStatusCANBus.setText('CANBus: can0') + return ok + else: + self.lblStatusCANBus.setStyleSheet('color: rgb(239, 41, 41);') + self.lblStatusCANBus.setText('CANBus \'can0\' not found')