def fill_frame(self, settings):
        close_btn = FlatButton(self,
                               self.callback,
                               MenuViewActions.NONE,
                               self.config.values['colors']['lightBlue'],
                               fontSize=20)
        close_btn.setText(_("Close"))
        close_btn.grid(row=0, column=3, sticky=N + S + E + W, padx=10, pady=20)

        self.exit_btn = FlatButton(self,
                                   self.callback,
                                   MenuViewActions.SHUTDOWN,
                                   self.config.values['colors']['lightBlue'],
                                   fontSize=20,
                                   timeout=4)
        self.exit_btn.grid(row=2,
                           column=2,
                           columnspan=2,
                           sticky=N + S + E + W,
                           padx=(40, 0),
                           pady=40)

        if settings.start:
            self.exit_btn.setEnabled(False)

        self.rowconfigure(0, weight=1)
        self.rowconfigure(1, weight=1)
        self.rowconfigure(2, weight=2)
        self.rowconfigure(3, weight=1)
        self.rowconfigure(4, weight=1)

        for i in range(0, 4):
            self.columnconfigure(i, weight=1)
    def fill_frame(self):
        for btn in self.alarm_btns:
            btn.destroy()

        self.alarm_btns.clear()

        clear_btn = FlatButton(self,
                               self.callback,
                               AlarmType.CLEAR,
                               self.config.values['colors']['lightBlue'],
                               fontSize=15)
        clear_btn.setText(_("Clear\nInactive Alarms"))
        clear_btn.grid(row=0, column=0, sticky=N + S + E + W, padx=10, pady=10)

        close_btn = FlatButton(self,
                               self.callback,
                               AlarmType.NONE,
                               self.config.values['colors']['lightBlue'],
                               fontSize=20)
        close_btn.setText(_("Close"))
        close_btn.grid(row=0, column=3, sticky=N + S + E + W, padx=10, pady=10)

        for i in range(0, len(self.alarms.alarms)):
            color = self.config.values['colors']['lightBlue']
            if self.alarms.alarms[i].active:
                color = self.config.values['colors']['alarmColor']

            if self.alarms.alarms[i].type == AlarmType.RUN_ON_BATTERY:
                self.alarm_btns.append(
                    FlatButton(self,
                               self.callback,
                               self.alarms.alarms[i].type,
                               color,
                               fontSize=20,
                               pressable=False))
            else:
                self.alarm_btns.append(
                    FlatButton(self,
                               self.callback,
                               self.alarms.alarms[i].type,
                               color,
                               fontSize=20))

            self.alarm_btns[i].setText(self.alarms.alarms[i])
            self.alarm_btns[i].grid(row=i + 1,
                                    column=0,
                                    columnspan=4,
                                    sticky=N + S + E + W,
                                    padx=10,
                                    pady=10)

        for i in range(0, len(self.alarms.alarms) + 1):
            self.rowconfigure(i, weight=1)
        for i in range(0, 4):
            self.columnconfigure(i, weight=1)
    def drawPlusButtons(self):
        first_plus = FlatButton(self, self.changeTimeCallback, (0, 1), self.config.values['colors']['lightBlue'], fontSize=40)
        first_plus.setText("+")
        first_plus.grid(row=1, column=0, sticky=N+S+E+W, padx=10, pady=10)

        second_plus = FlatButton(self, self.changeTimeCallback, (1, 1), self.config.values['colors']['lightBlue'], fontSize=40)
        second_plus.setText("+")
        second_plus.grid(row=1, column=1, sticky=N+S+E+W, padx=10, pady=10)

        third_plus = FlatButton(self, self.changeTimeCallback, (2, 1), self.config.values['colors']['lightBlue'], fontSize=40)
        third_plus.setText("+")
        third_plus.grid(row=1, column=3, sticky=N+S+E+W, padx=10, pady=10)

        fourth_plus = FlatButton(self, self.changeTimeCallback, (3, 1), self.config.values['colors']['lightBlue'], fontSize=40)
        fourth_plus.setText("+")
        fourth_plus.grid(row=1, column=4, sticky=N+S+E+W, padx=10, pady=10)
    def drawTime(self):
        self.first_digit = FlatButton(self, None, None, self.config.values['colors']['darkBlue'], fontSize=40)
        self.first_digit.grid(row=2, column=0, sticky=N+S+E+W, padx=10, pady=10)

        self.second_digit = FlatButton(self, None, None, self.config.values['colors']['darkBlue'], fontSize=40)
        self.second_digit.grid(row=2, column=1, sticky=N + S + E + W, padx=10, pady=10)

        dots = FlatButton(self, self.changeTimeCallback, (1, 1), self.config.values['colors']['darkBlue'],
                                 fontSize=40)
        dots.setText(":")
        dots.grid(row=2, column=2, sticky=N + S + E + W, padx=10, pady=10)

        self.third_digit = FlatButton(self, None, None, self.config.values['colors']['darkBlue'], fontSize=40)
        self.third_digit.grid(row=2, column=3, sticky=N + S + E + W, padx=10, pady=10)

        self.fourth_digit = FlatButton(self, None, None, self.config.values['colors']['darkBlue'], fontSize=40)
        self.fourth_digit.grid(row=2, column=4, sticky=N + S + E + W, padx=10, pady=10)

        self.update()
    def fill_frame(self):
        label_btn = FlatButton(self, None, None, self.config.values['colors']['darkBlue'], fontSize=25)
        label_btn.setText(_("Set the Time"))
        label_btn.grid(row=0, column=0, columnspan=5, sticky=N+S+E+W, padx=10, pady=10)

        self.drawPlusButtons()
        self.drawTime()
        self.drawMinusButtons()

        confirm_btn = FlatButton(self, self.returnTimeCallback, SetTimeCallback.SET_TIME, self.config.values['colors']['green'], fontSize=40)
        confirm_btn.setText(_("Confirm"), "white")
        confirm_btn.grid(row=4, column=0, columnspan=5, sticky=N + S + E + W, padx=20, pady=(60, 20))

        for i in range(0, 5):
            self.columnconfigure(i, weight=5)

        self.columnconfigure(2, weight=1)

        self.rowconfigure(0, weight=1)
        for i in range(1, 5):
            self.rowconfigure(i, weight=2)
Exemple #6
0
    def fill_frame(self):
        # Buttons on the  top and left
        self.air_btn = FlatButton(self, self.callback, MainViewActions.MENU,
                             self.config.values['colors']['lightBlue'])
        self.air_btn.setText(_("Menu"))
        self.air_btn.grid(row=0, column=0, sticky=N + S + E + W, padx=(0,2), pady=(2,0))

        self.alarm_btn = FlatButton(self, self.callback, MainViewActions.ALARM, self.config.values['colors']['lightBlue'])
        self.alarm_btn.setText(_("Alarm"))
        self.alarm_btn.grid(row=0, column=1, sticky=N + S + E + W, padx=(0,2), pady=(2,0))

        self.alarm_overview_btn = FlatButton(self, self.callback, MainViewActions.VIEW_ALARMS, self.config.values['colors']['lightBlue'])
        self.alarm_overview_btn.setText(_("Alarm Overview"))
        self.alarm_overview_btn.grid(row=0, column=2, sticky=N + S + E + W, padx=(0,2), pady=(2,0))

        self.patient_btn = FlatButton(self, self.callback, MainViewActions.PATIENT, self.config.values['colors']['lightBlue'])
        # self.patient_btn.setText(_("Patient"))
        self.patient_btn.setText("")
        self.patient_btn.grid(row=0, column=3, sticky=N + S + E + W, padx=(0,2), pady=(2, 0))

        self.switch_btn = FlatButton(self, self.callback, MainViewActions.STARTSTOP, self.config.values['colors']['lightBlue'], timeout=4)
        self.switch_btn.grid(row=0, column=4, sticky=N + S + E + W, padx=(0,2), pady=(2, 0))

        self.peep_btn = FlatButton(self, self.callback, MainViewActions.PEEP, self.config.values['colors']['lightBlue'])
        self.peep_btn.grid(row=1, column=0, columnspan=2, rowspan=3, sticky=N + S + E + W, padx=(0,2), pady=(2,0))

        self.freq_btn = FlatButton(self, self.callback, MainViewActions.FREQ, self.config.values['colors']['lightBlue'])
        self.freq_btn.grid(row=4, column=0,columnspan=2, rowspan=3, sticky=N + S + E + W, padx=(0,2), pady=(2,0))

        self.pres_btn = FlatButton(self, self.callback, MainViewActions.PRESSURE, self.config.values['colors']['lightBlue'])
        self.pres_btn.grid(row=7, column=0, columnspan=2, rowspan=3, sticky=N + S + E + W, padx=(0,2), pady=(2,0))

        self.oxy_btn = FlatButton(self, self.callback, MainViewActions.OXYGEN, self.config.values['colors']['lightBlue'])
        self.oxy_btn.grid(row=10, column=0, columnspan=2, rowspan=3, sticky=N + S + E + W, padx=(0,2), pady=(2,0))


        # Labels on the right side next to the graphs
        self.ppeak_label = CurrentValueCanvas(self, _("Ppeak"), 100, self.config.values['colors']['pressurePlot'])
        self.ppeak_label.grid(row=1, column=4, rowspan=2, sticky=N + S + E + W)

        self.pmean_label = CurrentValueCanvas(self, _("Pmean"), 50, self.config.values['colors']['pressurePlot'])
        self.pmean_label.grid(row=3, column=4, rowspan=2, sticky=N + S + E + W)

        self.oxy_label = CurrentValueCanvas(self, _("O2"), self.sensordata.oxygen, 'white')
        self.oxy_label.grid(row=5, column=4, rowspan=2, sticky=N + S + E + W)

        self.tvinexp_label = CurrentValueCanvas(self, _("TV in/exp"), 0, self.config.values['colors']['green'])
        self.tvinexp_label.grid(row=7, column=4, rowspan=2, sticky=N + S + E + W)

        self.tv_label1 = CurrentValueCanvas(self, _("min.vol"),
                                           [self.sensordata.tidal_volume_inhale, self.sensordata.tidal_volume_exhale],
                                           self.config.values['colors']['green'])
        self.tv_label1.grid(row=9, column=4, rowspan=2, sticky=N + S + E + W)

        self.batt_label = CurrentValueCanvas(self, _("Batt. [%]"), self.sensordata.battery_percentage, 'white')
        self.batt_label.grid(row=11, column=4, rowspan=2, sticky=N + S + E + W)

        # Buttons under graphs
        self.inspHold_btn = FlatButton(self, self.callback, MainViewActions.INSP_HOLD_STOP, self.config.values['colors']['lightBlue'])
        self.inspHold_btn.setCustomPressArgument(MainViewActions.INSP_HOLD_START)
        self.inspHold_btn.setText(_("Inspiration Hold\n(Hold to measure)"))
        self.inspHold_btn.grid(row=10, column=2, columnspan=1, rowspan=3, sticky=N + S + E + W, padx=(0,2), pady=(2,0))

        self.expHold_btn = FlatButton(self, self.callback, MainViewActions.EXP_HOLD_STOP, self.config.values['colors']['lightBlue'])
        self.expHold_btn.setCustomPressArgument(MainViewActions.EXP_HOLD_START)
        self.expHold_btn.setText(_("Expiration Hold\n(Hold to measure)"))
        self.expHold_btn.grid(row=10, column=3, columnspan=1, rowspan=3, sticky=N + S + E + W, padx=(0,2), pady=(2,0))


        self.rowconfigure(0, weight=5)
        for i in range(1, 10):
            self.rowconfigure(i, weight=1)
        for i in range(9, 13):
            self.rowconfigure(i, weight=3)

        self.columnconfigure(0, weight=2)
        self.columnconfigure(1, weight=2)
        self.columnconfigure(2, weight=5)
        self.columnconfigure(3, weight=5)
        self.columnconfigure(4, weight=2)

        self.drawGraphs()
    def fill_frame(self):

        pad = 1

        desc_btn = FlatButton(self,
                              None,
                              None,
                              self.config.values['colors']['darkBlue'],
                              fontSize=30)
        desc_btn.setText(self.description)
        desc_btn.grid(row=0, column=1, columnspan=2, sticky=N + S + E + W)

        close_btn = FlatButton(self,
                               self.confirmSetting,
                               SettingType.NONE,
                               self.config.values['colors']['lightBlue'],
                               fontSize=20)
        close_btn.setText(_("Close"))
        close_btn.grid(row=0, column=3, sticky=N + S + E + W, padx=10, pady=10)

        min_desc_btn = FlatButton(self,
                                  None,
                                  None,
                                  self.config.values['colors']['darkBlue'],
                                  fontSize=20)
        min_desc_btn.setText(self.label1)
        min_desc_btn.grid(row=1, column=0, sticky=N + S + E + W)

        minminus_btn = FlatButton(self,
                                  self.valueChange,
                                  ChangeAlarmViewActions.MINMINUS,
                                  self.config.values['colors']['lightBlue'],
                                  fontSize=30)
        minminus_btn.setText("-")
        minminus_btn.grid(row=1,
                          column=1,
                          sticky=N + S + E + W,
                          padx=pad,
                          pady=pad)

        minplus_btn = FlatButton(self,
                                 self.valueChange,
                                 ChangeAlarmViewActions.MINPLUS,
                                 self.config.values['colors']['lightBlue'],
                                 fontSize=30)
        minplus_btn.setText("+")
        minplus_btn.grid(row=1,
                         column=2,
                         sticky=N + S + E + W,
                         padx=pad,
                         pady=pad)

        self.min_value_btn = FlatButton(
            self,
            None,
            None,
            self.config.values['colors']['darkBlue'],
            fontSize=30)
        self.min_value_btn.setText(self.min_current)
        self.min_value_btn.grid(row=1, column=3, sticky=N + S + E + W)

        max_desc_btn = FlatButton(self,
                                  None,
                                  None,
                                  self.config.values['colors']['darkBlue'],
                                  fontSize=20)
        max_desc_btn.setText(self.label2)
        max_desc_btn.grid(row=2, column=0, sticky=N + S + E + W)

        maxminus_btn = FlatButton(self,
                                  self.valueChange,
                                  ChangeAlarmViewActions.MAXMINUS,
                                  self.config.values['colors']['lightBlue'],
                                  fontSize=30)
        maxminus_btn.setText("-")
        maxminus_btn.grid(row=2,
                          column=1,
                          sticky=N + S + E + W,
                          padx=pad,
                          pady=pad)

        maxplus_btn = FlatButton(self,
                                 self.valueChange,
                                 ChangeAlarmViewActions.MAXPLUS,
                                 self.config.values['colors']['lightBlue'],
                                 fontSize=30)
        maxplus_btn.setText("+")
        maxplus_btn.grid(row=2,
                         column=2,
                         sticky=N + S + E + W,
                         padx=pad,
                         pady=pad)

        self.max_value_btn = FlatButton(
            self,
            None,
            None,
            self.config.values['colors']['darkBlue'],
            fontSize=30)
        self.max_value_btn.setText(self.max_current)
        self.max_value_btn.grid(row=2, column=3, sticky=N + S + E + W)

        confirm_btn = FlatButton(self,
                                 self.confirmSetting,
                                 self.type,
                                 self.config.values['colors']['green'],
                                 fontSize=40)
        confirm_btn.setText(_("Confirm"), "white")
        confirm_btn.grid(row=3,
                         column=0,
                         columnspan=4,
                         sticky=N + S + E + W,
                         padx=20,
                         pady=(60, 20))

        for i in range(0, 4):
            self.columnconfigure(i, weight=1)

        self.rowconfigure(0, weight=1)
        for i in range(1, 4):
            self.rowconfigure(i, weight=2)
    def fill_frame(self):

        pad = 1

        close_btn = FlatButton(self,
                               self.confirmSetting,
                               SettingType.NONE,
                               self.config.values['colors']['lightBlue'],
                               fontSize=20)
        close_btn.setText(_("Close"))
        close_btn.grid(row=0, column=3, sticky=N + S + E + W, padx=10, pady=10)

        desc_btn = FlatButton(self,
                              None,
                              None,
                              self.config.values['colors']['darkBlue'],
                              fontSize=20)
        desc_btn.setText(self.description)
        desc_btn.grid(row=1, column=0, sticky=N + S + E + W)

        minus_btn = FlatButton(self,
                               self.valueChange,
                               ButtonAction.MINUS,
                               self.config.values['colors']['lightBlue'],
                               fontSize=30)
        minus_btn.setText("-")
        minus_btn.grid(row=1,
                       column=1,
                       sticky=N + S + E + W,
                       padx=pad,
                       pady=80)

        plus_btn = FlatButton(self,
                              self.valueChange,
                              ButtonAction.PLUS,
                              self.config.values['colors']['lightBlue'],
                              fontSize=30)
        plus_btn.setText("+")
        plus_btn.grid(row=1, column=2, sticky=N + S + E + W, padx=pad, pady=80)

        self.value_btn = FlatButton(self,
                                    None,
                                    None,
                                    self.config.values['colors']['darkBlue'],
                                    fontSize=30)
        self.value_btn.setText(self.current)
        self.value_btn.grid(row=1, column=3, sticky=N + S + E + W)

        confirm_btn = FlatButton(self,
                                 self.confirmSetting,
                                 self.type,
                                 self.config.values['colors']['green'],
                                 fontSize=40)
        confirm_btn.setText(_("Confirm"), "white")
        confirm_btn.grid(row=2,
                         column=0,
                         columnspan=4,
                         sticky=N + S + E + W,
                         padx=20,
                         pady=(20, 20))

        self.columnconfigure(0, weight=2)
        for i in range(1, 3):
            self.columnconfigure(i, weight=1)
        self.columnconfigure(3, weight=2)

        self.rowconfigure(0, weight=1)
        self.rowconfigure(1, weight=3)
        self.rowconfigure(2, weight=2)
Exemple #9
0
    def fill_frame(self):
        close_btn = FlatButton(self,
                               self.callback,
                               None,
                               self.config.values['colors']['lightBlue'],
                               fontSize=20)
        close_btn.setText(_("Close"))
        close_btn.grid(row=0, column=3, sticky=N + S + E + W, padx=10, pady=10)

        peep_btn = FlatButton(self,
                              self.callback,
                              SettingType.PEEP,
                              self.config.values['colors']['lightBlue'],
                              fontSize=20)
        peep_btn.setText(
            _("PEEP") + "\n" + str(self.settings.min_peep) + "-" +
            str(self.settings.max_peep))
        peep_btn.grid(row=1,
                      column=0,
                      sticky=N + S + E + W,
                      padx=(40, 0),
                      pady=80)

        press_btn = FlatButton(self,
                               self.callback,
                               SettingType.PRESSURE,
                               self.config.values['colors']['lightBlue'],
                               fontSize=20)
        press_btn.setText(
            _("Pressure") + "\n" + str(self.settings.min_pressure) + "-" +
            str(self.settings.max_pressure))
        press_btn.grid(row=1,
                       column=1,
                       sticky=N + S + E + W,
                       padx=(2, 0),
                       pady=80)

        tidal_btn = FlatButton(self,
                               self.callback,
                               SettingType.TIDAL,
                               self.config.values['colors']['lightBlue'],
                               fontSize=20)
        tidal_btn.setText(
            _("Tidal Volume") + "\n" + str(self.settings.min_tv) + "-" +
            str(self.settings.max_tv))
        tidal_btn.grid(row=1,
                       column=2,
                       sticky=N + S + E + W,
                       padx=(2, 0),
                       pady=80)

        oxy_btn = FlatButton(self,
                             self.callback,
                             SettingType.OXYGEN,
                             self.config.values['colors']['lightBlue'],
                             fontSize=20)
        oxy_btn.setText(
            _("Oxygen") + "\n" + str(self.settings.min_fio2) + "-" +
            str(self.settings.max_fio2))
        oxy_btn.grid(row=1,
                     column=3,
                     sticky=N + S + E + W,
                     padx=(2, 40),
                     pady=80)

        self.rowconfigure(0, weight=1)
        self.rowconfigure(1, weight=3)
        self.rowconfigure(2, weight=1)

        for i in range(0, 4):
            self.columnconfigure(i, weight=1)