def __init__(self, parent, case): """ Constructor """ QWidget.__init__(self, parent) Ui_LagrangianStatisticsForm.__init__(self) self.setupUi(self) self.case = case self.case.undoStopGlobal() self.model = LagrangianStatisticsModel(self.case) self.checkBoxISUIST.clicked.connect(self.slotISUIST) self.lineEditNBCLST.textChanged[str].connect(self.slotNBCLST) self.groupBoxISTALA.clicked.connect(self.slotISTALA) self.lineEditIDSTNT.editingFinished.connect(self.slotIDSTNT) self.lineEditNSTIST.editingFinished.connect(self.slotNSTIST) self.lineEditSEUIL.textChanged[str].connect(self.slotSEUIL) self.groupBoxIENSI3.clicked.connect(self.slotIENSI3) validatorNBCLST = IntValidator(self.lineEditNBCLST, min=0) # max=100 validatorIDSTNT = IntValidator(self.lineEditIDSTNT, min=0) validatorIDSTNT.setExclusiveMin(True) validatorNSTIST = IntValidator(self.lineEditNSTIST, min=0) validatorSEUIL = DoubleValidator(self.lineEditSEUIL, min=0.) self.lineEditNBCLST.setValidator(validatorNBCLST) self.lineEditIDSTNT.setValidator(validatorIDSTNT) self.lineEditNSTIST.setValidator(validatorNSTIST) self.lineEditSEUIL.setValidator(validatorSEUIL) # initialize Widgets # FIXME # test if restart lagrangian is on ## mdl.lagr = LagrangianModel() ## is_restart = mdl_lagr.getRestart() ## if is_restart == "off": ## self.lineEditISUIST.setEnabled(False) ## self.checkBoxISUIST.setEnabled(False) status = self.model.getRestartStatisticsStatus() if status == "on": self.checkBoxISUIST.setChecked(True) else: self.checkBoxISUIST.setChecked(False) nclust = self.model.getGroupOfParticlesValue() self.lineEditNBCLST.setText(str(nclust)) it = self.model.getIterationStart() self.lineEditIDSTNT.setText(str(it)) it = self.model.getIterSteadyStart() self.lineEditNSTIST.setText(str(it)) seuil = self.model.getThresholdValue() self.lineEditSEUIL.setText(str(seuil)) # volume status = self.model.getVolumeStatisticsStatus() if status == "on": self.groupBoxISTALA.setChecked(True) else: self.groupBoxISTALA.setChecked(False) self.slotISTALA() # boundary status = self.model.getBoundaryStatisticsStatus() if status == "on": self.groupBoxIENSI3.setChecked(True) else: self.groupBoxIENSI3.setChecked(False) self.slotIENSI3() self.case.undoStartGlobal()
def __init__(self, parent, case): """ Constructor """ QWidget.__init__(self, parent) Ui_LagrangianStatisticsForm.__init__(self) self.setupUi(self) self.case = case self.case.undoStopGlobal() self.model = LagrangianStatisticsModel(self.case) self.connect(self.checkBoxISUIST, SIGNAL("clicked()"), self.slotISUIST) self.connect(self.lineEditNBCLST, SIGNAL("textChanged(const QString &)"), self.slotNBCLST) self.connect(self.groupBoxISTALA, SIGNAL("clicked()"), self.slotISTALA) self.connect(self.lineEditIDSTNT, SIGNAL("editingFinished()"), self.slotIDSTNT) self.connect(self.lineEditNSTIST, SIGNAL("editingFinished()"), self.slotNSTIST) self.connect(self.lineEditSEUIL, SIGNAL("textChanged(const QString &)"), self.slotSEUIL) self.connect(self.groupBoxIENSI3, SIGNAL("clicked()"), self.slotIENSI3) self.connect(self.lineEditNSTBOR, SIGNAL("textChanged(const QString &)"), self.slotNSTBOR) self.connect(self.lineEditSEUILF, SIGNAL("textChanged(const QString &)"), self.slotSEUILF) validatorNBCLST = IntValidator(self.lineEditNBCLST, min=0) # max=100 validatorIDSTNT = IntValidator(self.lineEditIDSTNT, min=0) validatorIDSTNT.setExclusiveMin(True) validatorNSTIST = IntValidator(self.lineEditNSTIST, min=0) validatorSEUIL = DoubleValidator(self.lineEditSEUIL, min=0.) validatorNSTBOR = IntValidator(self.lineEditNSTBOR, min=0) validatorNSTBOR.setExclusiveMin(True) validatorSEUILF = DoubleValidator(self.lineEditSEUILF, min=0.) self.lineEditNBCLST.setValidator(validatorNBCLST) self.lineEditIDSTNT.setValidator(validatorIDSTNT) self.lineEditNSTIST.setValidator(validatorNSTIST) self.lineEditSEUIL.setValidator(validatorSEUIL) self.lineEditNSTBOR.setValidator(validatorNSTBOR) self.lineEditSEUILF.setValidator(validatorSEUILF) # initialize Widgets # FIXME # test if restart lagrangian is on ## mdl.lagr = LagrangianModel() ## is_restart = mdl_lagr.getRestart() ## if is_restart == "off": ## self.lineEditISUIST.setEnabled(False) ## self.checkBoxISUIST.setEnabled(False) status = self.model.getRestartStatisticsStatus() if status == "on": self.checkBoxISUIST.setChecked(True) else: self.checkBoxISUIST.setChecked(False) nclust = self.model.getGroupOfParticlesValue() self.lineEditNBCLST.setText(str(nclust)) # volume status = self.model.getVolumeStatisticsStatus() if status == "on": self.groupBoxISTALA.setChecked(True) else: self.groupBoxISTALA.setChecked(False) self.slotISTALA() # boundary status = self.model.getBoundaryStatisticsStatus() if status == "on": self.groupBoxIENSI3.setChecked(True) else: self.groupBoxIENSI3.setChecked(False) self.slotIENSI3() self.case.undoStartGlobal()