diff --git a/src/Meshing/Mage.py b/src/Meshing/Mage.py
index 1e8f4c2d..4dc75a1d 100644
--- a/src/Meshing/Mage.py
+++ b/src/Meshing/Mage.py
@@ -371,7 +371,8 @@ class MeshingWithMageMailleurTT(AMeshingTool):
lplan: bool = False,
lm: int = 3,
linear: bool = False,
- origin_value=0.0):
+ origin_value = 0.0,
+ orientation = 0):
if reach is None or len(reach.profiles) == 0:
return reach
@@ -400,7 +401,7 @@ class MeshingWithMageMailleurTT(AMeshingTool):
f"{str(step)} " +
f"{limites[0]} {limites[1]} " +
f"{directrices[0]} {directrices[1]} " +
- f"{lplan} {lm} {linear} " +
+ f"{orientation} {lm} {linear} " +
f"{origin} "
)
proc.start(
@@ -413,7 +414,7 @@ class MeshingWithMageMailleurTT(AMeshingTool):
"update_kp", step,
limites[0], limites[1],
directrices[0], directrices[1],
- lplan, lm, linear, origin, origin_value
+ orientation, lm, linear, origin, origin_value
]
)
)
diff --git a/src/View/Geometry/UpdateKPDialog.py b/src/View/Geometry/UpdateKPDialog.py
index b1b0b307..548a87c1 100644
--- a/src/View/Geometry/UpdateKPDialog.py
+++ b/src/View/Geometry/UpdateKPDialog.py
@@ -28,7 +28,7 @@ from PyQt5.QtCore import (
from PyQt5.QtWidgets import (
QDialogButtonBox, QComboBox, QUndoStack, QShortcut,
- QDoubleSpinBox,
+ QDoubleSpinBox, QButtonGroup,
)
@@ -50,12 +50,7 @@ class UpdateKPDialog(PamhyrDialog):
self._init_default_values()
def _init_default_values(self):
- self._space_step = 50.0
- self._lplan = False
- self._lm = "3"
- self._linear = False
- self._begin_cs = -1
- self._end_cs = -1
+ self._orientation = 0
self._begin_dir = "un"
self._end_dir = "np"
self._origin = self._reach.profile(0)
@@ -72,6 +67,15 @@ class UpdateKPDialog(PamhyrDialog):
self.find(QComboBox, "comboBox_origin").currentIndexChanged.connect(
self.changed_profile)
+ buttonbox = self.find(QButtonGroup, "buttonGroup_orientation")
+
+ i = 0
+ for button in buttonbox.buttons():
+ if button.objectName() == "radioButton_0": i = 0
+ if button.objectName() == "radioButton_1": i = 1
+ if button.objectName() == "radioButton_2": i = 2
+ buttonbox.setId(button, i)
+
def changed_profile(self):
origin = self.get_combobox_text("comboBox_origin")
self.set_double_spin_box(
@@ -114,6 +118,10 @@ class UpdateKPDialog(PamhyrDialog):
self.set_combobox_text("comboBox_begin_gl", self._begin_dir)
self.set_combobox_text("comboBox_end_gl", self._end_dir)
+ @property
+ def orientation(self):
+ return self._orientation
+
@property
def origin(self):
return self._origin
@@ -133,11 +141,10 @@ class UpdateKPDialog(PamhyrDialog):
def accept(self):
origin = self.get_combobox_text("comboBox_origin")
self._origin = self.profiles.index(origin)
-
self._origin_value = self.get_double_spin_box("doubleSpinBox_origin")
-
self._begin_dir = self.get_combobox_text("comboBox_begin_gl")
self._end_dir = self.get_combobox_text("comboBox_end_gl")
+ self._orientation = self.get_checked_id_button_group("buttonGroup_orientation")
super().accept()
diff --git a/src/View/Geometry/Window.py b/src/View/Geometry/Window.py
index 055ea8c3..ad5b0a23 100644
--- a/src/View/Geometry/Window.py
+++ b/src/View/Geometry/Window.py
@@ -336,6 +336,7 @@ class GeometryWindow(PamhyrWindow):
"origin": dlg.origin,
"directrices": [dlg.begin_dir, dlg.end_dir],
"origin_value": dlg.origin_value,
+ "orientation": dlg.orientation,
}
self._update_kp(data)
except Exception as e:
diff --git a/src/View/Tools/ASubWindow.py b/src/View/Tools/ASubWindow.py
index 78655358..2bbeca94 100644
--- a/src/View/Tools/ASubWindow.py
+++ b/src/View/Tools/ASubWindow.py
@@ -35,7 +35,7 @@ from PyQt5.QtWidgets import (
QRadioButton, QComboBox, QFileDialog,
QMessageBox, QTableView, QAction,
QDateTimeEdit, QWidget, QPlainTextEdit,
- QLabel, QDoubleSpinBox,
+ QLabel, QDoubleSpinBox, QButtonGroup,
)
from PyQt5.QtCore import (
QTime, QDateTime,
@@ -498,6 +498,17 @@ class ASubWindowFeatures(object):
qdate = QDateTime.fromString(date.isoformat(), "yyyy-MM-ddThh:mm:ss")
self.find(QDateTimeEdit, name).setDateTime(qdate)
+ def get_checked_id_button_group(self, name: str):
+ """Get current checked button id in a buttonGroup
+
+ Args:
+ name: The buttonGroup component name
+
+ Returns:
+ Current checked id
+ """
+ return self.find(QButtonGroup, name).checkedId()
+
# Top level interface
diff --git a/src/View/ui/UpdateKPOptions.ui b/src/View/ui/UpdateKPOptions.ui
index 881491ba..0f5f1b88 100644
--- a/src/View/ui/UpdateKPOptions.ui
+++ b/src/View/ui/UpdateKPOptions.ui
@@ -6,37 +6,23 @@
0
0
- 340
- 204
+ 381
+ 302
Dialog
+
+ Qt::LeftToRight
+
- -
-
-
- Qt::Horizontal
-
-
- QDialogButtonBox::Cancel|QDialogButtonBox::Ok
-
-
-
-
Distance computation
-
-
-
-
- true
-
-
-
-
@@ -47,11 +33,17 @@
- -
-
-
- true
+
-
+
+
+ Upstream to downstream
+
+ false
+
+
+ buttonGroup_orientation
+
-
@@ -67,20 +59,6 @@
-
- -
-
-
- Origin
-
-
-
- -
-
-
- Origin value
-
-
-
-
@@ -94,9 +72,80 @@
+ -
+
+
+ Origin
+
+
+
+ -
+
+
+ true
+
+
+
+ -
+
+
+ Origin value
+
+
+
+ -
+
+
+ Downstream to upstream
+
+
+ buttonGroup_orientation
+
+
+
+ -
+
+
+ true
+
+
+
+ -
+
+
+ Orientation
+
+
+
+ -
+
+
+ Qt::LeftToRight
+
+
+ Keep current
+
+
+ true
+
+
+ buttonGroup_orientation
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+ QDialogButtonBox::Cancel|QDialogButtonBox::Ok
+
+
+
@@ -134,4 +183,7 @@
+
+
+