32 #include <SimoxUtility/algorithm/string/string_tools.h>
42 selectedProfile(selectedProfile)
50 this->groupDefinitionFile = groupDefinitionFile;
51 basePath = groupDefinitionFile;
52 basePath = basePath.remove_filename();
73 std::set<std::string> proxySet;
77 proxySet.insert(proxyNode.attribute_value(
"value"));
79 proxySet.insert(
"ArmarXCoreInterfaces.systemObserver");
80 proxySet.insert(
"ArmarXCoreInterfaces.conditionHandler");
81 proxies.insert(proxies.end(), proxySet.begin(), proxySet.end());
83 profileConfigurations.clear();
86 auto profileName = configNode.attribute_value(
"profileName");
87 auto configuration = configNode.value();
88 profileConfigurations[profileName] = configuration;
91 ReadChildren(xmlGroupNode, basePath, 0);
97 return groupDefinitionFile;
102 const std::filesystem::path& path,
107 std::filesystem::path basename(xmlFolderNode.attribute_value(
"basename"));
109 ReadChildren(xmlFolderNode, path / basename, nesting + 1);
114 std::filesystem::path
filename(xmlStateNode.attribute_value(
"filename").c_str());
115 std::string fullpath = (path /
filename).
string();
116 allstateFilePaths.push_back(fullpath);
117 std::string visibility = xmlStateNode.attribute_value_or_default(
"visibility",
"");
118 stateVisibilityMap[fullpath] = visibility ==
"public" ?
ePublic :
ePrivate;
119 stateNestingMap[fullpath] = nesting;
133 return generateContext;
139 auto it = stateVisibilityMap.find(filepath);
141 if (it == stateVisibilityMap.end())
143 throw LocalException(
"State ") << filepath <<
" not found.";
153 auto it = stateNestingMap.find(filepath);
155 if (it == stateNestingMap.end())
157 std::stringstream ss;
159 for (std::pair<std::string, int> pair : stateNestingMap)
161 ss <<
"\n" << pair.first;
164 throw LocalException(
"State File ")
165 << filepath <<
" not found in nesting map. States in map (" << stateNestingMap.size()
172 std::vector<std::string>
181 return selectedProfile;
188 auto profile = selectedProfile;
192 if (profileConfigurations.count(profile->getName()) > 0)
194 configs = profileConfigurations.at(profile->getName());
196 if (!configs.empty())
198 result =
"# Profile: " + profile->getName() +
"\n" + configs +
"\n\n" + result;
200 profile = profile->getParent();
202 profile = selectedProfile;
203 std::string profileProperties;
206 profileProperties = profile->getAdditionalProperties() + profileProperties;
207 profile = profile->getParent();
209 profileProperties = simox::alg::replace_all(profileProperties,
"{#GroupName#}", groupName);
210 result = profileProperties + result;