Skip to content
Snippets Groups Projects
Commit 46ac7a5a authored by Jacob Wahlman's avatar Jacob Wahlman :ok_hand:
Browse files

fixed value setting of delay in properties

parent d64b24da
No related branches found
No related tags found
1 merge request!61Fixed save/load, sfg creating, simulation, bug fixes
Pipeline #16309 passed
This commit is part of merge request !61. Comments created here will be created in the context of that merge request.
...@@ -22,11 +22,15 @@ class PropertiesWindow(QDialog): ...@@ -22,11 +22,15 @@ class PropertiesWindow(QDialog):
self.vertical_layout = QVBoxLayout() self.vertical_layout = QVBoxLayout()
self.vertical_layout.addLayout(self.name_layout) self.vertical_layout.addLayout(self.name_layout)
if hasattr(self.operation.operation, "value"): if hasattr(self.operation.operation, "value") or hasattr(self.operation.operation, "initial_value"):
self.constant_layout = QHBoxLayout() self.constant_layout = QHBoxLayout()
self.constant_layout.setSpacing(50) self.constant_layout.setSpacing(50)
self.constant_value = QLabel("Value:") self.constant_value = QLabel("Value:")
self.edit_constant = QLineEdit(str(self.operation.operation.value)) if hasattr(self.operation.operation, "value"):
self.edit_constant = QLineEdit(str(self.operation.operation.value))
else:
self.edit_constant = QLineEdit(str(self.operation.operation.initial_value))
self.only_accept_float = QDoubleValidator() self.only_accept_float = QDoubleValidator()
self.edit_constant.setValidator(self.only_accept_float) self.edit_constant.setValidator(self.only_accept_float)
self.constant_layout.addWidget(self.constant_value) self.constant_layout.addWidget(self.constant_value)
...@@ -126,6 +130,9 @@ class PropertiesWindow(QDialog): ...@@ -126,6 +130,9 @@ class PropertiesWindow(QDialog):
self.operation.label.setPlainText(self.operation.name) self.operation.label.setPlainText(self.operation.name)
if hasattr(self.operation.operation, "value"): if hasattr(self.operation.operation, "value"):
self.operation.operation.value = float(self.edit_constant.text().replace(",", ".")) self.operation.operation.value = float(self.edit_constant.text().replace(",", "."))
elif hasattr(self.operation.operation, "initial_value"):
self.operation.operation.initial_value = float(self.edit_constant.text().replace(",", "."))
if self.check_show_name.isChecked(): if self.check_show_name.isChecked():
self.operation.label.setOpacity(1) self.operation.label.setOpacity(1)
self.operation.is_show_name = True self.operation.is_show_name = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment