def _setup_co__years(self):
        runs = get_simulation_runs(self.project)

        for run in runs:
            if run.get('name') == self.run_name:
                years = get_years_for_simulation_run(project = self.project,
                                                     simulation_run_node = run)
                (start,end) = (min(years), max(years))

        for i in range(start, end + 1):
            if i not in years: continue
            yr = QString(repr(i))
            self.co_start_year.addItem(yr)
            self.co_end_year.addItem(yr)
        for i in range(1, end - start + 2):
            yr = QString(repr(i))
            self.co_every_year.addItem(yr)
Esempio n. 2
0
    def _setup_co__years(self):
        runs = get_simulation_runs(self.project)

        for run in runs:
            if run.get('name') == self.run_name:
                years = get_years_for_simulation_run(project=self.project,
                                                     simulation_run_node=run)
                (start, end) = (min(years), max(years))

        for i in range(start, end + 1):
            if i not in years: continue
            yr = QString(repr(i))
            self.co_start_year.addItem(yr)
            self.co_end_year.addItem(yr)
        for i in range(1, end - start + 2):
            yr = QString(repr(i))
            self.co_every_year.addItem(yr)
    def _setup_simulation_data(self):
        current_row = self.lst_available_runs.currentRow()

        runs = get_simulation_runs(self.project)

        self.lst_available_runs.clear()
        idx = -1
        for i, run in enumerate(runs):
            run_name = run.get("name")
            if run_name == "base_year_data":
                idx = i

            years = get_years_for_simulation_run(project=self.project, simulation_run_node=run)
            self.available_years_for_simulation_runs[run_name] = years

            self.lst_available_runs.addItem(run_name)

        if current_row is None or current_row == -1:
            current_row = idx
        if current_row != -1:
            self.lst_available_runs.setCurrentRow(current_row)
            self.on_lst_available_runs_currentRowChanged(current_row)
Esempio n. 4
0
    def _setup_simulation_data(self):
        current_row = self.lst_available_runs.currentRow()

        runs = get_simulation_runs(self.project)

        self.lst_available_runs.clear()
        idx = -1
        for i, run in enumerate(runs):
            run_name = run.get('name')
            if run_name == 'base_year_data':
                idx = i

            years = get_years_for_simulation_run(project=self.project,
                                                 simulation_run_node=run)
            self.available_years_for_simulation_runs[run_name] = years

            self.lst_available_runs.addItem(run_name)

        if current_row is None or current_row == -1:
            current_row = idx
        if current_row != -1:
            self.lst_available_runs.setCurrentRow(current_row)
            self.on_lst_available_runs_currentRowChanged(current_row)