예제 #1
0
 def import_run(self, cache_directory, run_info={}):
     run_manager = get_run_manager()
     retval, retmsg = run_manager.import_run_from_cache(cache_directory)
     if not retval:
         MessageBox.warning(mainwindow = self.base_widget,
                            text = retmsg,
                            detailed_text = '')
     else:
         sync_available_runs(self.project)
예제 #2
0
    def finishedCallback(self, success, run_name):
        if success:
            print "Success returned from Model"

            if self.modelguielement.model.cancelled:
                self.modelguielement.model.run_manager.cancel_run()
            else:
                if self.batch_name is not None:
                    self.runIndicatorBatch()
        else:
            print "Error returned from Model"

        sync_available_runs(self.project)
        self.modelguielement.model.run_manager.close()
        self.emit(SIGNAL("runFinished(PyQt_PyObject)"),success)
예제 #3
0
    def finishedCallback(self, success, run_name):
        if success:
            print "Success returned from Model"

            if self.modelguielement.model.cancelled:
                self.modelguielement.model.run_manager.cancel_run()
            else:
                if self.batch_name is not None:
                    self.runIndicatorBatch()
        else:
            print "Error returned from Model"

        sync_available_runs(self.project)
        self.modelguielement.model.run_manager.close()
        self.emit(SIGNAL("runFinished(PyQt_PyObject)"),success)
예제 #4
0
 def _scanForRuns(self):
     data_path = self.project.data_path()
     if not os.path.exists(data_path):
         MessageBox.warning(mainwindow = self.base_widget,
                            text="Project data path %s doesn't exist. " % data_path + \
                            "Simulation runs in the Results tab cannot be updated." )
         return
     
     run_manager = get_run_manager()
     run_manager.clean_runs()
     self._sync_base_year_data(run_manager)        
     run_manager.close()
     
     added_runs, removed_runs = sync_available_runs(self.project)
     added_msg = removed_msg = None
     if len(added_runs) > 0:
         added_msg = ('The following simulation runs have been '
                      'automatically added to the results manager:\n\n%s'
                      % '\n'.join(added_runs))
     if len(removed_runs) > 0:
         removed_msg = ('The following simulation runs have been '
                      'automatically removed from the results manager:\n\n%s'
                      % '\n'.join(removed_runs))
     if added_msg or removed_msg:
         ## The idea is to leave the run information to services db & cache, and
         ## we don't need to save the newly added runs, once we set the temporary
         # self.project.dirty = True
         text = 'The list of simulation runs has been automatically updated.'
         detailed_text = '%s\n%s' % (added_msg or '', removed_msg or '')
         logger.log_status(text+'\n'+detailed_text)