diff --git a/b_asic/GUI/properties_window.py b/b_asic/GUI/properties_window.py index 4b8ef0200ea953810a1402daebb34a062357e966..580ce409bbe30ec2ec74ddcda542168dc4d7985c 100644 --- a/b_asic/GUI/properties_window.py +++ b/b_asic/GUI/properties_window.py @@ -22,11 +22,15 @@ class PropertiesWindow(QDialog): self.vertical_layout = QVBoxLayout() 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.setSpacing(50) 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.edit_constant.setValidator(self.only_accept_float) self.constant_layout.addWidget(self.constant_value) @@ -126,6 +130,9 @@ class PropertiesWindow(QDialog): self.operation.label.setPlainText(self.operation.name) if hasattr(self.operation.operation, "value"): 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(): self.operation.label.setOpacity(1) self.operation.is_show_name = True