| @@ -25,6 +25,7 @@ static_assert(kMaximumLadderColumns == kMaximumConditionColumns + 1); | |||||
| constexpr std::size_t kMaximumHmiProperties = 64U; | constexpr std::size_t kMaximumHmiProperties = 64U; | ||||
| constexpr std::size_t kMaximumIdBytes = 128U; | constexpr std::size_t kMaximumIdBytes = 128U; | ||||
| constexpr std::size_t kMaximumTextBytes = 4096U; | constexpr std::size_t kMaximumTextBytes = 4096U; | ||||
| constexpr std::size_t kMaximumHmiControlTextCharacters = 12U; | |||||
| constexpr std::size_t kMaximumAlarmTitleCharacters = 12U; | constexpr std::size_t kMaximumAlarmTitleCharacters = 12U; | ||||
| constexpr std::size_t kMaximumAlarmMessageCharacters = 20U; | constexpr std::size_t kMaximumAlarmMessageCharacters = 20U; | ||||
| constexpr std::size_t kMaximumPropertyKeyBytes = 128U; | constexpr std::size_t kMaximumPropertyKeyBytes = 128U; | ||||
| @@ -195,7 +195,8 @@ void PropertyPanelController::showControlProperties(const std::string &control_i | |||||
| if (!has_control) | if (!has_control) | ||||
| { | { | ||||
| ui_.controlTextEdit->setMaxLength(32767); | |||||
| ui_.controlTextEdit->setMaxLength( | |||||
| static_cast<int>(ProjectLimits::kMaximumHmiControlTextCharacters)); | |||||
| ui_.bindingAreaLabel->setVisible(false); | ui_.bindingAreaLabel->setVisible(false); | ||||
| ui_.bindingAreaComboBox->setVisible(false); | ui_.bindingAreaComboBox->setVisible(false); | ||||
| ui_.bindingIndexLabel->setVisible(false); | ui_.bindingIndexLabel->setVisible(false); | ||||
| @@ -223,9 +224,7 @@ void PropertyPanelController::showControlProperties(const std::string &control_i | |||||
| } | } | ||||
| ui_.controlTextEdit->setMaxLength( | ui_.controlTextEdit->setMaxLength( | ||||
| control->type == HmiControlType::AlarmList | |||||
| ? static_cast<int>(ProjectLimits::kMaximumAlarmTitleCharacters) | |||||
| : 32767); | |||||
| static_cast<int>(ProjectLimits::kMaximumHmiControlTextCharacters)); | |||||
| ui_.controlIdEdit->setText(fromUtf8(control->id)); | ui_.controlIdEdit->setText(fromUtf8(control->id)); | ||||
| ui_.controlTextEdit->setText(fromUtf8(control->text)); | ui_.controlTextEdit->setText(fromUtf8(control->text)); | ||||
| ui_.controlXSpinBox->setValue(control->bounds.x); | ui_.controlXSpinBox->setValue(control->bounds.x); | ||||
| @@ -1163,6 +1163,10 @@ void testModeActionsControlEditingAvailability() | |||||
| "an unbound added control must be marked in the property panel"); | "an unbound added control must be marked in the property panel"); | ||||
| require(text_edit->text() == QStringLiteral("按钮"), | require(text_edit->text() == QStringLiteral("按钮"), | ||||
| "property panel must show the control text"); | "property panel must show the control text"); | ||||
| require(text_edit->maxLength() | |||||
| == static_cast<int>( | |||||
| ProjectLimits::kMaximumHmiControlTextCharacters), | |||||
| "all HMI control text inputs must be limited to twelve characters"); | |||||
| require(button_operation->currentText() == QStringLiteral("瞬时 ON"), | require(button_operation->currentText() == QStringLiteral("瞬时 ON"), | ||||
| "new HMI buttons must default to momentary ON"); | "new HMI buttons must default to momentary ON"); | ||||