Exemplo n.º 1
0
 def model_experiment(self, experiment):
     # initialize model generator
     model_generator = ModelGenerator(experiment, use_median=self.median, name="Default Model")
     with ProgressWindow(self, 'Modeling') as pbar:
         # create models from data
         model_generator.model_all(pbar)
     self.setExperiment(experiment)
Exemplo n.º 2
0
    def remodel(self):
        # set the modeler options
        if self.model_mean_radio.isChecked():
            use_median = False
        elif self.model_median_radio.isChecked():
            use_median = True

        # initialize model generator
        experiment = self.main_widget.getExperiment()
        if experiment is None:
            return

        model_generator = ModelGenerator(experiment, use_median=use_median, modeler=self._modeler)

        model_generator.name = self.model_name_edit.text()
        # print(QCoreApplication.hasPendingEvents())
        with ProgressWindow(self.main_widget, 'Generating models') as pbar:
            # create models from data
            model_generator.model_all(pbar)

            self.main_widget.selector_widget.updateModelList()
            self.main_widget.selector_widget.selectLastModel()
            self.main_widget.updateMinMaxValue()

            # must happen before 'valuesChanged' to update the color boxes
            self.main_widget.selector_widget.tree_model.valuesChanged()
            self.main_widget.update()
Exemplo n.º 3
0
 def _import_file(file_name):
     with ProgressWindow(self, progress_text) as pw:
         experiment = reader_func(file_name, pw)
         self._set_opened_file_name(file_name)
         # call the modeler and create a function model
         if model:
             self.model_experiment(experiment)
         else:
             self.setExperiment(experiment)
Exemplo n.º 4
0
 def _save(file_name):
     with ProgressWindow(self, "Saving Experiment") as pw:
         write_experiment(self.getExperiment(), file_name, pw)
         self._set_opened_file_name(file_name)
Exemplo n.º 5
0
 def _save(file_name):
     with ProgressWindow(self, "Saving Screenshot"):
         image.save(file_name)