def okBtn_cb(): #Takes currently inputted values minIV = minIVUserInput.value maxIV = maxIVUserInput.value interval = intervalIVUserInput.value #Runs through validation algorithm isValidated,error = validation.validateInputs(minIV,maxIV,interval,exp.maxRange,exp.minRange) if not isValidated:#If they aren't valid # Show error errorDlg = template.ErrorDlg(error) self.open(errorDlg) else: if int(maxIV) - int(minIV) >= 200: #Set object variables self.isValidated = True self.startTime = int(minIV) self.endTime = int(maxIV) self.timeInterval = int(interval) self.close() else: errorDlg = template.ErrorDlg("Make the range at least 200") self.open(errorDlg)
def okBtn_cb(): #Takes currently inputted values minIV = minIVUserInput.value maxIV = maxIVUserInput.value interval = intervalIVUserInput.value #Runs through validation algorithm self.isValidated, error = validation.validateInputs( minIV, maxIV, interval, exp.maxRange, exp.minRange) if not self.isValidated: #If they aren't valid # Show error errorDlg = template.ErrorDlg(error) self.open(errorDlg) else: #Set object variables if int(maxIV) - int(minIV) > 100: self.isValidated = True self.minIVValue = int(minIV) self.maxIVValue = int(maxIV) self.intervalValue = int(interval) self.close() else: errorDlg = template.ErrorDlg( "Have a range of at least 100") errorDlg.open()
def startExperiment_cb(): if self.variablesDlg.isValidated: # If the user inputs are valid if not (self.app.animationRunning ): # And if the animation hasn't started yet self.app.animationRunning = True # Tell the rest of the program that the animation can now run else: errorDlg = template.ErrorDlg( "Experiment is already running") errorDlg.open() else: errorDlg = template.ErrorDlg("You haven't set the variables") errorDlg.open()
def graph_cb(): if self.app.experimentFinished: graphDlg = dlgs.GraphDialog(self.app.tableArea) self.open(graphDlg) else: errorDlg = template.ErrorDlg("Finish the Experiment") self.app.open(errorDlg)
def okBtn_cb(): #Takes currently inputted values if optionsGroup.value == 1: interval = "50" elif optionsGroup.value == 2: interval = "100" elif optionsGroup.value == 3: interval = "150" else: interval = "" cartWeights = minIVUserInput.value massHolderWeights = maxIVUserInput.value #Runs through validation algorithm self.isValidated,error = validation.validateNewton2ndLaw(cartWeights,massHolderWeights,interval,exp.minRange,exp.maxRange) if not self.isValidated:#If they aren't valid # Show error errorDlg = template.ErrorDlg(error) self.open(errorDlg) else: #Set object variables self.isValidated = True self.cartWeights = int(cartWeights) self.massHolderWeights = int(massHolderWeights) self.weightSize = round(int(interval) /1000,2) self.close()
def graph_cb(): if self.app.experimentFinished: xPoints = self.app.tableArea.xPoints yPoints = self.app.tableArea.yPoints graphDlg = dlgs.GraphDialog(xPoints, yPoints) self.open(graphDlg) else: errorDlg = template.ErrorDlg("Finish the Experiment") self.app.open(errorDlg)
def variables_cb(): if not self.app.variablesInputted: self.variablesDlg.open() if self.variablesDlg.isValidated: #Updates the values of the Experiment Object self.app.variablesInputted = True self.app.minIV = self.variablesDlg.minIVValue self.app.maxIV = self.variablesDlg.maxIVValue self.app.interval = self.variablesDlg.intervalValue self.app.tableArea.setup() else: self.app.open(template.ErrorDlg("You have already inputted variables."))
def variables_cb(): if not self.app.variablesInputted: self.variablesDlg.open() if self.variablesDlg.isValidated: # Updates the values of the Experiment Object self.app.variablesInputted = True self.app.engine.startHeight = self.variablesDlg.startHeight self.app.engine.endHeight = self.variablesDlg.endHeight self.app.engine.heightInterval = self.variablesDlg.heightInterval self.app.tableArea.setup() else: self.app.open( template.ErrorDlg("You have already inputted variables."))
def variables_cb(): if not self.app.variablesInputted: self.variablesDlg.open() if self.variablesDlg.isValidated: #Updates the values of the Experiment Object self.app.variablesInputted = True self.app.engine.cartWeights = self.variablesDlg.cartWeights self.app.engine.massHolderWeights = self.variablesDlg.massHolderWeights self.app.engine.weightSize = self.variablesDlg.weightSize self.app.tableArea.setup() else: self.app.open( template.ErrorDlg("You have already inputted variables."))