Пример #1
0
    def __init__(self, is_simulation=False, *args, **kwargs):
        super().__init__(*args, **kwargs)

        # load objects
        if is_simulation:
            self.microcontroller = microcontroller.Microcontroller_Simulation()
        else:
            self.microcontroller = microcontroller.Microcontroller()
        self.waveforms = core.Waveforms(self.microcontroller)

        # load widgets
        self.waveformDisplay = widgets.WaveformDisplay()
        self.controlPanel = widgets.ControlPanel()

        # layout widgets
        layout = QGridLayout()  #layout = QStackedLayout()
        layout.addWidget(self.waveformDisplay, 0, 0)
        layout.addWidget(self.controlPanel, 1, 0)

        # transfer the layout to the central widget
        self.centralWidget = QWidget()
        self.centralWidget.setLayout(layout)
        self.setCentralWidget(self.centralWidget)

        # make connections
        self.controlPanel.signal_logging_onoff.connect(
            self.waveforms.logging_onoff)
        self.waveforms.signal_plot1.connect(
            self.waveformDisplay.plotWidget[0].plot)
        self.waveforms.signal_plot2.connect(
            self.waveformDisplay.plotWidget[1].plot)
        # self.waveforms.signal_plotyy.connect(self.waveformDisplay.plotWidget[0].plot_yy)

        self.waveforms.signal_ch1.connect(self.controlPanel.label_ch1.setText)
        self.waveforms.signal_ch2.connect(self.controlPanel.label_ch2.setText)
Пример #2
0
	def __init__(self, *args, **kwargs):
		super().__init__(*args, **kwargs)

		# load objects
		if SIMULATION:
			self.microcontroller = microcontroller.Microcontroller_Simulation()
		else:
			self.microcontroller = microcontroller.Microcontroller()
		self.stepperMotorController = core.ValveController(self.microcontroller)
		self.ventController = core.VentController(self.microcontroller)
		self.waveforms = core.Waveforms(self.microcontroller,self.ventController)
		
		# load widgets
		self.navigationWidget = widgets.stepperMotorWidget(self.stepperMotorController)
		self.waveformDisplay = widgets.WaveformDisplay()
		self.controlPanel = widgets.ControlPanel(self.ventController)

		# layout widgets
		layout = QGridLayout() #layout = QStackedLayout()
		# layout.addWidget(self.navigationWidget,0,0)
		layout.addWidget(self.waveformDisplay,0,0)
		layout.addWidget(self.controlPanel,1,0)

		# transfer the layout to the central widget
		self.centralWidget = QWidget()
		self.centralWidget.setLayout(layout)
		self.setCentralWidget(self.centralWidget)

		# make connections
		self.stepperMotorController.xPos.connect(self.navigationWidget.label_Xpos.setNum)
		self.stepperMotorController.yPos.connect(self.navigationWidget.label_Ypos.setNum)
		self.waveforms.signal_Paw.connect(self.waveformDisplay.plotWidgets['Airway Pressure'].update_plot)
		self.waveforms.signal_Flow.connect(self.waveformDisplay.plotWidgets['Flow Rate'].update_plot)
		self.waveforms.signal_Volume.connect(self.waveformDisplay.plotWidgets['Volume'].update_plot)