summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-07-30 20:41:50 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-07-30 20:41:50 (GMT)
commitb7a2d38bdcee3bf85a32dea7ac74b144d5ef40fa (patch)
treebade629bcca6b6a1417cb45be4349a3c27ea0feb /apps
parentafbd0c4463c6f28ec1cd6ea45a68fdbcfcfeae6c (diff)
downloaduscxml-b7a2d38bdcee3bf85a32dea7ac74b144d5ef40fa.zip
uscxml-b7a2d38bdcee3bf85a32dea7ac74b144d5ef40fa.tar.gz
uscxml-b7a2d38bdcee3bf85a32dea7ac74b144d5ef40fa.tar.bz2
See detailled log
- Forcing Data.Type for Data(String) constructor now, default used to be INTERPRETED. - setDataModel and addIOProcessor on interpreter now - fixed a bug with Data(bool) constructor - various smaller fixes
Diffstat (limited to 'apps')
-rw-r--r--apps/samples/vrml/viewer.html2
-rw-r--r--apps/uscxml-dot.cpp49
-rw-r--r--apps/uscxml-transform.cpp9
3 files changed, 26 insertions, 34 deletions
diff --git a/apps/samples/vrml/viewer.html b/apps/samples/vrml/viewer.html
index 467681e..c585aaa 100644
--- a/apps/samples/vrml/viewer.html
+++ b/apps/samples/vrml/viewer.html
@@ -87,7 +87,7 @@
// serverURL: "http://femkit.smartvortex.eu:8086/vrml/",
// });
- var vrmlViewer = new VRMLViewer("scene1", {
+ var vrmlViewer = new eu_smartvorex_femkit_ui_modelviewer.VRMLViewer("scene1", {
resRoot: "/img/tridi/",
enableMovies: false,
enableDND: false,
diff --git a/apps/uscxml-dot.cpp b/apps/uscxml-dot.cpp
index 2b230b4..11e2994 100644
--- a/apps/uscxml-dot.cpp
+++ b/apps/uscxml-dot.cpp
@@ -39,29 +39,6 @@ void printUsageAndExit(const char* progName) {
int currOpt = 1;
-int32_t consumeNumericOption(int argc, char** argv, const std::string& name, int32_t defaultVal) {
- std::string test = argv[currOpt];
- if (boost::starts_with(test, std::string("-") + name)) {
- int value = 0;
- if (test.size() > 2) {
- // no space before value
- value = strTo<int>(test.substr(2, test.size() - 2));
- } else {
- // space before value
- if (argc > currOpt) {
- std::string tmp = argv[++currOpt];
- value = strTo<int>(tmp);
- } else {
- printUsageAndExit(argv[0]);
- }
- }
- currOpt++;
- return value;
- }
-
- return defaultVal;
-}
-
int main(int argc, char** argv) {
// setup logging
@@ -73,25 +50,26 @@ int main(int argc, char** argv) {
printUsageAndExit(argv[0]);
std::list<SCXMLDotWriter::StateAnchor> stateAnchors;
+ SCXMLDotWriter::StateAnchor rootAnchor;
SCXMLDotWriter::StateAnchor currAnchor;
int option;
- while ((option = getopt(argc, argv, "d:t:")) != -1) {
+ while ((option = getopt(argc, argv, "d:t:e:")) != -1) {
switch(option) {
case 'd':
- currAnchor.childDepth = strTo<int32_t>(optarg);
+ rootAnchor.childDepth = strTo<int32_t>(optarg);
break;
case 't':
- currAnchor.transDepth = strTo<int32_t>(optarg);
+ rootAnchor.transDepth = strTo<int32_t>(optarg);
break;
case 'e': {
std::string edgeType(optarg);
if (edgeType == "target") {
- currAnchor.type = SCXMLDotWriter::PORT_TARGET;
+ rootAnchor.type = SCXMLDotWriter::PORT_TARGET;
} else if (edgeType == "event") {
- currAnchor.type = SCXMLDotWriter::PORT_EVENT;
+ rootAnchor.type = SCXMLDotWriter::PORT_EVENT;
} else if (edgeType == "transition") {
- currAnchor.type = SCXMLDotWriter::PORT_TRANSITION;
+ rootAnchor.type = SCXMLDotWriter::PORT_TRANSITION;
} else {
printUsageAndExit(argv[0]);
}
@@ -102,8 +80,8 @@ int main(int argc, char** argv) {
}
}
- if (currAnchor)
- stateAnchors.push_back(currAnchor);
+ if (rootAnchor)
+ stateAnchors.push_back(rootAnchor);
try {
// current option has to be the interpreter's name
@@ -133,13 +111,20 @@ int main(int argc, char** argv) {
}
if (currAnchor) {
+ currAnchor.type = rootAnchor.type;
stateAnchors.push_back(currAnchor);
}
currAnchor = SCXMLDotWriter::StateAnchor();
}
- std::string outName = inputFile.file() + ".dot";
+ std::string outName;
+ if (boost::starts_with("file", inputFile.scheme())) {
+ outName = inputFile.path() + ".dot";
+ } else {
+ outName = inputFile.file() + ".dot";
+ }
+
SCXMLDotWriter::toDot(outName, interpreter, stateAnchors);
} catch(Event e) {
diff --git a/apps/uscxml-transform.cpp b/apps/uscxml-transform.cpp
index 245a89c..fc33617 100644
--- a/apps/uscxml-transform.cpp
+++ b/apps/uscxml-transform.cpp
@@ -193,7 +193,14 @@ int main(int argc, char** argv) {
}
if (toFlat) {
- std::cout << ChartToFSM::flatten(interpreter).getDocument();
+ if (outputFile.size() == 0 || outputFile == "-") {
+ std::cout << ChartToFSM::flatten(interpreter).getDocument();
+ } else {
+ std::ofstream outStream;
+ outStream.open(outputFile.c_str());
+ outStream << ChartToFSM::flatten(interpreter).getDocument();
+ outStream.close();
+ }
exit(EXIT_SUCCESS);
}
} catch (Event e) {