30 #include <SimoxUtility/algorithm/string/string_tools.h>
34 #define ARMARX_PACKAGE_TOOL "armarx-package"
43 if (!std::filesystem::exists(packageToolPath))
58 std::string& output)
const
61 if (!std::filesystem::exists(pathToPackageRoot))
66 std::string cmd = packageToolPath +
" status --dir \"" + pathToPackageRoot +
"\"";
88 const std::string& statePath,
89 const std::string& packagePath)
const
92 std::string escapedStatePath = simox::alg::replace_all(statePath,
" ",
"\\ ");
93 std::string escapedStatechartGroupName =
94 simox::alg::replace_all(statechartGroupName,
" ",
"\\ ");
95 std::string cmd = packageToolPath +
" add statechart " + escapedStatechartGroupName +
"/" +
96 escapedStatePath +
" -l " + escapedStatechartGroupName;
98 if (!packagePath.empty())
100 if (!std::filesystem::exists(packagePath))
104 cmd +=
" --dir " + packagePath;
113 const std::string& statePath,
114 const std::string& packagePath)
const
116 return addXmlStatechart(
"xmlstate",
"default", statechartGroupName, statePath, packagePath);
121 const std::string& statePath,
122 const std::string& packagePath)
const
124 return addXmlStatechart(
125 "xmlstate-xmlonly",
"xmlonly", statechartGroupName, statePath, packagePath);
130 const std::string& statePath,
131 const std::string& packagePath)
const
133 return addXmlStatechart(
"xmlstate",
"cpponly", statechartGroupName, statePath, packagePath);
143 ArmarXPackageToolInterface::addXmlStatechart(
const std::string& componentType,
144 const std::string& replacementStrategyType,
145 const std::string& statechartGroupName,
146 const std::string& statePath,
147 const std::string& packagePath)
const
150 std::string escapedStatePath = simox::alg::replace_all(statePath,
" ",
"\\ ");
151 std::string escapedStatechartGroupName =
152 simox::alg::replace_all(statechartGroupName,
" ",
"\\ ");
153 std::string cmd = packageToolPath +
" add " + componentType +
" " +
154 escapedStatechartGroupName +
"/" + escapedStatePath +
" -l " +
155 escapedStatechartGroupName +
" -s " + replacementStrategyType;
157 if (!packagePath.empty())
159 cmd +=
" --dir " + packagePath;
163 ARMARX_INFO <<
"Executed:\n" << cmd <<
"\nreturned = " << result;