mirror of https://gitlab.com/pamhyr/pamhyr2
Compare commits
4 Commits
c065b19ef8
...
012408d19e
| Author | SHA1 | Date |
|---|---|---|
|
|
012408d19e | |
|
|
f7e563e71a | |
|
|
81c6d39c1a | |
|
|
d682443e1d |
|
|
@ -139,19 +139,11 @@ class InternalMeshing(AMeshingTool):
|
|||
# len1 and 2: number of intervals
|
||||
# len1: target len
|
||||
|
||||
if tag1 == '': # left end point
|
||||
start1 = 0
|
||||
start2 = 0
|
||||
else:
|
||||
start1 = sect1.named_point_index(tag1)
|
||||
start2 = sect2.named_point_index(tag1)
|
||||
start1 = sect1.named_point_index(tag1)
|
||||
start2 = sect2.named_point_index(tag1)
|
||||
|
||||
if tag2 == '': # right end point
|
||||
end1 = sect1.nb_points-1
|
||||
end2 = sect2.nb_points-1
|
||||
else:
|
||||
end1 = sect1.named_point_index(tag2)
|
||||
end2 = sect2.named_point_index(tag2)
|
||||
end1 = sect1.named_point_index(tag2)
|
||||
end2 = sect2.named_point_index(tag2)
|
||||
|
||||
len1 = end1 - start1
|
||||
len2 = end2 - start2
|
||||
|
|
@ -183,11 +175,6 @@ class InternalMeshing(AMeshingTool):
|
|||
p = sect2.point(start2).copy()
|
||||
sect2.insert_point(start2, p)
|
||||
len2 += 1
|
||||
if tag1 == '': # left end point
|
||||
sect2.point(start2).name = ''
|
||||
if tag2 == '': # left end point
|
||||
sect2.point(start2+1).name = ''
|
||||
len2 += 1
|
||||
elif ltot1 < 0.0001:
|
||||
sect2.add_npoints(len1-len2)
|
||||
len2 = len1
|
||||
|
|
@ -254,8 +241,10 @@ class InternalMeshing(AMeshingTool):
|
|||
p = sect2.point(start2+len2).copy()
|
||||
sect2.insert_point(start2+len2, p)
|
||||
sect2.point(start2+len2).name = ''
|
||||
sect2.point(start2).name = tag1
|
||||
sect2.point(start2+len2).name = tag2
|
||||
if tag1 != "un":
|
||||
sect2.point(start2).name = tag1
|
||||
if tag1 != "np":
|
||||
sect2.point(start2+len2).name = tag2
|
||||
sect2.modified()
|
||||
|
||||
def update_rk(self, reach, begin_rk, end_rk,
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class Scenario(SQLSubModel):
|
|||
id: int = -1,
|
||||
name: str = "",
|
||||
description: str = "",
|
||||
x: int = 0.0, y: int = 0.0,
|
||||
x: int = 1000.0, y: int = 1000.0,
|
||||
revision: int = 0,
|
||||
parent=None):
|
||||
super(Scenario, self).__init__()
|
||||
|
|
|
|||
|
|
@ -1206,6 +1206,31 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
Returns:
|
||||
Nothing
|
||||
"""
|
||||
if self._study is None:
|
||||
return
|
||||
if self._study.filename is None or self._study.filename == "":
|
||||
self.message_box(
|
||||
window_title=self._trad["Warning"],
|
||||
text=self._trad["mb_unsaved_study_title"],
|
||||
informative_text=self._trad["mb_unsaved_studyh_msg"]
|
||||
)
|
||||
|
||||
options = QFileDialog.Options()
|
||||
options |= QFileDialog.DontUseNativeDialog
|
||||
|
||||
file_name, _ = QFileDialog.getSaveFileName(
|
||||
self, "Save File",
|
||||
"", "Pamhyr(*.pamhyr)",
|
||||
options=options,
|
||||
)
|
||||
if file_name is None or file_name == "":
|
||||
return
|
||||
|
||||
if file_name.rsplit(".", 1)[-1] == "pamhyr":
|
||||
self._study.filename = file_name
|
||||
else:
|
||||
self._study.filename = file_name + ".pamhyr"
|
||||
|
||||
if self._study is not None:
|
||||
if self.sub_window_exists(
|
||||
ScenariosWindow,
|
||||
|
|
|
|||
|
|
@ -149,8 +149,17 @@ class PlotAC(PamhyrPlot):
|
|||
self.annotation = []
|
||||
self.cgl, self.igl = reach.geometry.compute_guidelines()
|
||||
|
||||
lcomplete = list(self.cgl)
|
||||
lincomplete = list(self.igl)
|
||||
# we make sure that the lines are in the left-to-right order
|
||||
lcomplete = [
|
||||
x.name
|
||||
for x in profile.geometry.named_points()
|
||||
if x.name in self.cgl
|
||||
]
|
||||
lincomplete = [
|
||||
x.name
|
||||
for x in profile.geometry.named_points()
|
||||
if x.name in self.igl
|
||||
]
|
||||
|
||||
self.color_complete_gl = self.colors
|
||||
self.color_incomplete_gl = 2 * ["grey"]
|
||||
|
|
@ -170,7 +179,7 @@ class PlotAC(PamhyrPlot):
|
|||
]
|
||||
else:
|
||||
color = self.color_incomplete_gl[
|
||||
lincomplete.index(txt)
|
||||
lincomplete.index(txt) % len(self.color_incomplete_gl)
|
||||
]
|
||||
|
||||
annotation = self.canvas.axes.annotate(
|
||||
|
|
|
|||
|
|
@ -266,6 +266,16 @@ class MainTranslate(UnitTranslate):
|
|||
"incompatible study version"
|
||||
)
|
||||
|
||||
|
||||
self._dict["mb_unsaved_study_title"] = _translate(
|
||||
"MainWindow", "Open scenarios window"
|
||||
)
|
||||
self._dict["mb_unsaved_studyh_msg"] = _translate(
|
||||
"MainWindow",
|
||||
"You must save your study to open "
|
||||
"the scenario windows"
|
||||
)
|
||||
|
||||
self._dict["x"] = _translate("MainWindow", "X (m)")
|
||||
self._dict["y"] = _translate("MainWindow", "Y (m)")
|
||||
self._dict["Yes"] = _translate("MainWindow", "Yes")
|
||||
|
|
|
|||
729
src/lang/fr.ts
729
src/lang/fr.ts
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue