mirror of https://gitlab.com/pamhyr/pamhyr2
Compare commits
No commits in common. "012408d19e41852e0d718fb086b7e9e27590c439" and "c065b19ef8236025daf23923e4860cd1512746a6" have entirely different histories.
012408d19e
...
c065b19ef8
|
|
@ -139,9 +139,17 @@ class InternalMeshing(AMeshingTool):
|
||||||
# len1 and 2: number of intervals
|
# len1 and 2: number of intervals
|
||||||
# len1: target len
|
# len1: target len
|
||||||
|
|
||||||
|
if tag1 == '': # left end point
|
||||||
|
start1 = 0
|
||||||
|
start2 = 0
|
||||||
|
else:
|
||||||
start1 = sect1.named_point_index(tag1)
|
start1 = sect1.named_point_index(tag1)
|
||||||
start2 = sect2.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)
|
end1 = sect1.named_point_index(tag2)
|
||||||
end2 = sect2.named_point_index(tag2)
|
end2 = sect2.named_point_index(tag2)
|
||||||
|
|
||||||
|
|
@ -175,6 +183,11 @@ class InternalMeshing(AMeshingTool):
|
||||||
p = sect2.point(start2).copy()
|
p = sect2.point(start2).copy()
|
||||||
sect2.insert_point(start2, p)
|
sect2.insert_point(start2, p)
|
||||||
len2 += 1
|
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:
|
elif ltot1 < 0.0001:
|
||||||
sect2.add_npoints(len1-len2)
|
sect2.add_npoints(len1-len2)
|
||||||
len2 = len1
|
len2 = len1
|
||||||
|
|
@ -241,9 +254,7 @@ class InternalMeshing(AMeshingTool):
|
||||||
p = sect2.point(start2+len2).copy()
|
p = sect2.point(start2+len2).copy()
|
||||||
sect2.insert_point(start2+len2, p)
|
sect2.insert_point(start2+len2, p)
|
||||||
sect2.point(start2+len2).name = ''
|
sect2.point(start2+len2).name = ''
|
||||||
if tag1 != "un":
|
|
||||||
sect2.point(start2).name = tag1
|
sect2.point(start2).name = tag1
|
||||||
if tag1 != "np":
|
|
||||||
sect2.point(start2+len2).name = tag2
|
sect2.point(start2+len2).name = tag2
|
||||||
sect2.modified()
|
sect2.modified()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ class Scenario(SQLSubModel):
|
||||||
id: int = -1,
|
id: int = -1,
|
||||||
name: str = "",
|
name: str = "",
|
||||||
description: str = "",
|
description: str = "",
|
||||||
x: int = 1000.0, y: int = 1000.0,
|
x: int = 0.0, y: int = 0.0,
|
||||||
revision: int = 0,
|
revision: int = 0,
|
||||||
parent=None):
|
parent=None):
|
||||||
super(Scenario, self).__init__()
|
super(Scenario, self).__init__()
|
||||||
|
|
|
||||||
|
|
@ -1206,31 +1206,6 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||||
Returns:
|
Returns:
|
||||||
Nothing
|
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._study is not None:
|
||||||
if self.sub_window_exists(
|
if self.sub_window_exists(
|
||||||
ScenariosWindow,
|
ScenariosWindow,
|
||||||
|
|
|
||||||
|
|
@ -149,17 +149,8 @@ class PlotAC(PamhyrPlot):
|
||||||
self.annotation = []
|
self.annotation = []
|
||||||
self.cgl, self.igl = reach.geometry.compute_guidelines()
|
self.cgl, self.igl = reach.geometry.compute_guidelines()
|
||||||
|
|
||||||
# we make sure that the lines are in the left-to-right order
|
lcomplete = list(self.cgl)
|
||||||
lcomplete = [
|
lincomplete = list(self.igl)
|
||||||
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_complete_gl = self.colors
|
||||||
self.color_incomplete_gl = 2 * ["grey"]
|
self.color_incomplete_gl = 2 * ["grey"]
|
||||||
|
|
@ -179,7 +170,7 @@ class PlotAC(PamhyrPlot):
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
color = self.color_incomplete_gl[
|
color = self.color_incomplete_gl[
|
||||||
lincomplete.index(txt) % len(self.color_incomplete_gl)
|
lincomplete.index(txt)
|
||||||
]
|
]
|
||||||
|
|
||||||
annotation = self.canvas.axes.annotate(
|
annotation = self.canvas.axes.annotate(
|
||||||
|
|
|
||||||
|
|
@ -266,16 +266,6 @@ class MainTranslate(UnitTranslate):
|
||||||
"incompatible study version"
|
"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["x"] = _translate("MainWindow", "X (m)")
|
||||||
self._dict["y"] = _translate("MainWindow", "Y (m)")
|
self._dict["y"] = _translate("MainWindow", "Y (m)")
|
||||||
self._dict["Yes"] = _translate("MainWindow", "Yes")
|
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