mirror of https://gitlab.com/pamhyr/pamhyr2
Compare commits
6 Commits
da78d0cdb1
...
e19c3229bd
| Author | SHA1 | Date |
|---|---|---|
|
|
e19c3229bd | |
|
|
b3c6f1031b | |
|
|
c2d93b4a4a | |
|
|
76430322dd | |
|
|
31ae0ab8e0 | |
|
|
8182d434ec |
|
|
@ -520,6 +520,9 @@ class Study(SQLModel):
|
||||||
[self.scenarios, self._river]
|
[self.scenarios, self._river]
|
||||||
)
|
)
|
||||||
logger.debug(cnt)
|
logger.debug(cnt)
|
||||||
|
# HACK: 8 is the number of SQL request do and dont counted in
|
||||||
|
# submodel save_count (let's count sql execute into the
|
||||||
|
# '_save' method)
|
||||||
return cnt + 8
|
return cnt + 8
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
|
|
|
||||||
|
|
@ -546,6 +546,15 @@ class Mage(CommandLineSolver):
|
||||||
|
|
||||||
return files
|
return files
|
||||||
|
|
||||||
|
def skip_hs(self, hs):
|
||||||
|
return (
|
||||||
|
hs.input_reach is None
|
||||||
|
or not hs.input_reach.is_enable()
|
||||||
|
or not hs.enabled
|
||||||
|
or hs.input_section is None
|
||||||
|
or hs.is_deleted()
|
||||||
|
)
|
||||||
|
|
||||||
def _export_SIN(self, study, repertory, qlog, name="0"):
|
def _export_SIN(self, study, repertory, qlog, name="0"):
|
||||||
files = []
|
files = []
|
||||||
|
|
||||||
|
|
@ -571,19 +580,7 @@ class Mage(CommandLineSolver):
|
||||||
files.append(f"{name}.SIN")
|
files.append(f"{name}.SIN")
|
||||||
|
|
||||||
for hs in hydraulic_structures:
|
for hs in hydraulic_structures:
|
||||||
if hs.input_reach is None:
|
if self.skip_hs(hs):
|
||||||
continue
|
|
||||||
|
|
||||||
if not hs.input_reach.is_enable():
|
|
||||||
continue
|
|
||||||
|
|
||||||
if not hs.enabled:
|
|
||||||
continue
|
|
||||||
|
|
||||||
if hs.input_section is None:
|
|
||||||
continue
|
|
||||||
|
|
||||||
if hs.is_deleted():
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
f.write(
|
f.write(
|
||||||
|
|
@ -1186,7 +1183,7 @@ class Mage8(Mage):
|
||||||
for p in r.profiles:
|
for p in r.profiles:
|
||||||
p.geometry.compute_tabulation()
|
p.geometry.compute_tabulation()
|
||||||
|
|
||||||
logger.info(f"compute velocily...")
|
logger.info(f"compute velocity...")
|
||||||
|
|
||||||
for r in reachs:
|
for r in reachs:
|
||||||
for t in ts_list:
|
for t in ts_list:
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from tools import trace, timer
|
from tools import trace, timer, logger_exception
|
||||||
|
|
||||||
from PyQt5.QtWidgets import (
|
from PyQt5.QtWidgets import (
|
||||||
QAction, QListView, QVBoxLayout,
|
QAction, QListView, QVBoxLayout,
|
||||||
|
|
@ -134,7 +134,10 @@ class GeoTIFFListWindow(PamhyrWindow):
|
||||||
|
|
||||||
def _update_rectangle(self):
|
def _update_rectangle(self):
|
||||||
for rect in self._plot_rect:
|
for rect in self._plot_rect:
|
||||||
|
try:
|
||||||
rect.remove()
|
rect.remove()
|
||||||
|
except Exception as e:
|
||||||
|
logger_exception(e)
|
||||||
|
|
||||||
self._plot_rect = []
|
self._plot_rect = []
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -299,6 +299,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||||
"action_menu_rep_additional_lines": self.open_rep_lines,
|
"action_menu_rep_additional_lines": self.open_rep_lines,
|
||||||
"action_menu_edit_geotiff": self.open_geotiff,
|
"action_menu_edit_geotiff": self.open_geotiff,
|
||||||
"action_menu_close": self.close_model,
|
"action_menu_close": self.close_model,
|
||||||
|
"action_menu_quit": self.close,
|
||||||
"action_menu_results_last": self.open_last_results,
|
"action_menu_results_last": self.open_last_results,
|
||||||
"action_menu_open_results_from_file": self.open_results_from_file,
|
"action_menu_open_results_from_file": self.open_results_from_file,
|
||||||
"action_menu_compare_scenarios_results":
|
"action_menu_compare_scenarios_results":
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import logging
|
||||||
|
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
|
|
||||||
from tools import timer, trace
|
from tools import timer, trace, logger_exception
|
||||||
from View.Tools.PamhyrPlot import PamhyrPlot
|
from View.Tools.PamhyrPlot import PamhyrPlot
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from matplotlib import collections
|
from matplotlib import collections
|
||||||
|
|
@ -332,7 +332,10 @@ class PlotXY(PamhyrPlot):
|
||||||
lst = self._data[0]._study.river._geotiff.lst
|
lst = self._data[0]._study.river._geotiff.lst
|
||||||
|
|
||||||
for img in self._plot_img:
|
for img in self._plot_img:
|
||||||
|
try:
|
||||||
self._plot_img[img].remove()
|
self._plot_img[img].remove()
|
||||||
|
except Exception as e:
|
||||||
|
logger_exception(e)
|
||||||
|
|
||||||
self._plot_img = {}
|
self._plot_img = {}
|
||||||
|
|
||||||
|
|
@ -453,8 +456,12 @@ class PlotXY(PamhyrPlot):
|
||||||
overflow.append(pt_right)
|
overflow.append(pt_right)
|
||||||
|
|
||||||
for plot in self.overflow:
|
for plot in self.overflow:
|
||||||
|
try:
|
||||||
plot[0].remove()
|
plot[0].remove()
|
||||||
|
except Exception as e:
|
||||||
|
logger_exception(e)
|
||||||
del plot[0]
|
del plot[0]
|
||||||
|
|
||||||
self.overflow = []
|
self.overflow = []
|
||||||
|
|
||||||
for p in overflow:
|
for p in overflow:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue