Commit f09e05e1 authored by Tiago Sarmento's avatar Tiago Sarmento

adding templates and more global widgets

parent 5c7b5311
Pipeline #901 failed
......@@ -4,12 +4,16 @@ import logging
import sys
import numpy as np
from alarm_widgets.tab_alarms import TabAlarm
# from alarm_widgets.tab_alarms import TabAlarm
from global_widgets.tab_top_bar import TabTopBar
from global_widgets.tab_left_bar import TabLeftBar
from hev_main import MainView
from hev_settings import SettingsView
from hev_alarms import AlarmView
from hev_modes import ModeView
from hevclient import HEVClient
from main_widgets.tab_page_buttons import TabPageButtons
from PySide2.QtCore import QUrl, Signal, Slot
from PySide2.QtGui import QColor, QPalette
from PySide2.QtWidgets import (
......@@ -35,11 +39,11 @@ class NativeUI(HEVClient, QMainWindow):
def __init__(self, *args, **kwargs):
super(NativeUI, self).__init__(*args, **kwargs)
self.setWindowTitle("HEV NativeUI")
self.setFixedSize(1920, 1080)
# self.setFixedSize(1920/2, 1080/2)
# bars
self.topBar = TabTopBar()
self.buttonBar = TabPageButtons()
self.leftBar = TabLeftBar()
# Views
self.stack = QStackedWidget(self)
......@@ -47,14 +51,16 @@ class NativeUI(HEVClient, QMainWindow):
self.stack.addWidget(self.main_view)
self.settings_view = SettingsView()
self.stack.addWidget(self.settings_view)
self.alarms_view = TabAlarm()
self.alarms_view = AlarmView()
self.stack.addWidget(self.alarms_view)
self.modes_view = ModeView()
self.stack.addWidget(self.modes_view)
self.stack.setCurrentWidget(self.alarms_view)
self.menu_bar = TabPageButtons()
# self.menu_bar = TabPageButtons()
# Layout
hlayout = QHBoxLayout()
hlayout.addWidget(self.buttonBar)
hlayout.addWidget(self.leftBar)
hlayout.addWidget(self.stack)
vlayout = QVBoxLayout()
......@@ -106,10 +112,11 @@ class NativeUI(HEVClient, QMainWindow):
"""callback from the polling function, payload is data from socket """
# Store data in dictionary of lists
self.statusBar().showMessage(f"{payload}")
print(payload["type"])
# print(payload["type"])
try:
if payload["type"] == "DATA":
self.data = payload["DATA"]
self.ongoingAlarms = payload["alarms"]
# remove first entry and append plot data to end
self.plots = np.append(
np.delete(self.plots, 0, 0),
......@@ -133,11 +140,11 @@ class NativeUI(HEVClient, QMainWindow):
self.targets = payload["TARGET"]
if payload["type"] == "READBACK":
self.readback = payload["READBACK"]
print(self.readback)
# print(self.readback)
if payload["type"] == "PERSONAL":
self.data = payload["PERSONAL"]
self.targets = self.data
print(self.targets)
self.personal = payload["PERSONAL"]
# self.personal = self.data
# print(self.targets)
self.plots = np.append(
np.delete(self.plots, 0, 0),
......
from PySide2 import QtCore, QtGui, QtWidgets
class alarmWidget(QtWidgets.QWidget):
def __init__(self, alarmPayload, *args, **kwargs):
super(alarmWidget, self).__init__(*args, **kwargs)
self.layout = QtWidgets.QHBoxLayout()
self.layout.setSpacing(0)
self.layout.setMargin(0)
self.alarmPayload = alarmPayload
iconLabel = QtWidgets.QLabel()
iconLabel.setText("icon!")
self.layout.addWidget(iconLabel)
textLabel = QtWidgets.QLabel()
textLabel.setText(self.alarmPayload["alarm_code"])
textLabel.setFixedHeight(40)
textLabel.setFixedWidth(150)
textLabel.setAlignment(QtCore.Qt.AlignCenter)
self.layout.addWidget(textLabel)
self.setLayout(self.layout)
if alarmPayload["alarm_type"] == "PRIORITY_HIGH":
self.setStyleSheet("background-color:red;")
elif alarmPayload["alarm_type"] == "PRIORITY_MEDIUM":
self.setStyleSheet("background-color:orange;")
self.timer = QtCore.QTimer()
self.timer.setInterval(20000) # just faster than 60Hz
self.timer.timeout.connect(self.checkAlarm)
self.timer.start()
def checkAlarm(self):
# ongoingAlarms = self.parent().parent().parent().parent().parent().parent().parent().ongoingAlarms
# for alarms in ongoingAlarms:
# if alarms['alarm_code'] == 'rubbis':#self.alarmPayload['alarm_code']:
# return
# print('alarm no longer exists')
self.parent().alarmDict.pop(self.alarmPayload["alarm_code"])
self.setParent(None)
class alarmPopup(QtWidgets.QDialog):
def __init__(self, *args, **kwargs):
super(alarmPopup, self).__init__(*args, **kwargs)
......@@ -23,37 +64,24 @@ class alarmPopup(QtWidgets.QDialog):
self.shadow.setXOffset(10)
self.shadow.setYOffset(10)
self.timer = QtCore.QTimer()
self.timer.setInterval(100) # just faster than 60Hz
self.timer.timeout.connect(self.adjustSize)
self.timer.start()
def clearAlarms(self):
for i in reversed(range(self.layout.count())):
self.layout.itemAt(i).widget().setParent(None)
self.adjustSize()
self.setLayout(self.layout)
self.alarmDict = {}
def addAlarm(self, alarmPayload):
alarmBox = QtWidgets.QWidget()
alarmLayout = QtWidgets.QHBoxLayout()
alarmLayout.setSpacing(0)
alarmLayout.setMargin(0)
iconLabel = QtWidgets.QLabel()
iconLabel.setText("icon!")
alarmLayout.addWidget(iconLabel)
textLabel = QtWidgets.QLabel()
textLabel.setText(alarmPayload["alarm_code"])
textLabel.setFixedHeight(40)
textLabel.setFixedWidth(150)
textLabel.setAlignment(QtCore.Qt.AlignCenter)
alarmLayout.addWidget(textLabel)
alarmBox.setLayout(alarmLayout)
if alarmPayload["alarm_type"] == "PRIORITY_HIGH":
alarmBox.setStyleSheet("background-color:red;")
elif alarmPayload["alarm_type"] == "PRIORITY_MEDIUM":
alarmBox.setStyleSheet("background-color:orange;")
self.alarmDict[alarmPayload["alarm_code"]] = alarmWidget(alarmPayload)
self.layout.addWidget(self.alarmDict[alarmPayload["alarm_code"]])
self.layout.addWidget(alarmBox)
def resetTimer(self, alarmPayload):
self.alarmDict[alarmPayload["alarm_code"]].timer.start()
def location_on_window(self):
screen = QtWidgets.QDesktopWidget().screenGeometry()
......
......@@ -73,12 +73,13 @@ class TabAlarm(
self.list.acknowledge_all()
def updateAlarms(self):
newAlarm = self.parent().parent().parent().alarms
newAlarm = self.parent().parent().parent().parent().parent().alarms
if newAlarm == []:
return
if newAlarm["alarm_code"] in self.existingAlarms:
if newAlarm["alarm_code"] in self.alarmHandler.alarmDict:
self.alarmHandler.resetTimer(newAlarm)
a = 1 # do nothing
else:
self.alarmHandler.addAlarm(newAlarm)
self.existingAlarms.append(newAlarm["alarm_code"])
# self.existingAlarms.append(newAlarm["alarm_code"])
self.list.addAlarm(newAlarm)
from PySide2 import QtWidgets, QtGui, QtCore
from settings_widgets.tab_expert import simpleSpin
class TabClinical(
QtWidgets.QWidget
): # chose QWidget over QDialog family because easier to modify
def __init__(self, *args, **kwargs):
super(TabClinical, self).__init__(*args, **kwargs)
self.liveUpdating = True
self.modifications = []
self.spinDict = {}
clinicalList = [
["APNEA", "ms", "duration_calibration"],
["Check Pressure Patient", "ms", "duration_buff_purge"],
["High FIO2", "ms", ""],
["High Pressure", "", ""],
["High Respiratory Rate", "", ""],
["High VTE", "", ""],
["Low VTE", "", ""],
["High VTI", "", ""],
["Low VTI", "", ""],
["Low FIO2", "", ""],
["Occlusion", "", ""],
["High PEEP", "", ""],
["Low PEEP", "", ""],
]
grid = QtWidgets.QGridLayout()
i = 0
for info in clinicalList:
self.spinDict[info[0]] = simpleSpin(info)
grid.addWidget(self.spinDict[info[0]], int(i / 2), i % 2)
i = i + 1
hlayout = QtWidgets.QHBoxLayout()
self.okButton = QtWidgets.QPushButton()
self.okButton.setStyleSheet(
"height:50px; background-color:white; border-radius:4px;"
)
# self.okButton.pressed.connect(self.okButtonPressed)
hlayout.addWidget(self.okButton)
self.cancelButton = QtWidgets.QPushButton()
self.cancelButton.setStyleSheet(
"height:50px; background-color:white; border-radius:4px;"
)
# self.cancelButton.pressed.connect(self.cancelButtonPressed)
hlayout.addWidget(self.cancelButton)
vlayout = QtWidgets.QVBoxLayout()
vlayout.addLayout(grid)
vlayout.addLayout(hlayout)
self.setLayout(vlayout)
from PySide2 import QtWidgets, QtGui, QtCore
import sys
class selectorButton(QtWidgets.QPushButton):
def __init__(self, *args, **kwargs):
super(selectorButton, self).__init__(*args, **kwargs)
style = """QPushButton{
font:20pt;
}
QPushButton[selected="0"]{
font:black;
background-color:white ;
border:none;
}
QPushButton[selected="1"]{
font:white;
background-color:black;
border:none;
}""" # border:none is necessary to enact bg colour change
self.setStyleSheet(style)
self.setProperty("selected", "0")
from PySide2 import QtWidgets, QtGui, QtCore
class SetConfirmPopup(
QtWidgets.QDialog
): # chose QWidget over QDialog family because easier to modify
def __init__(self, setList, *args, **kwargs):
super().__init__(*args, **kwargs)
listWidget = QtWidgets.QListWidget()
for item in setList:
listWidget.addItem(item)
buttonHLayout = QtWidgets.QHBoxLayout()
self.okButton = QtWidgets.QPushButton()
self.okButton.setIcon(QtGui.QIcon("hev-display/svg/check-solid.svg"))
self.okButton.setStyleSheet("background-color:white; border-radius:4px ")
buttonHLayout.addWidget(self.okButton)
self.cancelButton = QtWidgets.QPushButton()
self.cancelButton.setIcon(QtGui.QIcon("figures/pic2.jpg"))
self.cancelButton.setStyleSheet("background-color:white; border-radius:4px ")
self.cancelButton.pressed.connect(self.cancel_button_pressed)
buttonHLayout.addWidget(self.cancelButton)
vlayout = QtWidgets.QVBoxLayout()
vlayout.addWidget(listWidget)
vlayout.addLayout(buttonHLayout)
self.setLayout(vlayout)
self.setWindowFlags(
QtCore.Qt.FramelessWindowHint | QtCore.Qt.WindowStaysOnTopHint
) # no window title
def cancel_button_pressed(self):
self.parent = None
from PySide2 import QtWidgets, QtGui, QtCore
class signallingSpinBox(QtWidgets.QSpinBox):
stepChanged = QtCore.Signal()
def stepBy(self, step):
value = self.value()
super(signallingSpinBox, self).stepBy(step)
if self.value() != value:
self.stepChanged.emit()
class simpleSpin(QtWidgets.QWidget):
def __init__(self, infoArray, *args, **kwargs):
super(simpleSpin, self).__init__(*args, **kwargs)
self.label, self.units, self.tag = infoArray
self.manuallyUpdated = False
layout = QtWidgets.QHBoxLayout()
textStyle = "color:white; font: 16pt"
self.nameLabel = QtWidgets.QLabel(self.label)
self.nameLabel.setStyleSheet(textStyle)
self.nameLabel.setAlignment(QtCore.Qt.AlignRight)
self.simpleSpin = signallingSpinBox()
self.simpleSpin.setStyleSheet(
"""QSpinBox{ width:100px; font:16pt}
QSpinBox[bgColour="0"]{background-color:white; }
QSpinBox[bgColour="1"]{background-color:grey; }
QSpinBox[textColour="0"]{color:black}
QSpinBox[textColour="1"]{color:red}
QSpinBox::up-button{width:20; border:solid white; color:black }
QSpinBox::down-button{width:20; }
"""
)
self.simpleSpin.setProperty("textColour", "0")
self.simpleSpin.setProperty("bgColour", "0")
self.simpleSpin.setButtonSymbols(
QtWidgets.QAbstractSpinBox.ButtonSymbols.PlusMinus
)
self.simpleSpin.setAlignment(QtCore.Qt.AlignCenter)
self.unitLabel = QtWidgets.QLabel(self.units)
self.unitLabel.setStyleSheet(textStyle)
self.unitLabel.setAlignment(QtCore.Qt.AlignLeft)
widgets = [self.nameLabel, self.simpleSpin, self.unitLabel]
for widget in widgets:
layout.addWidget(widget)
self.setLayout(layout)
self.simpleSpin.stepChanged.connect(self.manualStep)
# self.simpleSpin.valueChanged.connect(self.valChange)
def manualStep(self):
self.parent().liveUpdating = False
self.manuallyUpdated = True
self.simpleSpin.setProperty("textColour", "1")
# self.expertButton.style().unpolish(self.expertButton)
self.simpleSpin.style().polish(self.simpleSpin)
def update_readback_value(self):
newVal = (
self.parent()
.parent()
.parent()
.parent()
.parent()
.parent()
.readback[self.tag]
)
self.simpleSpin.setValue(newVal)
self.simpleSpin.setProperty("textColour", "0")
self.simpleSpin.style().polish(self.simpleSpin)
def update_targets_value(self):
if (
type(
self.parent()
.parent()
.parent()
.parent()
.parent()
.parent()
.parent()
.parent()
.targets
)
== str
):
return
newVal = (
self.parent().parent().parent().parent().parent().parent().targets[self.tag]
)
self.simpleSpin.setValue(newVal)
self.simpleSpin.setProperty("textColour", "0")
self.simpleSpin.style().polish(self.simpleSpin)
from global_widgets.tab_page_buttons import TabPageButtons
from global_widgets.tab_start_stop_buttons import TabStartStopStandbyButtons
from PySide2 import QtCore, QtGui, QtWidgets
class TabLeftBar(QtWidgets.QWidget):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
layout = QtWidgets.QVBoxLayout(self)
self.tab_page_buttons = TabPageButtons()
self.tab_start_stop_buttons = TabStartStopStandbyButtons()
self.widgets = [self.tab_page_buttons, self.tab_start_stop_buttons]
for widget in self.widgets:
layout.addWidget(widget)
self.setLayout(layout)
......@@ -2,6 +2,7 @@ import os
from PySide2 import QtGui, QtWidgets
from PySide2.QtCore import QSize
from global_widgets.tab_start_stop_buttons import TabStartStopStandbyButtons
class TabPageButtons(QtWidgets.QWidget):
......@@ -40,19 +41,27 @@ class TabPageButtons(QtWidgets.QWidget):
self.button_signin.pressed.connect(self.__signin_pressed)
self.button_alarms.pressed.connect(self.__alarms_pressed)
self.button_fancon.pressed.connect(self.__fancon_pressed)
self.button_cntrls.pressed.connect(self.__cntrls_pressed)
def __signin_pressed(self):
self.parent().parent().stack.setCurrentWidget(self.parent().parent().main_view)
self.parent().parent().parent().stack.setCurrentWidget(
self.parent().parent().parent().main_view
)
def __cntrls_pressed(self):
self.parent().parent().stack.setCurrentWidget(
self.parent().parent().settings_view
self.parent().parent().parent().stack.setCurrentWidget(
self.parent().parent().parent().settings_view
)
def __alarms_pressed(self):
self.parent().parent().stack.setCurrentWidget(
self.parent().parent().alarms_view
self.parent().parent().parent().stack.setCurrentWidget(
self.parent().parent().parent().alarms_view
)
def __fancon_pressed(self):
self.parent().parent().parent().stack.setCurrentWidget(
self.parent().parent().parent().modes_view
)
def __find_icons(self):
......
from main_widgets.tab_battery import TabBattery
from main_widgets.tab_personal import TabPersonal
from global_widgets.tab_battery import TabBattery
from global_widgets.tab_personal import TabPersonal
from PySide2 import QtCore, QtGui, QtWidgets
......
from PySide2 import QtWidgets, QtGui, QtCore
from settings_widgets.tab_expert import simpleSpin
class TemplateSetValues(
QtWidgets.QWidget
): # chose QWidget over QDialog family because easier to modify
def __init__(self, *args, **kwargs):
super(TemplateSetValues, self).__init__(*args, **kwargs)
self.liveUpdating = True
self.layoutList = []
self.timer = QtCore.QTimer()
self.timer.setInterval(160) # just faster than 60Hz
self.timer.timeout.connect(self.update_settings_data)
self.timer.start()
def finaliseLayout(self):
vlayout = QtWidgets.QVBoxLayout()
for layout in self.layoutList:
vlayout.addLayout(layout)
self.setLayout(vlayout)
def addSpinSingleCol(self, settingsList):
self.spinDict = {}
vOptionLayout = QtWidgets.QVBoxLayout()
for info in settingsList:
self.spinDict[info[0]] = simpleSpin(info)
vOptionLayout.addWidget(self.spinDict[info[0]])
self.layoutList.append(vOptionLayout)
def addButtons(self):
hlayout = QtWidgets.QHBoxLayout()
self.okButton = QtWidgets.QPushButton()
self.okButton.setStyleSheet(
"height:50px; background-color:white; border-radius:4px;"
)
self.okButton.pressed.connect(self.okButtonPressed)
hlayout.addWidget(self.okButton)
self.cancelButton = QtWidgets.QPushButton()
self.cancelButton.setStyleSheet(
"height:50px; background-color:white; border-radius:4px;"
)
self.cancelButton.pressed.connect(self.cancelButtonPressed)
hlayout.addWidget(self.cancelButton)
self.layoutList.append(hlayout)
def update_settings_data(self):
if self.liveUpdating:
for widget in self.spinDict:
self.spinDict[widget].update_targets_value()
def okButtonPressed(self):
message = []
self.liveUpdating = True
for widget in self.spinDict:
# print(widget)
if self.spinDict[widget].manuallyUpdated:
setVal = self.spinDict[widget].simpleSpin.value()
# print('manually updated')
print("set" + widget + " to " + str(setVal))
self.spinDict[widget].manuallyUpdated = False
def cancelButtonPressed(self):
self.liveUpdating = True
......@@ -7,35 +7,58 @@ from PySide2 import QtWidgets, QtGui, QtCore
# from PySide2.QtWidgets import QWidget, QApplication, QHBoxLayout, QVBoxLayout
from hevclient import HEVClient
from settings_widgets.tab_expert import TabExpert
from settings_widgets.tab_charts import TabChart
from alarm_widgets.tab_alarms import TabAlarm
from alarm_widgets.tab_clinical import TabClinical
from global_widgets.global_select_button import selectorButton
class SettingsView(QtWidgets.QWidget):
class AlarmView(QtWidgets.QWidget):
def __init__(self, *args, **kwargs):
super(SettingsView, self).__init__(*args, **kwargs)
super(AlarmView, self).__init__(*args, **kwargs)
hTabLayout = QtWidgets.QHBoxLayout()
self.alarmButton = QtWidgets.QPushButton("List of Alarms")
self.alarmButton.setStyleSheet("")
self.alarmButton = selectorButton("List of Alarms")
self.alarmButton.setProperty("selected", "1")
self.alarmButton.style().polish(self.alarmButton)
self.alarmButton.pressed.connect(self.alarmPressed)
hTabLayout.addWidget(self.alarmButton)
self.clinicalButton = QtWidgets.QPushButton("Clinical Limits")
self.clinicalButton.setStyleSheet("")
self.clinicalButton = selectorButton("Clinical Limits")
# self.clinicalButton.setStyleSheet("")
self.clinicalButton.pressed.connect(self.clinicalPressed)
hTabLayout.addWidget(self.clinicalButton)
self.techButton = QtWidgets.QPushButton("Technical Limits")
self.techButton.setStyleSheet("")
hTabLayout.addWidget(self.techButton)
self.techButton = selectorButton("Technical Limits")
# self.techButton.setStyleSheet("")
self.buttonWidgets = [self.alarmButton, self.clinicalButton, self.techButton]
for button in self.buttonWidgets:
hTabLayout.addWidget(button)
button.pressed.connect(lambda i=button: self.setColour(i))
vlayout = QtWidgets.QVBoxLayout()
vlayout.addLayout(hTabLayout)
self.stack = QtWidgets.QStackedWidget()
self.alarmTab = TabAlarm()
self.stack.addWidget(self.expertTab)
self.stack.addWidget(self.alarmTab)
self.clinicalTab = TabClinical()
self.stack.addWidget(self.clinicalTab)
# self.chartTab = TabChart()
# self.stack.addWidget(self.chartTab)
vlayout.addWidget(self.stack)
self.setLayout(vlayout)
def alarmPressed(self):
self.stack.setCurrentWidget(self.alarmTab)
def clinicalPressed(self):
self.stack.setCurrentWidget(self.clinicalTab)
def setColour(self, buttonWidg):
for button in self.buttonWidgets:
if button == buttonWidg:
button.setProperty("selected", "1")
else:
button.setProperty("selected", "0")
button.style().unpolish(button)
button.style().polish(button)
......@@ -5,7 +5,7 @@ Docstring
from main_widgets.tab_measurements import TabMeasurements
from main_widgets.tab_plots import TabPlots
from main_widgets.tab_spin_buttons import TabSpinButtons
from main_widgets.tab_start_stop_buttons import TabStartStopStandbyButtons
from main_widgets.tab_ellipsis import TabEllipsis
from PySide2.QtWidgets import QHBoxLayout, QVBoxLayout, QWidget
......@@ -20,25 +20,23 @@ class MainView(QWidget):
hlayout = QHBoxLayout()
# self.setStyleSheet('background-color: black')
left_vlayout = QVBoxLayout()
# left_vlayout = QVBoxLayout()
center_vlayout = QVBoxLayout()
right_vlayout = QVBoxLayout()
bottom_layout = QHBoxLayout()
# Set up the widget tabs
self.tab_plots = TabPlots()
# self.page_buttons = TabPageButtons()
self.start_stop_standby_buttons = TabStartStopStandbyButtons()
self.measurements = TabMeasurements()
# left column - page buttons and start/stop/standby
# left_vlayout.addWidget(self.page_buttons)
left_vlayout.addWidget(self.start_stop_standby_buttons)
hlayout.addLayout(left_vlayout)
self.tab_spin = TabSpinButtons(self)
self.ellipsis = TabEllipsis(self)
bottom_layout.addWidget(self.ellipsis)
bottom_layout.addWidget(self.tab_spin)
# center column - plots
center_vlayout.addWidget(self.tab_plots)
self.tab_spin = TabSpinButtons(self)
center_vlayout.addWidget(self.tab_spin)
center_vlayout.addLayout(bottom_layout)
hlayout.addLayout(center_vlayout)
# right column - measurements
......
import argparse
import logging
import sys
# from PySide2.QtWidgets import QWidget, QApplication, QHBoxLayout, QVBoxLayout
from hevclient import HEVClient
# from PySide2.QtCore import Slot
from PySide2 import QtCore, QtGui, QtWidgets
from mode_widgets.tab_modes import TabModes
from mode_widgets.tab_personal import TabPersonal
from global_widgets.global_select_button import selectorButton
class ModeView(QtWidgets.QWidget):
def __init__(self, *args, **kwargs):
super(ModeView, self).__init__(*args, **kwargs)
hTabLayout = QtWidgets.QHBoxLayout()
self.modeButton = selectorButton("Mode Settings")
self.modeButton.setProperty("selected", "1")
self.modeButton.style().polish(self.modeButton)
self.modeButton.pressed.connect(self.modePressed)
self.personalButton = selectorButton("Personal Settings")
self.personalButton.pressed.connect(self.personalPressed)
self.buttonWidgets = [self.modeButton, self.personalButton]
for button in self.buttonWidgets:
hTabLayout.addWidget(button)
button.pressed.connect(lambda i=button: self.setColour(i))
vlayout = QtWidgets.QVBoxLayout()
vlayout.addLayout(hTabLayout)
self.stack = QtWidgets.QStackedWidget()
self.modeTab = TabModes()
self.stack.addWidget(self.modeTab)
self.personalTab = TabPersonal()
self.stack.addWidget(self.personalTab)
vlayout.addWidget(self.stack)
self.setLayout(vlayout)
def modePressed(self):
self.stack.setCurrentWidget(self.modeTab)
def personalPressed(self):
self.stack.setCurrentWidget(self.personalTab)
def setColour(self, buttonWidg):
for button in self.buttonWidgets:
if button == buttonWidg:
button.setProperty("selected", "1")
else:
button.setProperty("selected", "0")
button.style().unpolish(button)
button.style().polish(button)
......@@ -4,10 +4,12 @@ import sys
# from PySide2.QtWidgets import QWidget, QApplication, QHBoxLayout, QVBoxLayout
from hevclient import HEVClient
# from PySide2.QtCore import Slot
from PySide2 import QtCore, QtGui, QtWidgets
from settings_widgets.tab_charts import TabChart
from settings_widgets.tab_expert import TabExpert
from global_widgets.global_select_button import selectorButton
class SettingsView(QtWidgets.QWidget):
......@@ -15,17 +17,18 @@ class SettingsView(QtWidgets.QWidget):
super(SettingsView, self).__init__(*args, **kwargs)
hTabLayout = QtWidgets.QHBoxLayout()
self.expertButton = QtWidgets.QPushButton("Expert")
self.expertButton.setStyleSheet("")
self.expertButton = selectorButton("Expert")
self.expertButton.setProperty("selected", "1")
self.expertButton.style().polish(self.expertButton)
self.expertButton.pressed.connect(self.expertPressed)
hTabLayout.addWidget(self.expertButton)
self.chartButton = QtWidgets.QPushButton("Charts")
self.chartButton.setStyleSheet("")
self.chartButton = selectorButton("Charts")
self.chartButton.pressed.connect(self.chartPressed)
hTabLayout.addWidget(self.chartButton)
self.expertButton3 = QtWidgets.QPushButton("Expert3")
self.expertButton3.setStyleSheet("")
hTabLayout.addWidget(self.expertButton3)
self.buttonWidgets = [self.expertButton, self.chartButton]
for button in self.buttonWidgets:
hTabLayout.addWidget(button)
button.pressed.connect(lambda i=button: self.setColour(i))
vlayout = QtWidgets.QVBoxLayout()
vlayout.addLayout(hTabLayout)
......@@ -48,3 +51,12 @@ class SettingsView(QtWidgets.QWidget):
def change(self):
print("pressed")
self.parent().setCentralWidget(self.parent().main_view)
def setColour(self, buttonWidg):
for button in self.buttonWidgets:
if button == buttonWidg:
button.setProperty("selected", "1")
else:
button.setProperty("selected", "0")
button.style().unpolish(button)
button.style().polish(button)
from PySide2 import QtWidgets
class TabEllipsis(QtWidgets.QWidget):
def __init__(self, *args, **kwargs):
super(TabEllipsis, self).__init__(*args, **kwargs)
grid = QtWidgets.QGridLayout()
self.sixtyButton = QtWidgets.QPushButton("60s")
grid.addWidget(self.sixtyButton, 0, 0)
self.thirtyButton = QtWidgets.QPushButton("30s")
grid.addWidget(self.thirtyButton, 0, 1)
self.fifteenButton = QtWidgets.QPushButton("15s")
grid.addWidget(self.fifteenButton, 1, 0)
self.fiveButton = QtWidgets.QPushButton("5s")
grid.addWidget(self.fiveButton, 1, 1)
self.setLayout(grid)
#!/usr/bin/env python3
import logging
import os
import pyqtgraph as pg
import numpy as np
from PySide2 import QtWidgets, QtCore, QtGui
from pyqtgraph import PlotWidget, plot, mkColor
from hevclient import HEVClient
import sys
class customSpinBox(QtWidgets.QSpinBox):
def __init__(self, iconPath: str):
super().__init__()
# self.setStyleSheet("border:none; background-image:url('" + iconPath + "');height:100px;width:100px")
class TabSpin(QtWidgets.QWidget):
def __init__(self, port=54322, *args, **kwargs):
super(TabSpin, self).__init__(*args, **kwargs)
layout = QtWidgets.QHBoxLayout()
self.Spin1 = customSpinBox(
""
) # QtWidgets.QPushSpin(QtGui.QIcon('SpinIcons/settings1.jpeg'),'')
# self.Spin1.setIcon(QtGui.QIcon('settings1.jpeg'))
# self.Spin1.setStyleSheet("border: none; background-image: url('SpinIcons/settings1.jpeg');height:50px")
layout.addWidget(self.Spin1)
self.Spin2 = customSpinBox(
"SpinIcons/settings2.jpeg"
) # QtWidgets.QPushSpin('test Spin number 2?')
# self.Spin2.setStyleSheet('border: none')
layout.addWidget(self.Spin2)
self.Spin3 = (
QtWidgets.QSpinBox()
) # customSpinBox('SpinIcons/settings3.jpeg')#QtWidgets.QPushSpin('test Spin number three?')
layout.addWidget(self.Spin3)
self.Spin4 = customSpinBox(
"SpinIcons/settings4.jpeg"
) # QtWidgets.QPushSpin('test Spin will it show up?')
layout.addWidget(self.Spin4)
self.setLayout(layout)
if __name__ == "__main__":
# parse args and setup logging
# setup pyqtplot widget
app = QtWidgets.QApplication(sys.argv)
dep = TabSpin()
dep.show()
app.exec_()
......@@ -94,6 +94,8 @@ class SpinButton(QtWidgets.QFrame):
self.layout = QtWidgets.QVBoxLayout()
self.layout.setSpacing(0)
self.layout.setMargin(0)
# create and style label
self.label = QtWidgets.QLabel()
self.label.setText("test label")
......@@ -160,9 +162,6 @@ class SpinButton(QtWidgets.QFrame):
self.popUp = SpinPopup()
self.popUp.okButton.clicked.connect(self.okButtonPressed)
self.popUp.cancelButton.clicked.connect(self.cancelButtonPressed)
# self.lineEdit.installEventFilter(self)
# self.test()
def eventFilter(self, source, event):
if (
......@@ -189,10 +188,6 @@ class SpinButton(QtWidgets.QFrame):
self.doubleSpin.setProperty("colour", option)
# def valuechange(self):
# print("changed to " + str(self.value()))
class TabSpinButtons(QtWidgets.QWidget):
def __init__(self, *args, **kwargs):
super(TabSpinButtons, self).__init__(*args, **kwargs)
......
#!/usr/bin/env python3
import logging
import os
import pyqtgraph as pg
import numpy as np
from PySide2 import QtWidgets, QtCore, QtGui
from pyqtgraph import PlotWidget, plot, mkColor
from hevclient import HEVClient
import sys
class customLabel(QtWidgets.QLabel):
def __init__(self, text):
super().__init__(text)
# self.setText('test text')
# self.setIcon(icon)
self.setStyleSheet(
"color: white;background-color: black;height:100px;width:100px"
)
class TabLabels(QtWidgets.QWidget):
def __init__(self, port=54322, *args, **kwargs):
super(TabLabels, self).__init__(*args, **kwargs)
self.history_length = 500
self.time_range = 30
self.port = port
layout = QtWidgets.QVBoxLayout()
self.label1 = customLabel("label1")
layout.addWidget(self.label1)
self.label2 = customLabel("label2")
layout.addWidget(self.label2)
self.label3 = customLabel("label3")
layout.addWidget(self.label3)
self.label4 = customLabel("label4")
layout.addWidget(self.label4)
self.setLayout(layout)
# self.timer = QtCore.QTimer()
# self.timer.setInterval(16) # just faster than 60Hz
# self.timer.timeout.connect(self.updateLabels) #updates without checking if new data arrived?
# self.timer.start()
def updateLabels(self):
self.label1.setText(str(self.parent().parent().plots[-1, 1]))
if __name__ == "__main__":
# parse args and setup logging
# setup pyqtplot widget
app = QtWidgets.QApplication(sys.argv)
dep = TabLabels()
dep.show()
app.exec_()
from PySide2 import QtWidgets, QtGui, QtCore
from global_widgets.global_select_button import selectorButton
from global_widgets.global_spinbox import simpleSpin
from global_widgets.template_set_values import TemplateSetValues
class TabModes(
TemplateSetValues
): # chose QWidget over QDialog family because easier to modify
def __init__(self, *args, **kwargs):
super(TabModes, self).__init__(*args, **kwargs)
settingsList = [
["Respiratory Rate", "/min", "respiratory_rate"],
["Inhale Time", "s", "inhale_time"],
["IE Ratio", "", "ie_ratio"],
["Inhale Trigger Sensitivity", "", "inhale_trigger_threshold"],
["Exhale Trigger Sensitivity", "", "exhale_trigger_threshold"],
["Inhale Pressure", "", "inspiratory_pressure"],
["Inhale volume", "", "volume"],
["Percentage O2", "", "fiO2_percent"],
]
hlayout = QtWidgets.QHBoxLayout()
hlayout.setSpacing(0)
self.pcacButton = selectorButton("PC/AC")
self.pcacButton.setProperty("selected", "1")
self.pcacButton.style().polish(self.pcacButton)
self.pcacEnable = [1, 0, 1, 1, 0, 1, 0, 1]
self.pcacBoxes = TemplateSetValues()
self.pcacBoxes.addSpinSingleCol(settingsList)
self.pcacBoxes.finaliseLayout()
self.prvcButton = selectorButton("PC/AC-PRVC")
self.prvcEnable = [1, 1, 0, 1, 0, 1, 1, 1]
self.prvcBoxes = TemplateSetValues()
self.prvcBoxes.addSpinSingleCol(settingsList)
self.prvcBoxes.finaliseLayout()
self.psvButton = selectorButton("PC-PSV")
self.psvEnable = [1, 1, 0, 1, 0, 1, 0, 1]
self.psvBoxes = TemplateSetValues()
self.psvBoxes.addSpinSingleCol(settingsList)
self.psvBoxes.finaliseLayout()
self.cpapButton = selectorButton("CPAP")
self.cpapEnable = [1, 0, 1, 1, 0, 1, 0, 1]
self.cpapBoxes = TemplateSetValues()
self.cpapBoxes.addSpinSingleCol(settingsList)
self.cpapBoxes.finaliseLayout()
self.buttonWidgets = [
self.pcacButton,
self.prvcButton,
self.psvButton,
self.cpapButton,
]
enableList = [self.pcacEnable, self.prvcEnable, self.psvEnable, self.cpapEnable]
self.boxes = [self.pcacBoxes, self.prvcBoxes, self.psvBoxes, self.cpapBoxes]
for button, array, box in zip(self.buttonWidgets, enableList, self.boxes):
hlayout.addWidget(button)
self.modeSwitch2(box, array)
button.pressed.connect(lambda i=button: self.setColour(i))
# button.pressed.connect(lambda i=array: self.modeSwitch(i))
button.pressed.connect(lambda i=box: self.modeSwitch(i))
self.layoutList.append(hlayout)
vlayout = QtWidgets.QVBoxLayout()
self.stack = QtWidgets.QStackedWidget()
for box in self.boxes:
self.stack.addWidget(box)
self.stack.setCurrentWidget(self.pcacBoxes)
vlayout.addWidget(self.stack)
self.layoutList.append(vlayout)
# self.addSpinSingleCol(settingsList)
self.addButtons()
self.finaliseLayout()
# self.modeSwitch(self.pcacEnable)
def setColour(self, buttonWidg):
for button in self.buttonWidgets:
if button == buttonWidg:
button.setProperty("selected", "1")
else:
button.setProperty("selected", "0")
button.style().unpolish(button)
button.style().polish(button)
def modeSwitch(self, box):
self.stack.setCurrentWidget(box)
def modeSwitch2(self, box, enableList):
for widget, enableBool in zip(box.spinDict, enableList):
box.spinDict[widget].simpleSpin.setEnabled(enableBool)
if enableBool == 1:
box.spinDict[widget].simpleSpin.setProperty("bgColour", "0")
if enableBool == 0:
box.spinDict[widget].simpleSpin.setProperty("bgColour", "1")
box.spinDict[widget].simpleSpin.style().unpolish(
box.spinDict[widget].simpleSpin
)
box.spinDict[widget].simpleSpin.style().polish(
box.spinDict[widget].simpleSpin
)
def modeSwitch3(self, enableList):
for widget, enableBool in zip(self.spinDict, enableList):
self.spinDict[widget].simpleSpin.setEnabled(enableBool)
if enableBool == 1:
self.spinDict[widget].simpleSpin.setProperty("bgColour", "0")
if enableBool == 0:
self.spinDict[widget].simpleSpin.setProperty("bgColour", "1")
self.spinDict[widget].simpleSpin.style().unpolish(
self.spinDict[widget].simpleSpin
)
self.spinDict[widget].simpleSpin.style().polish(
self.spinDict[widget].simpleSpin
)
# class TabModes(
# QtWidgets.QWidget
# ): # chose QWidget over QDialog family because easier to modify
# def __init__(self, *args, **kwargs):
# super(TabModes, self).__init__(*args, **kwargs)
# hlayout = QtWidgets.QHBoxLayout()
# self.pcacButton = QtWidgets.QPushButton('PC/AC')
# self.pcacEnable = [1,0,1,1,0,1,0,1]
# self.prvcButton = QtWidgets.QPushButton('PC/AC-PRVC')
# self.prvcEnable = [1,1,0,1,0,1,1,1]
# self.psvButton = QtWidgets.QPushButton('PC-PSV')
# self.psvEnable = [1,1,0,1,0,1,0,1]
# self.cpapButton = QtWidgets.QPushButton('CPAP')
# self.cpapEnable = [1,0,1,1,0,1,0,1]
# buttonWidgets = [self.pcacButton,self.prvcButton,self.psvButton,self.cpapButton]
# enableList = [self.pcacEnable, self.prvcEnable, self.psvEnable, self.cpapEnable]
# for button, array in zip(buttonWidgets,enableList):
# hlayout.addWidget(button)
# button.pressed.connect(lambda i=array: self.modeSwitch(i))
# self.liveUpdating = True
# settingsList = [
# ["Respiratory Rate", "/min", "respiratory_rate"],
# ["Inhale Time", "s", "inhale_time"],
# ["IE Ratio", "", "ie_ratio"],
# ["Inhale Trigger Sensitivity", "", "inhale_trigger_threshold"],
# ["Exhale Trigger Sensitivity", "", "exhale_trigger_threshold"],
# ["Inhale Pressure", "", "inspiratory_pressure"],
# ["Inhale volume", "", "volume"],
# ["Percentage O2", "", "fiO2_percent"]
# ]
# self.spinDict = {}
# vOptionLayout = QtWidgets.QVBoxLayout()
# for info in settingsList:
# self.spinDict[info[0]] = simpleSpin(info)
# vOptionLayout.addWidget(self.spinDict[info[0]])
# hlayout2 = QtWidgets.QHBoxLayout()
# self.okButton = QtWidgets.QPushButton()
# self.okButton.setStyleSheet(
# "height:50px; background-color:white; border-radius:4px;"
# )
# self.okButton.pressed.connect(self.okButtonPressed)
# hlayout2.addWidget(self.okButton)
# self.cancelButton = QtWidgets.QPushButton()
# self.cancelButton.setStyleSheet(
# "height:50px; background-color:white; border-radius:4px;"
# )
# self.cancelButton.pressed.connect(self.cancelButtonPressed)
# hlayout2.addWidget(self.cancelButton)
# vlayout = QtWidgets.QVBoxLayout()
# vlayout.addLayout(hlayout)
# vlayout.addLayout(vOptionLayout)
# vlayout.addLayout(hlayout2)
# self.setLayout(vlayout)
# self.timer = QtCore.QTimer()
# self.timer.setInterval(160) # just faster than 60Hz
# self.timer.timeout.connect(self.update_settings_data)
# self.timer.start()
# def update_settings_data(self):
# if self.liveUpdating:
# for widget in self.spinDict:
# self.spinDict[widget].update_targets_value()
# def okButtonPressed(self):
# message = []
# self.liveUpdating = True
# for widget in self.spinDict:
# #print(widget)
# if self.spinDict[widget].manuallyUpdated:
# setVal = self.spinDict[widget].simpleSpin.value()
# #print('manually updated')
# print('set' + widget + ' to ' + str(setVal) )
# self.spinDict[widget].manuallyUpdated = False
# def cancelButtonPressed(self):
# self.liveUpdating = True
# def modeSwitch(self,enableList):
# print('switching')
# print(enableList)
# for widget,enableBool in zip(self.spinDict, enableList):
# self.spinDict[widget].simpleSpin.setEnabled(enableBool)
# print(enableBool)
# if enableBool==1:
# print('doing it')
# self.spinDict[widget].simpleSpin.setProperty("bgColour", "0")
# if enableBool ==0:
# print('again')
# self.spinDict[widget].simpleSpin.setProperty("bgColour", "1")
# self.spinDict[widget].simpleSpin.style().unpolish(self.spinDict[widget].simpleSpin)
# self.spinDict[widget].simpleSpin.style().polish(self.spinDict[widget].simpleSpin)
# print('exiting')
from PySide2 import QtWidgets, QtGui, QtCore
from global_widgets.template_set_values import TemplateSetValues
class TabPersonal(
TemplateSetValues
): # chose QWidget over QDialog family because easier to modify
def __init__(self, *args, **kwargs):
settingsList = [
["Name", "/min", "respiratory_rate"],
["Patient ID", "s", "inhale_time"],
["Age", "", "ie_ratio"],
["Sex", "", "inhale_trigger_threshold"],
["Weight", "", "exhale_trigger_threshold"],
["Height", "", "inspiratory_pressure"],
]
super(TabPersonal, self).__init__(*args, **kwargs)
self.addSpinSingleCol(settingsList)
self.addButtons()
self.finaliseLayout()
# class TabPersonal(
# QtWidgets.QWidget
# ): # chose QWidget over QDialog family because easier to modify
# def __init__(self, *args, **kwargs):
# super(TabPersonal, self).__init__(*args, **kwargs)
# self.liveUpdating = True
# settingsList = [
# ["Name", "/min", "respiratory_rate"],
# ["Patient ID", "s", "inhale_time"],
# ["Age", "", "ie_ratio"],
# ["Sex", "", "inhale_trigger_threshold"],
# ["Weight", "", "exhale_trigger_threshold"],
# ["Height", "", "inspiratory_pressure"]
# ]
# self.spinDict = {}
# vOptionLayout = QtWidgets.QVBoxLayout()
# for info in settingsList:
# self.spinDict[info[0]] = simpleSpin(info)
# vOptionLayout.addWidget(self.spinDict[info[0]])
# hlayout = QtWidgets.QHBoxLayout()
# self.okButton = QtWidgets.QPushButton()
# self.okButton.setStyleSheet(
# "height:50px; background-color:white; border-radius:4px;"
# )
# self.okButton.pressed.connect(self.okButtonPressed)
# hlayout.addWidget(self.okButton)
# self.cancelButton = QtWidgets.QPushButton()
# self.cancelButton.setStyleSheet(
# "height:50px; background-color:white; border-radius:4px;"
# )
# self.cancelButton.pressed.connect(self.cancelButtonPressed)
# hlayout.addWidget(self.cancelButton)
# vlayout = QtWidgets.QVBoxLayout()
# vlayout.addLayout(vOptionLayout)
# vlayout.addLayout(hlayout)
# self.setLayout(vlayout)
# self.timer = QtCore.QTimer()
# self.timer.setInterval(160) # just faster than 60Hz
# self.timer.timeout.connect(self.update_settings_data)
# self.timer.start()
# def update_settings_data(self):
# if self.liveUpdating:
# for widget in self.spinDict:
# self.spinDict[widget].update_targets_value()
# def okButtonPressed(self):
# message = []
# self.liveUpdating = True
# for widget in self.spinDict:
# #print(widget)
# if self.spinDict[widget].manuallyUpdated:
# setVal = self.spinDict[widget].simpleSpin.value()
# #print('manually updated')
# print('set' + widget + ' to ' + str(setVal) )
# self.spinDict[widget].manuallyUpdated = False
# def cancelButtonPressed(self):
# self.liveUpdating = True
from PySide2 import QtWidgets, QtGui, QtCore
import sys
class simpleSpin(QtWidgets.QWidget):
def __init__(self, infoArray, *args, **kwargs):
super(simpleSpin, self).__init__(*args, **kwargs)
self.label, self.units, self.tag = infoArray
layout = QtWidgets.QHBoxLayout()
textStyle = "color:white; font: 16pt"
self.nameLabel = QtWidgets.QLabel(self.label)
self.nameLabel.setStyleSheet(textStyle)
self.nameLabel.setAlignment(QtCore.Qt.AlignRight)
layout.addWidget(self.nameLabel)
self.simpleSpin = QtWidgets.QSpinBox()
self.simpleSpin.setStyleSheet(
"""QSpinBox{background-color:white; width:100px; font:16pt}
QSpinBox[colour="0"]{color:black}
QSpinBox[colour="1"]{color:red}
QSpinBox::up-button{width:20; }
QSpinBox::down-button{width:20; }
"""
)
self.simpleSpin.setProperty("colour", "1")
self.simpleSpin.setButtonSymbols(
QtWidgets.QAbstractSpinBox.ButtonSymbols.PlusMinus
)
self.simpleSpin.setAlignment(QtCore.Qt.AlignCenter)
layout.addWidget(self.simpleSpin)
self.unitLabel = QtWidgets.QLabel(self.units)
self.unitLabel.setStyleSheet(textStyle)
self.unitLabel.setAlignment(QtCore.Qt.AlignLeft)
layout.addWidget(self.unitLabel)
self.setLayout(layout)
def update_value(self):
newVal = (
self.parent()
.parent()
.parent()
.parent()
.parent()
.parent()
.readback[self.tag]
)
self.simpleSpin.setValue(newVal)
from global_widgets.global_spinbox import simpleSpin
from global_widgets.global_select_button import selectorButton
from global_widgets.global_send_popup import SetConfirmPopup
class TabExpert(
......@@ -58,7 +9,8 @@ class TabExpert(
): # chose QWidget over QDialog family because easier to modify
def __init__(self, *args, **kwargs):
super(TabExpert, self).__init__(*args, **kwargs)
self.liveUpdating = True
self.modifications = []
controlDict = {
"Buffers": [
["Calibration", "ms", "duration_calibration"],
......@@ -80,7 +32,7 @@ class TabExpert(
["O2 in", "", "valve_o2_in"],
["Inhale", "", "valve_inhale"],
["Exhale", "", "valve_exhale"],
["Purge", "", "valve_purge"],
["Purge valve", "", "valve_purge"],
["Inhale Opening", "%", "valve_inhale_percent"],
["Exhale Opening", "%", "valve_exhale_percent"],
],
......@@ -117,12 +69,14 @@ class TabExpert(
self.okButton.setStyleSheet(
"height:50px; background-color:white; border-radius:4px;"
)
self.okButton.pressed.connect(self.okButtonPressed)
grid.addWidget(self.okButton, i, 0, 1, 3)
self.cancelButton = QtWidgets.QPushButton()
self.cancelButton.setStyleSheet(
"height:50px; background-color:white; border-radius:4px;"
)
self.cancelButton.pressed.connect(self.cancelButtonPressed)
grid.addWidget(self.cancelButton, i, 3, 1, 3)
self.setLayout(grid)
......@@ -133,5 +87,23 @@ class TabExpert(
self.timer.start()
def update_settings_data(self):
for spinBox in self.spinDict:
self.spinDict[spinBox].update_value()
if self.liveUpdating:
for spinBox in self.spinDict:
self.spinDict[spinBox].update_readback_value()
def okButtonPressed(self):
message = []
self.liveUpdating = True
for widget in self.spinDict:
# print(widget)
if self.spinDict[widget].manuallyUpdated:
setVal = self.spinDict[widget].simpleSpin.value()
# print('manually updated')
print("set" + widget + " to " + str(setVal))
message.append(["set" + widget + " to " + str(setVal)])
self.spinDict[widget].manuallyUpdated = False
self.popup = SetConfirmPopup(message)
self.popup.show()
def cancelButtonPressed(self):
self.liveUpdating = True
{"version": 182, "timestamp": 816562, "payload_type": "ALARM", "alarm_type": "PRIORITY_MEDIUM", "alarm_code": "HIGH_VTE", "param": 24868.025390625}
{"version": 182, "timestamp": 0, "payload_type": "BATTERY", "bat": 0, "ok": 0, "alarm": 0, "rdy2buf": 0, "bat85": 0, "prob_elec": 0, "dummy": false}
{"version": 182, "timestamp": 816103, "payload_type": "DATA", "fsm_state": "INHALE", "pressure_air_supply": 13, "pressure_air_regulated": 365.1913757324219, "pressure_o2_supply": 45, "pressure_o2_regulated": 0.0322265625, "pressure_buffer": 239.28102111816406, "pressure_inhale": 17.676271438598633, "pressure_patient": 16.122142791748047, "temperature_buffer": 659, "pressure_diff_patient": 0.5741281509399414, "ambient_pressure": 0, "ambient_temperature": 0, "airway_pressure": 7.061350345611572, "flow": 34.1150016784668, "flow_calc": 0.9805641174316406, "volume": 46869.6953125, "target_pressure": 17.0, "process_pressure": 17.676271438598633, "valve_duty_cycle": 0.5721527934074402, "proportional": -0.0013525428948923945, "integral": 0.04374659061431885, "derivative": -0.12062221765518188}
{
"version": 182,
"timestamp": 815263,
"payload_type": "READBACK",
"duration_pre_calibration": 6000,
"duration_calibration": 4000,
"duration_buff_purge": 600,
"duration_buff_flush": 600,
"duration_buff_prefill": 100,
"duration_buff_fill": 600,
"duration_buff_pre_inhale": 0,
"duration_inhale": 1000,
"duration_pause": 10,
"duration_exhale": 2990,
"valve_air_in": 0.0,
"valve_o2_in": 0.0,
"valve_inhale": 0,
"valve_exhale": 1,
"valve_purge": 0,
"ventilation_mode": "PC_AC",
"valve_inhale_percent": 0,
"valve_exhale_percent": 0,
"valve_air_in_enable": 1,
"valve_o2_in_enable": 1,
"valve_purge_enable": 1,
"inhale_trigger_enable": 1,
"exhale_trigger_enable": 0,
"peep": 3.167065143585205,
"inhale_exhale_ratio": 0.33779263496398926,
"kp": 0.0010000000474974513,
"ki": 0.0005000000237487257,
"kd": 0.0010000000474974513,
"pid_gain": 2.0,
"max_patient_pressure": 45
}
appdirs==1.4.4
astroid==2.4.2
attrs==20.3.0
black==20.8b1
cfgv==3.2.0
click==7.1.2
distlib==0.3.1
filelock==3.0.12
identify==1.5.13
importlib-metadata==3.4.0
iniconfig==1.1.1
isort==5.7.0
lazy-object-proxy==1.4.3
libscrc==1.5
mccabe==0.6.1
mypy-extensions==0.4.3
nodeenv==1.5.0
numpy==1.19.5
packaging==20.8
pathspec==0.8.1
pluggy==0.13.1
pre-commit==2.9.3
psutil==5.8.0
py==1.10.0
pylint==2.6.0
pyparsing==2.4.7
pyqtgraph==0.11.1
pyserial==3.5
pyserial-asyncio==0.5
#PySide2==5.15.2
pytest==6.2.1
PyYAML==5.4.1
regex==2020.11.13
#shiboken2==5.15.2
six==1.15.0
toml==0.10.2
typed-ast==1.4.2
typing-extensions==3.7.4.3
virtualenv==20.4.0
wrapt==1.12.1
zipp==3.4.0
{
"version": 182,
"timestamp": 815111,
"payload_type": "TARGET",
"mode": "CURRENT",
"inspiratory_pressure": 17.0,
"ie_ratio": 0.33779263496398926,
"volume": 400.0,
"respiratory_rate": 15.0,
"peep": 5.0,
"fiO2_percent": 21.0,
"inhale_time": 1.0,
"inhale_trigger_enable": 1,
"exhale_trigger_enable": 0,
"volume_trigger_enable": 0,
"inhale_trigger_threshold": 5.0,
"exhale_trigger_threshold": 25.0,
"buffer_upper_pressure": 300.0,
"buffer_lower_pressure": 285.0
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment