Index: simulator/plugins/disinfection/interface.ui
===================================================================
diff -u
--- simulator/plugins/disinfection/interface.ui (revision 0)
+++ simulator/plugins/disinfection/interface.ui (revision e25c762014f029632c278b0b324b05f353ea8986)
@@ -0,0 +1,823 @@
+
+
+ ui_interface
+
+
+
+ 0
+ 0
+ 392
+ 406
+
+
+
+ &5 Post-Treatment/&1 Disinfection
+
+
+ -
+
+
+
+ 10
+
+
+
+ color: rgb(238, 238, 236);
+background-color: rgb(78, 157, 236);
+
+
+ Disinfection
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
-
+
+
+
+ 10
+
+
+
+ Reject
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 50
+ 0
+
+
+
+
+ 10
+
+
+
+ reason
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ Accept
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 10
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 10
+
+
+
+ color: rgb(238, 238, 236);
+background-color: rgb(78, 157, 236);
+
+
+ Disinfect Response
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 10
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Plain
+
+
+
+
+
+
+
+
+ -
+
+
-
+
+
+
+ 10
+
+
+
+ Reject
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 50
+ 0
+
+
+
+
+ 10
+
+
+
+ reason
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ Accept
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 10
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 10
+
+
+
+ color: rgb(238, 238, 236);
+background-color: rgb(78, 157, 236);
+
+
+ Chemical Confirm Response
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 10
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Plain
+
+
+
+
+
+
+
+
+ -
+
+
-
+
+
+
+ 10
+
+
+
+ 0
+
+
+ 600
+
+
+ 600
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 10
+
+
+
+ color: rgb(238, 238, 236);
+background-color: rgb(78, 157, 236);
+
+
+ Flush Timeout
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 30
+ 0
+
+
+
+
+ 10
+
+
+
+ 600
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ CountDown
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 30
+ 0
+
+
+
+
+ 10
+
+
+
+ 600
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Total
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ 0
+
+
+ 600
+
+
+ 600
+
+
+ Qt::Horizontal
+
+
+
+
+
+ -
+
+
-
+
+
+
+ 10
+
+
+
+ 0
+
+
+ 600
+
+
+ 600
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 10
+
+
+
+ color: rgb(238, 238, 236);
+background-color: rgb(78, 157, 236);
+
+
+ Heat Timeout
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 30
+ 0
+
+
+
+
+ 10
+
+
+
+ 600
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ CountDown
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 30
+ 0
+
+
+
+
+ 10
+
+
+
+ 600
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Total
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ 0
+
+
+ 600
+
+
+ 600
+
+
+ Qt::Horizontal
+
+
+
+
+
+ -
+
+
-
+
+
+
+ 10
+
+
+
+ 0
+
+
+ 600
+
+
+ 600
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 10
+
+
+
+ color: rgb(238, 238, 236);
+background-color: rgb(78, 157, 236);
+
+
+ Chemical Timeout
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 30
+ 0
+
+
+
+
+ 10
+
+
+
+ 600
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ CountDown
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 30
+ 0
+
+
+
+
+ 10
+
+
+
+ 600
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Total
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ 0
+
+
+ 600
+
+
+ 600
+
+
+ Qt::Horizontal
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+
+
+
+
+
+ sldTimeoutCountDownFlush
+ valueChanged(int)
+ lblCurrentFlush
+ setNum(int)
+
+
+ 345
+ 248
+
+
+ 381
+ 249
+
+
+
+
+ sldTimeoutTotalFlush
+ valueChanged(int)
+ lblTargetFlush
+ setNum(int)
+
+
+ 345
+ 225
+
+
+ 381
+ 226
+
+
+
+
+ sldTimeoutTotalHeat
+ valueChanged(int)
+ lblTargetHeat
+ setNum(int)
+
+
+ 306
+ 289
+
+
+ 375
+ 291
+
+
+
+
+ sldTimeoutCountDownHeat
+ valueChanged(int)
+ lblCurrentHeat
+ setNum(int)
+
+
+ 302
+ 314
+
+
+ 357
+ 316
+
+
+
+
+ sldTimeoutTotalChemical
+ valueChanged(int)
+ lblTargetChemical
+ setNum(int)
+
+
+ 314
+ 359
+
+
+ 364
+ 359
+
+
+
+
+ sldTimeoutCountDownChemical
+ valueChanged(int)
+ lblCurrentChemical
+ setNum(int)
+
+
+ 332
+ 381
+
+
+ 360
+ 380
+
+
+
+
+
Index: simulator/plugins/disinfection/loader.py
===================================================================
diff -u
--- simulator/plugins/disinfection/loader.py (revision 0)
+++ simulator/plugins/disinfection/loader.py (revision e25c762014f029632c278b0b324b05f353ea8986)
@@ -0,0 +1,171 @@
+"""
+The Heparin 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 dialin.ui.hd_simulator import HDSimulator, TXStates
+# plugin specific
+# -- none --
+
+
+class Loader(DynamicLoader):
+ """
+ The Saline Bolus ui loader class
+ """
+
+ btnAcceptDisinfect: QtWidgets.QPushButton
+ btnRejectDisinfect: QtWidgets.QPushButton
+ spnReasonDisinfect: QtWidgets.QSpinBox
+ lblActionDisinfect: QtWidgets.QLabel
+
+ btnAcceptChemical: QtWidgets.QPushButton
+ btnRejectChemical: QtWidgets.QPushButton
+ spnReasonChemical: QtWidgets.QSpinBox
+ lblActionChemical: QtWidgets.QLabel
+
+ sldTimeoutTotalFlush: QtWidgets.QSlider
+ sldTimeoutCountDownFlush: QtWidgets.QSlider
+
+ sldTimeoutTotalHeat: QtWidgets.QSlider
+ sldTimeoutCountDownHeat: QtWidgets.QSlider
+
+ sldTimeoutTotalChemical: QtWidgets.QSlider
+ sldTimeoutCountDownChemical: QtWidgets.QSlider
+
+ def __init__(self, hd_simulator: HDSimulator):
+ super().__init__(os.path.dirname(__file__), hd_simulator)
+
+ def _init_loader(self):
+ """
+ finds and creates widgets
+ :return: none
+ """
+ self.btnAcceptDisinfect = self.find_button('btnAcceptDisinfect')
+ self.btnRejectDisinfect = self.find_button('btnRejectDisinfect')
+ self.spnReasonDisinfect = self.find_spinbox('spnReasonDisinfect')
+ self.lblActionDisinfect = self.find_label('lblActionDisinfect')
+
+ self.btnAcceptChemical = self.find_button('btnAcceptChemical')
+ self.btnRejectChemical = self.find_button('btnRejectChemical')
+ self.spnReasonChemical = self.find_spinbox('spnReasonChemical')
+ self.lblActionChemical = self.find_label('lblActionChemical')
+
+ self.sldTimeoutTotalFlush = self.find_slider('sldTimeoutTotalFlush')
+ self.sldTimeoutCountDownFlush = self.find_slider('sldTimeoutCountDownFlush')
+
+ self.sldTimeoutTotalHeat = self.find_slider('sldTimeoutTotalHeat')
+ self.sldTimeoutCountDownHeat = self.find_slider('sldTimeoutCountDownHeat')
+
+ self.sldTimeoutTotalChemical = self.find_slider('sldTimeoutTotalChemical')
+ self.sldTimeoutCountDownChemical = self.find_slider('sldTimeoutCountDownChemical')
+
+ def _init_widgets(self):
+ """
+ initializes the widgets' properties
+ :return: none
+ """
+ pass
+
+ def _init_connections(self):
+ """
+ initializes the widgets connections
+ :return:
+ """
+ self.btnAcceptDisinfect.clicked.connect(self.do_accept_disinfect)
+ self.btnRejectDisinfect.clicked.connect(self.do_reject_disinfect)
+
+ self.btnAcceptChemical.clicked.connect(self.do_accept_chemical)
+ self.btnRejectChemical.clicked.connect(self.do_reject_chemical)
+
+ self.sldTimeoutTotalFlush.valueChanged.connect(self.do_data_flush)
+ self.sldTimeoutCountDownFlush.valueChanged.connect(self.do_data_flush)
+
+ self.sldTimeoutTotalHeat.valueChanged.connect(self.do_data_heat)
+ self.sldTimeoutCountDownHeat.valueChanged.connect(self.do_data_heat)
+
+ self.sldTimeoutTotalChemical.valueChanged.connect(self.do_data_chemical)
+ self.sldTimeoutCountDownChemical.valueChanged.connect(self.do_data_chemical)
+
+ @Slot()
+ def do_accept_disinfect(self):
+ """
+ the slot for accept button
+ :return: none
+ """
+ # The FW enums have not been defined yet so put the msg here only to test, later shall be moved to a common file
+ self.hd_simulator.cmd_send_general_response(128, True, 0)
+ self.lblAction.setText('Accepted ')
+
+ @Slot()
+ def do_reject_disinfect(self):
+ """
+ the slot for reject button
+ :return: none
+ """
+ reason = self.spnReasonDisinfect.value()
+ # The FW enums have not been defined yet so put the msg here only to test, later shall be moved to a common file
+ self.hd_simulator.cmd_send_general_response(128, False, reason)
+ self.lblActionDisinfect.setText('Rejected ' + "{}".format(reason))
+
+ @Slot()
+ def do_accept_chemical(self):
+ """
+ the slot for accept button
+ :return: none
+ """
+ # The FW enums have not been defined yet so put the msg here only to test, later shall be moved to a common file
+ self.hd_simulator.cmd_send_general_response(130, True, 0)
+ self.lblAction.setText('Accepted ')
+
+ @Slot()
+ def do_reject_chemical(self):
+ """
+ the slot for reject button
+ :return: none
+ """
+ reason = self.spnReasonDisinfect.value()
+ # The FW enums have not been defined yet so put the msg here only to test, later shall be moved to a common file
+ self.hd_simulator.cmd_send_general_response(130, False, reason)
+ self.lblActionDisinfect.setText('Rejected ' + "{}".format(reason))
+
+ @Slot()
+ def do_data_flush(self):
+ """
+ the slot which is called to send the data
+ by calling the denaliMessage API cmd_send_treatment_recirculate_data
+ :return: none
+ """
+ timeout_total = self.sldTimeoutTotalFlush.value()
+ timeout_countdown = self.sldTimeoutCountDownFlush.value()
+ # The FW enums have not been defined yet so put the msg here only to test, later shall be moved to a common file
+ self.hd_simulator.cmd_send_general_progress_data(131, timeout_total, timeout_countdown, False)
+
+ @Slot()
+ def do_data_heat(self):
+ """
+ the slot which is called to send the data
+ by calling the denaliMessage API cmd_send_treatment_recirculate_data
+ :return: none
+ """
+ timeout_total = self.sldTimeoutTotalHeat.value()
+ timeout_countdown = self.sldTimeoutCountDownHeat.value()
+ # The FW enums have not been defined yet so put the msg here only to test, later shall be moved to a common file
+ self.hd_simulator.cmd_send_general_progress_data(132, timeout_total, timeout_countdown, False)
+
+ @Slot()
+ def do_data_chemical(self):
+ """
+ the slot which is called to send the data
+ by calling the denaliMessage API cmd_send_treatment_recirculate_data
+ :return: none
+ """
+ timeout_total = self.sldTimeoutTotalChemical.value()
+ timeout_countdown = self.sldTimeoutCountDownChemical.value()
+ # The FW enums have not been defined yet so put the msg here only to test, later shall be moved to a common file
+ self.hd_simulator.cmd_send_general_progress_data(133, timeout_total, timeout_countdown, False)
Index: simulator/plugins/disinfectionstates/interface.ui
===================================================================
diff -u
--- simulator/plugins/disinfectionstates/interface.ui (revision 0)
+++ simulator/plugins/disinfectionstates/interface.ui (revision e25c762014f029632c278b0b324b05f353ea8986)
@@ -0,0 +1,771 @@
+
+
+ ui_interface
+
+
+
+ 0
+ 0
+ 726
+ 669
+
+
+
+ &1 States/&4 DG Disinfection Mode
+
+
+ -
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 10
+
+
+
+ color: rgb(238, 238, 236);
+background-color: rgb(78, 157, 236);
+
+
+ Disinfection
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+ reset
+
+
+
+ -
+
+
+ Send
+
+
+
+
+
+ -
+
+
-
+
+
+
+ 320
+ 95
+
+
+
+
+ 8
+ 50
+ false
+
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ QAbstractItemView::NoEditTriggers
+
+
+ true
+
+
+ QAbstractItemView::SingleSelection
+
+
+ QAbstractItemView::SelectRows
+
+
+ true
+
+
+ false
+
+
+ 3
+
+
+ 2
+
+
+ true
+
+
+ 125
+
+
+ true
+
+
+ true
+
+
+ 18
+
+
+ 21
+
+
+
+ 0
+
+
+
+
+ 1
+
+
+
+
+ 2
+
+
+
+
+ HD OP Mode
+
+
+
+
+ Description
+
+
+ -
+
+ DG_DISINFECT_FLUSH
+
+
+ -
+
+ Disinfect Flush Mode
+
+
+ -
+
+ DG_DISINFECT_HEAT
+
+
+ -
+
+ Disinfect Heat Mode
+
+
+ -
+
+ DG_DISINFECT_CHEM
+
+
+ -
+
+ Disinfect Chenical Mode
+
+
+
+
+ -
+
+
+
+ 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
+
+
+
+ Flush
+
+
+
+
+ Description
+
+
+
+
+ -
+
+
+
+ 350
+ 510
+
+
+
+
+ 8
+ 50
+ false
+
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ QAbstractItemView::NoEditTriggers
+
+
+ true
+
+
+ QAbstractItemView::SingleSelection
+
+
+ QAbstractItemView::SelectRows
+
+
+ true
+
+
+ false
+
+
+ 23
+
+
+ 2
+
+
+ true
+
+
+ 330
+
+
+ true
+
+
+ true
+
+
+ 18
+
+
+ 21
+
+
+
+ 0
+
+
+
+
+ 1
+
+
+
+
+ 2
+
+
+
+
+ 3
+
+
+
+
+ 4
+
+
+
+
+ 5
+
+
+
+
+ 6
+
+
+
+
+ 7
+
+
+
+
+ 8
+
+
+
+
+ 9
+
+
+
+
+ 10
+
+
+
+
+ 11
+
+
+
+
+ 12
+
+
+
+
+ 13
+
+
+
+
+ 14
+
+
+
+
+ 15
+
+
+
+
+ 16
+
+
+
+
+ 17
+
+
+
+
+ 18
+
+
+
+
+ 19
+
+
+
+
+ 20
+
+
+
+
+ 21
+
+
+
+
+ 22
+
+
+
+
+ Heat
+
+
+
+
+ Description
+
+
+ -
+
+ DG_HEAT_DISINFECT_STATE_START
+
+
+ -
+
+ Heat disinfect, start mode state
+
+
+ -
+
+ DG_HEAT_DISINFECT_STATE_DRAIN_R1
+
+
+ -
+
+ Heat disinfect, drain R1 state
+
+
+ -
+
+ DG_HEAT_DISINFECT_STATE_DRAIN_R2
+
+
+ -
+
+ Heat disinfect, drain R2 state
+
+
+ -
+
+ DG_HEAT_DISINFECT_STATE_FLUSH_DRAIN
+
+
+ -
+
+ Heat disinfect, flush drain state
+
+
+ -
+
+ DG_HEAT_DISINFECT_STATE_FLUSH_CIRCULATION
+
+
+ -
+
+ Heat disinfect, flush circulation state
+
+
+ -
+
+ DG_HEAT_DISINFECT_STATE_FLUSH_R1_AND_R2
+
+
+ -
+
+ Heat disinfect, flush R1 and R2 state
+
+
+ -
+
+ DG_HEAT_DISINFECT_STATE_FLUSH_R2_AND_DRAIN_R1
+
+
+ -
+
+ Heat disinfect, flush R2 and drain R1 state
+
+
+ -
+
+ DG_HEAT_DISINFECT_STATE_FLUSH_DRAIN_R2
+
+
+ -
+
+ Heat disinfect, flush drain R2 state
+
+
+ -
+
+ DG_HEAT_DISINFECT_STATE_FLUSH_DRAIN_R1
+
+
+ -
+
+ Heat disinfect, flush drain R1 state
+
+
+ -
+
+ DG_HEAT_DISINFECT_STATE_FILL_WITH_WATER
+
+
+ -
+
+ Heat disinfect, fill with water state
+
+
+ -
+
+ DG_HEAT_DISINFECT_STATE_DISINFECT_R1_TO_R2
+
+
+ -
+
+ Heat disinfect, disinfect R1 to R2 state
+
+
+ -
+
+ DG_HEAT_DISINFECT_STATE_FILL_R2_WITH_HOT_WATER
+
+
+ -
+
+ Heat disinfect, fill R2 with hot water state
+
+
+ -
+
+ DG_HEAT_DISINFECT_STATE_DISINFECT_R2_TO_R1
+
+
+ -
+
+ Heat disinfect, disinfect R2 to R1 state
+
+
+ -
+
+ DG_HEAT_DISINFECT_STATE_COOL_DOWN_HEATERS
+
+
+ -
+
+ 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
+
+
+
+
+ 8
+ 50
+ false
+
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ QAbstractItemView::NoEditTriggers
+
+
+ true
+
+
+ QAbstractItemView::SingleSelection
+
+
+ QAbstractItemView::SelectRows
+
+
+ true
+
+
+ false
+
+
+ 0
+
+
+ 2
+
+
+ true
+
+
+ 330
+
+
+ true
+
+
+ true
+
+
+ 18
+
+
+ 21
+
+
+
+ Chemical
+
+
+
+
+ Description
+
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 3
+
+
+
+
+
+
+
+
+
Index: simulator/plugins/disinfectionstates/loader.py
===================================================================
diff -u
--- simulator/plugins/disinfectionstates/loader.py (revision 0)
+++ simulator/plugins/disinfectionstates/loader.py (revision e25c762014f029632c278b0b324b05f353ea8986)
@@ -0,0 +1,82 @@
+"""
+ The HD Op Mode ui loader
+"""
+# Python
+import os
+# Qt
+from PySide2 import QtWidgets
+from PySide2.QtCore import Slot
+# parent
+from simulator.dynamicloader import DynamicLoader
+# hd Simulator
+from dialin.ui.hd_simulator import HDSimulator
+# plugin specific
+from dialin.common.hd_defs import HDDefs
+from dialin.common.hd_defs import HD_Standby_States
+
+
+class Loader(DynamicLoader):
+ """
+ The HD Op Mode ui loader
+ """
+ tbReset: QtWidgets.QToolButton
+ tbSend: QtWidgets.QToolButton
+ tblSubMode: QtWidgets.QTableWidget
+ tblFlushMode: QtWidgets.QTableWidget
+ tblHeatMode: QtWidgets.QTableWidget
+ tblChemicalMode: QtWidgets.QTableWidget
+
+ def __init__(self, hd_simulator: HDSimulator):
+ super().__init__(os.path.dirname(__file__), hd_simulator)
+
+ 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.tblSubMode = self.find_table_widget('tblSubMode')
+ self.tblFlushMode = self.find_table_widget('tblFlushMode')
+ self.tblHeatMode = self.find_table_widget('tblHeatMode')
+ self.tblChemicalMode = self.find_table_widget('tblChemicalMode')
+
+ def _init_connections(self):
+ """
+ initializes the widgets connections
+ :return: none
+ """
+ self.tbReset.clicked.connect(self._init_widgets)
+ self.tbSend.clicked.connect(self.do_disinfect_states)
+ self.tblSubMode.currentCellChanged.connect(self.do_disinfect_states)
+ self.tblFlushMode.currentCellChanged.connect(self.do_disinfect_states)
+ self.tblHeatMode.currentCellChanged.connect(self.do_disinfect_states)
+ self.tblChemicalMode.currentCellChanged.connect(self.do_disinfect_states)
+
+ @Slot()
+ def _init_widgets(self):
+ """
+ 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
+
+ @Slot()
+ def do_disinfect_states(self):
+ """
+ the slot for state change
+ :return: none
+ """
+ sub_mode = int(self.tblSubMode.verticalHeaderItem(self.tblSubMode.currentRow()).text())
+ flush_mode = 0 # 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(
+ sub_mode,
+ flush_mode,
+ heat_mode,
+ chemical_mode
+ )