Пример #1
0
    def __init__(self, user: str, parent=None):
        super(Cronometro, self).__init__(parent)
        self.user = user
        self.settings: UserSettings = UserSettings(user)
        PacientInterface.__init__(self)
        get_cronometro_widget_ui(self)
        self.formLayout: QFormLayout = self.formLayout
        self.vuelta3_label: QLabel = self.vuelta3_label
        self.vuelta2_label: QLabel = self.vuelta2_label
        self.vuelta1_label: QLabel = self.vuelta1_label
        self.vuelta3_edit: QTextEdit = self.vuelta3_edit
        self.vuelta2_edit: QTextEdit = self.vuelta2_edit
        self.vuelta1_edit: QTextEdit = self.vuelta1_edit
        self.setObjectName("cronometro_paciente")
        self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
        self.progress_bar = get_cronometro_bar_widget()
        self.progress_bar.setSizePolicy(QSizePolicy.Expanding,
                                        QSizePolicy.Expanding)
        # Le ponemos los colores y los maximos al cronometro

        # editamos los label con los ajustes
        self.shownResults0: QLabel = self.shownResults0
        self.shownResults1: QLabel = self.shownResults1
        self.shownResults2: QLabel = self.shownResults2
        self.vuelta1_label.setText(self.settings.value(
            self.settings.LAP0_NAME))
        self.vuelta2_label.setText(self.settings.value(
            self.settings.LAP1_NAME))
        self.vuelta3_label.setText(self.settings.value(
            self.settings.LAP2_NAME))
        self.crono_widget.addWidget(self.progress_bar)
        self.stop_button.setVisible(False)
        self.cancel_button.setEnabled(False)
        self.vuelta1_edit.setEnabled(False)
        self.vuelta2_edit.setEnabled(False)
        self.vuelta3_edit.setEnabled(False)
        self.prueba_actual: Prueba = ...
        # Conexiones de los botones
        self.start_and_lap.clicked.connect(self.start_and_lap_slot)
        self.cancel_button.clicked.connect(self.cancel_slot)
        self.stop_button.clicked.connect(self.stop_slot)
        ###################################################################
        # Configuracion progress bar
        # self.start_and_lap.setEnabled(True)
        self.timer = None
        self.laps = []
        self.STOPPED = 4
        self.END = self.STOPPED - 2
        self.SAVE = self.STOPPED - 1
        self.status = self.STOPPED
        self.set_to_actual_state()
Пример #2
0
 def __init__(self, parent=None, width=5, height=4, dpi=100):
     PacientInterface.__init__(self)
     fig = Figure(figsize=(width, height), dpi=dpi)
     # self.axes = fig.add_subplot(111)
     self.fig, self.ax = pyplot.subplots()
     self.line_lap0 = None
     self.line_lap1 = None
     self.line_lap2 = None
     self.line_total = None
     self.markers0 = None
     self.markers1 = None
     self.markers2 = None
     self.markers_total = None
     self.text0 = None
     self.text1 = None
     self.text2 = None
     super(Grafica, self).__init__(self.fig)
     FigureCanvas.__init__(self, self.fig)
     FigureCanvasQTAgg.updateGeometry(self)
     self.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Maximum)
Пример #3
0
 def __init__(self, user: str):
     super(EvolutionTab, self).__init__()
     PacientInterface.__init__(self)
     GUI_Resources.get_evolution_tab(self)
     self.settings: UserSettings = UserSettings(user)
     self.evolution_listview: QListView = self.evolution_listview
     self.target_layout: QHBoxLayout = self.target_layout
     self.pacient_name: QLabel = self.pacient_name
     self.todos: QRadioButton = self.todos
     self.semanal: QRadioButton = self.semanal
     self.mensual: QRadioButton = self.mensual
     self.anual: QRadioButton = self.anual
     self.custom: QRadioButton = self.custom
     self.anual.clicked.connect(self.radio_handler)
     self.mensual.clicked.connect(self.radio_handler)
     self.semanal.clicked.connect(self.radio_handler)
     self.todos.clicked.connect(self.radio_handler)
     self.graph = Grafica()
     self.prueba: Prueba = ...
     self.pruebas: list = ...
     self.graph_test_1 = Grafica()
     self.graph_test_2 = Grafica()
     self.graph_test_3 = Grafica()
     self.graph_test_total = Grafica()
     self.user = user
     self.graph_lay_1: QVBoxLayout = self.graph_lay_1
     self.graph_lay_2: QVBoxLayout = self.graph_lay_2
     self.graph_lay_3: QVBoxLayout = self.graph_lay_3
     self.graph_lay_1.addWidget(self.graph_test_1)
     self.graph_lay_2.addWidget(self.graph_test_2)
     self.graph_lay_3.addWidget(self.graph_test_3)
     self.graph_lay_total.addWidget(self.graph_test_total)
     self.target_layout.addWidget(self.graph)
     self.notas_lap3.setVisible(False)
     self.notas_lap2.setVisible(False)
     self.notas_lap1.setVisible(False)
     self.notas_total.setVisible(False)
     self.tiempo_total: QLabel = self.tiempo_total
     self.tiempo_1: QLabel = self.tiempo_1
     self.tiempo_2: QLabel = self.tiempo_2
     self.tiempo_3: QLabel = self.tiempo_3
     #self.notas_lap_total.setVisible(False)
     self.model: PruebasListModel = PruebasListModel.get_instance(user)
     self.evolution_listview.setModel(self.model)
     self.model.change_model_list([])
     self.evolution_listview.clicked.connect(self.onPruebaClicked)
     self.title_test1: QLabel = self.title_test1
     self.title_test2: QLabel = self.title_test2
     self.title_test3: QLabel = self.title_test3
     self.title_test_total: QLabel = self.title_test_total
     self.title_test1.setText(self.settings.value(self.settings.LAP0_NAME))
     self.title_test2.setText(self.settings.value(self.settings.LAP1_NAME))
     self.title_test3.setText(self.settings.value(self.settings.LAP2_NAME))
     self.title_test_total.setText("Total")
     self.filter = get_selector_widget()
     self.buscar.clicked.connect(self.handle_filter)
     self.filter.buscar.clicked.connect(self.handle_filter)
     self.evolution_listview.customContextMenuRequested.connect(self.custom_context_menu)
     self.menu = Menu()
     self.edit_prueba = self.menu.addAction(StaticActions.edit_prueba_action)
     self.del_prueba = self.menu.addAction(StaticActions.del_prueba_action)
     self.add_prueba = self.menu.addAction(StaticActions.add_prueba_action)
     self.add_prueba.setEnabled(False)
     self.edit_prueba.setEnabled(False)
     self.del_prueba.setEnabled(False)
     self.add_prueba.triggered.connect(self.handle_actions)
     self.edit_prueba.triggered.connect(self.handle_actions)
     self.del_prueba.triggered.connect(self.handle_actions)
Пример #4
0
 def __init__(self):
     PacientInterface.__init__(self)
     QWidget.__init__(self)
     get_pacient_widget_ui(self)
     # Variables.
     self.email_regex = re.compile(u'(?:[a-z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])')
     self.dni_regex = re.compile("((([X-Z])|([LM])){1}([-]?)((\d){7})([-]?)([A-Z]{1}))|((\d{8})([-]?)([A-Z]))")
     self.dniValid = False
     self.telefono_regex = re.compile("^(?:6[0-9]|9[0-9]|7[1-9])[0-9]{7}$")
     self.combo_items = ["", "1", "1.5", "2", "2.5", "3", "4", "5", "0"]
     self.gender_items = ["", "Hombre", "Mujer"]
     self.on_focus = True
     # Declaramos los objetos
     self.showMessageBox = QMessageBox()
     self.nacimiento_calendar: QCalendarWidget = self.nacimiento_calendar
     self.nacimiento_field: QDateEdit = self.nacimiento_field
     self.estadio_combo_box: QComboBox = self.estadio_combo_box
     self.label_estadio: QLabel = self.label_estadio
     self.imc_result: QLabel = self.imc_result
     self.altura_edit: QDoubleSpinBox = self.altura_edit
     self.peso_edit: QDoubleSpinBox = self.peso_edit
     self.imc_label: QLabel = self.imc_label
     self.telefono_edit: QLineEdit = self.telefono_edit
     self.direccion_edit: QLineEdit = self.direccion_edit
     self.email_edit: QLineEdit = self.email_edit
     self.consejo_imc: QLabel = self.consejo_imc
     self.diagnostico_tool: QToolButton = self.diagnostico_tool
     self.nacimiento_tool: QToolButton = self.nacimiento_tool
     self.error_apellidos: QLabel = self.error_apellidos
     self.error_dni: QLabel = self.error_dni
     self.error_estadio: QLabel = self.error_estadio
     self.error_nombre: QLabel = self.error_nombre
     self.error_altura: QLabel = self.error_altura
     self.error_telefono: QLabel = self.error_telefono
     self.error_gender: QLabel = self.error_gender
     self.error_email: QLabel = self.error_email
     self.gender_combo_box: QComboBox = self.gender_combo_box
     self.diagnostico_date_edit: QDateEdit = self.diagnostico_date_edit
     self.cara_image: QLabel = self.cara_image
     self.cuerpo_image: QLabel = self.cuerpo_image
     self.current_calendar: QLabel = self.current_calendar
     self.diagnostico_calendar: QCalendarWidget = self.diagnostico_calendar
     self.accept_button: QPushButton = self.accept_button
     self.cancel_button: QPushButton = self.cancel_button
     self.foto_tab: QTabWidget = self.foto_tab
     self.context_button: QToolButton = self.context_button
     # Fin declaracion
     # Conexiones
     self.peso_edit.editingFinished.connect(self.calculate_imc)
     self.altura_edit.editingFinished.connect(self.calculate_imc)
     self.peso_edit.valueChanged.connect(self.calculate_imc)
     self.altura_edit.valueChanged.connect(self.calculate_imc)
     self.accept_button.clicked.connect(self.buttons)
     self.cancel_button.clicked.connect(self.buttons)
     #Comprobamos la letra del dni
     self.dni_field.textChanged.connect(self.comprueba_dni)
     # Fin conexion
     # Conexion Calendarios.
     self.nacimiento_calendar.clicked.connect(self.on_calendar_changed)
     self.nacimiento_field.dateChanged.connect(self.on_calendar_changed)
     self.diagnostico_date_edit.dateChanged.connect(self.on_calendar_changed)
     self.diagnostico_calendar.clicked.connect(self.on_calendar_changed)
     self.diagnostico_tool.clicked.connect(self.activate_calendar)
     self.nacimiento_tool.clicked.connect(self.activate_calendar)
     # Fin conexion calendarios
     # Formateamos ciertas cosas.
     self.gender_combo_box.addItems(self.gender_items)
     self.estadio_combo_box.addItems(self.combo_items)
     self.diagnostico_calendar.setVisible(False)
     self.nacimiento_calendar.setVisible(False)
     self.altura_edit.setDecimals(0)
     self.peso_edit.setDecimals(0)
     self.altura_edit.setSingleStep(1)
     self.peso_edit.setRange(0, 250)
     self.altura_edit.setRange(0, 300)
     self.menu = Menu()
     self.action_select_pic = self.menu.addAction(StaticActions.seleccionar_foto)
     self.action_select_pic.triggered.connect(self.take_picture)
     self.action_take_pic = self.menu.addAction(StaticActions.tomar_foto)
     self.action_take_pic.triggered.connect(self.take_picture)
     self.context_button.clicked.connect(self.popup_context_menu)
     self.context_button.customContextMenuRequested.connect(self.popup_context_menu)
     self.consejo_imc.setVisible(False)  # TODO Cambiar cuando acabe con el objeto settings
     self.pacientSelected(None)
     self.set_enabled(False)