Commit bfa613ee authored by Locatelli's avatar Locatelli

Correct bad last commit for managing enumerated values and labels for

command lines
parent 08e19d8b
......@@ -445,28 +445,35 @@ void AbstractParser::setProperty(ExperimentController* controller, const string&
controller->attach(CommandLineManager::getInstance());
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