Skip to content

Commit

Permalink
- No need to hard code StateSelect since it is part of built-in envir…
Browse files Browse the repository at this point in the history
…onment and can be accessed via API.

git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23648 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Dec 3, 2014
1 parent 7cf3e30 commit 696fbb4
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions OMEdit/OMEditGUI/Component/ComponentProperties.cpp
Expand Up @@ -103,8 +103,7 @@ Parameter::Parameter(ComponentInfo *pComponentInfo, OMCProxy *pOMCProxy, QString
mValueType = Parameter::Boolean;
} else if (pOMCProxy->isBuiltinType(pComponentInfo->getClassName())) {
mValueType = Parameter::Normal;
} else if (pOMCProxy->isWhat(StringHandler::Enumeration, pComponentInfo->getClassName()) ||
pComponentInfo->getClassName().compare("StateSelect") == 0) {
} else if (pOMCProxy->isWhat(StringHandler::Enumeration, pComponentInfo->getClassName())) {
mValueType = Parameter::Enumeration;
} else if (pOMCProxy->getBuiltinType(pComponentInfo->getClassName()).compare("Boolean") == 0) {
mValueType = Parameter::Boolean;
Expand Down Expand Up @@ -292,17 +291,9 @@ void Parameter::createValueWidget(OMCProxy *pOMCProxy, QString className)
mpValueComboBox = new QComboBox;
mpValueComboBox->setEditable(true);
mpValueComboBox->addItem("", "");
if (className.compare("StateSelect") == 0) {
mpValueComboBox->addItem("never", className + ".never");
mpValueComboBox->addItem("avoid", className + ".avoid");
mpValueComboBox->addItem("default", className + ".default");
mpValueComboBox->addItem("prefer", className + ".prefer");
mpValueComboBox->addItem("always", className + ".always");
} else {
enumerationLiterals = pOMCProxy->getEnumerationLiterals(className);
for (i = 0 ; i < enumerationLiterals.size(); i++) {
mpValueComboBox->addItem(enumerationLiterals[i], className + "." + enumerationLiterals[i]);
}
enumerationLiterals = pOMCProxy->getEnumerationLiterals(className);
for (i = 0 ; i < enumerationLiterals.size(); i++) {
mpValueComboBox->addItem(enumerationLiterals[i], className + "." + enumerationLiterals[i]);
}
connect(mpValueComboBox, SIGNAL(currentIndexChanged(int)), SLOT(valueComboBoxChanged(int)));
break;
Expand Down

0 comments on commit 696fbb4

Please sign in to comment.