[Jderobot-admin] jderobot-r1132 - trunk/src/stable/components/visualHFSM
bmenendez en jderobot.org
bmenendez en jderobot.org
Sab Dic 28 13:46:02 CET 2013
Author: bmenendez
Date: 2013-12-28 13:46:01 +0100 (Sat, 28 Dec 2013)
New Revision: 1132
Modified:
trunk/src/stable/components/visualHFSM/generate.cpp
trunk/src/stable/components/visualHFSM/visualhfsm.cpp
trunk/src/stable/components/visualHFSM/xmlparser.cpp
Log:
Mejorado el generador de c?\195?\179digo.
Modified: trunk/src/stable/components/visualHFSM/generate.cpp
===================================================================
--- trunk/src/stable/components/visualHFSM/generate.cpp 2013-12-26 15:52:03 UTC (rev 1131)
+++ trunk/src/stable/components/visualHFSM/generate.cpp 2013-12-28 12:46:01 UTC (rev 1132)
@@ -233,7 +233,7 @@
this->fs << "\twhile (true) {" << std::endl;
this->fs << "\t\tgettimeofday(&a, NULL);" << std::endl;
- this->fs << "\t\ttotala = a.tv_sec * 1000000 * a.tv_usec;" << std::endl;
+ this->fs << "\t\ttotala = a.tv_sec * 1000000 + a.tv_usec;" << std::endl;
this->fs << std::endl;
if (id != 1) {
@@ -438,10 +438,10 @@
this->fs << std::endl;
this->fs << "SET( SOURCE_FILES_AUTOMATA " << this->getCppName() << " )" << std::endl;
this->fs << std::endl;
- this->fs << "SET( INTERFACES_CPP_DIR /usr/local/lib/jderobot )" << std::endl;
- this->fs << "SET( LIBS_DIR /usr/local/include/jderobot )" << std::endl;
+ this->fs << "SET( INTERFACES_CPP_DIR /usr/local/include )" << std::endl;
+ this->fs << "SET( LIBS_DIR /usr/local/lib )" << std::endl;
this->fs << std::endl;
- this->fs << "SET( CMAKE_CXX_FLAGS \"-lpthread -lIce\" ) # Opciones para el compilador" << std::endl;
+ this->fs << "SET( CMAKE_CXX_FLAGS \"-pthread\" ) # Opciones para el compilador" << std::endl;
this->fs << std::endl;
this->fs << "SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR})" << std::endl;
this->fs << std::endl;
@@ -454,9 +454,10 @@
this->fs << "add_executable (automata ${SOURCE_FILES_AUTOMATA})" << std::endl;
this->fs << std::endl;
this->fs << "TARGET_LINK_LIBRARIES ( automata " << std::endl;
- this->fs << "\t${INTERFACES_CPP_DIR}/libJderobotInterfaces.so" << std::endl;
- this->fs << "\t${INTERFACES_CPP_DIR}/libjderobotutil.so" << std::endl;
- this->fs << "\t/usr/lib/libIceUtil.so" << std::endl;
+ this->fs << "\t${LIBS_DIR}/jderobot/libJderobotInterfaces.so" << std::endl;
+ this->fs << "\t${LIBS_DIR}/jderobot/libjderobotutil.so" << std::endl;
+ this->fs << "\tIce" << std::endl;
+ this->fs << "\tIceUtil" << std::endl;
this->fs << ")" << std::endl;
this->fs.flush();
Modified: trunk/src/stable/components/visualHFSM/visualhfsm.cpp
===================================================================
--- trunk/src/stable/components/visualHFSM/visualhfsm.cpp 2013-12-26 15:52:03 UTC (rev 1131)
+++ trunk/src/stable/components/visualHFSM/visualhfsm.cpp 2013-12-28 12:46:01 UTC (rev 1132)
@@ -193,6 +193,7 @@
parser.parse_file(filepath);
this->listInterfaces = parser.getConfigFile();
+ this->listLibraries = parser.getListLibs();
this->removeAllGui();
if (!this->loadSubautomata(parser.getListSubautomata()))
@@ -1049,6 +1050,8 @@
MySaxParser parser;
parser.set_substitute_entities(true);
parser.parse_file(this->filepath);
+
+ this->listInterfaces = parser.getConfigFile();
this->listLibraries = parser.getListLibs();
std::string cpppath(this->filepath);
Modified: trunk/src/stable/components/visualHFSM/xmlparser.cpp
===================================================================
--- trunk/src/stable/components/visualHFSM/xmlparser.cpp 2013-12-26 15:52:03 UTC (rev 1131)
+++ trunk/src/stable/components/visualHFSM/xmlparser.cpp 2013-12-28 12:46:01 UTC (rev 1132)
@@ -184,6 +184,7 @@
break;
case E_VARS:
this->option = E_VARS;
+ this->code.clear();
break;
case E_FUNCTIONS:
this->option = E_FUNCTIONS;
@@ -231,6 +232,9 @@
case E_LIB:
this->listLibraries.push_back(this->code);
break;
+ case E_VARS:
+ this->subautomata->setVariables(this->code);
+ break;
case E_FUNCTIONS:
this->subautomata->setFunctions(this->code);
break;
@@ -305,7 +309,7 @@
break;
}
case E_VARS: {
- this->subautomata->setVariables(text);
+ this->code += text;
break;
}
case E_FUNCTIONS: {
More information about the Jderobot-admin
mailing list