diff --git a/.circleci/config.yml b/.circleci/config.yml index 00916ed8ce..e80dfcbdfd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,8 +42,8 @@ jobs: command: | python2 tools/scripts/authors.py --handles --count --shoutout --since 2017-01-01 python3 tools/scripts/authors.py --handles --count --shoutout --since 2017-01-01 - python2 tools/system_design/builder/system_layout.py examples/communication/xml/communication.xml -o /tmp - python3 tools/system_design/builder/system_layout.py examples/communication/xml/communication.xml -o /tmp + python2 tools/xpcc_generator/builder/system_layout.py examples/xpcc/xml/communication.xml -o /tmp + python3 tools/xpcc_generator/builder/system_layout.py examples/xpcc/xml/communication.xml -o /tmp stm32f0-f1-examples: docker: diff --git a/.gitignore b/.gitignore index a78c488ffc..357ded5918 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ CMakeLists.txt examples/**/modm examples/**/SConstruct examples/**/Makefile +examples/**/generated diff --git a/examples/avr/communication/receiver/.gitignore b/examples/avr/communication/receiver/.gitignore deleted file mode 100644 index cbaa702905..0000000000 --- a/examples/avr/communication/receiver/.gitignore +++ /dev/null @@ -1 +0,0 @@ -communication/ diff --git a/examples/avr/communication/sender/.gitignore b/examples/avr/communication/sender/.gitignore deleted file mode 100644 index cbaa702905..0000000000 --- a/examples/avr/communication/sender/.gitignore +++ /dev/null @@ -1 +0,0 @@ -communication/ diff --git a/examples/avr/communication/receiver/component_receiver/receiver.cpp b/examples/avr/xpcc/receiver/component_receiver/receiver.cpp similarity index 100% rename from examples/avr/communication/receiver/component_receiver/receiver.cpp rename to examples/avr/xpcc/receiver/component_receiver/receiver.cpp diff --git a/examples/avr/communication/receiver/component_receiver/receiver.hpp b/examples/avr/xpcc/receiver/component_receiver/receiver.hpp similarity index 96% rename from examples/avr/communication/receiver/component_receiver/receiver.hpp rename to examples/avr/xpcc/receiver/component_receiver/receiver.hpp index ee7bd7cb6b..eb2e8601c8 100644 --- a/examples/avr/communication/receiver/component_receiver/receiver.hpp +++ b/examples/avr/xpcc/receiver/component_receiver/receiver.hpp @@ -18,7 +18,7 @@ #include -#include "communication/packets.hpp" +#include namespace component { diff --git a/examples/avr/communication/receiver/main.cpp b/examples/avr/xpcc/receiver/main.cpp similarity index 97% rename from examples/avr/communication/receiver/main.cpp rename to examples/avr/xpcc/receiver/main.cpp index 65dc30828c..a114af9c7b 100644 --- a/examples/avr/communication/receiver/main.cpp +++ b/examples/avr/xpcc/receiver/main.cpp @@ -27,8 +27,8 @@ using systemClock = SystemClock; #include "component_receiver/receiver.hpp" -#include "communication/postman.hpp" -#include "communication/identifier.hpp" +#include +#include // ---------------------------------------------------------------------------- // Logging diff --git a/examples/avr/communication/sender/project.xml b/examples/avr/xpcc/receiver/project.xml similarity index 73% rename from examples/avr/communication/sender/project.xml rename to examples/avr/xpcc/receiver/project.xml index de33329932..5ca867e161 100644 --- a/examples/avr/communication/sender/project.xml +++ b/examples/avr/xpcc/receiver/project.xml @@ -10,12 +10,12 @@ - - - + + + - :communication:xpcc + :communication:xpcc:generator :debug :driver:mcp2515 :platform:clock diff --git a/examples/avr/communication/sender/component_sender/sender.cpp b/examples/avr/xpcc/sender/component_sender/sender.cpp similarity index 95% rename from examples/avr/communication/sender/component_sender/sender.cpp rename to examples/avr/xpcc/sender/component_sender/sender.cpp index b743b6623f..897ecc4af8 100644 --- a/examples/avr/communication/sender/component_sender/sender.cpp +++ b/examples/avr/xpcc/sender/component_sender/sender.cpp @@ -17,8 +17,8 @@ #undef MODM_LOG_LEVEL #define MODM_LOG_LEVEL modm::log::DEBUG -#include "communication/identifier.hpp" -#include "communication/packets.hpp" +#include +#include #include "sender.hpp" diff --git a/examples/avr/communication/sender/component_sender/sender.hpp b/examples/avr/xpcc/sender/component_sender/sender.hpp similarity index 96% rename from examples/avr/communication/sender/component_sender/sender.hpp rename to examples/avr/xpcc/sender/component_sender/sender.hpp index bcb575036d..81faf81cef 100644 --- a/examples/avr/communication/sender/component_sender/sender.hpp +++ b/examples/avr/xpcc/sender/component_sender/sender.hpp @@ -19,7 +19,7 @@ #include #include -#include "communication/packets.hpp" +#include namespace component { diff --git a/examples/avr/communication/sender/main.cpp b/examples/avr/xpcc/sender/main.cpp similarity index 97% rename from examples/avr/communication/sender/main.cpp rename to examples/avr/xpcc/sender/main.cpp index 3bd14a6afd..97aa09c7a3 100644 --- a/examples/avr/communication/sender/main.cpp +++ b/examples/avr/xpcc/sender/main.cpp @@ -27,8 +27,8 @@ using systemClock = SystemClock; #include "component_sender/sender.hpp" -#include "communication/postman.hpp" -#include "communication/identifier.hpp" +#include +#include // ---------------------------------------------------------------------------- // Logging diff --git a/examples/avr/communication/receiver/project.xml b/examples/avr/xpcc/sender/project.xml similarity index 72% rename from examples/avr/communication/receiver/project.xml rename to examples/avr/xpcc/sender/project.xml index 94796961da..ddc969e214 100644 --- a/examples/avr/communication/receiver/project.xml +++ b/examples/avr/xpcc/sender/project.xml @@ -10,12 +10,12 @@ - - - + + + - :communication:xpcc + :communication:xpcc:generator :debug :driver:mcp2515 :platform:clock diff --git a/examples/linux/communication/basic/.gitignore b/examples/linux/communication/basic/.gitignore deleted file mode 100644 index cbaa702905..0000000000 --- a/examples/linux/communication/basic/.gitignore +++ /dev/null @@ -1 +0,0 @@ -communication/ diff --git a/examples/linux/communication/basic/component_receiver/receiver.cpp b/examples/linux/xpcc/basic/component_receiver/receiver.cpp similarity index 100% rename from examples/linux/communication/basic/component_receiver/receiver.cpp rename to examples/linux/xpcc/basic/component_receiver/receiver.cpp diff --git a/examples/linux/communication/basic/component_receiver/receiver.hpp b/examples/linux/xpcc/basic/component_receiver/receiver.hpp similarity index 96% rename from examples/linux/communication/basic/component_receiver/receiver.hpp rename to examples/linux/xpcc/basic/component_receiver/receiver.hpp index 67e9f18bf7..42bc837520 100644 --- a/examples/linux/communication/basic/component_receiver/receiver.hpp +++ b/examples/linux/xpcc/basic/component_receiver/receiver.hpp @@ -18,7 +18,7 @@ #include -#include "communication/packets.hpp" +#include namespace component { diff --git a/examples/linux/communication/basic/component_sender/sender.cpp b/examples/linux/xpcc/basic/component_sender/sender.cpp similarity index 95% rename from examples/linux/communication/basic/component_sender/sender.cpp rename to examples/linux/xpcc/basic/component_sender/sender.cpp index 269028d791..1201039d0a 100644 --- a/examples/linux/communication/basic/component_sender/sender.cpp +++ b/examples/linux/xpcc/basic/component_sender/sender.cpp @@ -17,8 +17,7 @@ #undef MODM_LOG_LEVEL #define MODM_LOG_LEVEL modm::log::DEBUG -#include "communication/identifier.hpp" -#include "communication/packets.hpp" +#include #include "sender.hpp" diff --git a/examples/linux/communication/basic/component_sender/sender.hpp b/examples/linux/xpcc/basic/component_sender/sender.hpp similarity index 96% rename from examples/linux/communication/basic/component_sender/sender.hpp rename to examples/linux/xpcc/basic/component_sender/sender.hpp index 0e7dc03e3b..8b2784b8e0 100644 --- a/examples/linux/communication/basic/component_sender/sender.hpp +++ b/examples/linux/xpcc/basic/component_sender/sender.hpp @@ -19,7 +19,7 @@ #include #include -#include "communication/packets.hpp" +#include namespace component { diff --git a/examples/linux/communication/basic/main.cpp b/examples/linux/xpcc/basic/main.cpp similarity index 95% rename from examples/linux/communication/basic/main.cpp rename to examples/linux/xpcc/basic/main.cpp index 54c5227876..1af21576b1 100644 --- a/examples/linux/communication/basic/main.cpp +++ b/examples/linux/xpcc/basic/main.cpp @@ -26,8 +26,8 @@ #include "component_receiver/receiver.hpp" #include "component_sender/sender.hpp" -#include "communication/postman.hpp" -#include "communication/identifier.hpp" +#include +#include // Use TIPC on Linux only // xpcc::TipcConnector connector; diff --git a/examples/linux/communication/basic/project.xml b/examples/linux/xpcc/basic/project.xml similarity index 63% rename from examples/linux/communication/basic/project.xml rename to examples/linux/xpcc/basic/project.xml index 29fc2c9f0f..5bff348fab 100644 --- a/examples/linux/communication/basic/project.xml +++ b/examples/linux/xpcc/basic/project.xml @@ -9,13 +9,13 @@ - - - + + + :platform:core - :communication:xpcc + :communication:xpcc:generator :debug :build:scons diff --git a/examples/communication/xml/communication.dtd b/examples/xpcc/xml/communication.dtd similarity index 100% rename from examples/communication/xml/communication.dtd rename to examples/xpcc/xml/communication.dtd diff --git a/examples/communication/xml/communication.xml b/examples/xpcc/xml/communication.xml similarity index 100% rename from examples/communication/xml/communication.xml rename to examples/xpcc/xml/communication.xml diff --git a/examples/zmq/1_stm32/.gitignore b/examples/zmq/1_stm32/.gitignore deleted file mode 100644 index cbaa702905..0000000000 --- a/examples/zmq/1_stm32/.gitignore +++ /dev/null @@ -1 +0,0 @@ -communication/ diff --git a/examples/zmq/1_stm32/component_odometry/odometry.cpp b/examples/zmq/1_stm32/component_odometry/odometry.cpp index a1dafe5a25..bc0d4a5246 100644 --- a/examples/zmq/1_stm32/component_odometry/odometry.cpp +++ b/examples/zmq/1_stm32/component_odometry/odometry.cpp @@ -16,9 +16,9 @@ #undef MODM_LOG_LEVEL #define MODM_LOG_LEVEL modm::log::DISABLED -#include "communication/identifier.hpp" -#include "communication/packets.hpp" -#include "communication/communication.hpp" +#include +#include +#include #include "odometry.hpp" diff --git a/examples/zmq/1_stm32/component_odometry/odometry.hpp b/examples/zmq/1_stm32/component_odometry/odometry.hpp index fb05c0b56e..311613fc65 100644 --- a/examples/zmq/1_stm32/component_odometry/odometry.hpp +++ b/examples/zmq/1_stm32/component_odometry/odometry.hpp @@ -16,7 +16,7 @@ #include #include -#include "communication/packets.hpp" +#include namespace component { diff --git a/examples/zmq/1_stm32/main.cpp b/examples/zmq/1_stm32/main.cpp index e3bb6d547d..db25b48d64 100644 --- a/examples/zmq/1_stm32/main.cpp +++ b/examples/zmq/1_stm32/main.cpp @@ -19,8 +19,8 @@ #include "component_odometry/odometry.hpp" -#include "communication/postman.hpp" -#include "communication/identifier.hpp" +#include +#include using namespace Board; diff --git a/examples/zmq/1_stm32/project.xml b/examples/zmq/1_stm32/project.xml index cd4daac648..7f13bf5c81 100644 --- a/examples/zmq/1_stm32/project.xml +++ b/examples/zmq/1_stm32/project.xml @@ -3,11 +3,11 @@ ../../../src/modm/board/disco_f407vg/board.xml - - + + - :communication:xpcc + :communication:xpcc:generator :platform:can:1 :platform:gpio :platform:timer:1 diff --git a/examples/zmq/3_zmq_app/.gitignore b/examples/zmq/3_zmq_app/.gitignore deleted file mode 100644 index cbaa702905..0000000000 --- a/examples/zmq/3_zmq_app/.gitignore +++ /dev/null @@ -1 +0,0 @@ -communication/ diff --git a/examples/zmq/3_zmq_app/component_gui/gui.cpp b/examples/zmq/3_zmq_app/component_gui/gui.cpp index 5ab843068a..fb5e0fc77a 100644 --- a/examples/zmq/3_zmq_app/component_gui/gui.cpp +++ b/examples/zmq/3_zmq_app/component_gui/gui.cpp @@ -12,9 +12,9 @@ #include -#include "communication/identifier.hpp" -#include "communication/packets.hpp" -#include "communication/communication.hpp" +#include +#include +#include #include "gui.hpp" diff --git a/examples/zmq/3_zmq_app/component_gui/gui.hpp b/examples/zmq/3_zmq_app/component_gui/gui.hpp index b2d5c53835..e6d52a9e8f 100644 --- a/examples/zmq/3_zmq_app/component_gui/gui.hpp +++ b/examples/zmq/3_zmq_app/component_gui/gui.hpp @@ -16,7 +16,7 @@ #include #include -#include "communication/packets.hpp" +#include namespace component { diff --git a/examples/zmq/3_zmq_app/main.cpp b/examples/zmq/3_zmq_app/main.cpp index fcfcdd03f6..371431d3e3 100644 --- a/examples/zmq/3_zmq_app/main.cpp +++ b/examples/zmq/3_zmq_app/main.cpp @@ -17,8 +17,8 @@ #include "component_gui/gui.hpp" -#include "communication/postman.hpp" -#include "communication/identifier.hpp" +#include +#include /** * Simple subscriber with zeromq. diff --git a/examples/zmq/3_zmq_app/project.xml b/examples/zmq/3_zmq_app/project.xml index 9e1a8550e9..93d04482b6 100644 --- a/examples/zmq/3_zmq_app/project.xml +++ b/examples/zmq/3_zmq_app/project.xml @@ -10,11 +10,11 @@ - - + + - :communication:xpcc + :communication:xpcc:generator :debug :platform:core :build:scons diff --git a/tools/build_script_generator/scons/module.lb b/tools/build_script_generator/scons/module.lb index b7b798d9c4..a5cb3ea560 100644 --- a/tools/build_script_generator/scons/module.lb +++ b/tools/build_script_generator/scons/module.lb @@ -27,19 +27,6 @@ def prepare(module, options): module.add_option( StringOption(name="image.source", default="", description="Path to the image folder")) - module.add_option( - StringOption(name="xpcc.source", default="", - description="Path to the XPCC source file")) - module.add_option( - StringOption(name="xpcc.container", default="", - description="Name of the XPCC container to generate for")) - module.add_option( - StringOption(name="xpcc.generate", default="communication", - description="Path to the XPCC generated folder")) - module.add_option( - StringOption(name="xpcc.namespace", default="robot", - description="Namespace of the generated XPCC communications")) - module.add_option( EnumerationOption(name="info.git", default="Disabled", enumeration=["Disabled", "Info", "Info+Status"], @@ -76,6 +63,7 @@ def build(env): def post_build(env, buildlog): is_unittest = env.has_module(":test") + has_xpcc_generator = env.has_module(":communication:xpcc:generator") has_image_source = len(env[":::image.source"]) target = env["modm:target"] @@ -89,8 +77,8 @@ def post_build(env, buildlog): "cmake_wrapper", "qtcreator", ] - if len(env[":::xpcc.source"]): - build_tools += ["system_design"] + if has_xpcc_generator: + build_tools += ["xpcc_generator"] if has_image_source: build_tools += ["bitmap"] if env[":::info.git"] != "Disabled" or env[":::info.build"]: @@ -119,6 +107,11 @@ def post_build(env, buildlog): "is_unittest": is_unittest, "has_image_source": has_image_source, "image_source": env[":::image.source"], + "has_xpcc_generator": has_xpcc_generator, + "generator_source": env.get_option(":communication:xpcc:generator:source", ""), + "generator_container": env.get_option(":communication:xpcc:generator:container", ""), + "generator_path": env.get_option(":communication:xpcc:generator:path", ""), + "generator_namespace": env.get_option(":communication:xpcc:generator:namespace", ""), }) # Set these substitutions for all templates env.substitutions = subs @@ -140,9 +133,6 @@ def post_build(env, buildlog): # Copy the scons-build-tools env.copy(repopath("ext/dlr/scons-build-tools"), "ext/dlr/scons-build-tools") env.copy("site_tools", "scons/site_tools") - # Copy XPCC tools - if "system_design" in build_tools: - env.copy(repopath("tools/system_design"), "tools/system_design") # these are the ONLY files that are allowed to NOT be namespaced with modm! env.outbasepath = "." diff --git a/tools/build_script_generator/scons/resources/SConscript.in b/tools/build_script_generator/scons/resources/SConscript.in index 399ed81347..a03956f7d0 100644 --- a/tools/build_script_generator/scons/resources/SConscript.in +++ b/tools/build_script_generator/scons/resources/SConscript.in @@ -104,7 +104,7 @@ env.SetDefault(CONFIG_OPENOCD_COMMANDS = [ %% endif # XPCC generator tool path -env["XPCC_SYSTEM_DESIGN"] = join(abspath("."), "tools", "system_design") +env["XPCC_SYSTEM_DESIGN"] = join(abspath("."), "tools", "xpcc_generator") # Toolchain configuration %% macro generate_flags_for_profile(name, profile, append=False) diff --git a/tools/build_script_generator/scons/resources/SConstruct.in b/tools/build_script_generator/scons/resources/SConstruct.in index b726136c7d..c2bf3487fd 100644 --- a/tools/build_script_generator/scons/resources/SConstruct.in +++ b/tools/build_script_generator/scons/resources/SConstruct.in @@ -54,15 +54,15 @@ for image in env.FindFiles("{{ image_source }}", ".pbm"): source, _ = env.Bitmap(str(image)) sources.append(source) %% endif -%% if options[":::xpcc.source"] != "" +%% if has_xpcc_generator # Generating XPCC sources -env.Append(CPPPATH="{{ options[":::xpcc.generate"] }}") -ignored.append("{{ options[":::xpcc.generate"] }}") +env.Append(CPPPATH="{{ generator_path }}") +ignored.append("{{ generator_path }}") sources += env.XpccCommunication( - xmlfile=abspath("{{ options[":::xpcc.source"] }}"), - container="{{ options[":::xpcc.container"] }}", - path=abspath("{{ options[":::xpcc.generate"] }}"), - namespace="{{ options[":::xpcc.namespace"] }}") + xmlfile=abspath("{{ generator_source }}"), + container="{{ generator_container }}", + path=abspath("{{ generator_path }}"), + namespace="{{ generator_namespace }}") %% endif %% if not is_unittest diff --git a/tools/build_script_generator/scons/site_tools/system_design.py b/tools/build_script_generator/scons/site_tools/xpcc_generator.py similarity index 100% rename from tools/build_script_generator/scons/site_tools/system_design.py rename to tools/build_script_generator/scons/site_tools/xpcc_generator.py diff --git a/tools/system_design/builder/__init__.py b/tools/xpcc_generator/builder/__init__.py similarity index 100% rename from tools/system_design/builder/__init__.py rename to tools/xpcc_generator/builder/__init__.py diff --git a/tools/system_design/builder/builder_base.py b/tools/xpcc_generator/builder/builder_base.py similarity index 100% rename from tools/system_design/builder/builder_base.py rename to tools/xpcc_generator/builder/builder_base.py diff --git a/tools/system_design/builder/cpp_communication.py b/tools/xpcc_generator/builder/cpp_communication.py similarity index 100% rename from tools/system_design/builder/cpp_communication.py rename to tools/xpcc_generator/builder/cpp_communication.py diff --git a/tools/system_design/builder/cpp_identifier.py b/tools/xpcc_generator/builder/cpp_identifier.py similarity index 100% rename from tools/system_design/builder/cpp_identifier.py rename to tools/xpcc_generator/builder/cpp_identifier.py diff --git a/tools/system_design/builder/cpp_packets.py b/tools/xpcc_generator/builder/cpp_packets.py similarity index 100% rename from tools/system_design/builder/cpp_packets.py rename to tools/xpcc_generator/builder/cpp_packets.py diff --git a/tools/system_design/builder/cpp_postman.py b/tools/xpcc_generator/builder/cpp_postman.py similarity index 100% rename from tools/system_design/builder/cpp_postman.py rename to tools/xpcc_generator/builder/cpp_postman.py diff --git a/tools/system_design/builder/cpp_xpcc_task_caller.py b/tools/xpcc_generator/builder/cpp_xpcc_task_caller.py similarity index 100% rename from tools/system_design/builder/cpp_xpcc_task_caller.py rename to tools/xpcc_generator/builder/cpp_xpcc_task_caller.py diff --git a/tools/system_design/builder/filter/__init__.py b/tools/xpcc_generator/builder/filter/__init__.py similarity index 100% rename from tools/system_design/builder/filter/__init__.py rename to tools/xpcc_generator/builder/filter/__init__.py diff --git a/tools/system_design/builder/filter/cpp.py b/tools/xpcc_generator/builder/filter/cpp.py similarity index 100% rename from tools/system_design/builder/filter/cpp.py rename to tools/xpcc_generator/builder/filter/cpp.py diff --git a/tools/system_design/builder/filter/java.py b/tools/xpcc_generator/builder/filter/java.py similarity index 100% rename from tools/system_design/builder/filter/java.py rename to tools/xpcc_generator/builder/filter/java.py diff --git a/tools/system_design/builder/generate_include_graph.py b/tools/xpcc_generator/builder/generate_include_graph.py similarity index 100% rename from tools/system_design/builder/generate_include_graph.py rename to tools/xpcc_generator/builder/generate_include_graph.py diff --git a/tools/system_design/builder/java_communication.py b/tools/xpcc_generator/builder/java_communication.py similarity index 100% rename from tools/system_design/builder/java_communication.py rename to tools/xpcc_generator/builder/java_communication.py diff --git a/tools/system_design/builder/java_generator.py b/tools/xpcc_generator/builder/java_generator.py similarity index 100% rename from tools/system_design/builder/java_generator.py rename to tools/xpcc_generator/builder/java_generator.py diff --git a/tools/system_design/builder/java_identifier.py b/tools/xpcc_generator/builder/java_identifier.py similarity index 100% rename from tools/system_design/builder/java_identifier.py rename to tools/xpcc_generator/builder/java_identifier.py diff --git a/tools/system_design/builder/java_meta_communication.py b/tools/xpcc_generator/builder/java_meta_communication.py similarity index 100% rename from tools/system_design/builder/java_meta_communication.py rename to tools/xpcc_generator/builder/java_meta_communication.py diff --git a/tools/system_design/builder/java_meta_packets.py b/tools/xpcc_generator/builder/java_meta_packets.py similarity index 100% rename from tools/system_design/builder/java_meta_packets.py rename to tools/xpcc_generator/builder/java_meta_packets.py diff --git a/tools/system_design/builder/java_packets.py b/tools/xpcc_generator/builder/java_packets.py similarity index 100% rename from tools/system_design/builder/java_packets.py rename to tools/xpcc_generator/builder/java_packets.py diff --git a/tools/system_design/builder/java_packets_jaxb_index.py b/tools/xpcc_generator/builder/java_packets_jaxb_index.py similarity index 100% rename from tools/system_design/builder/java_packets_jaxb_index.py rename to tools/xpcc_generator/builder/java_packets_jaxb_index.py diff --git a/tools/system_design/builder/system_layout.py b/tools/xpcc_generator/builder/system_layout.py similarity index 98% rename from tools/system_design/builder/system_layout.py rename to tools/xpcc_generator/builder/system_layout.py index 1c07a56f8b..f512512d7a 100644 --- a/tools/system_design/builder/system_layout.py +++ b/tools/xpcc_generator/builder/system_layout.py @@ -34,9 +34,9 @@ class SystemLayoutBuilder(builder_base.Builder): $ python3 system_layout.py ../../../../roboter/2012_captain/software/global/xml/robot.xml -o /tmp -s simulator -s "drive simulation" -s "External" # 2015 - $ python3 system_layout.py ../../../../season/common/robot.xml --dtdpath ../../../tools/system_design/xml/dtd -o /tmp - $ python3 system_layout.py ../../../../season/common/robot.xml --dtdpath ../../../tools/system_design/xml/dtd -o /tmp -s "drive big simulation" -s "drive little simulation" -s "External" -s "simulator" -s "drive big" + $ python3 system_layout.py ../../../../season/common/robot.xml --dtdpath ../../../tools/xpcc_generator/xml/dtd -o /tmp + $ python3 system_layout.py ../../../../season/common/robot.xml --dtdpath ../../../tools/xpcc_generator/xml/dtd -o /tmp -s "drive big simulation" -s "drive little simulation" -s "External" -s "simulator" -s "drive big" A PDF called system.pdf is generated in /tmp/system.pdf. If you want to display callable actions for each component add the -a switch. diff --git a/tools/system_design/builder/templates/cpp_caller.tpl b/tools/xpcc_generator/builder/templates/cpp_caller.tpl similarity index 100% rename from tools/system_design/builder/templates/cpp_caller.tpl rename to tools/xpcc_generator/builder/templates/cpp_caller.tpl diff --git a/tools/system_design/builder/templates/cpp_communication.tpl b/tools/xpcc_generator/builder/templates/cpp_communication.tpl similarity index 100% rename from tools/system_design/builder/templates/cpp_communication.tpl rename to tools/xpcc_generator/builder/templates/cpp_communication.tpl diff --git a/tools/system_design/builder/templates/include_graph.dot.tpl b/tools/xpcc_generator/builder/templates/include_graph.dot.tpl similarity index 100% rename from tools/system_design/builder/templates/include_graph.dot.tpl rename to tools/xpcc_generator/builder/templates/include_graph.dot.tpl diff --git a/tools/system_design/builder/templates/java_communication.tpl b/tools/xpcc_generator/builder/templates/java_communication.tpl similarity index 100% rename from tools/system_design/builder/templates/java_communication.tpl rename to tools/xpcc_generator/builder/templates/java_communication.tpl diff --git a/tools/system_design/builder/templates/java_components.tpl b/tools/xpcc_generator/builder/templates/java_components.tpl similarity index 100% rename from tools/system_design/builder/templates/java_components.tpl rename to tools/xpcc_generator/builder/templates/java_components.tpl diff --git a/tools/system_design/builder/templates/java_generator.tpl b/tools/xpcc_generator/builder/templates/java_generator.tpl similarity index 100% rename from tools/system_design/builder/templates/java_generator.tpl rename to tools/xpcc_generator/builder/templates/java_generator.tpl diff --git a/tools/system_design/builder/templates/java_identifier.tpl b/tools/xpcc_generator/builder/templates/java_identifier.tpl similarity index 100% rename from tools/system_design/builder/templates/java_identifier.tpl rename to tools/xpcc_generator/builder/templates/java_identifier.tpl diff --git a/tools/system_design/builder/templates/java_meta_communication.tpl b/tools/xpcc_generator/builder/templates/java_meta_communication.tpl similarity index 100% rename from tools/system_design/builder/templates/java_meta_communication.tpl rename to tools/xpcc_generator/builder/templates/java_meta_communication.tpl diff --git a/tools/system_design/builder/templates/java_meta_packets.tpl b/tools/xpcc_generator/builder/templates/java_meta_packets.tpl similarity index 100% rename from tools/system_design/builder/templates/java_meta_packets.tpl rename to tools/xpcc_generator/builder/templates/java_meta_packets.tpl diff --git a/tools/system_design/builder/templates/java_packets.tpl b/tools/xpcc_generator/builder/templates/java_packets.tpl similarity index 100% rename from tools/system_design/builder/templates/java_packets.tpl rename to tools/xpcc_generator/builder/templates/java_packets.tpl diff --git a/tools/system_design/builder/templates/java_packets_jaxb_index.tpl b/tools/xpcc_generator/builder/templates/java_packets_jaxb_index.tpl similarity index 100% rename from tools/system_design/builder/templates/java_packets_jaxb_index.tpl rename to tools/xpcc_generator/builder/templates/java_packets_jaxb_index.tpl diff --git a/tools/system_design/builder/templates/postman.cpp.tpl b/tools/xpcc_generator/builder/templates/postman.cpp.tpl similarity index 100% rename from tools/system_design/builder/templates/postman.cpp.tpl rename to tools/xpcc_generator/builder/templates/postman.cpp.tpl diff --git a/tools/system_design/builder/templates/postman.hpp.tpl b/tools/xpcc_generator/builder/templates/postman.hpp.tpl similarity index 100% rename from tools/system_design/builder/templates/postman.hpp.tpl rename to tools/xpcc_generator/builder/templates/postman.hpp.tpl diff --git a/tools/system_design/builder/templates/robot_identifier.tpl b/tools/xpcc_generator/builder/templates/robot_identifier.tpl similarity index 100% rename from tools/system_design/builder/templates/robot_identifier.tpl rename to tools/xpcc_generator/builder/templates/robot_identifier.tpl diff --git a/tools/system_design/builder/templates/robot_packets.cpp.tpl b/tools/xpcc_generator/builder/templates/robot_packets.cpp.tpl similarity index 100% rename from tools/system_design/builder/templates/robot_packets.cpp.tpl rename to tools/xpcc_generator/builder/templates/robot_packets.cpp.tpl diff --git a/tools/system_design/builder/templates/robot_packets.hpp.tpl b/tools/xpcc_generator/builder/templates/robot_packets.hpp.tpl similarity index 100% rename from tools/system_design/builder/templates/robot_packets.hpp.tpl rename to tools/xpcc_generator/builder/templates/robot_packets.hpp.tpl diff --git a/tools/xpcc_generator/module.lb b/tools/xpcc_generator/module.lb new file mode 100644 index 0000000000..ff265722bd --- /dev/null +++ b/tools/xpcc_generator/module.lb @@ -0,0 +1,35 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# Copyright (c) 2018, Niklas Hauser +# +# This file is part of the modm project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# ----------------------------------------------------------------------------- + +def init(module): + module.parent = "communication:xpcc" + module.name = "generator" + +def prepare(module, options): + module.add_option( + StringOption(name="source", default="", + description="Path to the XPCC source file")) + module.add_option( + StringOption(name="container", default="", + description="Name of the XPCC container to generate for")) + module.add_option( + StringOption(name="path", default="generated/xpcc", + description="Path to the XPCC generated folder")) + module.add_option( + StringOption(name="namespace", default="robot", + description="Namespace of the generated XPCC communications")) + + return True + +def build(env): + env.outbasepath = "modm/tools/xpcc_generator" + env.copy(".", ignore=env.ignore_patterns("*.lb")) diff --git a/tools/system_design/xml/dtd/rca_components.dtd b/tools/xpcc_generator/xml/dtd/rca_components.dtd similarity index 100% rename from tools/system_design/xml/dtd/rca_components.dtd rename to tools/xpcc_generator/xml/dtd/rca_components.dtd diff --git a/tools/system_design/xml/dtd/rca_container.dtd b/tools/xpcc_generator/xml/dtd/rca_container.dtd similarity index 100% rename from tools/system_design/xml/dtd/rca_container.dtd rename to tools/xpcc_generator/xml/dtd/rca_container.dtd diff --git a/tools/system_design/xml/dtd/rca_events.dtd b/tools/xpcc_generator/xml/dtd/rca_events.dtd similarity index 100% rename from tools/system_design/xml/dtd/rca_events.dtd rename to tools/xpcc_generator/xml/dtd/rca_events.dtd diff --git a/tools/system_design/xml/dtd/rca_packets.dtd b/tools/xpcc_generator/xml/dtd/rca_packets.dtd similarity index 100% rename from tools/system_design/xml/dtd/rca_packets.dtd rename to tools/xpcc_generator/xml/dtd/rca_packets.dtd diff --git a/tools/system_design/xmlparser/__init__.py b/tools/xpcc_generator/xmlparser/__init__.py similarity index 100% rename from tools/system_design/xmlparser/__init__.py rename to tools/xpcc_generator/xmlparser/__init__.py diff --git a/tools/system_design/xmlparser/action.py b/tools/xpcc_generator/xmlparser/action.py similarity index 100% rename from tools/system_design/xmlparser/action.py rename to tools/xpcc_generator/xmlparser/action.py diff --git a/tools/system_design/xmlparser/component.py b/tools/xpcc_generator/xmlparser/component.py similarity index 100% rename from tools/system_design/xmlparser/component.py rename to tools/xpcc_generator/xmlparser/component.py diff --git a/tools/system_design/xmlparser/container.py b/tools/xpcc_generator/xmlparser/container.py similarity index 100% rename from tools/system_design/xmlparser/container.py rename to tools/xpcc_generator/xmlparser/container.py diff --git a/tools/system_design/xmlparser/domain.py b/tools/xpcc_generator/xmlparser/domain.py similarity index 100% rename from tools/system_design/xmlparser/domain.py rename to tools/xpcc_generator/xmlparser/domain.py diff --git a/tools/system_design/xmlparser/event.py b/tools/xpcc_generator/xmlparser/event.py similarity index 100% rename from tools/system_design/xmlparser/event.py rename to tools/xpcc_generator/xmlparser/event.py diff --git a/tools/system_design/xmlparser/exception.py b/tools/xpcc_generator/xmlparser/exception.py similarity index 100% rename from tools/system_design/xmlparser/exception.py rename to tools/xpcc_generator/xmlparser/exception.py diff --git a/tools/system_design/xmlparser/parser.py b/tools/xpcc_generator/xmlparser/parser.py similarity index 99% rename from tools/system_design/xmlparser/parser.py rename to tools/xpcc_generator/xmlparser/parser.py index 39ce1bfa6a..aa73ae13ce 100644 --- a/tools/system_design/xmlparser/parser.py +++ b/tools/xpcc_generator/xmlparser/parser.py @@ -309,8 +309,8 @@ def _check_events(self): # ----------------------------------------------------------------------------- if __name__ == "__main__": parser = Parser() - parser.parse("../../../../season/common/robot.xml", dtdPath="../../../tools/system_design/xml/dtd") + parser.parse("../../../../season/common/robot.xml", dtdPath="../../../tools/xpcc_generator/xml/dtd") tree = parser.tree #print tree.dump() diff --git a/tools/system_design/xmlparser/parser_exception.py b/tools/xpcc_generator/xmlparser/parser_exception.py similarity index 100% rename from tools/system_design/xmlparser/parser_exception.py rename to tools/xpcc_generator/xmlparser/parser_exception.py diff --git a/tools/system_design/xmlparser/structure.gaphor b/tools/xpcc_generator/xmlparser/structure.gaphor similarity index 100% rename from tools/system_design/xmlparser/structure.gaphor rename to tools/xpcc_generator/xmlparser/structure.gaphor diff --git a/tools/system_design/xmlparser/structure.pdf b/tools/xpcc_generator/xmlparser/structure.pdf similarity index 100% rename from tools/system_design/xmlparser/structure.pdf rename to tools/xpcc_generator/xmlparser/structure.pdf diff --git a/tools/system_design/xmlparser/type.py b/tools/xpcc_generator/xmlparser/type.py similarity index 100% rename from tools/system_design/xmlparser/type.py rename to tools/xpcc_generator/xmlparser/type.py diff --git a/tools/system_design/xmlparser/utils.py b/tools/xpcc_generator/xmlparser/utils.py similarity index 100% rename from tools/system_design/xmlparser/utils.py rename to tools/xpcc_generator/xmlparser/utils.py diff --git a/tools/system_design/xmlparser/xml_utils.py b/tools/xpcc_generator/xmlparser/xml_utils.py similarity index 100% rename from tools/system_design/xmlparser/xml_utils.py rename to tools/xpcc_generator/xmlparser/xml_utils.py