mirror of https://gitlab.com/pamhyr/pamhyr2
pep8 + colors + debug
parent
c668dddcfd
commit
54fe032791
|
|
@ -1508,9 +1508,11 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
return
|
||||
|
||||
if self._last_solver._type == "mage8":
|
||||
self.open_solver_results(self._last_solver, self._last_results)
|
||||
self.open_solver_results(self._last_solver,
|
||||
self._last_results)
|
||||
elif self._last_solver._type == "adistswc":
|
||||
self.open_solver_results_adists(self._last_solver, self._last_results)
|
||||
self.open_solver_results_adists(self._last_solver,
|
||||
self._last_results)
|
||||
|
||||
def open_results_from_file(self):
|
||||
if self._study is None:
|
||||
|
|
|
|||
|
|
@ -144,6 +144,7 @@ class PlotAdis(PamhyrPlot):
|
|||
self._current_reach_id = reach_id
|
||||
self._current_profile_id = 0
|
||||
self.draw()
|
||||
self.update_current()
|
||||
|
||||
def update(self):
|
||||
if not self._init:
|
||||
|
|
@ -160,8 +161,8 @@ class PlotAdis(PamhyrPlot):
|
|||
self._current.set_visible(True)
|
||||
|
||||
def set_pollutant(self, pol_id):
|
||||
for l in self._lines:
|
||||
l.remove()
|
||||
for j in self._lines:
|
||||
j.remove()
|
||||
self._lines = []
|
||||
self._current_pol_id = pol_id
|
||||
self.update_min_and_max()
|
||||
|
|
@ -169,6 +170,7 @@ class PlotAdis(PamhyrPlot):
|
|||
self.update_current()
|
||||
self.update_idle()
|
||||
|
||||
|
||||
class PlotAdis_dx(PlotAdis):
|
||||
def __init__(self, canvas=None, trad=None, toolbar=None,
|
||||
results=None, reach_id=0, profile_id=0,
|
||||
|
|
@ -191,6 +193,7 @@ class PlotAdis_dx(PlotAdis):
|
|||
profile = reach.profile(self._current_profile_id)
|
||||
x = reach.geometry.get_rk()
|
||||
|
||||
self._lines = []
|
||||
for i in range(len(self._current_pol_id)):
|
||||
pol_id = self._current_pol_id[i]
|
||||
name = self.data.pollutants_list[pol_id]
|
||||
|
|
@ -205,7 +208,7 @@ class PlotAdis_dx(PlotAdis):
|
|||
self._lines.append(self.canvas.axes.plot(
|
||||
x, y,
|
||||
label=self.label[self._key]+" "+name,
|
||||
color=self.color_plot,
|
||||
color=self.colors[pol_id % len(self.colors)],
|
||||
**self.plot_default_kargs
|
||||
)[0])
|
||||
|
||||
|
|
@ -220,7 +223,7 @@ class PlotAdis_dx(PlotAdis):
|
|||
for i in range(len(self._current_pol_id)):
|
||||
pol_id = self._current_pol_id[i]
|
||||
if self.val_id[self._key] > 0 and self._type_pol[pol_id] == 1:
|
||||
y = [0.0]*len(x)
|
||||
continue # no mass
|
||||
else:
|
||||
y = list(map(
|
||||
lambda p: p.get_ts_key(
|
||||
|
|
@ -313,6 +316,7 @@ class PlotAdis_dt(PlotAdis):
|
|||
self.ts = list(self.results.get("timestamps"))
|
||||
self.ts.sort()
|
||||
|
||||
self._lines = []
|
||||
x = self.ts
|
||||
for i in range(len(self._current_pol_id)):
|
||||
pol_id = self._current_pol_id[i]
|
||||
|
|
@ -329,7 +333,7 @@ class PlotAdis_dt(PlotAdis):
|
|||
self._lines.append(self.canvas.axes.plot(
|
||||
x, y,
|
||||
label=self.label[self._key]+" "+name,
|
||||
color=self.color_plot,
|
||||
color=self.colors[pol_id % len(self.colors)],
|
||||
**self.plot_default_kargs
|
||||
)[0])
|
||||
|
||||
|
|
@ -344,7 +348,7 @@ class PlotAdis_dt(PlotAdis):
|
|||
for i in range(len(self._current_pol_id)):
|
||||
pol_id = self._current_pol_id[i]
|
||||
if self.val_id[self._key] > 0 and self._type_pol[pol_id] == 1:
|
||||
y = [0.0]*len(x)
|
||||
continue # no mass
|
||||
else:
|
||||
y = list(map(lambda data_el:
|
||||
data_el[pol_id][self.val_id[self._key]],
|
||||
|
|
|
|||
|
|
@ -46,8 +46,7 @@ from PyQt5.QtWidgets import (
|
|||
from View.Tools.Plot.PamhyrCanvas import MplCanvas
|
||||
from View.Tools.Plot.PamhyrToolbar import PamhyrPlotToolbar
|
||||
|
||||
#from View.Results.PlotSedAdisDt import PlotAdis_dt
|
||||
from View.Results.PlotSedAdisDx import PlotAdis_dx, PlotAdis_dt
|
||||
from View.Results.PlotSedAdis import PlotAdis_dx, PlotAdis_dt
|
||||
|
||||
from View.Results.CustomPlot.Plot import CustomPlot
|
||||
from View.Results.CustomPlot.CustomPlotValuesSelectionDialog import (
|
||||
|
|
@ -463,7 +462,7 @@ class ResultsWindowAdisTS(PamhyrWindow):
|
|||
for t in ["pollutants"]:
|
||||
table = self.find(QTableView, f"tableView_{t}")
|
||||
selectionModel = table.selectionModel()
|
||||
index = table.model().index(ind[0]- 1, 0)
|
||||
index = table.model().index(ind[0] - 1, 0)
|
||||
|
||||
selectionModel.select(
|
||||
index,
|
||||
|
|
@ -503,7 +502,6 @@ class ResultsWindowAdisTS(PamhyrWindow):
|
|||
self.plot_mdx.set_pollutant(self._pol_id)
|
||||
self.plot_mdt.set_pollutant(self._pol_id)
|
||||
|
||||
|
||||
if timestamp is not None:
|
||||
self.plot_cdt.set_timestamp(timestamp)
|
||||
self.plot_cdx.set_timestamp(timestamp)
|
||||
|
|
|
|||
Loading…
Reference in New Issue