Index: TD_Vitals/interface.ui =================================================================== diff -u --- TD_Vitals/interface.ui (revision 0) +++ TD_Vitals/interface.ui (revision 976a9362e2aaa083b5ed1926edee03be28bf2b58) @@ -0,0 +1,194 @@ + + + ui_interface + + + + 0 + 0 + 439 + 193 + + + + + 100000 + 100000 + + + + &3 Treatment/&4 Vitals + + + + + + + + + + + 0 + 0 + + + + + 352 + 0 + + + + + 16777215 + 16777215 + + + + + 10 + + + + color: rgb(238, 238, 236); +background-color: rgb(92, 53, 102); + + + + 101 : [0x6500] : Treatment Vitals + + + Qt::AlignCenter + + + + + + + send + + + + + + + + + + + + 180 + 0 + + + + Systolic + + + + + + + 60 + + + 250 + + + 120 + + + + + + + + + + + + 180 + 0 + + + + Diastolic + + + + + + + 40 + + + 200 + + + 80 + + + + + + + + + + + + 180 + 0 + + + + Heart Rate + + + + + + + 40 + + + 180 + + + 100 + + + + + + + + + + + + 180 + 0 + + + + Reason + + + + + + + 900 + + + + + + + + + + + + Index: TD_Vitals/loader.py =================================================================== diff -u --- TD_Vitals/loader.py (revision 0) +++ TD_Vitals/loader.py (revision 976a9362e2aaa083b5ed1926edee03be28bf2b58) @@ -0,0 +1,103 @@ +""" + The Vitals ui loader +""" +# Python +import os +import can +import struct + +# Qt +from PySide2 import QtCore, QtWidgets +from PySide2.QtCore import Slot + +# parent +from engine.dynamicloader import DynamicLoader + +# plugin specific +from leahi_dialin.common.msg_defs import MsgIds +from leahi_dialin.protocols import CAN + +# hd Simulator +from leahi_dialin.ui.td_messaging import TD_Messaging + +class Loader(DynamicLoader): + """ + The Vitals ui loader + """ + + 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: + channel_id = CAN.DenaliChannels.ui_to_td_ch_id + vitals_request_message_id = MsgIds.MSG_ID_UI_BLOOD_PRESSURE_REQUEST.value + self.can_interface.register_receiving_publication_function(channel_id, + vitals_request_message_id, + self.handle_vitals_request) + + def _init_loader(self): + """ + finds and creates widgets + :return: none + """ + self.tbSend = self.find_widget(QtWidgets.QToolButton , 'tbSend' ) + self.sbSystolic = self.find_widget(QtWidgets.QSpinBox , 'SystolicSpinBox' ) + self.sbDiastolic = self.find_widget(QtWidgets.QSpinBox , 'DiastolicSpinBox' ) + self.sbHeartRate = self.find_widget(QtWidgets.QSpinBox , 'HeartRateSpinBox' ) + self.sbVitalsReason = self.find_widget(QtWidgets.QSpinBox , 'VitalsReasonSpinBox' ) + + def _init_connections(self): + """ + initializes the widgets connections + :return: none + """ + self.tbSend .clicked .connect(self.do_send) + self.sbSystolic .valueChanged.connect(self.do_vitals_data) + self.sbDiastolic .valueChanged.connect(self.do_vitals_data) + self.sbHeartRate .valueChanged.connect(self.do_vitals_data) + + def _init_widgets(self): + """ + initializes the widgets' properties + :return: none + """ + + self.sbSystolic .setValue(120) + self.sbDiastolic .setValue(80) + self.sbHeartRate .setValue(100) + self.sbVitalsReason .setValue(0) + + @Slot() + def handle_vitals_request(self, message, timestamp = 0.0): + """ + Called when the user requests to firmware from UI + @return: None + """ + reason = self.sbVitalsReason.value() + self.td_interface.td_vitals_adjustment_response(reason) + + @Slot() + def do_vitals_data(self): + """ + the slot for Vitals Data + :return: none + """ + systolic = self.sbSystolic .value() + diastolic = self.sbDiastolic .value() + heartRate = self.sbHeartRate .value() + + self.td_interface.td_vitals( + systolic , + diastolic , + heartRate + ) + + @Slot() + def do_send(self): + """ + the slot for treatment set point Data + :return: none + """ + self.do_vitals_data() Fisheye: Tag 976a9362e2aaa083b5ed1926edee03be28bf2b58 refers to a dead (removed) revision in file `Vitals/interface.ui'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 976a9362e2aaa083b5ed1926edee03be28bf2b58 refers to a dead (removed) revision in file `Vitals/loader.py'. Fisheye: No comparison available. Pass `N' to diff?