-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathfloat_state_dialog.py
More file actions
414 lines (366 loc) · 25.9 KB
/
Copy pathfloat_state_dialog.py
File metadata and controls
414 lines (366 loc) · 25.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
#!/usr/bin/env python3.7
# -*- coding: utf-8 -*-
"""DesignSPHysics Float State configuration dialog. """
import FreeCADGui
# from PySide import QtCore, QtGui
from PySide6 import QtCore, QtWidgets
from mod.translation_tools import __
from mod.dialog_tools import info_dialog
from mod.enums import ObjectType
from mod.dataobjects.case import Case
from mod.dataobjects.float_property import FloatProperty
class FloatStateDialog(QtWidgets.QDialog):
""" Defines a window with floating """
def __init__(self, parent=None):
super().__init__(parent=parent)
self.setWindowTitle(__("Floating configuration"))
self.ok_button = QtWidgets.QPushButton(__("OK"))
self.cancel_button = QtWidgets.QPushButton(__("Cancel"))
self.target_mk = Case.the().get_simulation_object(FreeCADGui.Selection.getSelection()[0].Name).obj_mk
self.ok_button.clicked.connect(self.on_ok)
self.cancel_button.clicked.connect(self.on_cancel)
self.is_floating_layout = QtWidgets.QHBoxLayout()
self.is_floating_label = QtWidgets.QLabel(__("Set floating: "))
self.is_floating_label.setToolTip(__("Sets the current MKBound selected as floating."))
self.is_floating_selector = QtWidgets.QComboBox()
self.is_floating_selector.insertItems(0, ["True", "False"])
self.is_floating_selector.currentIndexChanged.connect(self.on_floating_change)
self.is_floating_targetlabel = QtWidgets.QLabel(__("Target MKBound: ") + str(self.target_mk))
self.is_floating_layout.addWidget(self.is_floating_label)
self.is_floating_layout.addWidget(self.is_floating_selector)
self.is_floating_layout.addStretch(1)
self.is_floating_layout.addWidget(self.is_floating_targetlabel)
self.floating_props_group = QtWidgets.QGroupBox(__("Floating properties"))
self.floating_props_layout = QtWidgets.QVBoxLayout()
self.floating_props_massrhop_layout = QtWidgets.QHBoxLayout()
self.floating_props_massrhop_label = QtWidgets.QLabel(__("Mass/Density: "))
self.floating_props_massrhop_label.setToolTip(__("Selects an mass/density calculation method and its value."))
self.floating_props_massrhop_selector = QtWidgets.QComboBox()
self.floating_props_massrhop_selector.insertItems(0, ["massbody (kg)", "rhopbody (kg/m^3)"])
self.floating_props_massrhop_input = QtWidgets.QLineEdit()
self.floating_props_massrhop_selector.currentIndexChanged.connect(self.on_massrhop_change)
self.floating_props_massrhop_layout.addWidget(self.floating_props_massrhop_label)
self.floating_props_massrhop_layout.addWidget(self.floating_props_massrhop_selector)
self.floating_props_massrhop_layout.addWidget(self.floating_props_massrhop_input)
self.floating_center_layout = QtWidgets.QHBoxLayout()
self.floating_center_label = QtWidgets.QLabel(__("Gravity center (m): "))
self.floating_center_label.setToolTip(__("Sets the mk group gravity center."))
self.floating_center_label_x = QtWidgets.QLabel("X")
self.floating_center_input_x = QtWidgets.QLineEdit()
self.floating_center_label_y = QtWidgets.QLabel("Y")
self.floating_center_input_y = QtWidgets.QLineEdit()
self.floating_center_label_z = QtWidgets.QLabel("Z")
self.floating_center_input_z = QtWidgets.QLineEdit()
self.floating_center_auto = QtWidgets.QCheckBox("Auto ")
self.floating_center_auto.toggled.connect(self.on_gravity_auto)
self.floating_center_layout.addWidget(self.floating_center_label)
self.floating_center_layout.addWidget(self.floating_center_label_x)
self.floating_center_layout.addWidget(self.floating_center_input_x)
self.floating_center_layout.addWidget(self.floating_center_label_y)
self.floating_center_layout.addWidget(self.floating_center_input_y)
self.floating_center_layout.addWidget(self.floating_center_label_z)
self.floating_center_layout.addWidget(self.floating_center_input_z)
self.floating_center_layout.addWidget(self.floating_center_auto)
self.floating_inertia_layout = QtWidgets.QHBoxLayout()
self.floating_inertia_label = QtWidgets.QLabel(__("Inertia (kg*m<sup>2</sup>): "))
self.floating_inertia_label.setToolTip(__("Sets the MK group inertia."))
self.floating_inertia_label_x = QtWidgets.QLabel("XX")
self.floating_inertia_input_x = QtWidgets.QLineEdit()
self.floating_inertia_label_y = QtWidgets.QLabel("YY")
self.floating_inertia_input_y = QtWidgets.QLineEdit()
self.floating_inertia_label_z = QtWidgets.QLabel("ZZ")
self.floating_inertia_input_z = QtWidgets.QLineEdit()
self.floating_inertia_auto = QtWidgets.QCheckBox("Auto ")
self.floating_inertia_auto.toggled.connect(self.on_inertia_auto)
self.floating_inertia_layout.addWidget(self.floating_inertia_label)
self.floating_inertia_layout.addWidget(self.floating_inertia_label_x)
self.floating_inertia_layout.addWidget(self.floating_inertia_input_x)
self.floating_inertia_layout.addWidget(self.floating_inertia_label_y)
self.floating_inertia_layout.addWidget(self.floating_inertia_input_y)
self.floating_inertia_layout.addWidget(self.floating_inertia_label_z)
self.floating_inertia_layout.addWidget(self.floating_inertia_input_z)
self.floating_inertia_layout.addWidget(self.floating_inertia_auto)
self.floating_velini_layout = QtWidgets.QHBoxLayout()
self.floating_velini_label = QtWidgets.QLabel(__("Initial linear velocity: "))
self.floating_velini_label.setToolTip(__("Sets the MK group initial linear velocity"))
self.floating_velini_label_x = QtWidgets.QLabel("X")
self.floating_velini_input_x = QtWidgets.QLineEdit()
self.floating_velini_label_y = QtWidgets.QLabel("Y")
self.floating_velini_input_y = QtWidgets.QLineEdit()
self.floating_velini_label_z = QtWidgets.QLabel("Z")
self.floating_velini_input_z = QtWidgets.QLineEdit()
self.floating_velini_auto = QtWidgets.QCheckBox("Auto ")
self.floating_velini_auto.toggled.connect(self.on_velini_auto)
self.floating_velini_layout.addWidget(self.floating_velini_label)
self.floating_velini_layout.addWidget(self.floating_velini_label_x)
self.floating_velini_layout.addWidget(self.floating_velini_input_x)
self.floating_velini_layout.addWidget(self.floating_velini_label_y)
self.floating_velini_layout.addWidget(self.floating_velini_input_y)
self.floating_velini_layout.addWidget(self.floating_velini_label_z)
self.floating_velini_layout.addWidget(self.floating_velini_input_z)
self.floating_velini_layout.addWidget(self.floating_velini_auto)
self.floating_omegaini_layout = QtWidgets.QHBoxLayout()
self.floating_omegaini_label = QtWidgets.QLabel(__("Initial angular velocity: "))
self.floating_omegaini_label.setToolTip(__("Sets the MK group initial angular velocity"))
self.floating_omegaini_label_x = QtWidgets.QLabel("X")
self.floating_omegaini_input_x = QtWidgets.QLineEdit()
self.floating_omegaini_label_y = QtWidgets.QLabel("Y")
self.floating_omegaini_input_y = QtWidgets.QLineEdit()
self.floating_omegaini_label_z = QtWidgets.QLabel("Z")
self.floating_omegaini_input_z = QtWidgets.QLineEdit()
self.floating_omegaini_auto = QtWidgets.QCheckBox("Auto ")
self.floating_omegaini_auto.toggled.connect(self.on_omegaini_auto)
self.floating_omegaini_layout.addWidget(self.floating_omegaini_label)
self.floating_omegaini_layout.addWidget(self.floating_omegaini_label_x)
self.floating_omegaini_layout.addWidget(self.floating_omegaini_input_x)
self.floating_omegaini_layout.addWidget(self.floating_omegaini_label_y)
self.floating_omegaini_layout.addWidget(self.floating_omegaini_input_y)
self.floating_omegaini_layout.addWidget(self.floating_omegaini_label_z)
self.floating_omegaini_layout.addWidget(self.floating_omegaini_input_z)
self.floating_omegaini_layout.addWidget(self.floating_omegaini_auto)
self.floating_translation_layout = QtWidgets.QHBoxLayout()
self.floating_translation_label = QtWidgets.QLabel(__("Translation DOF: "))
self.floating_translation_label.setToolTip(__("Use No for translation restriction in the movement (default=(Yes, Yes, Yes))"))
self.floating_translation_label_x = QtWidgets.QLabel("X")
self.floating_translation_input_x = QtWidgets.QComboBox()
self.floating_translation_input_x.insertItems(1, ["No", "Yes"])
self.floating_translation_label_y = QtWidgets.QLabel("Y")
self.floating_translation_input_y = QtWidgets.QComboBox()
self.floating_translation_input_y.insertItems(1, ["No", "Yes"])
self.floating_translation_label_z = QtWidgets.QLabel("Z")
self.floating_translation_input_z = QtWidgets.QComboBox()
self.floating_translation_input_z.insertItems(1, ["No", "Yes"])
self.floating_translation_auto = QtWidgets.QCheckBox("Auto ")
self.floating_translation_auto.toggled.connect(self.on_translation_auto)
self.floating_translation_layout.addWidget(self.floating_translation_label)
self.floating_translation_layout.addStretch(1)
self.floating_translation_layout.addWidget(self.floating_translation_label_x)
self.floating_translation_layout.addWidget(self.floating_translation_input_x)
self.floating_translation_layout.addStretch(1)
self.floating_translation_layout.addWidget(self.floating_translation_label_y)
self.floating_translation_layout.addWidget(self.floating_translation_input_y)
self.floating_translation_layout.addStretch(1)
self.floating_translation_layout.addWidget(self.floating_translation_label_z)
self.floating_translation_layout.addWidget(self.floating_translation_input_z)
self.floating_translation_layout.addStretch(1)
self.floating_translation_layout.addWidget(self.floating_translation_auto)
self.floating_rotation_layout = QtWidgets.QHBoxLayout()
self.floating_rotation_label = QtWidgets.QLabel(__("Rotation DOF: "))
self.floating_rotation_label.setToolTip(__("Use No for rotation restriction in the movement (default=(Yes , Yes, Yes))"))
self.floating_rotation_label_x = QtWidgets.QLabel("X")
self.floating_rotation_input_x = QtWidgets.QComboBox()
self.floating_rotation_input_x.insertItems(1, ["No", "Yes"])
self.floating_rotation_label_y = QtWidgets.QLabel("Y")
self.floating_rotation_input_y = QtWidgets.QComboBox()
self.floating_rotation_input_y.insertItems(1, ["No", "Yes"])
self.floating_rotation_label_z = QtWidgets.QLabel("Z")
self.floating_rotation_input_z = QtWidgets.QComboBox()
self.floating_rotation_input_z.insertItems(1, ["No", "Yes"])
self.floating_rotation_auto = QtWidgets.QCheckBox("Auto ")
self.floating_rotation_auto.toggled.connect(self.on_rotation_auto)
self.floating_rotation_layout.addWidget(self.floating_rotation_label)
self.floating_rotation_layout.addStretch(1)
self.floating_rotation_layout.addWidget(self.floating_rotation_label_x)
self.floating_rotation_layout.addWidget(self.floating_rotation_input_x)
self.floating_rotation_layout.addStretch(1)
self.floating_rotation_layout.addWidget(self.floating_rotation_label_y)
self.floating_rotation_layout.addWidget(self.floating_rotation_input_y)
self.floating_rotation_layout.addStretch(1)
self.floating_rotation_layout.addWidget(self.floating_rotation_label_z)
self.floating_rotation_layout.addWidget(self.floating_rotation_input_z)
self.floating_rotation_layout.addStretch(1)
self.floating_rotation_layout.addWidget(self.floating_rotation_auto)
self.floating_material_layout = QtWidgets.QHBoxLayout()
self.floating_material_label = QtWidgets.QLabel(__("Material: "))
self.floating_material_line_edit = QtWidgets.QLineEdit()
self.floating_material_auto = QtWidgets.QCheckBox("Auto ")
self.floating_material_auto.toggled.connect(self.on_material_auto)
self.floating_material_layout.addWidget(self.floating_material_label)
self.floating_material_layout.addWidget(self.floating_material_line_edit)
self.floating_material_layout.addStretch(1)
self.floating_material_layout.addWidget(self.floating_material_auto)
self.floating_props_layout.addLayout(self.floating_props_massrhop_layout)
self.floating_props_layout.addLayout(self.floating_center_layout)
self.floating_props_layout.addLayout(self.floating_inertia_layout)
self.floating_props_layout.addLayout(self.floating_velini_layout)
self.floating_props_layout.addLayout(self.floating_omegaini_layout)
self.floating_props_layout.addLayout(self.floating_translation_layout)
self.floating_props_layout.addLayout(self.floating_rotation_layout)
self.floating_props_layout.addLayout(self.floating_material_layout)
self.floating_props_layout.addStretch(1)
self.floating_props_group.setLayout(self.floating_props_layout)
self.buttons_layout = QtWidgets.QHBoxLayout()
self.buttons_layout.addStretch(1)
self.buttons_layout.addWidget(self.ok_button)
self.buttons_layout.addWidget(self.cancel_button)
self.floatings_window_layout = QtWidgets.QVBoxLayout()
self.floatings_window_layout.addLayout(self.is_floating_layout)
self.floatings_window_layout.addWidget(self.floating_props_group)
self.floatings_window_layout.addLayout(self.buttons_layout)
self.setLayout(self.floatings_window_layout)
float_property: FloatProperty = Case.the().get_mk_based_properties(ObjectType.BOUND, self.target_mk).float_property
if float_property:
self.is_floating_selector.setCurrentIndex(0)
self.on_floating_change(0)
self.floating_props_group.setEnabled(True)
self.floating_props_massrhop_selector.setCurrentIndex(float_property.mass_density_type)
self.floating_props_massrhop_input.setText(str(float_property.mass_density_value))
if not float_property.gravity_center:
self.floating_center_input_x.setText("0")
self.floating_center_input_y.setText("0")
self.floating_center_input_z.setText("0")
else:
self.floating_center_input_x.setText(str(float_property.gravity_center[0]))
self.floating_center_input_y.setText(str(float_property.gravity_center[1]))
self.floating_center_input_z.setText(str(float_property.gravity_center[2]))
if not float_property.inertia:
self.floating_inertia_input_x.setText("0")
self.floating_inertia_input_y.setText("0")
self.floating_inertia_input_z.setText("0")
else:
self.floating_inertia_input_x.setText(str(float_property.inertia[0]))
self.floating_inertia_input_y.setText(str(float_property.inertia[1]))
self.floating_inertia_input_z.setText(str(float_property.inertia[2]))
if not float_property.initial_linear_velocity:
self.floating_velini_input_x.setText("0")
self.floating_velini_input_y.setText("0")
self.floating_velini_input_z.setText("0")
else:
self.floating_velini_input_x.setText(
str(float_property.initial_linear_velocity[0]))
self.floating_velini_input_y.setText(str(float_property.initial_linear_velocity[1]))
self.floating_velini_input_z.setText(str(float_property.initial_linear_velocity[2]))
if not float_property.initial_angular_velocity:
self.floating_omegaini_input_x.setText("0")
self.floating_omegaini_input_y.setText("0")
self.floating_omegaini_input_z.setText("0")
else:
self.floating_omegaini_input_x.setText(
str(float_property.initial_angular_velocity[0]))
self.floating_omegaini_input_y.setText(str(float_property.initial_angular_velocity[1]))
self.floating_omegaini_input_z.setText(str(float_property.initial_angular_velocity[2]))
if not float_property.translation_restriction:
self.floating_translation_input_x.setCurrentIndex(1)
self.floating_translation_input_y.setCurrentIndex(1)
self.floating_translation_input_z.setCurrentIndex(1)
else:
self.floating_translation_input_x.setCurrentIndex(float_property.translation_restriction[0])
self.floating_translation_input_y.setCurrentIndex(float_property.translation_restriction[1])
self.floating_translation_input_z.setCurrentIndex(float_property.translation_restriction[2])
if not float_property.rotation_restriction:
self.floating_rotation_input_x.setCurrentIndex(1)
self.floating_rotation_input_y.setCurrentIndex(1)
self.floating_rotation_input_z.setCurrentIndex(1)
else:
self.floating_rotation_input_x.setCurrentIndex(float_property.rotation_restriction[0])
self.floating_rotation_input_y.setCurrentIndex(float_property.rotation_restriction[1])
self.floating_rotation_input_z.setCurrentIndex(float_property.rotation_restriction[2])
if not float_property.material:
self.floating_material_line_edit.setText("")
else:
self.floating_material_line_edit.setText(float_property.material)
self.floating_center_auto.setCheckState(QtCore.Qt.Checked if not float_property.gravity_center else QtCore.Qt.Unchecked)
self.floating_inertia_auto.setCheckState(QtCore.Qt.Checked if not float_property.inertia else QtCore.Qt.Unchecked)
self.floating_velini_auto.setCheckState(QtCore.Qt.Checked if not float_property.initial_linear_velocity else QtCore.Qt.Unchecked)
self.floating_omegaini_auto.setCheckState(QtCore.Qt.Checked if not float_property.initial_angular_velocity else QtCore.Qt.Unchecked)
self.floating_translation_auto.setCheckState(QtCore.Qt.Checked if not float_property.translation_restriction else QtCore.Qt.Unchecked)
self.floating_rotation_auto.setCheckState(QtCore.Qt.Checked if not float_property.rotation_restriction else QtCore.Qt.Unchecked)
self.floating_material_auto.setCheckState(QtCore.Qt.Checked if not float_property.material else QtCore.Qt.Unchecked)
else:
self.is_floating_selector.setCurrentIndex(1)
self.on_floating_change(1)
self.floating_props_group.setEnabled(False)
self.is_floating_selector.setCurrentIndex(1)
self.floating_props_massrhop_selector.setCurrentIndex(1)
self.floating_props_massrhop_input.setText("1000")
self.floating_center_input_x.setText("0")
self.floating_center_input_y.setText("0")
self.floating_center_input_z.setText("0")
self.floating_inertia_input_x.setText("0")
self.floating_inertia_input_y.setText("0")
self.floating_inertia_input_z.setText("0")
self.floating_velini_input_x.setText("0")
self.floating_velini_input_y.setText("0")
self.floating_velini_input_z.setText("0")
self.floating_omegaini_input_x.setText("0")
self.floating_omegaini_input_y.setText("0")
self.floating_omegaini_input_z.setText("0")
self.floating_translation_input_x.setCurrentIndex(1)
self.floating_translation_input_y.setCurrentIndex(1)
self.floating_translation_input_z.setCurrentIndex(1)
self.floating_rotation_input_x.setCurrentIndex(1)
self.floating_rotation_input_y.setCurrentIndex(1)
self.floating_rotation_input_z.setCurrentIndex(1)
self.floating_material_line_edit.setText("")
self.floating_center_auto.setCheckState(QtCore.Qt.Checked)
self.floating_inertia_auto.setCheckState(QtCore.Qt.Checked)
self.floating_velini_auto.setCheckState(QtCore.Qt.Checked)
self.floating_omegaini_auto.setCheckState(QtCore.Qt.Checked)
self.floating_translation_auto.setCheckState(QtCore.Qt.Checked)
self.floating_rotation_auto.setCheckState(QtCore.Qt.Checked)
self.floating_material_auto.setCheckState(QtCore.Qt.Checked)
self.exec_()
def on_ok(self):
""" Composes floating options and saves them into the appropriate data structure. """
info_dialog(__("This will apply the floating properties to all objects with mkbound = ") + str(self.target_mk))
if self.is_floating_selector.currentIndex() == 1:
# Remove Floating
Case.the().get_mk_based_properties(ObjectType.BOUND, self.target_mk).float_property = None
self.accept()
return
# Floating is true
fp = FloatProperty() # FloatProperty to be inserted
fp.mk = self.target_mk
fp.mass_density_type = self.floating_props_massrhop_selector.currentIndex()
fp.mass_density_value = float(self.floating_props_massrhop_input.text())
fp.gravity_center = list() if self.floating_center_auto.isChecked() else [float(self.floating_center_input_x.text()), float(self.floating_center_input_y.text()), float(self.floating_center_input_z.text())]
fp.inertia = list() if self.floating_inertia_auto.isChecked() else [float(self.floating_inertia_input_x.text()), float(self.floating_inertia_input_y.text()), float(self.floating_inertia_input_z.text())]
fp.initial_linear_velocity = list() if self.floating_velini_auto.isChecked() else [float(self.floating_velini_input_x.text()), float(self.floating_velini_input_y.text()), float(self.floating_velini_input_z.text())]
fp.initial_angular_velocity = list() if self.floating_omegaini_auto.isChecked() else [float(self.floating_omegaini_input_x.text()), float(self.floating_omegaini_input_y.text()), float(self.floating_omegaini_input_z.text())]
fp.translation_restriction = list() if self.floating_translation_auto.isChecked() else [int(self.floating_translation_input_x.currentIndex()), int(self.floating_translation_input_y.currentIndex()), int(self.floating_translation_input_z.currentIndex())]
fp.rotation_restriction = list() if self.floating_rotation_auto.isChecked() else [int(self.floating_rotation_input_x.currentIndex()), int(self.floating_rotation_input_y.currentIndex()), int(self.floating_rotation_input_z.currentIndex())]
fp.material = "" if self.floating_material_auto.isChecked() else str(self.floating_material_line_edit.text())
Case.the().get_mk_based_properties(ObjectType.BOUND, self.target_mk).float_property = fp
self.accept()
def on_cancel(self):
""" Closes the dialog and rejects. """
self.reject()
def on_floating_change(self, index):
""" Reacts to the floating index changing enabling/disabling the floating properties. """
self.floating_props_group.setEnabled(index == 0)
def on_massrhop_change(self, _):
""" Reacts to the massrhop checkbox change enabling disabling its input. """
self.floating_props_massrhop_input.setText("0.0")
def on_gravity_auto(self):
""" Reacts to the gravity auto check enabling/disabling its inputs. """
self.floating_center_input_x.setEnabled(not self.floating_center_auto.isChecked())
self.floating_center_input_y.setEnabled(not self.floating_center_auto.isChecked())
self.floating_center_input_z.setEnabled(not self.floating_center_auto.isChecked())
def on_inertia_auto(self):
""" Reacts to the inertia auto check enabling/disabling its inputs. """
self.floating_inertia_input_x.setEnabled(not self.floating_inertia_auto.isChecked())
self.floating_inertia_input_y.setEnabled(not self.floating_inertia_auto.isChecked())
self.floating_inertia_input_z.setEnabled(not self.floating_inertia_auto.isChecked())
def on_velini_auto(self):
""" Reacts to the velini auto check enabling/disabling its inputs. """
self.floating_velini_input_x.setEnabled(not self.floating_velini_auto.isChecked())
self.floating_velini_input_y.setEnabled(not self.floating_velini_auto.isChecked())
self.floating_velini_input_z.setEnabled(not self.floating_velini_auto.isChecked())
def on_omegaini_auto(self):
""" Reacts to the omegaini auto check enabling/disabling its inputs. """
self.floating_omegaini_input_x.setEnabled(not self.floating_omegaini_auto.isChecked())
self.floating_omegaini_input_y.setEnabled(not self.floating_omegaini_auto.isChecked())
self.floating_omegaini_input_z.setEnabled(not self.floating_omegaini_auto.isChecked())
def on_translation_auto(self):
""" Reacts to the translation auto check enabling disabling its inputs. """
self.floating_translation_input_x.setEnabled(not self.floating_translation_auto.isChecked())
self.floating_translation_input_y.setEnabled(not self.floating_translation_auto.isChecked())
self.floating_translation_input_z.setEnabled(not self.floating_translation_auto.isChecked())
def on_rotation_auto(self):
""" Reacts to the rotation checkbox being pressed enabling/disabling its inputs. """
self.floating_rotation_input_x.setEnabled(not self.floating_rotation_auto.isChecked())
self.floating_rotation_input_y.setEnabled(not self.floating_rotation_auto.isChecked())
self.floating_rotation_input_z.setEnabled(not self.floating_rotation_auto.isChecked())
def on_material_auto(self):
""" Reacts to the material auto checkbox being pressed enabling/disabling its input. """
self.floating_material_line_edit.setEnabled(not self.floating_material_auto.isChecked())