Exemple #1
0
class Form2Dialog(QtGui.QDialog):
    def __init__(self):
        QtGui.QDialog.__init__(self)
        # Set up the user interface from Designer.
        self.ui = Ui_Form()
        self.ui.setupUi(self)

    def SetTextBrowseInputShapeFilter(self):
        self.ui.BrowseShapeLineEdit.setText(flowmapper.InputShpFilterName)

        #InputShpFilterDirectory = os.path.realpath(flowmapper.InputShpFilterName)
        InputShpFilterDirectory = flowmapper.InputShpFilterName
        if len(flowmapper.InputShpFilterName) > 0:
            extension = os.path.splitext(str(InputShpFilterDirectory))[1]
            if extension == ".shp":
                self.ui.CalStat.setEnabled(True)

    def SetTextBrowseOutputShapeFilter(self):
        self.ui.BrowseShapeLineEdit_2.setText(flowmapper.OutputShpFilterName)

    def No_Of_Features(self):
        self.ui.No_Of_Features_LineEdit.setText(flowmapper.CalStatNoOfFeatures)

    def No_Of_FeaturesNotZero(self):
        self.ui.No_Of_ZeroFlowFeatures_LineEdit.setText(
            flowmapper.CalStatNoOfFeaturesZero)

    def Mean(self):
        self.ui.Mean_LineEdit.setText(flowmapper.CalStatMean)

    def MeanNotZero(self):
        self.ui.MeanNotZero_LineEdit.setText(flowmapper.CalStatMeanNotZero)

    def MaxFlow(self):
        self.ui.MaxFlow_LineEdit.setText(flowmapper.CalStatMaxFlow)

    def MinFlow(self):
        self.ui.MinFlow_LineEdit.setText(flowmapper.CalStatMinFlow)

    def SumMagnitude(self):
        self.ui.SumMagnitude_LineEdit.setText(flowmapper.CalStatSumMagnitude)

    def StdDev(self):
        self.ui.StdDev_LineEdit.setText(flowmapper.CalStatStdDev)

    def StdDevNotZero(self):
        self.ui.StdDevNotZero_LineEdit.setText(flowmapper.CalStatStdDevNotZero)
Exemple #2
0
class Form2Dialog(QtGui.QDialog):
    
    def __init__(self):
        QtGui.QDialog.__init__(self)
        # Set up the user interface from Designer.
        self.ui = Ui_Form()
        self.ui.setupUi(self)

    def SetTextBrowseInputShapeFilter(self):
        self.ui.BrowseShapeLineEdit.setText(flowmapper.InputShpFilterName)
        
        #InputShpFilterDirectory = os.path.realpath(flowmapper.InputShpFilterName)
        InputShpFilterDirectory = flowmapper.InputShpFilterName
        if len(flowmapper.InputShpFilterName) > 0:
            extension = os.path.splitext(str(InputShpFilterDirectory))[1]
            if extension == ".shp":
                self.ui.CalStat.setEnabled(True)
        
    def SetTextBrowseOutputShapeFilter(self):
        self.ui.BrowseShapeLineEdit_2.setText(flowmapper.OutputShpFilterName)
    
    def No_Of_Features(self):
        self.ui.No_Of_Features_LineEdit.setText(flowmapper.CalStatNoOfFeatures)

    def No_Of_FeaturesNotZero(self):
        self.ui.No_Of_ZeroFlowFeatures_LineEdit.setText(flowmapper.CalStatNoOfFeaturesZero)
        
    def Mean(self):
        self.ui.Mean_LineEdit.setText(flowmapper.CalStatMean)
    
    def MeanNotZero(self):
        self.ui.MeanNotZero_LineEdit.setText(flowmapper.CalStatMeanNotZero)
        
    def MaxFlow(self):
        self.ui.MaxFlow_LineEdit.setText(flowmapper.CalStatMaxFlow)

    def MinFlow(self):
        self.ui.MinFlow_LineEdit.setText(flowmapper.CalStatMinFlow)
        
    def SumMagnitude(self):
        self.ui.SumMagnitude_LineEdit.setText(flowmapper.CalStatSumMagnitude)
    
    def StdDev(self):
        self.ui.StdDev_LineEdit.setText(flowmapper.CalStatStdDev)
    
    def StdDevNotZero(self):
        self.ui.StdDevNotZero_LineEdit.setText(flowmapper.CalStatStdDevNotZero)
Exemple #3
0
 def __init__(self,
              parent=None,
              paciente_rut=None,
              medico_rut=None,
              fecha=None,
              sintomas=None,
              diagnostico=None,
              recomendaciones=None,
              receta=None):
     super(FormCitas, self).__init__(parent)
     self.ui = Ui_Form()
     self.ui.setupUi(self)
     if paciente_rut is None:  # Cuando no recibe rut crea, cuando recibe edita
         self.ui.save.clicked.connect(self.crear_ct)
         self.ui.cancel.clicked.connect(self.exitformnuevo)
     else:
         self.colocar_datos(paciente_rut, medico_rut, fecha, sintomas,
                            diagnostico, recomendaciones, receta)
         self.ui.save.clicked.connect(self.editar_cita)
         self.ui.cancel.clicked.connect(self.exitform)
Exemple #4
0
 def __init__(self, parent=None, paciente_rut=None, medico_rut = None,
     fecha = None, sintomas = None, diagnostico = None, recomendaciones = None,
     receta = None):
     super(FormCitas, self).__init__(parent)
     self.ui = Ui_Form()
     self.ui.setupUi(self)
     if paciente_rut is None:# Cuando no recibe rut crea, cuando recibe edita
         self.ui.save.clicked.connect(self.crear_ct)
         self.ui.cancel.clicked.connect(self.exitformnuevo)
     else:
         self.colocar_datos(paciente_rut,medico_rut,fecha,sintomas,diagnostico,recomendaciones,receta)
         self.ui.save.clicked.connect(self.editar_cita)
         self.ui.cancel.clicked.connect(self.exitform)
Exemple #5
0
 def __init__(self):
     QtGui.QDialog.__init__(self)
     # Set up the user interface from Designer.
     self.ui = Ui_Form()
     self.ui.setupUi(self)
Exemple #6
0
class FormCitas(QtGui.QDialog):
    """Clase encargada del manejo del formulario citas, determina que hace
    cada boton el formulario y llama los metodos del modelo"""
    def __init__(self,
                 parent=None,
                 paciente_rut=None,
                 medico_rut=None,
                 fecha=None,
                 sintomas=None,
                 diagnostico=None,
                 recomendaciones=None,
                 receta=None):
        super(FormCitas, self).__init__(parent)
        self.ui = Ui_Form()
        self.ui.setupUi(self)
        if paciente_rut is None:  # Cuando no recibe rut crea, cuando recibe edita
            self.ui.save.clicked.connect(self.crear_ct)
            self.ui.cancel.clicked.connect(self.exitformnuevo)
        else:
            self.colocar_datos(paciente_rut, medico_rut, fecha, sintomas,
                               diagnostico, recomendaciones, receta)
            self.ui.save.clicked.connect(self.editar_cita)
            self.ui.cancel.clicked.connect(self.exitform)

    def exitformnuevo(self):
        self.close()

    def exitform(self):
        from ctrl_grid3 import *
        self.close()
        self.rld = Vtn5()
        self.rld.reloadG()

    def colocar_datos(self, paciente_rut, medico_rut, fecha, sintomas,
                      diagnostico, recomendaciones, receta):
        #ingresa los datos de los medicos en las grillas

        self.ui.p_rut.setText(str(paciente_rut))
        self.ui.m_rut.setText(str(medico_rut))
        self.ui.fecha.setText(fecha)
        self.ui.sintoma.setText(sintomas)
        self.ui.diagnostico.setText(diagnostico)
        self.ui.recomendaciones.setText(recomendaciones)
        self.ui.receta.setText(receta)

    def obtener_datos(self):
        #obtiene los datos del medico del formulario
        paciente_rut = self.ui.p_rut.text()
        medico_rut = self.ui.m_rut.text()
        fecha = self.ui.fecha.text()
        sintomas = self.ui.sintoma.text()
        diagnostico = self.ui.diagnostico.text()
        recomendaciones = self.ui.recomendaciones.text()
        receta = self.ui.receta.text()
        return (paciente_rut, medico_rut, fecha, sintomas, diagnostico,
                recomendaciones, receta)

    def crear_ct(self):
        paciente_rut, medico_rut, fecha, sintomas, diagnostico, recomendaciones, receta = self.obtener_datos(
        )
        print(paciente_rut)
        print(medico_rut)
        print(fecha)
        print(sintomas)
        print(diagnostico)
        print(recomendaciones)
        print(receta)

        try:
            model.agregar_cita(paciente_rut, medico_rut, fecha, sintomas,
                               diagnostico, recomendaciones, receta)
            self.accepted.emit()
            msgBox = QtGui.QMessageBox()
            msgBox.setText(u"La cita ha sido creada.")
            msgBox.exec_()
            self.close()
        except (ValueError, IOError):
            errorMessageDialog = QtGui.QMessageBox(self)
            self.errorMessageDialog.setText(
                "Debe Completar los campos correctamente")
            self.errorMessageDialog.exec_()
            pass

    def editar_cita(self):
        from ctrl_grid3 import *
        paciente_rut, medico_rut, fecha, sintomas, diagnostico, recomendaciones, receta = self.obtener_datos(
        )
        try:
            model.editar_cita(paciente_rut, medico_rut, fecha, sintomas,
                              diagnostico, recomendaciones, receta)
            msgBox = QtGui.QMessageBox()
            msgBox.setText(u"La cita ha sido editada.")
            msgBox.exec_()
            self.close()
            self.rld = Vtn5()
            self.rld.reloadG()
        except (ValueError, IOError):
            errorMessageDialog = QtGui.QMessageBox(self)
            self.errorMessageDialog.setText(
                "Debe Completar los campos correctamente")
            self.errorMessageDialog.exec_()
            pass
Exemple #7
0
class FormCitas(QtGui.QDialog):
    """Clase encargada del manejo del formulario citas, determina que hace
    cada boton el formulario y llama los metodos del modelo"""

    def __init__(self, parent=None, paciente_rut=None, medico_rut = None,
        fecha = None, sintomas = None, diagnostico = None, recomendaciones = None,
        receta = None):
        super(FormCitas, self).__init__(parent)
        self.ui = Ui_Form()
        self.ui.setupUi(self)
        if paciente_rut is None:# Cuando no recibe rut crea, cuando recibe edita
            self.ui.save.clicked.connect(self.crear_ct)
            self.ui.cancel.clicked.connect(self.exitformnuevo)
        else:
            self.colocar_datos(paciente_rut,medico_rut,fecha,sintomas,diagnostico,recomendaciones,receta)
            self.ui.save.clicked.connect(self.editar_cita)
            self.ui.cancel.clicked.connect(self.exitform)

    def exitformnuevo(self):
        self.close()

    def exitform(self):
        from ctrl_grid3 import *
        self.close()
        self.rld = Vtn5()
        self.rld.reloadG()

    def colocar_datos(self, paciente_rut,medico_rut,fecha,sintomas,diagnostico,recomendaciones,receta):
        #ingresa los datos de los medicos en las grillas

        self.ui.p_rut.setText(str(paciente_rut))
        self.ui.m_rut.setText(str(medico_rut))
        self.ui.fecha.setText(fecha)
        self.ui.sintoma.setText(sintomas)
        self.ui.diagnostico.setText(diagnostico)
        self.ui.recomendaciones.setText(recomendaciones)
        self.ui.receta.setText(receta)

    def obtener_datos(self):
        #obtiene los datos del medico del formulario
        paciente_rut = self.ui.p_rut.text()
        medico_rut = self.ui.m_rut.text()
        fecha = self.ui.fecha.text()
        sintomas = self.ui.sintoma.text()
        diagnostico = self.ui.diagnostico.text()
        recomendaciones = self.ui.recomendaciones.text()
        receta = self.ui.receta.text()
        return (paciente_rut,medico_rut,fecha,sintomas,diagnostico,recomendaciones,receta)

    def crear_ct(self):
        paciente_rut,medico_rut,fecha,sintomas,diagnostico,recomendaciones,receta = self.obtener_datos()
        print(paciente_rut)
        print(medico_rut)
        print(fecha)
        print(sintomas)
        print(diagnostico)
        print(recomendaciones)
        print(receta)

        try:
            model.agregar_cita(paciente_rut,medico_rut,fecha,sintomas,diagnostico,recomendaciones,receta)
            self.accepted.emit()
            msgBox = QtGui.QMessageBox()
            msgBox.setText(u"La cita ha sido creada.")
            msgBox.exec_()
            self.close()
        except(ValueError, IOError):
            errorMessageDialog = QtGui.QMessageBox(self)
            self.errorMessageDialog.setText("Debe Completar los campos correctamente")
            self.errorMessageDialog.exec_()
            pass

    def editar_cita(self):
        from ctrl_grid3 import *
        paciente_rut, medico_rut, fecha, sintomas, diagnostico, recomendaciones, receta = self.obtener_datos()
        try:
            model.editar_cita(paciente_rut,medico_rut,fecha,sintomas,diagnostico,recomendaciones,receta)
            msgBox = QtGui.QMessageBox()
            msgBox.setText(u"La cita ha sido editada.")
            msgBox.exec_()
            self.close()
            self.rld = Vtn5()
            self.rld.reloadG()
        except (ValueError, IOError):
            errorMessageDialog = QtGui.QMessageBox(self)
            self.errorMessageDialog.setText("Debe Completar los campos correctamente")
            self.errorMessageDialog.exec_()
            pass
Exemple #8
0
 def __init__(self):
     QtGui.QDialog.__init__(self)
     # Set up the user interface from Designer.
     self.ui = Ui_Form()
     self.ui.setupUi(self)