41 return "Unexpected Event";
45 return "Invalid input parameters";
53 StringVariantContainerBaseMap
56 StringVariantContainerBaseMap setValueMap;
58 for (StateParameterMap::const_iterator it = paramMap.begin(); it != paramMap.end(); it++)
62 setValueMap[it->first] = it->second->value;
72 StringVariantContainerBaseMap
ValueMap;
74 for (StateParameterMap::const_iterator it = paramMap.begin(); it != paramMap.end(); it++)
76 ValueMap[it->first] = it->second->value->cloneContainer();
86 StringVariantContainerBaseMap& dictionary =
event->properties;
87 StringVariantContainerBaseMap::iterator it = dictionary.find(key);
89 if (it != dictionary.end())
101 StringVariantContainerBaseMap& dictionary =
event->properties;
102 StringVariantContainerBaseMap::iterator it = dictionary.find(key);
104 if (it != dictionary.end())
109 dictionary[key] = valueList->cloneContainer();
120 for (StateParameterMap::const_iterator it = dict1.begin(); it != dict1.end(); it++)
122 StateParameterMap::const_iterator it2 = dict2.find(it->first);
124 if (it2 == dict2.end()
140 for (StringVariantContainerBaseMap::const_iterator it = dict1.begin(); it != dict1.end(); it++)
142 StringVariantContainerBaseMap::const_iterator it2 = dict2.find(it->first);
144 if (it2 == dict2.end()
157 for (StringVariantContainerBaseMap::const_iterator it =
source.begin(); it !=
source.end(); it++)
159 StringVariantContainerBaseMap::iterator itDest = destination.find(it->first);
161 if (itDest != destination.end())
163 *itDest->second = *it->second;
171 for (StringVariantContainerBaseMap::const_iterator it =
source.begin(); it !=
source.end(); it++)
173 StateParameterMap::iterator itDest = destination.find(it->first);
175 if (itDest != destination.end())
177 itDest->second->value = it->second->cloneContainer();
178 itDest->second->set =
true;
188 for (StringVariantContainerBaseMap::const_iterator it =
source.begin(); it !=
source.end(); it++)
190 destination[it->first] = it->second->cloneContainer();
198 for (StateParameterMap::const_iterator it =
source.begin(); it !=
source.end(); it++)
200 destination[it->first] = StateParameterIceBasePtr::dynamicCast(it->second->ice_clone());
209 for (StateParameterMap::const_iterator it =
source.begin(); it !=
source.end(); it++)
211 destination[it->first] = it->second->value->cloneContainer();
220 for (StringVariantContainerBaseMap::const_iterator it =
source.begin(); it !=
source.end(); it++)
223 param->value = it->second->cloneContainer();
224 param->optionalParam =
false;
226 destination[it->first] = param;
234 std::stringstream result;
237 for (StringVariantContainerBaseMap::const_iterator it = mymap.begin(); it != mymap.end(); it++)
242 if (!it->second->getContainerType()->subType)
248 throw LocalException(
"Could not cast to SingleVariant");
252 result << var->getOutputValueOnly() <<
"\n";
257 json->serializeIceObject(it->second);
258 result << json->asString(
true) <<
"\n";
289 std::stringstream result;
292 for (StateParameterMap::const_iterator it = mymap.begin(); it != mymap.end(); it++)
306 if (!it->second->value->getContainerType()->subType)
313 throw LocalException(
"Could not cast to SingleVariant");
323 result <<
"\t#" << i <<
" " <<
getVariantString(var, it->first) <<
" (" << setStr <<
")\n";
329 json->serializeIceObject(it->second->value);
330 result <<
"\t#" << i <<
" " << it->first <<
": " << json->asString(
true) <<
"\n";
358 for (StateParameterMap::const_iterator it = paramMap.begin(); it != paramMap.end(); it++)
360 if (!it->second->optionalParam && !it->second->set)
364 *logOutput +=
"\tRequired parameter '" + it->first +
"' was not set.\n";
370 else if (!it->second->optionalParam || it->second->set)
374 result &= it->second->value->validateElements();
378 ARMARX_DEBUG_S <<
"Incomplete type for key: " << it->first <<
" - " << e.what();
392 IceUtil::Int64 timeoutDura = 4000;
395 bool allInitialized =
true;
396 int waitIntervallMs = 10;
399 IceUtil::Time timeout = IceUtil::Time::milliSeconds(timeoutDura);
400 std::vector<std::string> notInitList;
404 while (!allInitialized
405 &&
IceUtil::Time(waitStartTime + timeout - IceUtil::Time::now()).toMilliSeconds() > 0)
407 allInitialized =
true;
410 for (StateParameterMap::const_iterator it = paramMap.begin(); it != paramMap.end(); it++)
418 allInitialized =
false;
419 notInitList.push_back(it->first);
425 &&
IceUtil::Time(IceUtil::Time::now() - lastOutput).toSeconds() >= 5)
430 usleep(waitIntervallMs * 1000);
432 if (waitIntervallMs < timeoutDura * 0.5f)
434 waitIntervallMs *= 2;
452 StateParameterMap::iterator it = paramMap.begin();
454 for (; it != paramMap.end(); ++it)
456 it->second->set =
false;
469 std::stringstream
str;
470 str << name <<
":\n" << var;