Index: simulator/plugins/alarms/loader.py
===================================================================
diff -u -r6f1082f52141e89d2cc6ec99688430897bfb8469 -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18
--- simulator/plugins/alarms/loader.py (.../loader.py) (revision 6f1082f52141e89d2cc6ec99688430897bfb8469)
+++ simulator/plugins/alarms/loader.py (.../loader.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18)
@@ -8,6 +8,7 @@
from dialin.squish import denaliMessages
from datetime import datetime
from dialin.common.prs_defs import AlarmPriority
+from dialin.ui.hd_simulator import HDSimulator
class Loader(DynamicLoader):
@@ -68,8 +69,9 @@
AlarmPriority.ALARM_HIGH: 'rgb(239, 41, 41)'
}
- def __init__(self):
- super().__init__(os.path.dirname(__file__))
+ def __init__(self, hd_simulator: HDSimulator):
+ super().__init__(os.path.dirname(__file__), hd_simulator)
+ print(" ---------- ", self.hd_simulator)
def _init_loader(self):
"""
Index: simulator/plugins/createtreatment/loader.py
===================================================================
diff -u -rdb5d7914d3c89371d7ce7e79dcd78626d1f06ee8 -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18
--- simulator/plugins/createtreatment/loader.py (.../loader.py) (revision db5d7914d3c89371d7ce7e79dcd78626d1f06ee8)
+++ simulator/plugins/createtreatment/loader.py (.../loader.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18)
@@ -6,6 +6,7 @@
from PySide2 import QtWidgets
from PySide2.QtCore import Slot
from dialin.squish import denaliMessages
+from dialin.ui.hd_simulator import HDSimulator
class Loader(DynamicLoader):
@@ -24,8 +25,8 @@
spnUFVolumeRejectReason: QtWidgets.QSpinBox
sldUFVolume: QtWidgets.QSlider
- def __init__(self):
- super().__init__(os.path.dirname(__file__))
+ def __init__(self, hd_simulator: HDSimulator):
+ super().__init__(os.path.dirname(__file__), hd_simulator)
def _init_loader(self):
"""
Index: simulator/plugins/heparin/loader.py
===================================================================
diff -u -rf921975179b1c1ad61d841b9db5976c00432fdcc -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18
--- simulator/plugins/heparin/loader.py (.../loader.py) (revision f921975179b1c1ad61d841b9db5976c00432fdcc)
+++ simulator/plugins/heparin/loader.py (.../loader.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18)
@@ -7,6 +7,7 @@
from PySide2.QtCore import Slot
from dialin.squish import denaliMessages
from dialin.squish.denaliMessages import txStates
+from dialin.ui.hd_simulator import HDSimulator
class Loader(DynamicLoader):
@@ -23,8 +24,9 @@
requested_state: txStates
- def __init__(self):
- super().__init__(os.path.dirname(__file__))
+ def __init__(self, hd_simulator: HDSimulator):
+ super().__init__(os.path.dirname(__file__), hd_simulator)
+ print(" ---------- ", self.hd_simulator)
self.requested_state = txStates.HEPARIN_STATE_PAUSED
def _init_loader(self):
Index: simulator/plugins/inlinebloodpressures/loader.py
===================================================================
diff -u -rf921975179b1c1ad61d841b9db5976c00432fdcc -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18
--- simulator/plugins/inlinebloodpressures/loader.py (.../loader.py) (revision f921975179b1c1ad61d841b9db5976c00432fdcc)
+++ simulator/plugins/inlinebloodpressures/loader.py (.../loader.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18)
@@ -8,6 +8,7 @@
from dialin.squish import denaliMessages
from dialin.squish.denaliMessages import txStates, EResponse
from dialin.common import Ranges
+from dialin.ui.hd_simulator import HDSimulator
class Loader(DynamicLoader):
@@ -34,8 +35,9 @@
sldArterialValue: QtWidgets.QSlider
sldVenousValue: QtWidgets.QSlider
- def __init__(self):
- super().__init__(os.path.dirname(__file__))
+ def __init__(self, hd_simulator: HDSimulator):
+ super().__init__(os.path.dirname(__file__), hd_simulator)
+ print(" ---------- ", self.hd_simulator)
self.saline_requested_state = txStates.SALINE_BOLUS_STATE_IDLE
def _init_loader(self):
Index: simulator/plugins/rinseback/interface.ui
===================================================================
diff -u
--- simulator/plugins/rinseback/interface.ui (revision 0)
+++ simulator/plugins/rinseback/interface.ui (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18)
@@ -0,0 +1,485 @@
+
+
+ ui_interface
+
+
+
+ 0
+ 0
+ 500
+ 255
+
+
+
+
+ 500
+ 255
+
+
+
+
+ 16777215
+ 255
+
+
+
+ Rinseback
+
+
+ -
+
+
-
+
+
-
+
+
+
+ 10
+
+
+
+ Accept
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ color: rgb(238, 238, 236);
+background-color: rgb(174, 64, 194);
+
+
+ Rinseback Adjustment
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 50
+ 0
+
+
+
+
+ 10
+
+
+
+ mL
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 10
+
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 50
+ 0
+
+
+
+
+ 10
+
+
+
+ reason
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 10
+
+
+
+ QFrame::StyledPanel
+
+
+ QFrame::Plain
+
+
+
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ Reject
+
+
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+ Target
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ 0
+
+
+ 300
+
+
+ 300
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+
+ 30
+ 0
+
+
+
+
+ 10
+
+
+
+ 300
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+
+ 10
+
+
+
+ color: rgb(238, 238, 236);
+background-color: rgb(174, 64, 194);
+
+
+ Rinseback Data
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Volume
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ sldCurrent
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ 0
+
+
+ 300
+
+
+ 0
+
+
+ Qt::Horizontal
+
+
+
+ -
+
+
+
+ 30
+ 0
+
+
+
+
+ 10
+
+
+
+ 0
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
+
+
+ 0
+ 0
+
+
+
+ Rate
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+ sldCurrent
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ 50
+
+
+ 150
+
+
+ 25
+
+
+ 50
+
+
+ Qt::Horizontal
+
+
+ QSlider::TicksAbove
+
+
+ 25
+
+
+
+ -
+
+
+
+ 30
+ 0
+
+
+
+
+ 10
+
+
+
+ 50
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+
+
+
+
+ -
+
+
+ Qt::Vertical
+
+
+
+ 20
+ 40
+
+
+
+
+ -
+
+
+
+ 10
+
+
+
+ color: rgb(238, 238, 236);
+background-color: rgb(174, 64, 194);
+
+
+ Rinseback
+
+
+ Qt::AlignCenter
+
+
+
+
+
+
+
+
+ sldTarget
+ valueChanged(int)
+ lblTarget
+ setNum(int)
+
+
+ 244
+ 182
+
+
+ 469
+ 184
+
+
+
+
+ sldCurrent
+ valueChanged(int)
+ lblCurrent
+ setNum(int)
+
+
+ 413
+ 202
+
+
+ 468
+ 207
+
+
+
+
+ sldRate
+ valueChanged(int)
+ lblRate
+ setNum(int)
+
+
+ 445
+ 225
+
+
+ 487
+ 226
+
+
+
+
+
Index: simulator/plugins/rinseback/loader.py
===================================================================
diff -u
--- simulator/plugins/rinseback/loader.py (revision 0)
+++ simulator/plugins/rinseback/loader.py (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18)
@@ -0,0 +1,104 @@
+"""
+The Heparin ui loader class
+"""
+import os
+from simulator.dynamicloader import DynamicLoader
+
+from PySide2 import QtWidgets
+from PySide2.QtCore import Slot
+
+from dialin.ui.hd_simulator import HDSimulator
+from dialin.ui.hd_simulator import TXStates
+
+
+class Loader(DynamicLoader):
+ """
+ The Saline Bolus ui loader class
+ """
+
+ btnAccept: QtWidgets.QPushButton
+ btnReject: QtWidgets.QPushButton
+ lblAction: QtWidgets.QLabel
+ spnRejectReason: QtWidgets.QSpinBox
+ sldTarget: QtWidgets.QSlider
+ sldCurrent: QtWidgets.QSlider
+ sldRate: QtWidgets.QSlider
+
+ requested_state: TXStates
+
+ def __init__(self, hd_simulator: HDSimulator):
+ super().__init__(os.path.dirname(__file__), hd_simulator)
+ print(" ---------- ", self.hd_simulator)
+ self.requested_state = TXStates.RINSEBACK_STOP_INIT_STATE
+
+ def _init_loader(self):
+ """
+ finds and creates widgets
+ :return: none
+ """
+ # saline adjustment
+ self.btnAccept = self.find_button('btnAccept')
+ self.btnReject = self.find_button('btnReject')
+ self.lblAction = self.find_label('lblAction')
+ self.spnRejectReason = self.find_spinbox('spnRejectReason')
+ # rinseback data
+ self.sldTarget = self.find_slider('sldTarget')
+ self.sldCurrent = self.find_slider('sldCurrent')
+ self.sldRate = self.find_slider('sldRate')
+
+ def _init_widgets(self):
+ """
+ initializes the widgets' properties
+ :return: none
+ """
+ pass
+
+ def _init_connections(self):
+ """
+ initializes the widgets connections
+ :return:
+ """
+ # saline adjustment
+ self.btnAccept.clicked.connect(self.do_accept)
+ self.btnReject.clicked.connect(self.do_reject)
+ # saline data
+ self.sldTarget.valueChanged.connect(self.do_data)
+ self.sldCurrent.valueChanged.connect(self.do_data)
+ self.sldRate.valueChanged.connect(self.do_data)
+
+ @Slot()
+ def do_accept(self):
+ """
+ the slot for accept button
+ :return: none
+ """
+ # toggle the requested state
+ # if self.requested_state == TXStates.Rinseba:
+ # self.requested_state = TXStates.HEPARIN_STATE_PAUSED
+ # else:
+ # self.requested_state = TXStates.HEPARIN_STATE_DISPENSING
+ #
+ # self.hd_simulator.setHeparinResponse(True, 0, self.requested_state)
+ # self.lblAction.setText('Accepted ')
+
+ @Slot()
+ def do_reject(self):
+ """
+ the slot for accept saline bolus button
+ :return: none
+ """
+ reason = self.spnRejectReason.value()
+ self.hd_simulator.cmd_send_treatment_adjust_rinseback_response(False, reason)
+ self.lblAction.setText('Rejected ' + "{}".format(reason))
+
+ @Slot()
+ def do_data(self):
+ """
+ the slot which is called to send the data
+ by calling the denaliMessage API cmd_send_treatment_rinseback_data
+ :return: none
+ """
+ target = self.sldTarget.value()
+ current = self.sldCurrent.value()
+ rate = self.sldRate.value()
+ self.hd_simulator.cmd_send_treatment_rinseback_data(target, current, rate)
Index: simulator/plugins/salinebolus/loader.py
===================================================================
diff -u -rf921975179b1c1ad61d841b9db5976c00432fdcc -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18
--- simulator/plugins/salinebolus/loader.py (.../loader.py) (revision f921975179b1c1ad61d841b9db5976c00432fdcc)
+++ simulator/plugins/salinebolus/loader.py (.../loader.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18)
@@ -7,6 +7,7 @@
from PySide2.QtCore import Slot
from dialin.squish import denaliMessages
from dialin.squish.denaliMessages import txStates
+from dialin.ui.hd_simulator import HDSimulator
class Loader(DynamicLoader):
@@ -25,8 +26,9 @@
saline_requested_state: txStates
- def __init__(self):
- super().__init__(os.path.dirname(__file__))
+ def __init__(self, hd_simulator: HDSimulator):
+ super().__init__(os.path.dirname(__file__), hd_simulator)
+ print(" ---------- ", self.hd_simulator)
self.saline_requested_state = txStates.SALINE_BOLUS_STATE_IDLE
def _init_loader(self):
Index: simulator/plugins/treatmentranges/interface.ui
===================================================================
diff -u -r15118be5139122e2129f00482d173d58503b338e -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18
--- simulator/plugins/treatmentranges/interface.ui (.../interface.ui) (revision 15118be5139122e2129f00482d173d58503b338e)
+++ simulator/plugins/treatmentranges/interface.ui (.../interface.ui) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18)
@@ -28,9 +28,6 @@
Broad cast
-
- true
-
-
Index: simulator/plugins/treatmentranges/loader.py
===================================================================
diff -u -rf921975179b1c1ad61d841b9db5976c00432fdcc -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18
--- simulator/plugins/treatmentranges/loader.py (.../loader.py) (revision f921975179b1c1ad61d841b9db5976c00432fdcc)
+++ simulator/plugins/treatmentranges/loader.py (.../loader.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18)
@@ -7,8 +7,8 @@
from PySide2.QtCore import QTimer
from PySide2.QtCore import Slot
from dialin.squish import denaliMessages
+from dialin.ui.hd_simulator import HDSimulator
-
class Loader(DynamicLoader):
"""
The Treatment Ranges ui loader
@@ -24,9 +24,11 @@
spnUFVolumeMax: QtWidgets.QSpinBox
sldDurationValue: QtWidgets.QSlider
- def __init__(self):
- super().__init__(os.path.dirname(__file__))
+ def __init__(self, hd_simulator: HDSimulator):
+ super().__init__(os.path.dirname(__file__), hd_simulator)
+ print(" ---------- ", self.hd_simulator)
+
def _init_loader(self):
"""
finds and creates widgets
Index: simulator/plugins/treatmentstates/interface.ui
===================================================================
diff -u -r15118be5139122e2129f00482d173d58503b338e -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18
--- simulator/plugins/treatmentstates/interface.ui (.../interface.ui) (revision 15118be5139122e2129f00482d173d58503b338e)
+++ simulator/plugins/treatmentstates/interface.ui (.../interface.ui) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18)
@@ -6,14 +6,26 @@
0
0
- 674
- 466
+ 518
+ 531
Treatment States
+
+ 6
+
+
+ 6
+
+
+ 6
+
+
+ 6
+
-
@@ -37,15 +49,23 @@
- 325
- 265
+ 275
+ 200
8
+ 50
+ false
+
+ Qt::ScrollBarAlwaysOff
+
+
+ Qt::ScrollBarAlwaysOff
+
QAbstractItemView::NoEditTriggers
@@ -55,11 +75,17 @@
QAbstractItemView::SelectRows
+
+ true
+
+
+ false
+
true
- 300
+ 260
true
@@ -110,21 +136,6 @@
7
-
-
- 8
-
-
-
-
- 9
-
-
-
-
- 10
-
-
Treatment States (subMode)
@@ -137,51 +148,36 @@
-
- TREATMENT_DIALYSIS_STATE
+ TREATMENT_BLOOD_PRIME_STATE
-
- TREATMENT_STOP_STATE
+ TREATMENT_DIALYSIS_STATE
-
- TREATMENT_RINSEBACK_STATE
+ TREATMENT_STOP_STATE
-
- TREATMENT_RINSEBACK_PAUSE_STATE
+ TREATMENT_RINSEBACK_STATE
-
- TREATMENT_RECIRC_SETUP_STATE
+ TREATMENT_RECIRC_STATE
-
- TREATMENT_RECIRC_STATE
+ TREATMENT_DIALYSIS_END_STATE
-
- TREATMENT_RECIRC_PAUSE_STATE
-
-
- -
-
- TREATMENT_RECIRC_STOP_STATE
-
-
- -
-
- TREATMENT_DIALYSIS_END_STATE
-
-
- -
-
TREATMENT_END_STATE
@@ -191,15 +187,21 @@
- 325
- 225
+ 200
+ 170
8
+
+ Qt::ScrollBarAlwaysOff
+
+
+ Qt::ScrollBarAlwaysOff
+
QAbstractItemView::NoEditTriggers
@@ -209,11 +211,14 @@
QAbstractItemView::SelectRows
+
+ false
+
true
- 300
+ 210
21
@@ -279,7 +284,7 @@
- 310
+ 275
100
@@ -288,6 +293,12 @@
8
+
+ Qt::ScrollBarAlwaysOff
+
+
+ Qt::ScrollBarAlwaysOff
+
QAbstractItemView::NoEditTriggers
@@ -297,11 +308,14 @@
QAbstractItemView::SelectRows
+
+ false
+
true
- 300
+ 260
21
@@ -360,7 +374,7 @@
- 325
+ 225
155
@@ -369,6 +383,12 @@
8
+
+ Qt::ScrollBarAlwaysOff
+
+
+ Qt::ScrollBarAlwaysOff
+
QAbstractItemView::NoEditTriggers
@@ -378,11 +398,14 @@
QAbstractItemView::SelectRows
+
+ false
+
true
- 300
+ 210
21
@@ -457,6 +480,176 @@
+ -
+
+
+
+ 275
+ 130
+
+
+
+
+ 8
+
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ QAbstractItemView::NoEditTriggers
+
+
+ QAbstractItemView::SingleSelection
+
+
+ QAbstractItemView::SelectRows
+
+
+ false
+
+
+ true
+
+
+ 260
+
+
+ 21
+
+
+
+ 0
+
+
+
+
+ 1
+
+
+
+
+ 2
+
+
+
+
+ 3
+
+
+
+
+ 4
+
+
+
+
+ Rinseback States
+
+
+ -
+
+ RINSEBACK_STOP_INIT_STATE
+
+
+ ItemIsSelectable|ItemIsEnabled
+
+
+ -
+
+ RINSEBACK_RUN_STATE
+
+
+ -
+
+ RINSEBACK_PAUSED_STATE
+
+
+ -
+
+ RINSEBACK_STOP_STATE
+
+
+ -
+
+ RINSEBACK_RUN_ADDITIONAL_STATE
+
+
+
+
+ -
+
+
+
+ 225
+ 100
+
+
+
+
+ 8
+
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ Qt::ScrollBarAlwaysOff
+
+
+ QAbstractItemView::NoEditTriggers
+
+
+ QAbstractItemView::SingleSelection
+
+
+ QAbstractItemView::SelectRows
+
+
+ false
+
+
+ true
+
+
+ 210
+
+
+ 21
+
+
+
+ 0
+
+
+
+
+ 1
+
+
+
+
+ Recirculate States
+
+
+ -
+
+ TREATMENT_RECIRC_RECIRC_STATE
+
+
+ ItemIsSelectable|ItemIsEnabled
+
+
+ -
+
+ TREATMENT_RECIRC_STOPPED_STATE
+
+
+
+
Index: simulator/plugins/treatmentstates/loader.py
===================================================================
diff -u -rf921975179b1c1ad61d841b9db5976c00432fdcc -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18
--- simulator/plugins/treatmentstates/loader.py (.../loader.py) (revision f921975179b1c1ad61d841b9db5976c00432fdcc)
+++ simulator/plugins/treatmentstates/loader.py (.../loader.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18)
@@ -2,13 +2,15 @@
The Ultrafiltration ui loader
"""
import os
-from simulator.dynamicloader import DynamicLoader
+
from PySide2 import QtWidgets
from PySide2.QtCore import Slot
-from dialin.squish import denaliMessages
-from dialin.squish.denaliMessages import txStates
+from simulator.dynamicloader import DynamicLoader
+from dialin.ui.hd_simulator import TXStates
+from dialin.ui.hd_simulator import HDSimulator
+
class Loader(DynamicLoader):
"""
The Ultrafiltration ui loader
@@ -17,9 +19,12 @@
tblUFStates: QtWidgets.QTableWidget
tblSalineStates: QtWidgets.QTableWidget
tblHeparinStates: QtWidgets.QTableWidget
+ tblRinsebackStates: QtWidgets.QTableWidget
+ tblRecirculateStates: QtWidgets.QTableWidget
- def __init__(self):
- super().__init__(os.path.dirname(__file__))
+ def __init__(self, hd_simulator: HDSimulator):
+ super().__init__(os.path.dirname(__file__), hd_simulator)
+ print(" ---------- ", self.hd_simulator)
def _init_loader(self):
"""
@@ -30,6 +35,8 @@
self.tblUFStates = self.find_table_widget('tblUFStates')
self.tblSalineStates = self.find_table_widget('tblSalineStates')
self.tblHeparinStates = self.find_table_widget('tblHeparinStates')
+ self.tblRinsebackStates = self.find_table_widget('tblRinsebackStates')
+ self.tblRecirculateStates = self.find_table_widget('tblRecirculateStates')
def _init_connections(self):
"""
@@ -40,27 +47,33 @@
self.tblUFStates.cellClicked.connect(self.do_treatment_states)
self.tblSalineStates.cellClicked.connect(self.do_treatment_states)
self.tblHeparinStates.cellClicked.connect(self.do_treatment_states)
+ self.tblRinsebackStates.cellClicked.connect(self.do_treatment_states)
+ self.tblRecirculateStates.cellClicked.connect(self.do_treatment_states)
# apply/send the initial states
- self.do_treatment_states()
+ # self.do_treatment_states()
def _init_widgets(self):
"""
initializes the widgets' properties
:return: none
"""
- self.tblSubMode.setCurrentCell(txStates.TREATMENT_DIALYSIS_STATE, 0)
- self.tblUFStates.setCurrentCell(txStates.UF_OFF_STATE, 0)
- self.tblSalineStates.setCurrentCell(txStates.SALINE_BOLUS_STATE_IDLE, 0)
- self.tblHeparinStates.setCurrentCell(txStates.HEPARIN_STATE_OFF, 0)
+ self.tblSubMode.setCurrentCell(TXStates.TREATMENT_DIALYSIS_STATE, 0)
+ self.tblUFStates.setCurrentCell(TXStates.UF_OFF_STATE, 0)
+ self.tblSalineStates.setCurrentCell(TXStates.SALINE_BOLUS_STATE_IDLE, 0)
+ self.tblHeparinStates.setCurrentCell(TXStates.HEPARIN_STATE_OFF, 0)
+ self.tblRinsebackStates.setCurrentCell(TXStates.HEPARIN_STATE_OFF, 0)
+ self.tblRecirculateStates.setCurrentCell(TXStates.TREATMENT_RECIRC_STOPPED_STATE, 0)
@Slot()
def do_treatment_states(self):
"""
the slot for saline bolus state change
:return: none
"""
- sub_mode = self.tblSubMode.verticalHeaderItem(self.tblSubMode.currentRow()).text()
- uf_state = self.tblUFStates.verticalHeaderItem(self.tblUFStates.currentRow()).text()
- saline = self.tblSalineStates.verticalHeaderItem(self.tblSalineStates.currentRow()).text()
- heparin = self.tblHeparinStates.verticalHeaderItem(self.tblHeparinStates.currentRow()).text()
- denaliMessages.setTreatmentStatesData(sub_mode, uf_state, saline, heparin)
+ sub_mode = int(self.tblSubMode.verticalHeaderItem(self.tblSubMode.currentRow()).text())
+ uf_state = int(self.tblUFStates.verticalHeaderItem(self.tblUFStates.currentRow()).text())
+ saline = int(self.tblSalineStates.verticalHeaderItem(self.tblSalineStates.currentRow()).text())
+ heparin = int(self.tblHeparinStates.verticalHeaderItem(self.tblHeparinStates.currentRow()).text())
+ rinseback = int(self.tblHeparinStates.verticalHeaderItem(self.tblRinsebackStates.currentRow()).text())
+ recirculate = int(self.tblHeparinStates.verticalHeaderItem(self.tblRecirculateStates.currentRow()).text())
+ self.hd_simulator.cmd_set_treatment_states_data(sub_mode, uf_state, saline, heparin, rinseback, recirculate)
Index: simulator/plugins/ultrafiltration/loader.py
===================================================================
diff -u -r9206e36aeff354823f2c37103d79f548221cd64c -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18
--- simulator/plugins/ultrafiltration/loader.py (.../loader.py) (revision 9206e36aeff354823f2c37103d79f548221cd64c)
+++ simulator/plugins/ultrafiltration/loader.py (.../loader.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18)
@@ -7,6 +7,7 @@
from PySide2.QtCore import Slot
from dialin.squish import denaliMessages
from dialin.squish.denaliMessages import txStates, EResponse
+from dialin.ui.hd_simulator import HDSimulator
class Loader(DynamicLoader):
@@ -31,8 +32,9 @@
spnUfResumeRejectReason: QtWidgets.QSpinBox
sldUfVolume: QtWidgets.QSlider
- def __init__(self):
- super().__init__(os.path.dirname(__file__))
+ def __init__(self, hd_simulator: HDSimulator):
+ super().__init__(os.path.dirname(__file__), hd_simulator)
+ print(" ---------- ", self.hd_simulator)
def _init_loader(self):
"""
Index: simulator/run.py
===================================================================
diff -u -r69b2aacf31c5fdc28e078f87dbdee5c3ab672dd1 -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18
--- simulator/run.py (.../run.py) (revision 69b2aacf31c5fdc28e078f87dbdee5c3ab672dd1)
+++ simulator/run.py (.../run.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18)
@@ -6,6 +6,7 @@
from dialin.squish import utils
from PySide2 import QtCore, QtWidgets
from simulator.loader import Simulator
+from dialin.ui.hd_simulator import HDSimulator
def main():
@@ -21,12 +22,26 @@
simulator = Simulator()
simulator.show()
+ hd_simulator_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:
+ print("HDSimulator number of instances is ", HDSimulator.instanceCount)
+
+
if __name__ == "__main__":
QtCore.QCoreApplication.setAttribute(QtCore.Qt.AA_ShareOpenGLContexts)
main()
Index: simulator/simulator/diality-logo.jpg
===================================================================
diff -u
Binary files differ
Index: simulator/simulator/dynamicloader.py
===================================================================
diff -u -rf921975179b1c1ad61d841b9db5976c00432fdcc -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18
--- simulator/simulator/dynamicloader.py (.../dynamicloader.py) (revision f921975179b1c1ad61d841b9db5976c00432fdcc)
+++ simulator/simulator/dynamicloader.py (.../dynamicloader.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18)
@@ -20,12 +20,13 @@
loader: QUiLoader
window: QtWidgets.QWidget
- hd_simulator: HDSimulator
+ hd_simulator: HDSimulator = None
- def __init__(self, location: str):
+ def __init__(self, location: str, hd_simulator: HDSimulator):
super().__init__(None)
self.location = location
self.loader = QUiLoader()
+ self.hd_simulator = hd_simulator
self.__load_ui()
self._init_loader()
self._init_widgets()
Index: simulator/simulator/interface.ui
===================================================================
diff -u -r9206e36aeff354823f2c37103d79f548221cd64c -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18
--- simulator/simulator/interface.ui (.../interface.ui) (revision 9206e36aeff354823f2c37103d79f548221cd64c)
+++ simulator/simulator/interface.ui (.../interface.ui) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18)
@@ -6,8 +6,8 @@
0
0
- 451
- 298
+ 837
+ 556
@@ -30,9 +30,6 @@
0
- -
-
-
-
@@ -89,14 +86,27 @@
+ -
+
+
+
+
+ 20
+ 49
+ 76
+
+
+
+
+
-
+
+
+
actionCascade
Index: simulator/simulator/loader.py
===================================================================
diff -u -rf921975179b1c1ad61d841b9db5976c00432fdcc -r1779b6711f3791e8bf570e06ddb4c2e7d2a52e18
--- simulator/simulator/loader.py (.../loader.py) (revision f921975179b1c1ad61d841b9db5976c00432fdcc)
+++ simulator/simulator/loader.py (.../loader.py) (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18)
@@ -31,10 +31,9 @@
plugins = []
def __init__(self):
- super().__init__(os.path.dirname(__file__))
+ super().__init__(os.path.dirname(__file__), HDSimulator())
self.saline_requested_state = txStates.SALINE_BOLUS_STATE_IDLE
if self.__check_can_bus():
- self.__hd_simulator = HDSimulator()
self.__init_plugins()
self.__init_actions()
@@ -65,7 +64,7 @@
# from within the __init__.py in the plugins folder
# folders with '__' and '.' have been ignored.
for plugin in available_plugins:
- self.__register_plugin(eval(plugin + '()'))
+ self.__register_plugin(eval(plugin)(self.hd_simulator))
def __init_actions(self):
"""
@@ -95,7 +94,6 @@
:param obj: the plugin object
:return: False if the passed obj is None
"""
- obj.hd_simulator = self.__hd_simulator
self.plugins.append(obj)
wgt = obj.window
sub = self.mdiArea.addSubWindow(wgt)
Index: simulator/simulator/resources.qrc
===================================================================
diff -u
--- simulator/simulator/resources.qrc (revision 0)
+++ simulator/simulator/resources.qrc (revision 1779b6711f3791e8bf570e06ddb4c2e7d2a52e18)
@@ -0,0 +1,5 @@
+
+
+ diality-logo.jpg
+
+