Commit d4173a17 authored by ics's avatar ics

Correct bug for commaline when using enumerated property values

parent 4d9b2c2c
......@@ -446,27 +446,30 @@ void AbstractParser::setProperty(ExperimentController* controller, const string&
string lvalue = value;
try {
if (propertyName.empty() == false) {
uint32 servantID = dataprovider::Database::getInstance(0)->getServantID(controller->getName());
uint32 propertyID = dataprovider::Database::getInstance(0)->getPropertyID(servantID, propertyName);
uint32 enumlabelsID = dataprovider::Database::getInstance(0)->getEnumeratedLabelsProperty(propertyID);
if (enumlabelsID != 0) {
uint32 enumvaluesID = dataprovider::Database::getInstance(0)->getEnumeratedValuesProperty(propertyID);
// Get the dynamic property size.
uint32 enumeratedLabelsSize = dataprovider::Database::getInstance(0)->getDynamicPropertySize(enumlabelsID);
// Search for the label.
for (int i = 0; i < enumeratedLabelsSize; ++i) {
uint32 labelPropertyID = dataprovider::Database::getInstance(0)->getDynamicPropertyIDAtIndex(enumlabelsID, i, false);
std::string label = dataprovider::Database::getInstance(0)->getValue<string>(labelPropertyID);
// Check the label.
if (label == lvalue) {
uint32 valuePropertyID = dataprovider::Database::getInstance(0)->getDynamicPropertyIDAtIndex(enumvaluesID, i, false);
lvalue = dataprovider::Database::getInstance(0)->getFormattedValue(valuePropertyID);
break;
try {
uint32 servantID = dataprovider::Database::getInstance(0)->getServantID(controller->getName());
uint32 propertyID = dataprovider::Database::getInstance(0)->getPropertyID(servantID, propertyName);
uint32 enumlabelsID = dataprovider::Database::getInstance(0)->getEnumeratedLabelsProperty(propertyID);
if (enumlabelsID != 0) {
uint32 enumvaluesID = dataprovider::Database::getInstance(0)->getEnumeratedValuesProperty(propertyID);
// Get the dynamic property size.
uint32 enumeratedLabelsSize = dataprovider::Database::getInstance(0)->getDynamicPropertySize(enumlabelsID);
// Search for the label.
for (int i = 0; i < enumeratedLabelsSize; ++i) {
uint32 labelPropertyID = dataprovider::Database::getInstance(0)->getDynamicPropertyIDAtIndex(enumlabelsID, i, false);
std::string label = dataprovider::Database::getInstance(0)->getValue<string>(labelPropertyID);
// Check the label.
if (label == lvalue) {
uint32 valuePropertyID = dataprovider::Database::getInstance(0)->getDynamicPropertyIDAtIndex(enumvaluesID, i, false);
lvalue = dataprovider::Database::getInstance(0)->getFormattedValue(valuePropertyID);
break;
}
}
}
}
} catch (...) {
}
string ptype = controller->getPropertyType(propertyName);
if (ptype == "int32") {
// Test conversion
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment