mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
pamhyr: Fixing pep8 and use RD and RG by default at update PK (if exists).
This commit is contained in:
1 parent
2ee8420b94
commit
6c4b67d93a
3 files changed
+32
-18
No files matched your search
+2
-2
@@ -371,8 +371,8 @@ class MeshingWithMageMailleurTT(AMeshingTool):
|
||||
lplan: bool = False,
|
||||
lm: int = 3,
|
||||
linear: bool = False,
|
||||
origin_value = 0.0,
|
||||
orientation = 0):
|
||||
origin_value=0.0,
|
||||
orientation=0):
|
||||
if reach is None or len(reach.profiles) == 0:
|
||||
return reach
|
||||
|
||||
|
||||
+5
-3
@@ -270,8 +270,10 @@ class Study(SQLModel):
|
||||
def _load(cls, filename):
|
||||
new = cls(init_new=False, filename=filename)
|
||||
|
||||
version = new.execute("SELECT value FROM info WHERE key='study_release'")[0]
|
||||
new.status.version = int(version)
|
||||
version = new.execute(
|
||||
"SELECT value FROM info WHERE key='study_release'"
|
||||
)
|
||||
new.status.version = int(version[0])
|
||||
|
||||
# TODO: Load metadata
|
||||
new.name = new.execute("SELECT value FROM info WHERE key='name'")[0]
|
||||
@@ -308,7 +310,7 @@ class Study(SQLModel):
|
||||
progress = progress if progress is not None else lambda: None
|
||||
|
||||
self.execute(
|
||||
"INSERT INTO info VALUES ('study_release', "+
|
||||
"INSERT INTO info VALUES ('study_release', " +
|
||||
f"'{self.status.version}')"
|
||||
)
|
||||
|
||||
|
||||
@@ -50,9 +50,20 @@ class UpdateKPDialog(PamhyrDialog):
|
||||
self._init_default_values()
|
||||
|
||||
def _init_default_values(self):
|
||||
self._orientation = 0
|
||||
gl, _ = self._reach.compute_guidelines()
|
||||
self._gl = list(gl)
|
||||
|
||||
self._begin_dir = "un"
|
||||
self._end_dir = "np"
|
||||
|
||||
lower_gl = list(map(str.lower, self._gl))
|
||||
for i, gl in enumerate(lower_gl):
|
||||
if gl == "rd":
|
||||
self._begin_dir = self._gl[i]
|
||||
elif gl == "rg":
|
||||
self._end_dir = self._gl[i]
|
||||
|
||||
self._orientation = 0
|
||||
self._origin = self._reach.profile(0)
|
||||
self._origin_value = self._reach.profile(0).kp
|
||||
|
||||
@@ -64,16 +75,18 @@ class UpdateKPDialog(PamhyrDialog):
|
||||
|
||||
self.combobox_add_items("comboBox_origin", profiles)
|
||||
|
||||
self.find(QComboBox, "comboBox_origin").currentIndexChanged.connect(
|
||||
self.changed_profile)
|
||||
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
|
||||
name = button.objectName()
|
||||
i = int(name.split('_')[-1])
|
||||
|
||||
buttonbox.setId(button, i)
|
||||
|
||||
def changed_profile(self):
|
||||
@@ -106,11 +119,8 @@ class UpdateKPDialog(PamhyrDialog):
|
||||
return name
|
||||
|
||||
def _init_default_values_guidelines(self):
|
||||
gl, _ = self._reach.compute_guidelines()
|
||||
gl = list(gl)
|
||||
|
||||
bgl = ['un'] + gl + ['np']
|
||||
egl = ['un'] + gl + ['np']
|
||||
bgl = ['un'] + self._gl + ['np']
|
||||
egl = ['un'] + self._gl + ['np']
|
||||
|
||||
self.combobox_add_items("comboBox_begin_gl", bgl)
|
||||
self.combobox_add_items("comboBox_end_gl", egl)
|
||||
@@ -144,7 +154,9 @@ class UpdateKPDialog(PamhyrDialog):
|
||||
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")
|
||||
self._orientation = self.get_checked_id_button_group(
|
||||
"buttonGroup_orientation"
|
||||
)
|
||||
|
||||
super().accept()
|
||||
|
||||
|
||||
Reference in new issue
Block a user