class DialogExport(QtGui.QDialog): def __init__(self, repertoire, parent=None): u"""repertoire : rep par défaut pour l'export """ QtGui.QDialog.__init__(self, parent) self.repertoire = repertoire self.defaultRep = repertoire self.setObjectName(_fromUtf8("self")) self.resize(508, 366) self.verticalLayout = QtGui.QVBoxLayout(self) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.labelMain = QtGui.QLabel(self) font = QtGui.QFont() font.setBold(True) font.setWeight(75) self.labelMain.setFont(font) self.labelMain.setObjectName(_fromUtf8("labelMain")) self.verticalLayout.addWidget(self.labelMain) self.frameOptions = QtGui.QFrame(self) self.frameOptions.setFrameShape(QtGui.QFrame.StyledPanel) self.frameOptions.setFrameShadow(QtGui.QFrame.Raised) self.frameOptions.setObjectName(_fromUtf8("frameOptions")) self.gridLayout = QtGui.QGridLayout(self.frameOptions) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.chboxes = {} self.chboxes["XML"] = QtGui.QCheckBox(self.frameOptions) self.gridLayout.addWidget(self.chboxes["XML"], 0, 1, 1, 1, QtCore.Qt.AlignLeft) self.chboxes["XML"].setToolTip(u"pour EAO") self.chboxes["CSV"] = QtGui.QCheckBox(self.frameOptions) self.gridLayout.addWidget(self.chboxes["CSV"], 0, 2, 1, 1) self.chboxes["CSV"].setToolTip(u"pour traitement de données") self.labelFormat = QtGui.QLabel(self.frameOptions) self.labelFormat.setObjectName(_fromUtf8("labelFormat")) self.gridLayout.addWidget(self.labelFormat, 0, 0, 1, 1) self.labelDir = QtGui.QLabel(self.frameOptions) self.labelDir.setObjectName(_fromUtf8("labelDir")) self.gridLayout.addWidget(self.labelDir, 1, 0, 1, 1) self.editDir = QtGui.QLineEdit(self.frameOptions) self.editDir.setObjectName(_fromUtf8("editDir")) self.editDir.setFixedWidth(300) self.gridLayout.addWidget(self.editDir, 1, 1, 1, 3) self.btnParcourir = QtGui.QPushButton(self.frameOptions) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.btnParcourir.sizePolicy().hasHeightForWidth()) self.btnParcourir.setSizePolicy(sizePolicy) self.btnParcourir.setObjectName(_fromUtf8("btnParcourir")) self.gridLayout.addWidget(self.btnParcourir, 1, 4, 1, 1) spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.gridLayout.addItem(spacerItem, 0, 4, 2, 1) self.verticalLayout.addWidget(self.frameOptions) self.table = TabDF(self, colWidth=70) self.table.setObjectName(_fromUtf8("table")) self.table.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) self.verticalLayout.addWidget(self.table) self.frameBtns = QtGui.QFrame(self) self.frameBtns.setFrameShape(QtGui.QFrame.StyledPanel) self.frameBtns.setFrameShadow(QtGui.QFrame.Raised) self.frameBtns.setObjectName(_fromUtf8("frameBtns")) self.horizontalLayout = QtGui.QHBoxLayout(self.frameBtns) self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.horizontalLayout.addItem(spacerItem1) self.btnExport = QtGui.QPushButton(self.frameBtns) self.btnExport.setObjectName(_fromUtf8("btnExport")) self.horizontalLayout.addWidget(self.btnExport) self.btnFin = QtGui.QPushButton(self.frameBtns) self.btnFin.setObjectName(_fromUtf8("btnFin")) self.horizontalLayout.addWidget(self.btnFin) self.verticalLayout.addWidget(self.frameBtns) self.retranslateUi() QtCore.QMetaObject.connectSlotsByName(self) self.editDir.textEdited.connect(self.new_dir_manuel) self.btnParcourir.clicked.connect(self.get_dir) self.btnFin.clicked.connect(self.reject) def retranslateUi(self): self.setWindowTitle(_translate("DialogExport", "Export", None)) self.labelMain.setText( _translate("DialogExport", "Choisir les sorties de modèles à exporter :", None)) self.labelFormat.setText(_translate("DialogExport", "Format :", None)) self.labelDir.setText(_translate("DialogExport", "Répertoire :", None)) self.editDir.setText(_translate("DialogExport", self.repertoire, None)) self.btnParcourir.setText(_translate("DialogExport", "Parcourir", None)) self.chboxes["XML"].setText(_translate("DialogExport", "XML", None)) self.chboxes["CSV"].setText(_translate("DialogExport", "CSV", None)) self.btnExport.setText(_translate("DialogExport", "Exporter", None)) self.btnFin.setText(_translate("DialogExport", "Terminé", None)) def get_dir(self): u"""fonction associée au bouton Parcourir, pour récupérer et afficher le dossier choisi """ rep = QtGui.QFileDialog.getExistingDirectory() if rep != '': #pour gérer le cas re vide (si annulation) self.repertoire = rep self.editDir.setText(str(self.repertoire)) def new_dir_manuel(self, rep): u"""retient le répertoire entré manuellement """ self.repertoire = rep
class FormPHO(QtGui.QWidget): u"""classe de formulaire avec les paramètres de Phoeniks + tableau de résultats """ def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.setObjectName(_fromUtf8("Form")) self.horizontalLayout = QtGui.QHBoxLayout(self) self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) fixed = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) #1ère colonne : paramètres self.gpBoxParams = QtGui.QGroupBox(self) self.gpBoxParams.setSizePolicy(fixed) self.gpBoxParams.setFixedHeight(107) self.gpBoxParams.setFixedWidth(212) self.gpBoxParams.setObjectName(_fromUtf8("gpBoxParams")) self.gridLayout = QtGui.QGridLayout(self.gpBoxParams) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.labelDeb = QtGui.QLabel(self.gpBoxParams) self.labelDeb.setObjectName(_fromUtf8("labelDeb")) self.gridLayout.addWidget(self.labelDeb, 0, 0, 1, 1) self.editDeb = QtGui.QDateTimeEdit(self.gpBoxParams) self.editDeb.setAlignment(QtCore.Qt.AlignCenter) self.editDeb.setObjectName(_fromUtf8("editDeb")) self.gridLayout.addWidget(self.editDeb, 0, 1, 1, 1) self.labelFin = QtGui.QLabel(self.gpBoxParams) self.labelFin.setObjectName(_fromUtf8("labelFin")) self.gridLayout.addWidget(self.labelFin, 1, 0, 1, 1) self.editFin = QtGui.QDateTimeEdit(self.gpBoxParams) self.editFin.setAlignment(QtCore.Qt.AlignCenter) self.editFin.setObjectName(_fromUtf8("editFin")) self.gridLayout.addWidget(self.editFin, 1, 1, 1, 1) self.labelCG = QtGui.QLabel(self.gpBoxParams) self.labelCG.setObjectName(_fromUtf8("labelCG")) self.labelCG.setFixedWidth(20) self.gridLayout.addWidget(self.labelCG, 0, 2, 2, 1) self.labelQ0 = QtGui.QLabel(self.gpBoxParams) self.labelQ0.setObjectName(_fromUtf8("labelQ0")) self.gridLayout.addWidget(self.labelQ0, 2, 0, 1, 1) self.editQ0 = QtGui.QDoubleSpinBox(self.gpBoxParams) self.editQ0.setMaximum(1000) self.editQ0.setSuffix(u" m3/s") self.editQ0.setAlignment(QtCore.Qt.AlignCenter) self.editQ0.setObjectName(_fromUtf8("editQ0")) self.gridLayout.addWidget(self.editQ0, 2, 1, 1, 1) self.horizontalLayout.addWidget(self.gpBoxParams) #2ème colonne : bouton lancement +choix de la config self.frameGo = QtGui.QFrame(self) self.frameGo.setSizePolicy(fixed) self.frameGo.setFixedHeight(107) self.frameGo.setFixedWidth(243) self.frameGo.setFrameShape(QtGui.QFrame.StyledPanel) self.frameGo.setFrameShadow(QtGui.QFrame.Raised) self.frameGo.setObjectName(_fromUtf8("frameGo")) self.verticalLayout = QtGui.QVBoxLayout(self.frameGo) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.btnGo = QtGui.QPushButton(self.frameGo) self.btnGo.setObjectName(_fromUtf8("btnGo")) self.btnGo.setSizePolicy(fixed) self.verticalLayout.addWidget(self.btnGo, alignment=QtCore.Qt.AlignHCenter) self.vSpacer = QtGui.QSpacerItem(5, 5, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.horizontalLayout.addItem(self.vSpacer) self.btnGo.raise_() self.horizontalLayout.addWidget(self.frameGo) #3ème colonne : tableau des résultats self.frameResults = QtGui.QFrame(self) self.layoutResults = QtGui.QVBoxLayout(self.frameResults) self.label_tMax = QtGui.QLabel(self.frameResults) self.label_tMax.setText(u"") self.layoutResults.addWidget(self.label_tMax, alignment=QtCore.Qt.AlignLeft) self.table = TabDF(self.frameResults, colWidth=70) self.table.setObjectName(_fromUtf8("table")) self.table.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) self.layoutResults.addWidget(self.table) self.horizontalLayout.addWidget(self.frameResults) self.retranslateUi() QtCore.QMetaObject.connectSlotsByName(self) def retranslateUi(self): self.setWindowTitle(_translate("Form", "Form", None)) self.gpBoxParams.setTitle(_translate("Form", "Paramètres", None)) self.labelDeb.setText(_translate("Form", "Début CG", None)) self.editDeb.setDisplayFormat( _translate("Form", "dd/MM/yyyy HH:00", None)) self.labelFin.setText(_translate("Form", "Fin CG", None)) self.editFin.setDisplayFormat( _translate("Form", "dd/MM/yyyy HH:00", None)) self.labelQ0.setText(_translate("Form", "Q0", None)) self.labelCG.setText(_translate("Form", "0 h", None)) self.btnGo.setText(_translate("Form", "Calculer", None)) def sizeHint(self): return QtCore.QSize(768, 123)
class Ui_FormScManuels(object): def setupUi(self, FormScManuels): FormScManuels.setObjectName(_fromUtf8("FormScManuels")) self.gridLayout = QtGui.QGridLayout(FormScManuels) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.labelTitre = QtGui.QLabel(FormScManuels) font = QtGui.QFont() font.setBold(True) font.setWeight(75) self.labelTitre.setFont(font) self.labelTitre.setAlignment(QtCore.Qt.AlignLeft) self.labelTitre.setObjectName(_fromUtf8("labelTitre")) self.gridLayout.addWidget(self.labelTitre, 0, 0, 1, 1) self.labelSsTitre = QtGui.QLabel(FormScManuels) self.labelSsTitre.setObjectName(_fromUtf8("labelSsTitre")) self.gridLayout.addWidget(self.labelSsTitre, 1, 0, 1, 2) self.tab_M1 = TabDF(FormScManuels) self.tab_M1.setFixedSize(QtCore.QSize(326, 370)) self.tab_M1.setAlternatingRowColors(True) self.tab_M1.setObjectName(_fromUtf8("tab_M1")) self.tab_M1.horizontalHeader().setDefaultSectionSize(70) self.gridLayout.addWidget(self.tab_M1, 3, 0, 1, 1) self.tab_M2 = TabDF(FormScManuels) self.tab_M2.setFixedSize(QtCore.QSize(224, 370)) self.tab_M2.setAlternatingRowColors(True) self.tab_M2.setObjectName(_fromUtf8("tab_M2")) self.tab_M2.horizontalHeader().setDefaultSectionSize(70) self.tab_M2.verticalHeader().setVisible(False) self.tab_M2.verticalHeader().setStretchLastSection(False) self.gridLayout.addWidget(self.tab_M2, 3, 1, 1, 1) self.label_M1 = QtGui.QLabel(FormScManuels) font = QtGui.QFont() font.setBold(True) font.setWeight(75) self.label_M1.setFont(font) self.label_M1.setAlignment(QtCore.Qt.AlignCenter) self.label_M1.setObjectName(_fromUtf8("label_M1")) self.gridLayout.addWidget(self.label_M1, 2, 0, 1, 1) self.label_M2 = QtGui.QLabel(FormScManuels) font = QtGui.QFont() font.setBold(True) font.setWeight(75) self.label_M2.setFont(font) self.label_M2.setAlignment(QtCore.Qt.AlignCenter) self.label_M2.setObjectName(_fromUtf8("label_M2")) self.gridLayout.addWidget(self.label_M2, 2, 1, 1, 1) self.label_M1.setBuddy(self.tab_M1) self.label_M2.setBuddy(self.tab_M2) self.hSpacer = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum) self.gridLayout.addItem(self.hSpacer, 3, 2, 1, 1) self.vSpacer = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.gridLayout.addItem(self.vSpacer, 4, 0, 1, 1) self.retranslateUi(FormScManuels) QtCore.QMetaObject.connectSlotsByName(FormScManuels) FormScManuels.setTabOrder(self.tab_M1, self.tab_M2) def retranslateUi(self, FormScManuels): FormScManuels.setWindowTitle(_translate("FormScManuels", "Form", None)) self.labelTitre.setText( _translate("FormScManuels", u"Scénarios de pluie manuels", None)) self.labelSsTitre.setText( _translate( "FormScManuels", trim( u"""Entrer les cumuls de pluie journaliers (mm) pour les scénarios de pluie manuels éventuels. Jusqu'à 2 scénarios manuels. """), None)) self.label_M1.setText(_translate("FormScManuels", "Manuel 1", None)) self.label_M2.setText(_translate("FormScManuels", "Manuel 2", None))
class FormANA(QtGui.QFrame): u"""classe de formulaire avec les paramètres d'Analog + tableau de résultats """ def __init__(self, parent=None): QtGui.QFrame.__init__(self, parent) self.setObjectName(_fromUtf8("Form")) self.horizontalLayout = QtGui.QHBoxLayout(self) self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout")) fixed = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Fixed) #1ère colonne : paramètres self.gpBoxParams = QtGui.QGroupBox(self) self.gpBoxParams.setSizePolicy(fixed) self.gpBoxParams.setFixedWidth(212) self.gpBoxParams.setFixedHeight(107) self.gpBoxParams.setObjectName(_fromUtf8("gpBoxParams")) self.gridLayout = QtGui.QGridLayout(self.gpBoxParams) self.gridLayout.setObjectName(_fromUtf8("gridLayout")) self.labelDeb = QtGui.QLabel(self.gpBoxParams) self.labelDeb.setObjectName(_fromUtf8("labelDeb")) self.gridLayout.addWidget(self.labelDeb, 0, 0, 1, 1) self.editDeb = QtGui.QDoubleSpinBox(self.gpBoxParams) self.editDeb.setMaximum(1000) self.editDeb.setSuffix(u" mm") self.editDeb.setAlignment(QtCore.Qt.AlignCenter) self.editDeb.setObjectName(_fromUtf8("editDeb")) self.gridLayout.addWidget(self.editDeb, 0, 1, 1, 1) self.labelFin = QtGui.QLabel(self.gpBoxParams) self.labelFin.setObjectName(_fromUtf8("labelFin")) self.gridLayout.addWidget(self.labelFin, 1, 0, 1, 1) self.editFin = QtGui.QDoubleSpinBox(self.gpBoxParams) self.editFin.setMaximum(1000) self.editFin.setSuffix(u" mm") self.editFin.setAlignment(QtCore.Qt.AlignCenter) self.editFin.setObjectName(_fromUtf8("editFin")) self.gridLayout.addWidget(self.editFin, 1, 1, 1, 1) self.labelQ0 = QtGui.QLabel(self.gpBoxParams) self.labelQ0.setObjectName(_fromUtf8("labelQ0")) self.gridLayout.addWidget(self.labelQ0, 2, 0, 1, 1) self.editQ0 = QtGui.QDoubleSpinBox(self.gpBoxParams) self.editQ0.setMaximum(1000) self.editQ0.setSuffix(u" m3/s") self.editQ0.setAlignment(QtCore.Qt.AlignCenter) self.editQ0.setObjectName(_fromUtf8("editQ0")) self.gridLayout.addWidget(self.editQ0, 2, 1, 1, 1) self.horizontalLayout.addWidget(self.gpBoxParams) #2ème colonne : bouton lancement +choix de la config self.frameGo = QtGui.QFrame(self) self.frameGo.setSizePolicy(fixed) self.frameGo.setFixedWidth(243) self.frameGo.setFixedHeight(107) self.frameGo.setFrameShape(QtGui.QFrame.StyledPanel) self.frameGo.setFrameShadow(QtGui.QFrame.Raised) self.frameGo.setObjectName(_fromUtf8("frameGo")) self.verticalLayout = QtGui.QVBoxLayout(self.frameGo) self.verticalLayout.setObjectName(_fromUtf8("verticalLayout")) self.btnGo = QtGui.QPushButton(self.frameGo) self.btnGo.setObjectName(_fromUtf8("btnGo")) self.btnGo.setSizePolicy(fixed) self.verticalLayout.addWidget(self.btnGo, alignment=QtCore.Qt.AlignHCenter) self.vSpacer = QtGui.QSpacerItem(5, 300, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout.addItem(self.vSpacer) self.horizontalLayout.addWidget(self.frameGo) #3ème colonne : tableau des résultats self.table = TabDF(self, checkCol=True) self.table.setObjectName(_fromUtf8("table")) self.table.verticalHeader().setVisible(False) self.table.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) # self.table.setFixedSize(QtCore.QSize(500, 100)) self.horizontalLayout.addWidget(self.table) self.retranslateUi() QtCore.QMetaObject.connectSlotsByName(self) def retranslateUi(self): self.setWindowTitle(_translate("Form", "Form", None)) self.gpBoxParams.setTitle(_translate("Form", "Paramètres", None)) self.labelDeb.setText(_translate("Form", "CG min", None)) self.labelFin.setText(_translate("Form", "CG max", None)) self.labelQ0.setText(_translate("Form", "Q0", None)) self.btnGo.setText(_translate("Form", "Voir les Analogs", None)) def sizeHint(self): return QtCore.QSize(768, 123)