Index: TD_OpMode/loader.py
===================================================================
diff -u -r9307b8315113adb7ad1823a19d58df6ea7e4ef8b -rb8705aa1e0402a49cc266c642facb833888116bd
--- TD_OpMode/loader.py (.../loader.py) (revision 9307b8315113adb7ad1823a19d58df6ea7e4ef8b)
+++ TD_OpMode/loader.py (.../loader.py) (revision b8705aa1e0402a49cc266c642facb833888116bd)
@@ -12,7 +12,7 @@
from engine.dynamicloader import DynamicLoader
# plugin specific
-from leahi_dialin.common.td_defs import td_enum_repository as TD_Defs
+from leahi_dialin.common.td_defs import TDOpModes, TDStandbyStates
# dialin
from leahi_dialin.ui.td_messaging import TD_Messaging
@@ -54,9 +54,9 @@
initializes the widgets' properties
:return: none
"""
- self.tblOpMode.setCurrentCell(TD_Defs.TDOpModes.MODE_INIT.value, 0)
+ self.tblOpMode.setCurrentCell(TDOpModes.MODE_INIT.value, 0)
self.tblOpMode.horizontalHeaderItem(0).setTextAlignment(QtCore.Qt.AlignLeft)
- self.tblSubMode.setCurrentCell(TD_Defs.TDStandbyStates.STANDBY_START_STATE.value, 0)
+ self.tblSubMode.setCurrentCell(TDStandbyStates.STANDBY_START_STATE.value, 0)
self.tblSubMode.horizontalHeaderItem(0).setTextAlignment(QtCore.Qt.AlignLeft)
@Slot()
Index: TD_Pressures/interface.ui
===================================================================
diff -u -r767c7999a57c41783d0269ec5ba296caf5278295 -rb8705aa1e0402a49cc266c642facb833888116bd
--- TD_Pressures/interface.ui (.../interface.ui) (revision 767c7999a57c41783d0269ec5ba296caf5278295)
+++ TD_Pressures/interface.ui (.../interface.ui) (revision b8705aa1e0402a49cc266c642facb833888116bd)
@@ -6,8 +6,8 @@
0
0
- 761
- 338
+ 718
+ 273
@@ -27,68 +27,73 @@
-
-
-
- 2
+
+
+
+ 0
+ 0
+
-
-
-
-
-
- 0
- 0
-
-
-
-
- 352
- 0
-
-
-
-
- 10
-
-
-
- color: rgb(238, 238, 236);
+
+
+ 352
+ 0
+
+
+
+
+ 10
+
+
+
+ color: rgb(238, 238, 236);
background-color: rgb(139, 59, 59);
-
-
- 36 : [0x2400] : TD Pressures
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
- Send
-
-
-
- -
-
-
- reset
-
-
-
-
+
+
+ 36 : [0x2400] : TD Pressures
+
+
+ Qt::AlignCenter
+
+
- -
+
-
+
+
+ Send
+
+
+
+ -
+
+
+ reset
+
+
+
+ -
-
QLayout::SetFixedSize
+
-
+
+
+
+ 10
+
+
+
+ Qt::Vertical
+
+
+
-
-
-
-
+
-
+
0
@@ -107,15 +112,15 @@
- Low
+ 0
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
- -
-
+
-
+
0
@@ -128,19 +133,37 @@
0
+
+
+ 10
+
+
- Value
+ Low
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
- sldArterialValue
+
+
+ -
+
+
+ -400
+
+ 600
+
+
+ -300
+
+
+ Qt::Horizontal
+
- -
-
+
-
+
0
@@ -153,17 +176,15 @@
0
-
-
- 10
-
-
- High
+ Avg
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+ sldArterialValue
+
-
@@ -193,27 +214,44 @@
- -
-
+
-
+
+
+
+ 30
+ 0
+
+
+
+ 0
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
-
+
0
0
-
-
- 10
-
+
+
+ 30
+ 0
+
-
- -300
+
+ Value
-
- 0
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
- 10
+
+ sldArterialValue
@@ -244,24 +282,8 @@
- -
-
-
- -400
-
-
- 600
-
-
- -300
-
-
- Qt::Horizontal
-
-
-
- -
-
+
-
+
0
@@ -280,15 +302,15 @@
- 0
+ High
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
- -
-
+
-
+
30
@@ -303,28 +325,27 @@
- -
-
+
-
+
-
+
0
0
-
-
- 30
- 0
-
+
+
+ 10
+
-
- Avg
+
+ -300
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+ 0
-
- sldArterialValue
+
+ 10
@@ -344,67 +365,31 @@
- -
-
+
+
+ -
+
+
-
+
30
0
- 0
+ Avg
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+ sldVenousValue
+
-
-
- -
-
-
-
- 0
- 0
-
-
-
-
- 10
-
-
-
- background-color: rgb(229, 156, 156);
-
-
- TMP Limit (mmHg)
-
-
- Qt::AlignCenter
-
-
-
- -
-
-
-
- 10
-
-
-
- Qt::Vertical
-
-
-
- -
-
-
- QLayout::SetFixedSize
-
-
-
-
+
-
+
0
@@ -423,15 +408,15 @@
- Low
+ 0
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
- -
-
+
-
+
0
@@ -444,38 +429,27 @@
- -100
+ 20
- 400
+ 600
10
- 20
+ 400
- -
-
-
-
- 0
- 0
-
-
+
-
+
30
0
-
-
- 10
-
-
0
@@ -484,35 +458,24 @@
- -
-
-
-
- 0
- 0
-
+
-
+
+
+
+ 30
+ 0
+
-
-
- 10
-
+
+ 0
-
- -100
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
- 400
-
-
- 10
-
-
- 200
-
-
-
+
0
@@ -538,8 +501,8 @@
- -
-
+
-
+
0
@@ -565,8 +528,32 @@
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 10
+
+
+
+ 20
+
+
+ 600
+
+
+ 10
+
+
+
+ -
+
30
@@ -584,8 +571,8 @@
- -
-
+
-
+
-100
@@ -597,28 +584,8 @@
- -
-
-
-
- 30
- 0
-
-
-
- 0
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
-
-
- -
-
-
-
-
+
-
+
0
@@ -637,15 +604,35 @@
- 0
+ Low
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+ -
+
+
+ -100
+
+
+ 700
+
+
+ Qt::Horizontal
+
+
+
+
+
+ -
+
+
+ QLayout::SetFixedSize
+
-
-
+
0
@@ -658,54 +645,27 @@
- 20
+ -100
- 600
+ 400
10
-
-
- -
-
-
-
- 30
- 0
-
+
+ 200
-
- Value
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
- sldVenousValue
-
- -
-
-
-
- 0
- 0
-
-
+
-
+
30
0
-
-
- 10
-
-
0
@@ -714,24 +674,8 @@
- -
-
-
-
- 30
- 0
-
-
-
- 0
-
-
- Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
-
-
-
- -
-
+
-
+
0
@@ -757,21 +701,8 @@
- -
-
-
- -100
-
-
- 700
-
-
- Qt::Horizontal
-
-
-
- -
-
+
-
+
0
@@ -797,8 +728,8 @@
- -
-
+
-
+
0
@@ -811,29 +742,29 @@
- 20
+ -100
- 600
+ 400
10
- 400
+ 20
- -
-
+
-
+
30
0
- Avg
+ Value
Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
@@ -843,8 +774,35 @@
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 30
+ 0
+
+
+
+
+ 10
+
+
+
+ 0
+
+
+ Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter
+
+
+
+ -
+
-100
@@ -856,14 +814,25 @@
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
30
0
+
+
+ 10
+
+
0
@@ -874,13 +843,37 @@
- -
-
+
-
+
+
+
+ 0
+ 0
+
+
10
+
+ background-color: rgb(229, 156, 156);
+
+
+ (H2) Arterial Limit (mmHg)
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 10
+
+
Qt::Vertical
@@ -910,8 +903,8 @@
- -
-
+
-
+
0
@@ -927,7 +920,7 @@
background-color: rgb(229, 156, 156);
- (H2) Arterial Limit (mmHg)
+ TMP Limit (mmHg)
Qt::AlignCenter
@@ -963,21 +956,112 @@
+ -
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 352
+ 0
+
+
+
+
+ 16777215
+ 16777215
+
+
+
+
+ 10
+
+
+
+ color: rgb(238, 238, 236);
+background-color: rgb(139, 59, 59);
+
+
+
+ 165 : [0xA500] : Pressures Widening
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+ send
+
+
+
+
+
+ -
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+
+ 0
+ 0
+
+
+
+ false
+
+
+ QFrame::WinPanel
+
+
+ QFrame::Sunken
+
+
+ -
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 180
+ 0
+
+
+
+ Reason
+
+
+
+ -
+
+
+ 900
+
+
+
+
+
- -
-
-
- Qt::Vertical
-
-
-
- 20
- 115
-
-
-
-
Index: TD_Pressures/loader.py
===================================================================
diff -u -r03501309d607343ba120663e0abce74faeb34f59 -rb8705aa1e0402a49cc266c642facb833888116bd
--- TD_Pressures/loader.py (.../loader.py) (revision 03501309d607343ba120663e0abce74faeb34f59)
+++ TD_Pressures/loader.py (.../loader.py) (revision b8705aa1e0402a49cc266c642facb833888116bd)
@@ -13,6 +13,9 @@
# Plugin specific
from leahi_dialin.ui.common import Ranges
+from leahi_dialin.protocols import CAN
+from leahi_dialin.common.msg_defs import MsgIds
+from leahi_dialin.utils import conversions
# hd Simulator
from leahi_dialin.ui.td_messaging import TD_Messaging
@@ -25,7 +28,12 @@
def __init__(self):
self.td_interface = TD_Messaging()
+ self.can_interface = self.td_interface.can_interface
super().__init__(os.path.dirname(__file__))
+ if self.can_interface is not None:
+ self.can_interface.register_receiving_publication_function(CAN.DenaliChannels.ui_to_td_ch_id,
+ MsgIds.MSG_ID_UI_PRESSURE_LIMIT_WIDEN_REQUEST.value,
+ self.handle_pressures_widen_request)
def _init_loader(self):
"""
@@ -59,7 +67,11 @@
self.sldTMPValue = self.find_widget(QtWidgets.QSlider ,'sldTMPValue' )
self.spnLimitState = self.find_widget(QtWidgets.QSpinBox ,'spnLimitState' )
+ self.tbPressureWidenSend = self.find_widget(QtWidgets.QToolButton ,'tbPressuresWidenSend' )
+ self.spnPressureWidenRejection = self.find_widget(QtWidgets.QSpinBox ,'PressuresWidenReasonSpinBox' )
+ self.lblPressureWidenReq = self.find_widget(QtWidgets.QLabel ,'lbPressureWidenRequest' )
+
self.lblArterialTitle .setText (f"{self.lblArterialTitle .text()} [{Ranges.ARTERIAL_PRESSURE_MINIMUM},{Ranges.ARTERIAL_PRESSURE_MAXIMUM}]" )
self.lblVenousTitle .setText (f"{self.lblVenousTitle .text()} [{Ranges.VENOUS_PRESSURE_MINIMUM},{Ranges.VENOUS_PRESSURE_MAXIMUM}]" )
self.lblTMPTitle .setText (f"{self.lblTMPTitle .text()} [{Ranges.TMP_PRESSURE_MINIMUM},{Ranges.TMP_PRESSURE_MAXIMUM}]" )
@@ -118,6 +130,8 @@
self.spnTMPLimitHigh .setValue (Ranges.TMP_PRESSURE_HIGH_DEF)
self.spnLimitState .setValue(0)
+ self.spnPressureWidenRejection.setValue(0)
+ self.lblPressureWidenReq.setText("-")
def _init_connections(self):
@@ -143,8 +157,10 @@
self.spnTMPLimitHigh .valueChanged.connect(self.do_pressures_data)
self.spnLimitState .valueChanged.connect(self.do_pressures_data)
+ self.tbPressureWidenSend .clicked.connect(self.do_pressures_widen_response)
+
@Slot()
def do_pressures_data(self):
"""
@@ -177,4 +193,19 @@
tmp_pressure ,
tmp_min ,
tmp_max
- )
\ No newline at end of file
+ )
+
+
+ @Slot()
+ def handle_pressures_widen_request(self, message, timestamp = 0.0):
+ """
+ Called when the user requests to firmware from UI
+ @return: None
+ """
+ self.lblPressureWidenReq.setText("Requested")
+
+
+ @Slot()
+ def do_pressures_widen_response(self):
+ reason = self.spnPressureWidenRejection.value()
+ self.td_interface.td_pressures_widen_adjustment_response(reason)
\ No newline at end of file
Index: TD_TreatmentStates/loader.py
===================================================================
diff -u -r9307b8315113adb7ad1823a19d58df6ea7e4ef8b -rb8705aa1e0402a49cc266c642facb833888116bd
--- TD_TreatmentStates/loader.py (.../loader.py) (revision 9307b8315113adb7ad1823a19d58df6ea7e4ef8b)
+++ TD_TreatmentStates/loader.py (.../loader.py) (revision b8705aa1e0402a49cc266c642facb833888116bd)
@@ -10,7 +10,7 @@
from engine.dynamicloader import DynamicLoader
# plugin specific
-from leahi_dialin.common.td_defs import td_enum_repository as TD_Defs
+from leahi_dialin.common.td_defs import TDTreatmentStates, TDDialysisStates
# hd Simulator
from leahi_dialin.ui.td_messaging import TD_Messaging
@@ -71,9 +71,9 @@
initializes the widgets' properties
:return: none
"""
- self.tblSubMode .setCurrentCell(TD_Defs.TDTreatmentStates.TREATMENT_START_STATE .value , 0)
+ self.tblSubMode .setCurrentCell(TDTreatmentStates.TREATMENT_START_STATE.value, 0)
self.tblBloodPrimeStates .setCurrentCell(0 , 0)
- self.tblDialysisStates .setCurrentCell(TD_Defs.TDDialysisStates.DIALYSIS_UF_STATE .value , 0)
+ self.tblDialysisStates .setCurrentCell(TDDialysisStates.DIALYSIS_UF_STATE.value, 0)
self.tblUFStates .setCurrentCell(0 , 0)
self.tblTreatmentStopStates.setCurrentCell(0 , 0)
self.tblRinsebackStates .setCurrentCell(0 , 0)