mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
add orientation option for update KP
This commit is contained in:
1 parent
57d43cd5d3
commit
98feca7fca
5 files changed
+122
-50
No files matched your search
@@ -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()
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user