[openrtm-commit:03218] r807 - in trunk/rtmtools: . jp.go.aist.rtm.rtcbuilder.lua jp.go.aist.rtm.rtcbuilder.lua/.settings jp.go.aist.rtm.rtcbuilder.lua/META-INF jp.go.aist.rtm.rtcbuilder.lua/src jp.go.aist.rtm.rtcbuilder.lua/src/jp jp.go.aist.rtm.rtcbuilder.lua/src/jp/go jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/test jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/ui jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/ui/Perspective
openrtm @ openrtm.org
openrtm @ openrtm.org
2018年 3月 5日 (月) 22:39:11 JST
Author: miyamoto
Date: 2018-03-05 22:39:11 +0900 (Mon, 05 Mar 2018)
New Revision: 807
Added:
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/.classpath
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/.project
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/.settings/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/.settings/org.eclipse.jdt.core.prefs
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/META-INF/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/META-INF/MANIFEST.MF
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/bin/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/build.properties
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/build.xml
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/plugin.properties
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/plugin.xml
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/IRtcBuilderConstantsLua.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/RtcBuilderLuaPlugin.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager/LuaCMakeGenerateManager.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager/LuaConverter.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager/LuaGenerateManager.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager/TemplateHelperLua.java
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/CMakeLists.txt.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/FindOpenRTMLua.cmake.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/SrcCMakeLists.txt.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/cpack_options_cmake.in.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/postinst.in.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/prerm.in.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/wix_patch.xml.in.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/Lua_RTC.lua.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/Lua_SVC_idl_example.lua.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/_doc.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/delete.bat.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/idlcompile.bat.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/idlcompile.sh.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/test/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/test/Lua_Test_RTC.lua.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/ui/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/ui/Perspective/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/ui/Perspective/LuaProperty.java
Modified:
trunk/rtmtools/build_all
trunk/rtmtools/build_features
trunk/rtmtools/build_plugins
trunk/rtmtools/buildall.bat
trunk/rtmtools/check_packages
Log:
add a Lua code generator plugin.
Modified: trunk/rtmtools/build_all
===================================================================
--- trunk/rtmtools/build_all 2018-03-03 14:15:57 UTC (rev 806)
+++ trunk/rtmtools/build_all 2018-03-05 13:39:11 UTC (rev 807)
@@ -83,6 +83,7 @@
jp.go.aist.rtm.rtcbuilder.nl1
jp.go.aist.rtm.rtcbuilder.java
jp.go.aist.rtm.rtcbuilder.python
+ jp.go.aist.rtm.rtcbuilder.lua
jp.go.aist.rtm.repositoryView
jp.go.aist.rtm.repositoryView.nl1
jp.go.aist.rtm.nameserviceview
Modified: trunk/rtmtools/build_features
===================================================================
--- trunk/rtmtools/build_features 2018-03-03 14:15:57 UTC (rev 806)
+++ trunk/rtmtools/build_features 2018-03-05 13:39:11 UTC (rev 807)
@@ -87,6 +87,7 @@
jp.go.aist.rtm.rtcbuilder.nl1
jp.go.aist.rtm.rtcbuilder.java
jp.go.aist.rtm.rtcbuilder.python
+ jp.go.aist.rtm.rtcbuilder.lua
jp.go.aist.rtm.repositoryView
jp.go.aist.rtm.repositoryView.nl1
jp.go.aist.rtm.nameserviceview
Modified: trunk/rtmtools/build_plugins
===================================================================
--- trunk/rtmtools/build_plugins 2018-03-03 14:15:57 UTC (rev 806)
+++ trunk/rtmtools/build_plugins 2018-03-05 13:39:11 UTC (rev 807)
@@ -80,6 +80,7 @@
jp.go.aist.rtm.rtcbuilder.nl1
jp.go.aist.rtm.rtcbuilder.java
jp.go.aist.rtm.rtcbuilder.python
+ jp.go.aist.rtm.rtcbuilder.lua
jp.go.aist.rtm.repositoryView
jp.go.aist.rtm.repositoryView.nl1
jp.go.aist.rtm.nameserviceview
Modified: trunk/rtmtools/buildall.bat
===================================================================
--- trunk/rtmtools/buildall.bat 2018-03-03 14:15:57 UTC (rev 806)
+++ trunk/rtmtools/buildall.bat 2018-03-05 13:39:11 UTC (rev 807)
@@ -16,6 +16,7 @@
jp.go.aist.rtm.rtcbuilder.nl1 ^
jp.go.aist.rtm.rtcbuilder.java ^
jp.go.aist.rtm.rtcbuilder.python ^
+ jp.go.aist.rtm.rtcbuilder.lua ^
jp.go.aist.rtm.repositoryView ^
jp.go.aist.rtm.repositoryView.nl1 ^
jp.go.aist.rtm.nameserviceview ^
Modified: trunk/rtmtools/check_packages
===================================================================
--- trunk/rtmtools/check_packages 2018-03-03 14:15:57 UTC (rev 806)
+++ trunk/rtmtools/check_packages 2018-03-05 13:39:11 UTC (rev 807)
@@ -18,6 +18,7 @@
jp.go.aist.rtm.rtcbuilder.nl1
jp.go.aist.rtm.rtcbuilder.java
jp.go.aist.rtm.rtcbuilder.python
+ jp.go.aist.rtm.rtcbuilder.lua
jp.go.aist.rtm.repositoryView
jp.go.aist.rtm.repositoryView.nl1
jp.go.aist.rtm.nameserviceview
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/.classpath
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/.classpath (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/.classpath 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/.project
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/.project (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/.project 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jp.go.aist.rtm.rtcbuilder.lua</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/.settings/org.eclipse.jdt.core.prefs 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/META-INF/MANIFEST.MF
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/META-INF/MANIFEST.MF (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/META-INF/MANIFEST.MF 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Ant-Version: Apache Ant 1.10.1
+Created-By: 1.8.0_131-b11 (Oracle Corporation)
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: jp.go.aist.rtm.rtcbuilder.lua;singleton:=true
+Bundle-Version: 0.2.0.rc1v20180305
+Bundle-ClassPath: jp.go.aist.rtm.rtcbuilder.lua,.
+Bundle-Activator: jp.go.aist.rtm.rtcbuilder.lua.RtcBuilderLuaPlugin
+Bundle-Vendor: %providerName
+Require-Bundle: org.eclipse.ui, org.eclipse.core.runtime, jp.go.aist.r
+ tm.rtcbuilder;bundle-version="1.1.0"
+Bundle-ActivationPolicy: lazy
+Export-Package: jp.go.aist.rtm.rtcbuilder.lua,jp.go.aist.rtm.rtcbuilde
+ r.lua.manager,jp.go.aist.rtm.rtcbuilder.lua.ui.Perspective
+Built-By: Miyamoto
+Built-Date: 2018/03/05 22:08:24
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/build.properties
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/build.properties (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/build.properties 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties
+javacDefaultEncoding.. = UTF-8
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/build.xml
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/build.xml (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/build.xml 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,112 @@
+<project name="jp.go.aist.rtm.rtcbuilder.lua" default="jar"
+ xmlns:ant4eclipse="antlib:org.ant4eclipse"
+ xmlns:antcontrib="antlib:net.sf.antcontrib" >
+
+ <property name="target.name" value="jp.go.aist.rtm.rtcbuilder.lua" />
+
+ <taskdef name="manifesttask" classname="aist.ManifestTask" />
+
+ <property name="source" value="src"/>
+
+ <property name="dist.dir" value="jar" />
+ <property name="build.dir" value="bin"/>
+ <property name="icons.dir" value="icons"/>
+ <property name="lib.dir" value="lib"/>
+
+ <property environment="env"/>
+ <property name="eclipse.home" value="${env.ECLIPSE_HOME}"/>
+ <!--
+ <taskdef resource="net/sf/ant4eclipse/antlib.xml" />
+ -->
+ <taskdef uri="antlib:net.sf.antcontrib"
+ resource="net/sf/antcontrib/antlib.xml" />
+ <taskdef uri="antlib:org.ant4eclipse"
+ resource="org/ant4eclipse/antlib.xml" />
+
+ <property name="targetPlatformLocation" value="${eclipse.home}" />
+ <property name="workspace" value="${basedir}/.." />
+ <property name="project.name" value="jp.go.aist.rtm.rtcbuilder.lua" />
+ <tstamp>
+ <format property="built.date" pattern="yyyy/MM/dd HH:mm:ss" />
+ </tstamp>
+
+ <target name="buildAll">
+ <antcall target="clean" />
+ <antcall target="compile" />
+ <antcall target="jar" />
+ </target>
+
+ <target name="clean" description="ビルドで生成されたファイルを削除します">
+ <delete includeEmptyDirs="true" quiet="true">
+ <fileset dir="${build.dir}" includes="**/*.class" />
+ <fileset dir="." includes="**/*.log" />
+ </delete>
+ <delete dir="${build.dir}/jp" quiet="true"/>
+ <delete dir="${dist.dir}" quiet="true"/>
+ </target>
+
+ <target name="compile" description="ソースをコンパイルします">
+<!--
+ <getEclipseClasspath pathid="build.classpath" targetplatformlocation="${targetPlatformLocation}"
+ workspace="${workspace}" projectname="${project.name}"/>
+-->
+ <ant4eclipse:targetPlatform id="eclipse-3.8">
+ <location dir="${targetPlatformLocation}" />
+ </ant4eclipse:targetPlatform>
+ <ant4eclipse:jdtClassPathLibrary name="org.eclipse.jdt.junit.JUNIT_CONTAINER/4">
+ <fileset dir="${eclipse.home}/plugins/org.junit_4.11.0.v201303080030" />
+ </ant4eclipse:jdtClassPathLibrary>
+
+ <ant4eclipse:getJdtClassPath
+ pathid="build.classpath"
+ workspacedirectory="${workspace}"
+ projectname="${project.name}" >
+ <jdtclasspathcontainerargument key="target.platform" value="eclipse-3.8" />
+ </ant4eclipse:getJdtClassPath>
+
+
+ <javac srcdir="${source}" destdir="${build.dir}"
+ classpathref="build.classpath" encoding="UTF-8" />
+ </target>
+
+ <target name="jar" description="jarファイルを作成します">
+ <copy todir="${build.dir}/jp/go/aist/rtm/rtcbuilder/lua/template">
+ <fileset dir="${source}/jp/go/aist/rtm/rtcbuilder/lua/template">
+ <include name="cmake/**/**.vsl" />
+ <include name="lua/**/**.vsl" />
+ </fileset>
+ </copy>
+ <mkdir dir="${dist.dir}" />
+ <delete>
+ <fileset dir="${dist.dir}" includes="${target.name}_*.jar" />
+ </delete>
+ <!-- Version settings -->
+ <manifesttask file="META-INF/MANIFEST.MF" key="Bundle-Version" property="manifest.project.version" />
+ <condition property="project.version"
+ value="${env.PROJECT_VERSION}"
+ else="${manifest.project.version}">
+ <isset property="env.PROJECT_VERSION" />
+ </condition>
+ <property name="jar.version" value="_${project.version}"/>
+ <property name="jar.name" value="${target.name}${jar.version}"/>
+ <!-- Updating MANIFEST.MF -->
+ <manifest file="META-INF/MANIFEST.MF" mode="update">
+ <attribute name="Bundle-Version" value="${project.version}"/>
+ <attribute name="Built-By" value="${user.name}"/>
+ <attribute name="Built-Date" value="${built.date}"/>
+ </manifest>
+ <!-- Creating a jar file -->
+ <jar destfile="${dist.dir}/${jar.name}.jar" manifest="META-INF/MANIFEST.MF">
+ <fileset dir="${build.dir}">
+ <exclude name="jp/go/aist/rtm/rtcbuilder/lua/_test/_100/**" />
+ </fileset>
+ <fileset dir=".">
+ <include name="icons/**.**" />
+ <include name="lib/**.**" />
+ <include name="plugin.xml" />
+ <include name="plugin.properties" />
+ </fileset>
+ </jar>
+ </target>
+
+</project>
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/plugin.properties
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/plugin.properties (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/plugin.properties 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,20 @@
+# <copyright>
+# </copyright>
+#
+
+
+# ====================================================================
+# To code developer:
+# Do NOT change the properties between this line and the
+# "%%% END OF TRANSLATED PROPERTIES %%%" line.
+# Make a new property name, append to the end of the file and change
+# the code to use the new property.
+# ====================================================================
+
+# ====================================================================
+# %%% END OF TRANSLATED PROPERTIES %%%
+# ====================================================================
+
+pluginName = RtcBuilder for Lua
+providerName = AIST
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/plugin.xml
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/plugin.xml (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/plugin.xml 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension point="jp.go.aist.rtm.rtcbuilder.generateManager">
+ <manager
+ managerclass="jp.go.aist.rtm.rtcbuilder.lua.manager.LuaGenerateManager"
+ seq="100"/>
+ <manager
+ managerclass="jp.go.aist.rtm.rtcbuilder.lua.manager.LuaCMakeGenerateManager"
+ seq="110"/>
+ </extension>
+
+</plugin>
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/IRtcBuilderConstantsLua.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/IRtcBuilderConstantsLua.java (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/IRtcBuilderConstantsLua.java 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,41 @@
+package jp.go.aist.rtm.rtcbuilder.lua;
+
+public interface IRtcBuilderConstantsLua {
+
+ public static final String LANG_LUA = "Lua";
+ public static final String LANG_LUA_ARG = "lua";
+ //
+ public static final int DOC_DEFAULT_WIDTH = 80;
+ //
+ public static final int DOC_AUTHOR_OFFSET_LUA = 9;
+ public static final int DOC_DEFAULT_OFFSET_LUA = 1;
+ public static final int DOC_DESC_OFFSET_LUA = 4;
+ public static final int DOC_NUMBER_OFFSET_LUA = 15;
+ public static final int DOC_FREQUENCY_OFFSET_LUA = 18;
+ public static final int DOC_CYCLE_OFFSET_LUA = 24;
+ public static final int DOC_DETAIL_OFFSET_LUA = 22;
+ public static final int DOC_RANGE_OFFSET_LUA = 14;
+ public static final int DOC_CONSTRAINT_OFFSET_LUA = 19;
+ public static final int DOC_PRE_OFFSET_LUA = 9;
+ public static final int DOC_POST_OFFSET_LUA = 10;
+ public static final int DOC_ACTIVITY_OFFSET_LUA = 4;
+ //
+ public static final String DOC_DEFAULT_PREFIX_LUA = " ";
+ public static final String DOC_MODULE_PREFIX_LUA = "\t";
+ public static final String DOC_DESC_PREFIX_LUA = "\t\t";
+ public static final String DOC_UNIT_PREFIX_LUA = "\t\t ";
+ public static final String DOC_NUMBER_PREFIX_LUA = "\t\t ";
+ public static final String DOC_SEMANTICS_PREFIX_LUA = "\t\t ";
+ public static final String DOC_FREQUENCY_PREFIX_LUA = "\t\t ";
+ public static final String DOC_CYCLE_PREFIX_LUA = "\t\t ";
+ public static final String DOC_DETAIL_PREFIX_LUA = "\t\t ";
+ public static final String DOC_RANGE_PREFIX_LUA = "\t\t ";
+ public static final String DOC_CONSTRAINT_PREFIX_LUA = "\t\t ";
+ public static final String DOC_PRE_PREFIX_LUA = "\t\t ";
+ public static final String DOC_POST_PREFIX_LUA = "\t\t ";
+ public static final String DOC_ACTIVITY_PREFIX_LUA = "\t#\t";
+ public static final String DOC_PRESH_PREFIX_LUA = "\t#\t ";
+ public static final String DOC_POSTSH_PREFIX_LUA = "\t#\t ";
+ //
+
+}
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/RtcBuilderLuaPlugin.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/RtcBuilderLuaPlugin.java (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/RtcBuilderLuaPlugin.java 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,67 @@
+package jp.go.aist.rtm.rtcbuilder.lua;
+
+
+
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import jp.go.aist.rtm.toolscommon.profiles.util.LoggerUtil;
+
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class RtcBuilderLuaPlugin extends AbstractUIPlugin {
+
+ private static final Logger LOGGER = LoggerFactory
+ .getLogger(RtcBuilderLuaPlugin.class);
+
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "jp.go.aist.rtm.rtcbuilder.lua";
+
+ // The shared instance
+ private static RtcBuilderLuaPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public RtcBuilderLuaPlugin() {
+
+ LoggerUtil.setup();
+ LOGGER.trace("RtcBuilderLuaPlugin: START");
+
+
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static RtcBuilderLuaPlugin getDefault() {
+ return plugin;
+ }
+
+}
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager/LuaCMakeGenerateManager.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager/LuaCMakeGenerateManager.java (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager/LuaCMakeGenerateManager.java 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,131 @@
+package jp.go.aist.rtm.rtcbuilder.lua.manager;
+
+import java.io.InputStream;
+import java.util.List;
+import java.util.Map;
+
+import jp.go.aist.rtm.rtcbuilder.generator.GeneratedResult;
+import jp.go.aist.rtm.rtcbuilder.generator.param.RtcParam;
+import jp.go.aist.rtm.rtcbuilder.manager.CMakeGenerateManager;
+import jp.go.aist.rtm.rtcbuilder.template.TemplateUtil;
+import static jp.go.aist.rtm.rtcbuilder.IRtcBuilderConstants.*;
+import static jp.go.aist.rtm.rtcbuilder.util.RTCUtil.form;
+import static jp.go.aist.rtm.rtcbuilder.lua.IRtcBuilderConstantsLua.LANG_LUA;
+import static jp.go.aist.rtm.rtcbuilder.lua.IRtcBuilderConstantsLua.LANG_LUA_ARG;
+
+public class LuaCMakeGenerateManager extends CMakeGenerateManager {
+
+ static final String TEMPLATE_PATH_LUA = "jp/go/aist/rtm/rtcbuilder/lua/template";
+
+ public LuaCMakeGenerateManager() {
+ }
+
+ @Override
+ public String getTargetVersion() {
+ return RTM_VERSION_100;
+ }
+
+ @Override
+ public String getManagerKey() {
+ return LANG_LUA;
+ }
+
+ @Override
+ public String getLangArgList() {
+ return LANG_LUA_ARG;
+ }
+
+ @Override
+ public Map<String, Object> createContextMap(RtcParam rtcParam) {
+ Map<String, Object> map = super.createContextMap(rtcParam);
+ map.put("templateLua", TEMPLATE_PATH_LUA);
+ return map;
+ }
+
+ // RTM 1.0系
+ @Override
+ public List<GeneratedResult> generateTemplateCode10(
+ Map<String, Object> contextMap) {
+ List<GeneratedResult> result = super.generateTemplateCode10(contextMap);
+
+ GeneratedResult gr;
+ RtcParam rtcParam = (RtcParam) contextMap.get("rtcParam");
+ if(0<rtcParam.getServicePorts().size()) {
+ gr = generatePostinstIin(contextMap);
+ result.add(gr);
+ gr = generatePrermIn(contextMap);
+ result.add(gr);
+ gr = generateCMakeWixPatchXmlIn(contextMap);
+ result.add(gr);
+ }
+
+ return result;
+ }
+
+ // 1.0系 (CMake)
+
+ @Override
+ public GeneratedResult generateCMakeLists(Map<String, Object> contextMap) {
+ String outfile = "CMakeLists.txt";
+ String infile = "cmake/CMakeLists.txt.vsl";
+ GeneratedResult result = generateLua(infile, outfile, contextMap);
+ //result.setNotBom(true);
+ return result;
+ }
+
+ // 1.0系 (CMake/cpack_resources)
+ public GeneratedResult generatePostinstIin(Map<String, Object> contextMap) {
+ String outfile = "postinst.in";
+ String infile = "cmake/postinst.in.vsl";
+ return generateLua(infile, outfile, contextMap);
+ }
+
+ public GeneratedResult generatePrermIn(Map<String, Object> contextMap) {
+ String outfile = "prerm.in";
+ String infile = "cmake/prerm.in.vsl";
+ return generateLua(infile, outfile, contextMap);
+ }
+
+ public GeneratedResult generateCMakeWixPatchXmlIn(Map<String, Object> contextMap) {
+ String outfile = "cmake/wix_patch.xml.in";
+ String infile = "cmake/wix_patch.xml.in.vsl";
+ return generateLua(infile, outfile, contextMap);
+ }
+
+ @Override
+ public GeneratedResult generateCmakeCPackOption(Map<String, Object> contextMap) {
+ String outfile = "cmake/cpack_options.cmake.in";
+ String infile = "cmake/cpack_options_cmake.in.vsl";
+ GeneratedResult result = generateLua(infile, outfile, contextMap);
+ //result.setNotBom(true);
+ return result;
+ }
+
+ @Override
+ public GeneratedResult generateSrcCMakeLists(Map<String, Object> contextMap) {
+ String outfile = "src/CMakeLists.txt";
+ String infile = "cmake/SrcCMakeLists.txt.vsl";
+ GeneratedResult result = generateLua(infile, outfile, contextMap);
+ //result.setNotBom(true);
+ return result;
+ }
+ /////
+ public GeneratedResult generateLua(String infile, String outfile,
+ Map<String, Object> contextMap) {
+ try {
+ String template = TEMPLATE_PATH_LUA + "/" + infile;
+ ClassLoader cl = Thread.currentThread().getContextClassLoader();
+ InputStream ins = cl.getResourceAsStream(template);
+ GeneratedResult gr = TemplateUtil.createGeneratedResult(ins,
+ contextMap, outfile);
+ if (ins != null) {
+ ins.close();
+ }
+ return gr;
+ } catch (Exception e) {
+ throw new RuntimeException(form(MSG_ERROR_GENERATE_FILE,
+ new String[] { "CMake", outfile }), e);
+ }
+ }
+
+}
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager/LuaConverter.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager/LuaConverter.java (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager/LuaConverter.java 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,409 @@
+package jp.go.aist.rtm.rtcbuilder.lua.manager;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import jp.go.aist.rtm.rtcbuilder.generator.param.ConfigSetParam;
+import jp.go.aist.rtm.rtcbuilder.generator.param.idl.IdlFileParam;
+import jp.go.aist.rtm.rtcbuilder.generator.param.idl.ServiceArgumentParam;
+import jp.go.aist.rtm.rtcbuilder.generator.param.idl.ServiceClassParam;
+import jp.go.aist.rtm.rtcbuilder.generator.param.idl.ServiceMethodParam;
+
+/**
+ * Luaソースを出力する際に使用されるユーティリティ
+ */
+public class LuaConverter {
+ protected Map<String, String> mapType;
+ protected Map<String, String> mapTypeArgs;
+
+ private final String dirIn = "in";
+ private final String dirOut = "out";
+ private final String dirInOut = "inout";
+
+ private final String idlLongLong = "longlong";
+ private final String idlUnsignedLong = "unsignedlong";
+ private final String idlUnsignedLongLong = "unsignedlonglong";
+ private final String idlUnsignedShort = "unsignedshort";
+ private final String idlString = "string";
+ private final String idlWstring = "wstring";
+ private final String idlVoid= "void";
+ //
+ private final String luaLongLong = "longlong";
+ private final String luaUnsignedLong = "ulong";
+ private final String luaUnsignedLongLong = "ulonglong";
+ private final String luaUnsignedShort = "ushort";
+ private final String luaString = "string";
+ //
+ private final String luaLongLongParam = "long long";
+ private final String luaUnsignedLongParam = "unsigned long";
+ private final String luaUnsignedLongLongParam = "unsigned long long";
+ private final String luaUnsignedShortParam = "unsigned short";
+ //
+
+ public LuaConverter() {
+ mapType = new HashMap<String, String>();
+ mapType.put(idlLongLong, luaLongLong);
+ mapType.put(idlUnsignedLong, luaUnsignedLong);
+ mapType.put(idlUnsignedLongLong, luaUnsignedLongLong);
+ mapType.put(idlUnsignedShort, luaUnsignedShort);
+ //
+ mapTypeArgs = new HashMap<String, String>(mapType);
+ mapTypeArgs.put(idlLongLong, luaLongLongParam);
+ mapTypeArgs.put(idlUnsignedLong, luaUnsignedLongParam);
+ mapTypeArgs.put(idlUnsignedLongLong, luaUnsignedLongLongParam);
+ mapTypeArgs.put(idlUnsignedShort, luaUnsignedShortParam);
+ //
+// mapTypeArgsCmnt = new HashMap(mapTypeArgs);
+ //
+ }
+
+ /**
+ * CORBA型からLua型へ型を変換する(TypeDef考慮)
+ *
+ * @param strCorba CORBA型
+ * @return Lua型
+ */
+ public String convCORBA2LuaTypeDef(String strCorba, ServiceClassParam scp) {
+ String strType = scp.getTypeDef().get(strCorba).getOriginalDef();
+ String result = "";
+ if(strType.endsWith("[]")) {
+ strType = strType.substring(0, strType.length()-2);
+ }
+
+ if( strType.equals(luaString)) {
+ result = "(omniORB.tcInternal.tv_string,0)";
+ } else {
+ result = "omniORB.tcInternal.tv_" + strType;
+ }
+ return result;
+ }
+ /**
+ * CORBA型からLua型へ型を変換する
+ *
+ * @param strCorba CORBA型
+ * @param scp サービスクラス
+ * @return Lua型
+ */
+ public String convCORBA2Lua(String strCorba) {
+ String result = mapType.get(strCorba);
+ if( result == null ) result = strCorba;
+
+ return result;
+ }
+ /**
+ * CORBA型からLua型へ型を変換する(コメント用)
+ *
+ * @param strCorba CORBA型
+ * @param scp サービスクラス
+ * @return Lua型
+ */
+ public String convCORBA2LuaArg(String strCorba) {
+ String result = mapTypeArgs.get(strCorba);
+ if( result == null ) result = strCorba;
+
+ return result;
+ }
+ /**
+ * CORBA型からLua型へ型を変換する
+ *
+ * @param strCorba CORBA型
+ * @param scp サービスクラス
+ * @return Lua型
+ */
+ public String convCORBA2Lua4IDL(String strCorba, ServiceClassParam scp) {
+ String strType = (scp.getTypeDef().get(strCorba) == null) ? null : scp
+ .getTypeDef().get(strCorba).getOriginalDef();
+ String result = "";
+ if( strType==null) {
+ if(strCorba.equals(idlString)) {
+ result = "(omniORB.tcInternal.tv_string,0)";
+ } else if(strCorba.equals(idlWstring)) {
+ result = "(omniORB.tcInternal.tv_wstring,0)";
+ } else {
+ result = mapType.get(strCorba);
+ if( result == null ) result = strCorba;
+ result = "omniORB.tcInternal.tv_" + result;
+ }
+ } else {
+ result = "omniORB.typeMapping[\"IDL:" + strCorba + ":1.0\"]";
+ }
+ return result;
+ }
+ /**
+ * メソッド入力パラメータの型を取得する
+ *
+ * @param strCorba CORBA型
+ * @param scp サービスクラス
+ * @return 入力パラメータ
+ */
+ public String selectInParamType(ServiceMethodParam smp, ServiceClassParam scp) {
+ String result = "";
+ int intHit = 0;
+
+ for(ServiceArgumentParam arg : smp.getArguments() ) {
+ if(arg.getDirection().equals(dirIn) || arg.getDirection().equals(dirInOut)) {
+ result = result + convCORBA2Lua4IDL(arg.getType(),scp) + ", ";
+ intHit++;
+ }
+ }
+ if( intHit > 1 ) result = result.substring(0, result.length()-2 );
+ result = "(" + result;
+ return result;
+ }
+
+ /**
+ * メソッド入力パラメータの名称を取得する
+ *
+ * @param strCorba CORBA型
+ * @param scp サービスクラス
+ * @return 入力パラメータ
+ */
+ public String selectInParamName(ServiceMethodParam smp, ServiceClassParam scp) {
+ String result = "";
+ int count = 0;
+ for(ServiceArgumentParam arg : smp.getArguments() ) {
+ if(arg.getDirection().equals(dirIn) || arg.getDirection().equals(dirInOut)) {
+ if(count == 0)
+ {
+ result = arg.getName();
+ }
+ else
+ {
+ result = result + ", " + arg.getName();
+ }
+ count++;
+ }
+ }
+ return result;
+ }
+
+ /**
+ * メソッド出力パラメータの型を取得する
+ *
+ * @param strCorba CORBA型
+ * @param scp サービスクラス
+ * @return 出力ラメータ
+ */
+ public String selectOutParamType(ServiceMethodParam smp, ServiceClassParam scp) {
+ String result = "";
+ int intHit = 0;
+
+ if(!smp.getIsVoid()) {
+ result = result + convCORBA2Lua4IDL(smp.getType(),scp) + ", ";
+ intHit++;
+ }
+ for(ServiceArgumentParam aug : smp.getArguments() ) {
+ if(aug.getDirection().equals(dirOut) || aug.getDirection().equals(dirInOut)) {
+ result = result + convCORBA2Lua4IDL(aug.getType(),scp) + ", ";
+ intHit++;
+ }
+ }
+ if( intHit > 1 ) result = result.substring(0, result.length()-2 );
+ return result;
+ }
+ /**
+ * メソッド出力パラメータの名称を取得する
+ *
+ * @param strCorba CORBA型
+ * @param scp サービスクラス
+ * @return 出力パラメータ
+ */
+ public String selectOutParamName(ServiceMethodParam smp, ServiceClassParam scp) {
+ String result = "";
+ boolean blnHit = false;
+
+ if( !smp.getType().equals(idlVoid) ) {
+ result = " result";
+ }
+ for(ServiceArgumentParam arg : smp.getArguments() ) {
+ if(arg.getDirection().equals(dirOut) || arg.getDirection().equals(dirInOut)) {
+ if( result.length()>0 ) result += ",";
+ result = result + " " + arg.getName();
+ blnHit = true;
+ }
+ }
+ if( smp.getType().equals(idlVoid) && !blnHit) {
+ result = " None";
+ }
+ return result;
+ }
+ /**
+ * Sequence型か判断する
+ *
+ * @param type 検証対象型
+ * @return 検証結果
+ */
+ public String convPortInit(String type) {
+ if( this.isSequence(type) )
+ return "[]";
+ return "0";
+ }
+ /**
+ * Sequence型か判断する
+ *
+ * @param type 検証対象型
+ * @return 検証結果
+ */
+ private boolean isSequence(String type) {
+ if( type.toLowerCase().endsWith("seq") )
+ return true;
+ return false;
+ }
+ /**
+ * パラメータの初期値を取得する
+ *
+ * @param config 対象パラメータ
+ * @return 初期値
+ */
+ public boolean isString(String type) {
+ if( type.toLowerCase().equals(luaString) )
+ return true;
+ return false;
+ }
+ /**
+ * パラメータの初期値を取得する
+ *
+ * @param config 対象パラメータ
+ * @return 初期値
+ */
+ public String convDefaultVal(ConfigSetParam config) {
+ String defVal = config.getDefaultVal();
+ if( config.getName().startsWith("vector") ) {
+ String[] eachVal = defVal.split(",");
+ String result = "";
+ for(int intIdx=0;intIdx<eachVal.length;intIdx++) {
+ if(intIdx>0) result += ", ";
+ result = result + eachVal[intIdx];
+ }
+ result = "[" + result + "]";
+ return result;
+ } else if(isString(config.getType()) ) {
+ return "'" + defVal + "'";
+ } else {
+ return defVal;
+ }
+ }
+
+ /**
+ * データポート初期化用メソッド名を返す
+ *
+ * @param rtcType ポートの型
+ * @return 初期化メソッド名
+ */
+ public String getDataportInitMethodName(String rtcType) {
+
+ //module名が付いていないデータ型(::が付いていない)は、
+ //文字列に()を付けてデフォルトコンストラクタ扱いにする
+ if(!rtcType.matches(".*::.*")) return rtcType + "()";
+ String methodName = "::"+rtcType;
+
+ //module名が「RTC」のときは親データ型である「Time」のコンストラクタを引数に入れた
+ //コンストラクタを引数に入れコンストラクタ文字列にして返す
+ //それ以外のmodule名の場合、()を付けただけのデフォルトコンストラクタを返す
+// if(rtcType.startsWith("RTC::")) {
+// methodName = methodName + "(RTC.Time(0,0)";
+// }
+// else {
+// methodName = methodName + "()";
+// }
+
+ return methodName;
+ }
+
+ /**
+ * データポート変数型定義変数を返す
+ *
+ * @param rtcType ポートの型
+ * @return 変数型定義変数
+ */
+ public String getTypeDefinition(String rtcType) {
+ String methodName = rtcType.replace("::", "._d_");
+ return methodName;
+ }
+
+ public String convFullName(String source) {
+ if(source.contains("::")) {
+ return source.replace("::", ".");
+
+ }
+ return "_GlobalIDL." + source;
+ }
+
+ public String getModuleName(String source) {
+ if(source.contains("::")) {
+ int index = source.lastIndexOf("::");
+ return source.substring(0, index);
+
+ }
+ return "_GlobalIDL";
+ }
+
+ public String convToLower(String source) {
+ return source.toLowerCase();
+ }
+
+ public String convModuleName(IdlFileParam source) {
+ List<String> addedList = new ArrayList<String>();
+ StringBuilder strWork;
+ StringBuilder result = new StringBuilder();
+
+ boolean existGlobal = false;
+ for(ServiceClassParam target : source.getServiceClassParams() ) {
+ strWork = new StringBuilder();
+ if(target.getName().contains("::")) {
+ int index = target.getName().lastIndexOf("::");
+ strWork.append("import ");
+ strWork.append(target.getName().substring(0, index));
+ strWork.append(", ");
+ strWork.append(target.getName().substring(0, index));
+ strWork.append("__POA");
+ } else {
+ if(!existGlobal) {
+ strWork.append("import ");
+ strWork.append("_GlobalIDL, _GlobalIDL__POA");
+ existGlobal = true;
+ }
+ }
+ //
+ if(addedList.contains(strWork.toString())==false) {
+ result.append(strWork.toString()).append(System.getProperty("line.separator"));
+ addedList.add(strWork.toString());
+ }
+ }
+ return result.toString();
+ }
+
+ public String convModuleNameAll(List<IdlFileParam> sourceList) {
+ List<String> addedList = new ArrayList<String>();
+ StringBuilder strWork;
+ StringBuilder result = new StringBuilder();
+
+ boolean existGlobal = false;
+ for(IdlFileParam source : sourceList) {
+ for(ServiceClassParam target : source.getServiceClassParams() ) {
+ strWork = new StringBuilder();
+ if(target.getName().contains("::")) {
+ int index = target.getName().lastIndexOf("::");
+ strWork.append("import ");
+ strWork.append(target.getName().substring(0, index));
+ strWork.append(", ");
+ strWork.append(target.getName().substring(0, index));
+ strWork.append("__POA");
+ } else {
+ if(!existGlobal) {
+ strWork.append("import ");
+ strWork.append("_GlobalIDL, _GlobalIDL__POA");
+ existGlobal = true;
+ }
+ }
+ if(addedList.contains(strWork.toString())==false) {
+ result.append(strWork.toString()).append(System.getProperty("line.separator"));
+ addedList.add(strWork.toString());
+ }
+ }
+ }
+ return result.toString();
+ }
+}
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager/LuaGenerateManager.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager/LuaGenerateManager.java (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager/LuaGenerateManager.java 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,227 @@
+package jp.go.aist.rtm.rtcbuilder.lua.manager;
+
+import static jp.go.aist.rtm.rtcbuilder.IRtcBuilderConstants.*;
+import static jp.go.aist.rtm.rtcbuilder.lua.IRtcBuilderConstantsLua.*;
+import static jp.go.aist.rtm.rtcbuilder.util.RTCUtil.*;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import jp.go.aist.rtm.rtcbuilder.generator.GeneratedResult;
+import jp.go.aist.rtm.rtcbuilder.generator.param.RtcParam;
+import jp.go.aist.rtm.rtcbuilder.generator.param.idl.IdlFileParam;
+import jp.go.aist.rtm.rtcbuilder.generator.param.idl.ServiceClassParam;
+import jp.go.aist.rtm.rtcbuilder.lua.ui.Perspective.LuaProperty;
+import jp.go.aist.rtm.rtcbuilder.manager.GenerateManager;
+import jp.go.aist.rtm.rtcbuilder.template.TemplateHelper;
+import jp.go.aist.rtm.rtcbuilder.template.TemplateUtil;
+import jp.go.aist.rtm.rtcbuilder.ui.Perspective.LanguageProperty;
+
+/**
+ * Luaファイルの出力を制御するマネージャ
+ */
+public class LuaGenerateManager extends GenerateManager {
+
+ static final String TEMPLATE_PATH = "jp/go/aist/rtm/rtcbuilder/lua/template";
+
+ static final String MSG_ERROR_GENERATE_FILE = "Lua generation error. [{0}]";
+
+ @Override
+ public String getTargetVersion() {
+ return RTM_VERSION_100;
+ }
+
+ @Override
+ public String getManagerKey() {
+ return LANG_LUA;
+ }
+
+ @Override
+ public String getLangArgList() {
+ return LANG_LUA_ARG;
+ }
+
+ @Override
+ public LanguageProperty getLanguageProperty(RtcParam rtcParam) {
+ LanguageProperty langProp = null;
+ if (rtcParam.isLanguageExist(LANG_LUA)) {
+ langProp = new LuaProperty();
+ }
+ return langProp;
+ }
+
+ /**
+ * ファイルを出力する
+ *
+ * @param generatorParam
+ * @return 出力結果のリスト
+ */
+ public List<GeneratedResult> generateTemplateCode(RtcParam rtcParam) {
+ List<GeneratedResult> result = new ArrayList<GeneratedResult>();
+
+ if (!rtcParam.isLanguageExist(LANG_LUA)) {
+ return result;
+ }
+
+ List<IdlFileParam> allIdlFileParams = new ArrayList<IdlFileParam>();
+ allIdlFileParams.addAll(rtcParam.getProviderIdlPathes());
+ allIdlFileParams.addAll(rtcParam.getConsumerIdlPathes());
+ List<IdlFileParam> allIdlFileParamsForBuild = new ArrayList<IdlFileParam>();
+ allIdlFileParamsForBuild.addAll(allIdlFileParams);
+ allIdlFileParamsForBuild.addAll(rtcParam.getIncludedIdlPathes());
+
+ // IDLファイル内に記述されているServiceClassParamを設定する
+ for (IdlFileParam idlFileParam : allIdlFileParams) {
+ for (ServiceClassParam serviceClassParam : rtcParam.getServiceClassParams()) {
+ if (idlFileParam.getIdlPath().equals(serviceClassParam.getIdlPath())){
+ if (!idlFileParam.getServiceClassParams().contains(serviceClassParam)){
+ idlFileParam.addServiceClassParams(serviceClassParam);
+ }
+ }
+ }
+ }
+
+ Map<String, Object> contextMap = new HashMap<String, Object>();
+ contextMap.put("template", TEMPLATE_PATH);
+ contextMap.put("rtcParam", rtcParam);
+ contextMap.put("tmpltHelper", new TemplateHelper());
+ contextMap.put("tmpltHelperLua", new TemplateHelperLua());
+ contextMap.put("luaConv", new LuaConverter());
+ contextMap.put("allIdlFileParam", allIdlFileParams);
+ contextMap.put("idlPathes", rtcParam.getIdlPathes());
+ contextMap.put("allIdlFileParamBuild", allIdlFileParamsForBuild);
+
+ return generateTemplateCode10(contextMap);
+ }
+
+ // RTM 1.0系
+ @SuppressWarnings("unchecked")
+ public List<GeneratedResult> generateTemplateCode10(
+ Map<String, Object> contextMap) {
+ List<GeneratedResult> result = new ArrayList<GeneratedResult>();
+ RtcParam rtcParam = (RtcParam) contextMap.get("rtcParam");
+ List<IdlFileParam> allIdlFileParams = (List<IdlFileParam>) contextMap
+ .get("allIdlFileParam");
+
+ GeneratedResult gr;
+ gr = generateLuaSource(contextMap);
+ result.add(gr);
+
+ /*
+ if ( 0<allIdlFileParams.size() ) {
+ gr = generateIDLCompileBat(contextMap);
+ result.add(gr);
+ gr = generateIDLCompileSh(contextMap);
+ result.add(gr);
+ gr = generateDeleteBat(contextMap);
+ result.add(gr);
+ }
+ */
+
+ for (IdlFileParam idlFileParam : rtcParam.getProviderIdlPathes()) {
+ contextMap.put("idlFileParam", idlFileParam);
+ gr = generateSVCIDLExampleSource(contextMap);
+ result.add(gr);
+ }
+ //////////
+ gr = generateLuaTestSource(contextMap);
+ result.add(gr);
+ for (IdlFileParam idlFileParam : rtcParam.getConsumerIdlPathes()) {
+ contextMap.put("idlFileParam", idlFileParam);
+ gr = generateTestSVCIDLExampleSource(contextMap);
+ result.add(gr);
+ }
+
+ return result;
+ }
+
+ // 1.0系 (Lua)
+
+ public GeneratedResult generateLuaSource(Map<String, Object> contextMap) {
+ RtcParam rtcParam = (RtcParam) contextMap.get("rtcParam");
+ String outfile = rtcParam.getName() + ".lua";
+ String infile = "lua/Lua_RTC.lua.vsl";
+ GeneratedResult result = generate(infile, outfile, contextMap);
+ result.setNotBom(true);
+ //result.setEncode("UTF-8");
+ return result;
+ }
+
+ public GeneratedResult generateSVCIDLExampleSource(
+ Map<String, Object> contextMap) {
+ IdlFileParam idlParam = (IdlFileParam) contextMap.get("idlFileParam");
+ String outfile = idlParam.getIdlFileNoExt() + "_idl_example.lua";
+ String infile = "lua/Lua_SVC_idl_example.lua.vsl";
+ GeneratedResult result = generate(infile, outfile, contextMap);
+ result.setNotBom(true);
+ return result;
+ }
+
+ // 1.0系 (ビルド環境)
+
+
+ public GeneratedResult generateIDLCompileBat(Map<String, Object> contextMap) {
+ String outfile = "idlcompile.bat";
+ String infile = "lua/idlcompile.bat.vsl";
+ GeneratedResult result = generate(infile, outfile, contextMap);
+ //result.setEncode("Shift_JIS");
+ return result;
+ }
+
+
+ public GeneratedResult generateIDLCompileSh(Map<String, Object> contextMap) {
+ String outfile = "idlcompile.sh";
+ String infile = "lua/idlcompile.sh.vsl";
+ GeneratedResult result = generate(infile, outfile, contextMap);
+ //result.setNotBom(true);
+ return result;
+ }
+
+ public GeneratedResult generateDeleteBat(Map<String, Object> contextMap) {
+ String outfile = "delete.bat";
+ String infile = "lua/delete.bat.vsl";
+ GeneratedResult result = generate(infile, outfile, contextMap);
+ //result.setEncode("Shift_JIS");
+ return result;
+ }
+
+ //////////
+ public GeneratedResult generateLuaTestSource(Map<String, Object> contextMap) {
+ RtcParam rtcParam = (RtcParam) contextMap.get("rtcParam");
+ String outfile = "test/" + rtcParam.getName() + "Test.lua";
+ String infile = "lua/test/Lua_Test_RTC.lua.vsl";
+ GeneratedResult result = generate(infile, outfile, contextMap);
+ result.setNotBom(true);
+ return result;
+ }
+
+ public GeneratedResult generateTestSVCIDLExampleSource(
+ Map<String, Object> contextMap) {
+ IdlFileParam idlParam = (IdlFileParam) contextMap.get("idlFileParam");
+ String outfile = "test/" + idlParam.getIdlFileNoExt() + "_idl_example.lua";
+ String infile = "lua/Lua_SVC_idl_example.lua.vsl";
+ return generate(infile, outfile, contextMap);
+ }
+ //////////
+ public GeneratedResult generate(String infile, String outfile,
+ Map<String, Object> contextMap) {
+ try {
+ String template = TEMPLATE_PATH + "/" + infile;
+ InputStream ins = getClass().getClassLoader().getResourceAsStream(
+ template);
+ GeneratedResult gr = TemplateUtil.createGeneratedResult(ins,
+ contextMap, outfile);
+ if (ins != null) {
+ ins.close();
+ }
+ return gr;
+ } catch (Exception e) {
+ throw new RuntimeException(form(MSG_ERROR_GENERATE_FILE,
+ new String[] { outfile }), e);
+ }
+ }
+
+}
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager/TemplateHelperLua.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager/TemplateHelperLua.java (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/manager/TemplateHelperLua.java 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,143 @@
+package jp.go.aist.rtm.rtcbuilder.lua.manager;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import jp.go.aist.rtm.rtcbuilder.IRtcBuilderConstants;
+import jp.go.aist.rtm.rtcbuilder.generator.param.idl.IdlFileParam;
+import jp.go.aist.rtm.rtcbuilder.lua.IRtcBuilderConstantsLua;
+import jp.go.aist.rtm.rtcbuilder.util.StringUtil;
+
+/**
+ * テンプレートを出力する際に使用されるヘルパー Lua用
+ */
+public class TemplateHelperLua {
+ //
+ public String convertDocLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_DEFAULT_PREFIX_LUA, IRtcBuilderConstantsLua.DOC_DEFAULT_OFFSET_LUA);
+ }
+ public String convertAuthorDocLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_DEFAULT_PREFIX_LUA, IRtcBuilderConstantsLua.DOC_AUTHOR_OFFSET_LUA);
+ }
+ public String convertModuleDocLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_MODULE_PREFIX_LUA, IRtcBuilderConstantsLua.DOC_DEFAULT_OFFSET_LUA);
+ }
+ public String convertDescDocLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_DESC_PREFIX_LUA, IRtcBuilderConstantsLua.DOC_DESC_OFFSET_LUA);
+ }
+ public String convertTypeDocLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_UNIT_PREFIX_LUA, IRtcBuilderConstants.DOC_UNIT_OFFSET);
+ }
+ public String convertNumberDocLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_NUMBER_PREFIX_LUA, IRtcBuilderConstantsLua.DOC_NUMBER_OFFSET_LUA);
+ }
+ public String convertSemanticsDocLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_SEMANTICS_PREFIX_LUA, IRtcBuilderConstants.DOC_SEMANTICS_OFFSET);
+ }
+ public String convertFrequencyDocLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_FREQUENCY_PREFIX_LUA, IRtcBuilderConstantsLua.DOC_FREQUENCY_OFFSET_LUA);
+ }
+ public String convertCycleDocLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_CYCLE_PREFIX_LUA, IRtcBuilderConstantsLua.DOC_CYCLE_OFFSET_LUA);
+ }
+ public String convertInterfaceLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_NUMBER_PREFIX_LUA, IRtcBuilderConstantsLua.DOC_NUMBER_OFFSET_LUA);
+ }
+ public String convertDetailLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_DETAIL_PREFIX_LUA, IRtcBuilderConstantsLua.DOC_DETAIL_OFFSET_LUA);
+ }
+ public String convertUnitDocLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_UNIT_PREFIX_LUA, IRtcBuilderConstants.DOC_UNIT_OFFSET);
+ }
+ public String convertRangeDocLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_RANGE_PREFIX_LUA, IRtcBuilderConstantsLua.DOC_RANGE_OFFSET_LUA);
+ }
+ public String convertConstraintDocLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_CONSTRAINT_PREFIX_LUA, IRtcBuilderConstantsLua.DOC_CONSTRAINT_OFFSET_LUA);
+ }
+ public String convertPreDocLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_PRE_PREFIX_LUA, IRtcBuilderConstantsLua.DOC_PRE_OFFSET_LUA);
+ }
+ public String convertPostDocLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_POST_PREFIX_LUA, IRtcBuilderConstantsLua.DOC_POST_OFFSET_LUA);
+ }
+ public String convertActivityDocLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_ACTIVITY_PREFIX_LUA, IRtcBuilderConstantsLua.DOC_ACTIVITY_OFFSET_LUA);
+ }
+ public String convertPreShDocLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_PRESH_PREFIX_LUA, IRtcBuilderConstantsLua.DOC_PRE_OFFSET_LUA);
+ }
+ public String convertPostShDocLua(String source) {
+ return StringUtil.splitString(source, IRtcBuilderConstantsLua.DOC_DEFAULT_WIDTH,
+ IRtcBuilderConstantsLua.DOC_POSTSH_PREFIX_LUA, IRtcBuilderConstantsLua.DOC_POST_OFFSET_LUA);
+ }
+ //
+ public boolean hasDataPortType(List<IdlFileParam> targetFiles) {
+ for(IdlFileParam target : targetFiles) {
+ if(target.isDataPort()) return true;
+ }
+ return false;
+ }
+
+ public List<String> getDataPortTypes(List<IdlFileParam> targetFiles) {
+ List<String> result = new ArrayList<String>();
+ List<String> check = new ArrayList<String>();
+ check.add("RTC");
+ check.add("OpenRTM_aist");
+
+ for(IdlFileParam target : targetFiles) {
+ if(target.isDataPort()==false) continue;
+ String targetType = "";
+ for(String targetTypes : target.getTargetType()) {
+ if( targetTypes.contains("::") ) {
+ String[] types = targetTypes.split("::");
+ /////
+ targetType = types[0];
+ if(check.contains(targetType)==false) {
+ check.add(targetType);
+ result.add(targetType);
+ }
+// StringBuilder builder = new StringBuilder();
+// for(int index=0;index<types.length-1;index++) {
+// if(index!=0) builder.append(".");
+// builder.append(types[index]);
+// targetType = builder.toString();
+// if(check.contains(targetType)==false) {
+// check.add(targetType);
+// result.add(targetType);
+// }
+// }
+
+ } else {
+ targetType = "_GlobalIDL";
+ if(check.contains(targetType)==false) {
+ check.add(targetType);
+ result.add(targetType);
+ }
+ }
+ }
+ }
+ return result;
+ }
+ public String convertServiceInterfaceName(String source) {
+ return "IDL:"+source.replace("::", "/") + ":1.0";
+ }
+}
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/CMakeLists.txt.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/CMakeLists.txt.vsl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/CMakeLists.txt.vsl 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,202 @@
+cmake_minimum_required(VERSION 2.8)
+if(POLICY CMP0040)
+ cmake_policy(SET CMP0040 OLD)
+endif()
+if(POLICY CMP0053)
+ cmake_policy(SET CMP0053 OLD)
+endif()
+
+project(${rtcParam.name})
+string(TOLOWER ${dol}{PROJECT_NAME} PROJECT_NAME_LOWER)
+include("${dol}{PROJECT_SOURCE_DIR}/cmake/utils.cmake")
+set(PROJECT_VERSION ${rtcParam.version} CACHE STRING "${rtcParam.name} version")
+set(UPGRADE_GUID "")
+DISSECT_VERSION()
+set(PROJECT_SHORT_VER ${PROJECT_VERSION_MAJOR}${PROJECT_VERSION_MINOR}${PROJECT_VERSION_REVISION})
+set(PROJECT_DESCRIPTION "${rtcParam.description}")
+set(PROJECT_VENDOR "${rtcParam.vender}")
+#if( ${rtcParam.docCreator.length()} > 0 )
+set(PROJECT_MAINTAINER "${rtcParam.docCreator}")
+#else
+set(PROJECT_MAINTAINER "unknown")
+#end
+set(PROJECT_TYPE "lua/${rtcParam.category}")
+
+find_package(OpenRTM)
+set(RTM_VER ${dol}{OPENRTM_VERSION})
+set(RTM_SHORT_VER ${dol}{OPENRTM_VERSION_MAJOR}${dol}{OPENRTM_VERSION_MINOR}${dol}{OPENRTM_VERSION_PATCH})
+
+function(get_dist ARG0)
+ if(NOT ${dol}{CMAKE_SYSTEM_NAME} MATCHES "Linux")
+ set(${dol}{ARG0} ${dol}{CMAKE_SYSTEM_NAME} PARENT_SCOPE)
+ return()
+ endif()
+ foreach(dist Debian Ubuntu RedHat Fedora CentOS Raspbian)
+ execute_process(
+ COMMAND grep ${dol}{dist} -s /etc/issue /etc/os-release /etc/redhat-release /etc/system-release
+ OUTPUT_VARIABLE dist_name
+ )
+ if(${dol}{dist_name} MATCHES ${dol}{dist})
+ set(${dol}{ARG0} ${dol}{dist} PARENT_SCOPE)
+ return()
+ endif()
+ endforeach()
+endfunction(get_dist)
+
+function(get_pkgmgr ARG0)
+ get_dist(DIST_NAME)
+ if(${dol}{DIST_NAME} MATCHES "Debian" OR
+ ${dol}{DIST_NAME} MATCHES "Ubuntu" OR
+ ${dol}{DIST_NAME} MATCHES "Raspbian")
+ set(${dol}{ARG0} "DEB" PARENT_SCOPE)
+ return()
+ endif()
+ if(${dol}{DIST_NAME} MATCHES "RedHat" OR
+ ${dol}{DIST_NAME} MATCHES "Fedora" OR
+ ${dol}{DIST_NAME} MATCHES "CentOS")
+ set(${dol}{ARG0} "RPM" PARENT_SCOPE)
+ return()
+ endif()
+endfunction(get_pkgmgr)
+
+get_dist(DIST_NAME)
+MESSAGE(STATUS "Distribution is ${dol}{DIST_NAME}")
+
+get_pkgmgr(PKGMGR)
+if(PKGMGR AND NOT LINUX_PACKAGE_GENERATOR)
+ set(LINUX_PACKAGE_GENERATOR ${dol}{PKGMGR})
+ if(${dol}{PKGMGR} MATCHES "DEB")
+ execute_process(COMMAND dpkg --print-architecture
+ OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ message(STATUS "Package manager is ${dol}{PKGMGR}. Arch is ${dol}{CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.")
+ endif()
+ if(${dol}{PKGMGR} MATCHES "RPM")
+ execute_process(COMMAND uname "-m"
+ OUTPUT_VARIABLE CPACK_RPM_PACKAGE_ARCHITECTURE
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ message(STATUS "Package manager is ${dol}{PKGMGR}. Arch is ${dol}{CPACK_RPM_PACKAGE_ARCHITECTURE}.")
+ endif()
+endif()
+
+option(BUILD_DOCUMENTATION "Build the documentation" OFF)
+
+#if(${rtcParam.servicePorts.size()}>0)
+set(IDL_FILES ""
+#foreach($p in ${rtcParam.providerIdlPathes})
+ ${p.idlFile}
+#end
+#foreach($p in ${rtcParam.consumerIdlPathes})
+ ${p.idlFile}
+#end)
+
+if(WIN32)
+ set(SCRIPT_FILE ""
+ idlcompile.bat delete.bat)
+else()
+ set(SCRIPT_FILE ""
+ idlcompile.sh)
+endif()
+#end
+
+set(EXEC_FILES ""
+ ${rtcParam.name}.lua
+#if(${rtcParam.servicePorts.size()}>0) ${dol}{SCRIPT_FILE}#end
+)
+
+set(OTHER_SRCS CMakeLists.txt
+ RTC.xml ${rtcParam.name}.conf rtc.conf)
+
+${sharp} check lua installed
+find_package(Lua51)
+
+if(WIN32)
+ set(OPENRTM_SHARE_PREFIX "OpenRTM-aist/${dol}{RTM_VER}/Components/${dol}{PROJECT_TYPE}")
+ set(INSTALL_PREFIX ${dol}{PROJECT_NAME})
+ if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ set(CMAKE_INSTALL_PREFIX "${dol}{OPENRTM_DIR}Components/${dol}{PROJECT_TYPE}/${dol}{PROJECT_NAME}" CACHE PATH "..." FORCE)
+ endif()
+else()
+ set(OPENRTM_SHARE_PREFIX "share/openrtm-${dol}{OPENRTM_VERSION_MAJOR}.${dol}{OPENRTM_VERSION_MINOR}")
+ set(INSTALL_PREFIX "${dol}{OPENRTM_SHARE_PREFIX}/components/${dol}{PROJECT_TYPE}/${dol}{PROJECT_NAME}")
+endif()
+
+#if(${rtcParam.servicePorts.size()}>0)
+${sharp} postinst, prerm settings
+if(UNIX)
+ configure_file(${dol}{CMAKE_CURRENT_SOURCE_DIR}/postinst.in
+ ${dol}{CMAKE_CURRENT_SOURCE_DIR}/postinst @ONLY
+ )
+ configure_file(${dol}{CMAKE_CURRENT_SOURCE_DIR}/prerm.in
+ ${dol}{CMAKE_CURRENT_SOURCE_DIR}/prerm @ONLY
+ )
+endif()
+
+add_custom_target( ${dol}{PROJECT_NAME} ALL
+ COMMAND ${dol}{CMAKE_COMMAND} -E make_directory ${dol}{PROJECT_BINARY_DIR}/idl
+ COMMAND ${dol}{CMAKE_COMMAND} -E copy_directory
+ ${dol}{PROJECT_SOURCE_DIR}/idl ${dol}{PROJECT_BINARY_DIR}/idl
+)
+#end
+
+foreach(target ${dol}{EXEC_FILES})
+ add_custom_command( TARGET ${dol}{PROJECT_NAME} POST_BUILD
+ COMMAND ${dol}{CMAKE_COMMAND} -E copy
+ ${dol}{PROJECT_SOURCE_DIR}/${dol}{target} ${dol}{PROJECT_BINARY_DIR}
+ )
+endforeach()
+
+install(PROGRAMS ${dol}{EXEC_FILES} DESTINATION "${dol}{INSTALL_PREFIX}"
+ COMPONENT component)
+
+install(FILES ${dol}{PROJECT_SOURCE_DIR}/RTC.xml DESTINATION ${dol}{INSTALL_PREFIX}
+ COMPONENT component)
+
+#if(${rtcParam.servicePorts.size()}>0)
+install(DIRECTORY idl DESTINATION "${dol}{INSTALL_PREFIX}"
+ COMPONENT component)
+#end
+
+${sharp} add uninstall target
+configure_file(
+ "${dol}{CMAKE_CURRENT_SOURCE_DIR}/cmake/uninstall_target.cmake.in"
+ "${dol}{CMAKE_CURRENT_BINARY_DIR}/uninstall_target.cmake"
+ IMMEDIATE @ONLY)
+add_custom_target(uninstall COMMAND
+ ${dol}{CMAKE_COMMAND} -P ${dol}{CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
+
+if(WIN32)
+ ${sharp} start menu
+ set_property(INSTALL "${dol}{INSTALL_PREFIX}/${dol}{PROJECT_NAME}.lua"
+ PROPERTY CPACK_START_MENU_SHORTCUTS "${dol}{PROJECT_NAME}.lua")
+endif()
+
+${sharp} target settings for document
+if(BUILD_DOCUMENTATION)
+ add_subdirectory(doc)
+endif(BUILD_DOCUMENTATION)
+
+#if(${rtcParam.servicePorts.size()}>0)
+if(UNIX)
+ set(CPACK_GENERATOR "${dol}{LINUX_PACKAGE_GENERATOR}")
+ if(CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
+ set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${dol}{CMAKE_SOURCE_DIR}/postinst;${dol}{CMAKE_SOURCE_DIR}/prerm")
+ endif(CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
+ if(CPACK_RPM_PACKAGE_ARCHITECTURE)
+ set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${dol}{CMAKE_SOURCE_DIR}/postinst")
+ set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${dol}{CMAKE_SOURCE_DIR}/prerm")
+ endif(CPACK_RPM_PACKAGE_ARCHITECTURE)
+endif()
+
+set(WIX_PATCH_FILE "${dol}{CMAKE_CURRENT_BINARY_DIR}/wix_patch.xml")
+configure_file("cmake/wix_patch.xml.in"
+ ${dol}{WIX_PATCH_FILE} @ONLY)
+#end
+
+set(cpack_options "${dol}{PROJECT_BINARY_DIR}/cpack_options.cmake")
+configure_file("${dol}{PROJECT_SOURCE_DIR}/cmake/cpack_options.cmake.in"
+ ${dol}{cpack_options} @ONLY)
+
+set(CPACK_PROJECT_CONFIG_FILE ${dol}{cpack_options})
+include(${dol}{CPACK_PROJECT_CONFIG_FILE})
+include(CPack)
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/FindOpenRTMLua.cmake.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/FindOpenRTMLua.cmake.vsl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/FindOpenRTMLua.cmake.vsl 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,101 @@
+
+set(OMNIORB_FOUND FALSE)
+set(OPENRTM_FOUND FALSE)
+
+
+if(UNIX)
+ include(FindPkgConfig)
+
+ ${sharp} omniORB
+ pkg_check_modules(OMNIORB REQUIRED "omniORB4")
+ if(NOT OMNIORB_DIR)
+ if(OMNIORB_FOUND)
+ set(OMNIORB_DIR "${dol}{OMNIORB_PREFIX}")
+ endif()
+ set(OMNIORB_DIR "${dol}{OMNIORB_DIR}" CACHE PATH "omniORB root directory")
+ endif()
+
+ ${sharp} OpenRTM-aist
+ pkg_check_modules(OPENRTM REQUIRED "openrtm-aist")
+ if(NOT OPENRTM_DIR)
+ if(OPENRTM_FOUND)
+ set(OPENRTM_DIR "${dol}{OPENRTM_PREFIX}")
+ endif()
+ set(OPENRTM_DIR "${dol}{OPENRTM_DIR}" CACHE PATH "OpenRTM-aist root directory")
+ endif()
+
+ string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1"
+ OPENRTM_VERSION_MAJOR "${dol}{OPENRTM_VERSION}")
+ string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2"
+ OPENRTM_VERSION_MINOR "${dol}{OPENRTM_VERSION}")
+ string(REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\3"
+ OPENRTM_VERSION_PATCH "${dol}{OPENRTM_VERSION}")
+
+
+endif(UNIX)
+
+if(WIN32)
+ ${sharp} omniORB
+ if(NOT OMNIORB_DIR)
+ if(NOT ${dol}ENV{OMNI_ROOT} STREQUAL "")
+ set(OMNIORB_DIR "${dol}ENV{OMNI_ROOT}")
+ set(OMNIORB_FOUND TRUE)
+ endif()
+ set(OMNIORB_DIR "${dol}{OMNIORB_DIR}" CACHE PATH "omniORB root directory")
+ if(NOT OMNIORB_FOUND)
+ message(FATAL_ERROR "omniORB not found.")
+ endif()
+ endif()
+
+ ${sharp} omniORB version
+ file(GLOB _vers RELATIVE "${dol}{OMNIORB_DIR}" "${dol}{OMNIORB_DIR}/THIS_IS_OMNIORB*")
+ if("${dol}{_vers}" STREQUAL "")
+ message(FATAL_ERROR "omniORB version file not found.")
+ endif()
+
+ if("${dol}{_vers}" MATCHES "THIS_IS_OMNIORB")
+ set(OMNIORB_VERSION "${dol}{_vers}")
+ string(REGEX REPLACE "THIS_IS_OMNIORB_" ""
+ OMNIORB_VERSION "${dol}{OMNIORB_VERSION}")
+ string(REGEX REPLACE "[_]" "."
+ OMNIORB_VERSION "${dol}{OMNIORB_VERSION}")
+ string(REGEX REPLACE "[.]" ""
+ OMNIORB_VERSION_NUM "${dol}{OMNIORB_VERSION}")
+ endif()
+
+ ${sharp} OpenRTM-aist
+ if(NOT OPENRTM_DIR)
+ if(NOT ${dol}ENV{RTM_ROOT} STREQUAL "")
+ set(OPENRTM_DIR "${dol}ENV{RTM_ROOT}")
+ set(OPENRTM_FOUND TRUE)
+ endif()
+ set(OPENRTM_DIR "${dol}{OPENRTM_DIR}" CACHE PATH "OpenRTM-aist root directory")
+ if(NOT OPENRTM_FOUND)
+ message(FATAL_ERROR "OpenRTM-aist not found.")
+ endif()
+ endif()
+
+ ${sharp} OpenRTM-aist version
+ set(OPENRTM_VERSION "${dol}{OPENRTM_DIR}")
+ string(REGEX REPLACE ".*OpenRTM-aist/" "" OPENRTM_VERSION "${dol}{OPENRTM_VERSION}")
+ string(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\1" OPENRTM_VERSION_MAJOR "${dol}{OPENRTM_VERSION}")
+ string(REGEX REPLACE "([0-9]+)\\.([0-9]+)" "\\2" OPENRTM_VERSION_MINOR "${dol}{OPENRTM_VERSION}")
+ set(OPENRTM_VERSION_PATCH "0")
+ set(OPENRTM_VERSION "${dol}{OPENRTM_VERSION_MAJOR}.${dol}{OPENRTM_VERSION_MINOR}.${dol}{OPENRTM_VERSION_PATCH}")
+
+
+endif(WIN32)
+
+message(STATUS "FindOpenRTMLua setup done.")
+
+message(STATUS " OMNIORB_DIR=${dol}{OMNIORB_DIR}")
+message(STATUS " OMNIORB_VERSION=${dol}{OMNIORB_VERSION}")
+
+message(STATUS " OPENRTM_DIR=${dol}{OPENRTM_DIR}")
+message(STATUS " OPENRTM_VERSION=${dol}{OPENRTM_VERSION}")
+message(STATUS " OPENRTM_VERSION_MAJOR=${dol}{OPENRTM_VERSION_MAJOR}")
+message(STATUS " OPENRTM_VERSION_MINOR=${dol}{OPENRTM_VERSION_MINOR}")
+message(STATUS " OPENRTM_VERSION_PATCH=${dol}{OPENRTM_VERSION_PATCH}")
+
+message(STATUS " OPENRTM_IDLC=${dol}{OPENRTM_IDLC}")
+message(STATUS " OPENRTM_IDLFLAGS=${dol}{OPENRTM_IDLFLAGS}")
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/SrcCMakeLists.txt.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/SrcCMakeLists.txt.vsl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/SrcCMakeLists.txt.vsl 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,58 @@
+set(comp_srcs ${rtcParam.name}.cpp #foreach($providerIdlFile in ${rtcParam.providerIdlPathes})${tmpltHelper.getFilenameNoExt(${providerIdlFile.idlFile})}${tmpltHelper.serviceImplSuffix}.cpp #end)
+set(standalone_srcs ${rtcParam.name}Comp.cpp)
+
+if (DEFINED OPENRTM_INCLUDE_DIRS)
+ string(REGEX REPLACE "-I" ";"
+ OPENRTM_INCLUDE_DIRS "${dol}{OPENRTM_INCLUDE_DIRS}")
+ string(REGEX REPLACE " ;" ";"
+ OPENRTM_INCLUDE_DIRS "${dol}{OPENRTM_INCLUDE_DIRS}")
+endif (DEFINED OPENRTM_INCLUDE_DIRS)
+
+if (DEFINED OPENRTM_LIBRARY_DIRS)
+ string(REGEX REPLACE "-L" ";"
+ OPENRTM_LIBRARY_DIRS "${dol}{OPENRTM_LIBRARY_DIRS}")
+ string(REGEX REPLACE " ;" ";"
+ OPENRTM_LIBRARY_DIRS "${dol}{OPENRTM_LIBRARY_DIRS}")
+endif (DEFINED OPENRTM_LIBRARY_DIRS)
+
+if (DEFINED OPENRTM_LIBRARIES)
+ string(REGEX REPLACE "-l" ";"
+ OPENRTM_LIBRARIES "${dol}{OPENRTM_LIBRARIES}")
+ string(REGEX REPLACE " ;" ";"
+ OPENRTM_LIBRARIES "${dol}{OPENRTM_LIBRARIES}")
+endif (DEFINED OPENRTM_LIBRARIES)
+
+include_directories(${dol}{PROJECT_SOURCE_DIR}/include)
+include_directories(${dol}{PROJECT_SOURCE_DIR}/include/${dol}{PROJECT_NAME})
+include_directories(${dol}{PROJECT_BINARY_DIR})
+include_directories(${dol}{PROJECT_BINARY_DIR}/idl)
+include_directories(${dol}{OPENRTM_INCLUDE_DIRS})
+include_directories(${dol}{OMNIORB_INCLUDE_DIRS})
+add_definitions(${dol}{OPENRTM_CFLAGS})
+add_definitions(${dol}{OMNIORB_CFLAGS})
+
+MAP_ADD_STR(comp_hdrs "../" comp_headers)
+
+link_directories(${dol}{OPENRTM_LIBRARY_DIRS})
+link_directories(${dol}{OMNIORB_LIBRARY_DIRS})
+
+add_library(${dol}{PROJECT_NAME} ${dol}{LIB_TYPE} ${dol}{comp_srcs}
+ ${dol}{comp_headers} ${dol}{ALL_IDL_SRCS})
+set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
+set_source_files_properties(${dol}{ALL_IDL_SRCS} PROPERTIES GENERATED 1)
+if(NOT TARGET ALL_IDL_TGT)
+ add_custom_target(ALL_IDL_TGT)
+endif(NOT TARGET ALL_IDL_TGT)
+add_dependencies(${dol}{PROJECT_NAME} ALL_IDL_TGT)
+target_link_libraries(${dol}{PROJECT_NAME} ${dol}{OPENRTM_LIBRARIES})
+
+add_executable(${dol}{PROJECT_NAME}Comp ${dol}{standalone_srcs}
+ ${dol}{comp_srcs} ${dol}{comp_headers} ${dol}{ALL_IDL_SRCS})
+add_dependencies(${dol}{PROJECT_NAME}Comp ALL_IDL_TGT)
+target_link_libraries(${dol}{PROJECT_NAME}Comp ${dol}{OPENRTM_LIBRARIES})
+
+install(TARGETS ${dol}{PROJECT_NAME} ${dol}{PROJECT_NAME}Comp
+ EXPORT ${dol}{PROJECT_NAME}
+ RUNTIME DESTINATION ${dol}{INSTALL_PREFIX} COMPONENT component
+ LIBRARY DESTINATION ${dol}{INSTALL_PREFIX} COMPONENT component
+ ARCHIVE DESTINATION ${dol}{INSTALL_PREFIX} COMPONENT component)
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/cpack_options_cmake.in.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/cpack_options_cmake.in.vsl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/cpack_options_cmake.in.vsl 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,91 @@
+set(CPACK_PACKAGE_NAME "@PROJECT_NAME@")
+set(CPACK_RPM_PACKAGE_NAME "@PROJECT_NAME@")
+set(CPACK_PACKAGE_VERSION_MAJOR "@PROJECT_VERSION_MAJOR@")
+set(CPACK_PACKAGE_VERSION_MINOR "@PROJECT_VERSION_MINOR@")
+set(CPACK_PACKAGE_VERSION_PATCH "@PROJECT_VERSION_REVISION@")
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "@PROJECT_DESCRIPTION@")
+set(CPACK_PACKAGE_VENDOR "@PROJECT_VENDOR@")
+
+if(CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
+ set(CPACK_PACKAGE_FILE_NAME "@PROJECT_NAME_LOWER at _@PROJECT_VERSION at _@CPACK_DEBIAN_PACKAGE_ARCHITECTURE@")
+#if(${rtcParam.servicePorts.size()}>0)
+ set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "@CMAKE_SOURCE_DIR@/postinst;@CMAKE_SOURCE_DIR@/prerm")
+#end
+endif(CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
+if(CPACK_RPM_PACKAGE_ARCHITECTURE)
+ set(CPACK_PACKAGE_FILE_NAME "@PROJECT_NAME at -@PROJECT_VERSION at -@CPACK_RPM_PACKAGE_ARCHITECTURE@")
+#if(${rtcParam.servicePorts.size()}>0)
+ set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE "@CMAKE_SOURCE_DIR@/postinst")
+ set(CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "@CMAKE_SOURCE_DIR@/prerm")
+#end
+endif(CPACK_RPM_PACKAGE_ARCHITECTURE)
+set(CPACK_RESOURCE_FILE_LICENSE "@PROJECT_SOURCE_DIR@/COPYING.LESSER")
+
+set(CPACK_COMPONENTS_ALL component)
+set(CPACK_COMPONENT_COMPONENT_DISPLAY_NAME "Applications")
+set(CPACK_COMPONENT_COMPONENT_DESCRIPTION
+ "Component library and stand-alone executable")
+if(INSTALL_HEADERS)
+ set(CPACK_COMPONENTS_ALL ${dol}{CPACK_COMPONENTS_ALL} headers)
+ set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "Header files")
+ set(CPACK_COMPONENT_HEADERS_DESCRIPTION
+ "Header files from the component.")
+ set(CPACK_COMPONENT_HEADERS_DEPENDS component)
+endif(INSTALL_HEADERS)
+if(INSTALL_IDL)
+ set(CPACK_COMPONENTS_ALL ${dol}{CPACK_COMPONENTS_ALL} idl)
+ set(CPACK_COMPONENT_IDL_DISPLAY_NAME "IDL files")
+ set(CPACK_COMPONENT_IDL_DESCRIPTION
+ "IDL files for the component's services.")
+ set(CPACK_COMPONENT_IDL_DEPENDS component)
+endif(INSTALL_IDL)
+set(INSTALL_EXAMPLES @BUILD_EXAMPLES@)
+if(INSTALL_EXAMPLES)
+ set(CPACK_COMPONENTS_ALL ${dol}{CPACK_COMPONENTS_ALL} examples)
+ set(CPACK_COMPONENT_EXAMPLES_DISPLAY_NAME "Examples")
+ set(CPACK_COMPONENT_EXAMPLES_DESCRIPTION
+ "Sample configuration files and other component resources.")
+ set(CPACK_COMPONENT_EXAMPLES_DEPENDS component)
+endif(INSTALL_EXAMPLES)
+set(INSTALL_DOCUMENTATION @BUILD_DOCUMENTATION@)
+if(INSTALL_DOCUMENTATION)
+ set(CPACK_COMPONENTS_ALL ${dol}{CPACK_COMPONENTS_ALL} documentation)
+ set(CPACK_COMPONENT_DOCUMENTATION_DISPLAY_NAME "Documentation")
+ set(CPACK_COMPONENT_DOCUMENTATION_DESCRIPTION
+ "Component documentation")
+ set(CPACK_COMPONENT_DOCUMENTATION_DEPENDS component)
+endif(INSTALL_DOCUMENTATION)
+if(INSTALL_SOURCES)
+ set(CPACK_COMPONENTS_ALL ${dol}{CPACK_COMPONENTS_ALL} sources)
+ set(CPACK_COMPONENT_SOURCES_DISPLAY_NAME "Source files")
+ set(CPACK_COMPONENT_SOURCES_DESCRIPTION
+ "Source files from the component.")
+endif(INSTALL_SOURCES)
+
+IF (WIN32)
+ set(CPACK_GENERATOR "WIX")
+ set(CPACK_RESOURCE_FILE_LICENSE
+ "@CMAKE_CURRENT_SOURCE_DIR@/cmake/License.rtf")
+ set(CPACK_PACKAGE_FILE_NAME
+ "@PROJECT_NAME@@PROJECT_SHORT_VER at _rtm@RTM_SHORT_VER at _${dol}{CPACK_SYSTEM_NAME}")
+ set(CPACK_PACKAGE_NAME ${dol}{CPACK_PACKAGE_FILE_NAME})
+ set(CPACK_UNINSTALL_NAME @PROJECT_NAME@)
+ set(CPACK_PACKAGE_INSTALL_DIRECTORY "@OPENRTM_SHARE_PREFIX@")
+
+ ${sharp} Windows WiX package settings
+ if(${dol}{CPACK_GENERATOR} MATCHES "WIX")
+ set(CPACK_WIX_CULTURES "ja-jp")
+ set(CPACK_WIX_UPGRADE_GUID @UPGRADE_GUID@)
+ set(CPACK_WIX_PRODUCT_ICON "@PROJECT_SOURCE_DIR@/cmake\\rt_middleware_logo.ico")
+ set(CPACK_WIX_UI_BANNER "@PROJECT_SOURCE_DIR@/cmake/rt_middleware_banner.bmp")
+ set(CPACK_WIX_UI_DIALOG "@PROJECT_SOURCE_DIR@/cmake/rt_middleware_dlg.bmp")
+ set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "http://www.openrtm.org")
+#if(${rtcParam.servicePorts.size()}>0)
+ set(CPACK_WIX_PATCH_FILE "@WIX_PATCH_FILE@")
+#end
+ endif()
+
+ELSE(WIN32)
+ set(CPACK_GENERATOR @LINUX_PACKAGE_GENERATOR@)
+ set(CPACK_PACKAGE_CONTACT @PROJECT_MAINTAINER@)
+ENDIF (WIN32)
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/postinst.in.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/postinst.in.vsl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/postinst.in.vsl 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,5 @@
+${sharp}!/bin/sh
+${sharp} postinst script
+set -e
+cd /usr/@INSTALL_PREFIX@
+sh idlcompile.sh
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/prerm.in.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/prerm.in.vsl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/prerm.in.vsl 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,4 @@
+${sharp}!/bin/sh
+${sharp} prerm script
+sudo rm -rf /usr/@INSTALL_PREFIX@
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/wix_patch.xml.in.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/wix_patch.xml.in.vsl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/cmake/wix_patch.xml.in.vsl 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,24 @@
+<CPackWiXPatch>
+ <CPackWiXFragment Id="${sharp}PRODUCT">
+ <CustomAction Id="PostinstAction"
+ ExeCommand="idlcompile.bat"
+ Execute="deferred" Impersonate="no"
+ FileKey="CM_FP_component. at PROJECT_NAME@.idlcompile.bat"/>
+ <CustomAction Id="PrermAction"
+ ExeCommand="delete.bat"
+ Execute="deferred" Impersonate="no"
+ FileKey="CM_FP_component. at PROJECT_NAME@.delete.bat"/>
+ <InstallExecuteSequence>
+ <Custom Action="PostinstAction"
+ Before="InstallFinalize">
+ NOT Installed
+ </Custom>
+ </InstallExecuteSequence>
+ <InstallExecuteSequence>
+ <Custom Action="PrermAction"
+ Before="RemoveFiles">
+ Installed
+ </Custom>
+ </InstallExecuteSequence>
+ </CPackWiXFragment>
+</CPackWiXPatch>
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/Lua_RTC.lua.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/Lua_RTC.lua.vsl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/Lua_RTC.lua.vsl 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,563 @@
+---------------------------------
+--! @file ${rtcParam.name}.lua
+--! @brief ${rtcParam.description}
+#set( $Date$ = "dummy" )
+--! @date \$Date$
+#if( ${rtcParam.docCreator.length()} > 0 )
+--! @author ${tmpltHelperLua.convertAuthorDocLua(${rtcParam.docCreator})}
+#end
+#if( ${rtcParam.docLicense.length()} > 0 )
+--! ${tmpltHelperLua.convertDocLua(${rtcParam.docLicense})}
+#end
+---------------------------------
+
+
+
+-- Import RTM module
+local openrtm = require "openrtm"
+
+
+
+-- Import Service implementation class
+-- <rtc-template block="service_impl">
+#foreach($providerIdlFile in ${rtcParam.providerIdlPathes})
+local ${tmpltHelper.getFilenameNoExt(${providerIdlFile.idlFile})}_idl_example = require "${tmpltHelper.getFilenameNoExt(${providerIdlFile.idlFile})}_idl_example"
+#end
+
+
+
+
+
+
+
+-- </rtc-template>
+
+
+-- This module's spesification
+-- <rtc-template block="module_spec">
+-- This module's spesification
+-- <rtc-template block="module_spec">
+local ${luaConv.convToLower(${rtcParam.name})}_spec = {["implementation_id"]="${rtcParam.name}",
+ ["type_name"]="${rtcParam.name}",
+ ["description"]="${rtcParam.description}",
+ ["version"]="${rtcParam.version}",
+ ["vendor"]="${rtcParam.vender}",
+ ["category"]="${rtcParam.category}",
+ ["activity_type"]="${rtcParam.componentType}",
+ ["max_instance"]="${rtcParam.maxInstance}",
+ ["language"]="Lua",
+ ["lang_type"]="SCRIPT",
+#foreach($configParam in ${rtcParam.configParams})
+ ["conf.default.${configParam.name}"]="${configParam.defaultVal}",
+#end
+#if( ${rtcParam.configParams.size()} > 0 )
+#foreach($configParam in ${rtcParam.configParams})
+#if( ${configParam.widget.length()} > 0 )
+ ["conf.__widget__.${configParam.name}"]="${configParam.widget}#if( ${configParam.step.length()} > 0 ).${configParam.step}#end",
+#end
+#end
+#foreach($configParam in ${rtcParam.configParams})
+#if( ${configParam.constraint.length()} > 0 )
+ ["conf.__constraints__.${configParam.name}"]="${configParam.constraint}",
+#end
+#end
+#foreach($configParam in ${rtcParam.configParams})
+ ["conf.__type__.${configParam.name}"]="${configParam.type}",
+#end
+#end
+#if( ${rtcParam.configParameterParams.size()} > 0 )
+#foreach($parameterParam in ${rtcParam.configParameterParams})
+#if( ${parameterParam.isNonPeriodic()} )
+ ["${parameterParam.configName}"]="${parameterParam.defaultVal}",
+#end
+#end
+#end
+ ""}
+-- </rtc-template>
+
+
+-- @class ${rtcParam.name}
+-- @brief ${rtcParam.description}
+#if( ${rtcParam.docDescription.length()} > 0 )
+--
+-- ${tmpltHelperLua.convertModuleDocLua(${rtcParam.docDescription})}
+#end
+#if( ${rtcParam.docInOut.length()} > 0 )
+--
+-- ${tmpltHelperLua.convertModuleDocLua(${rtcParam.docInOut})}
+#end
+#if( ${rtcParam.docAlgorithm.length()} > 0 )
+--
+-- ${tmpltHelperLua.convertModuleDocLua(${rtcParam.docAlgorithm})}
+#end
+#if( ${rtcParam.docReference.length()} > 0 )
+--
+-- ${tmpltHelperLua.convertModuleDocLua(${rtcParam.docReference})}
+#end
+local ${rtcParam.name} = {}
+${rtcParam.name}.new = function(manager)
+ local obj = {}
+ setmetatable(obj, {__index=openrtm.RTObject.new(manager)})
+
+#foreach($IdlFile in ${allIdlFileParam})
+#if(${IdlFile.dataPort})
+ manager:loadIdLFile("idl/${tmpltHelper.getFileName(${IdlFile.IdlFile})}")
+#end
+#end
+
+#foreach($port in ${rtcParam.outports})
+ obj._d_${port.tmplVarName} = openrtm.RTCUtil.instantiateDataType("${luaConv.getDataportInitMethodName(${port.type})}")
+ --[[
+#if(${port.docDescription.length()}>0) ${tmpltHelperLua.convertDescDocLua(${port.docDescription})}
+#end
+#if(${port.docType.length()}>0) - Type: ${tmpltHelperLua.convertTypeDocLua(${port.docType})}
+#end
+#if(${port.docNum.length()}>0) - Number: ${tmpltHelperLua.convertNumberDocLua(${port.docNum})}
+#end
+#if(${port.docSemantics.length()}>0) - Semantics: ${tmpltHelperLua.convertSemanticsDocLua(${port.docSemantics})}
+#end
+#if(${port.docUnit.length()}>0) - Unit: ${tmpltHelperLua.convertTypeDocLua(${port.docUnit})}
+#end
+#if(${port.docOccurrence.length()}>0) - Frequency: ${tmpltHelperLua.convertFrequencyDocLua(${port.docOccurrence})}
+#end
+#if(${port.docOperation.length()}>0) - Operation Cycle: ${tmpltHelperLua.convertCycleDocLua(${port.docOperation})}
+#end
+ --]]
+ obj._${port.name}Out = openrtm.OutPort.new("${port.name}", obj._d_${port.tmplVarName}, "${luaConv.getDataportInitMethodName(${port.type})}")
+#end
+#foreach($port in ${rtcParam.inports})
+ obj._d_${port.tmplVarName} = openrtm.RTCUtil.instantiateDataType("${luaConv.getDataportInitMethodName(${port.type})}")
+ --[[
+#if(${port.docDescription.length()}>0) ${tmpltHelperLua.convertDescDocLua(${port.docDescription})}
+#end
+#if(${port.docType.length()}>0) - Type: ${tmpltHelperLua.convertTypeDocLua(${port.docType})}
+#end
+#if(${port.docNum.length()}>0) - Number: ${tmpltHelperLua.convertNumberDocLua(${port.docNum})}
+#end
+#if(${port.docSemantics.length()}>0) - Semantics: ${tmpltHelperLua.convertSemanticsDocLua(${port.docSemantics})}
+#end
+#if(${port.docUnit.length()}>0) - Unit: ${tmpltHelperLua.convertTypeDocLua(${port.docUnit})}
+#end
+#if(${port.docOccurrence.length()}>0) - Frequency: ${tmpltHelperLua.convertFrequencyDocLua(${port.docOccurrence})}
+#end
+#if(${port.docOperation.length()}>0) - Operation Cycle: ${tmpltHelperLua.convertCycleDocLua(${port.docOperation})}
+#end
+ --]]
+ obj._${port.name}In = openrtm.InPort.new("${port.name}", obj._d_${port.tmplVarName}, "${luaConv.getDataportInitMethodName(${port.type})}")
+#end
+
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+ --[[
+#if(${servicePort.docDescription.length()}>0) ${tmpltHelperLua.convertDescDocLua(${servicePort.docDescription})}
+#end
+#if(${servicePort.docIfDescription.length()}>0) Interface: ${tmpltHelperLua.convertInterfaceLua(${servicePort.docIfDescription})}
+#end
+ --]]
+ obj._${servicePort.name}Port = openrtm.CorbaPort.new("${servicePort.name}")
+#end#end#end
+
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+#foreach($serviceInterface in ${servicePort.servicePortInterfaces})
+#if(${serviceInterface.index}==0)
+ --[[
+#if(${serviceInterface.docDescription.length()}>0) ${tmpltHelperLua.convertDescDocLua(${serviceInterface.docDescription})}
+#end
+#if(${serviceInterface.docArgument.length()}>0) - Argument: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docArgument})}
+#end
+#if(${serviceInterface.docReturn.length()}>0) - Return Value: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docReturn})}
+#end
+#if(${serviceInterface.docException.length()}>0) - Exception: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docException})}
+#end
+#if(${serviceInterface.docPreCondition.length()}>0) - PreCondition: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docPreCondition})}
+#end
+#if(${serviceInterface.docPostCondition.length()}>0) - PostCondition: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docPostCondition})}
+#end
+ --]]
+ obj._${serviceInterface.tmplVarName} = ${tmpltHelper.getFilenameNoExt(${serviceInterface.IdlFile})}_idl_example.${tmpltHelper.getBasename(${serviceInterface.interfaceType})}_i.new()
+#end#end#end#end#end
+
+
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+#foreach($serviceInterface in ${servicePort.servicePortInterfaces})
+#if(${serviceInterface.index}==1)
+ --[[
+#if(${serviceInterface.docDescription.length()}>0) ${tmpltHelperLua.convertDescDocLua(${serviceInterface.docDescription})}
+#end
+#if(${serviceInterface.docArgument.length()}>0) - Argument: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docArgument})}
+#end
+#if(${serviceInterface.docReturn.length()}>0) - Return Value: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docReturn})}
+#end
+#if(${serviceInterface.docException.length()}>0) - Exception: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docException})}
+#end
+#if(${serviceInterface.docPreCondition.length()}>0) - PreCondition: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docPreCondition})}
+#end
+#if(${serviceInterface.docPostCondition.length()}>0) - PostCondition: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docPostCondition})}
+#end
+ --]]
+ obj._${serviceInterface.tmplVarName} = openrtm.CorbaConsumer.new("${tmpltHelperLua.convertServiceInterfaceName(${serviceInterface.interfaceType})}")
+#end#end#end#end#end
+
+ -- initialize of configuration-data.
+ -- <rtc-template block="init_conf_param">
+#foreach($configParam in ${rtcParam.configParams})
+ --[[
+ ${tmpltHelperLua.convertDescDocLua(${configParam.docDescription})}
+ - Name: ${configParam.docDataName} ${configParam.tmplVarName}
+ - DefaultValue: ${configParam.defaultVal}
+#if(${configParam.docUnit.length()}>0) - Unit: ${tmpltHelperLua.convertUnitDocLua(${configParam.docUnit})}
+#end
+#if(${configParam.docRange.length()}>0) - Range: ${tmpltHelperLua.convertRangeDocLua(${configParam.docRange})}
+#end
+#if(${configParam.docConstraint.length()}>0) - Constraint: ${tmpltHelperLua.convertConstraintDocLua(${configParam.docConstraint})}
+#end
+ --]]
+ obj._${configParam.tmplVarName} = {_value=${luaConv.convDefaultVal(${configParam})}}
+#end
+
+ -- </rtc-template>
+#if(${rtcParam.getDocActionOverView(0).length()}>0) -- ${tmpltHelperLua.convertDescDocLua(${rtcParam.getDocActionOverView(0)})}
+#end
+ --
+ -- The initialize action (on CREATED->ALIVE transition)
+ -- formaer rtc_init_entry()
+ --
+ -- @return RTC::ReturnCode_t
+ --
+#if(${rtcParam.getDocActionPreCondition(0).length()}>0) -- @pre ${tmpltHelperLua.convertPreDocLua(${rtcParam.getDocActionPreCondition(0)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(0).length()}>0) -- @post ${tmpltHelperLua.convertPostDocLua(${rtcParam.getDocActionPostCondition(0)})}
+#end
+ --
+ function obj:onInitialize()
+ -- Bind variables and configuration variable
+#foreach($configParam in ${rtcParam.configParams})
+ self:bindParameter("${configParam.name}", self._${configParam.tmplVarName}, "${configParam.defaultVal}")
+#end
+
+ -- Set OutPort buffers
+#foreach($port in ${rtcParam.outports})
+ self:addOutPort("${port.name}",self._${port.name}Out)
+#end
+
+ -- Set InPort buffers
+#foreach($port in ${rtcParam.inports})
+ self:addInPort("${port.name}",self._${port.name}In)
+#end
+
+ -- Set service provider to Ports
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+#foreach($serviceInterface in ${servicePort.servicePortInterfaces})
+#if(${serviceInterface.index}==0)
+ self._${servicePort.name}Port:registerProvider("${serviceInterface.name}", "${serviceInterface.interfaceType}", self._${serviceInterface.tmplVarName}, "idl/${tmpltHelper.getFileName(${serviceInterface.IdlFile})}", "${tmpltHelperLua.convertServiceInterfaceName(${serviceInterface.interfaceType})}")
+#end#end#end#end#end
+
+ -- Set service consumers to Ports
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+#foreach($serviceInterface in ${servicePort.servicePortInterfaces})
+#if(${serviceInterface.index}==1)
+ self._${servicePort.name}Port:registerConsumer("${serviceInterface.name}", "${serviceInterface.interfaceType}", self._${serviceInterface.tmplVarName}, "idl/${tmpltHelper.getFileName(${serviceInterface.IdlFile})}")
+#end#end#end#end#end
+
+ -- Set CORBA Service Ports
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+ self:addPort(self._${servicePort.name}Port)
+#end#end#end
+#if(${tmpltHelper.checkDetailContent(0,${rtcParam})}) ${rtcParam.getDetailContent(0)}
+#end
+
+ return self._ReturnCode_t.RTC_OK
+ end
+
+#if(${rtcParam.getDocActionOverView(1).length()}>0) #if(${rtcParam.IsNotImplemented(1)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(1)})}
+#end
+ #if(${rtcParam.IsNotImplemented(1)})-- #end--
+ #if(${rtcParam.IsNotImplemented(1)})-- #end-- The finalize action (on ALIVE->END transition)
+ #if(${rtcParam.IsNotImplemented(1)})-- #end-- formaer rtc_exiting_entry()
+ #if(${rtcParam.IsNotImplemented(1)})-- #end--
+ #if(${rtcParam.IsNotImplemented(1)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(1)})--#end
+
+#if(${rtcParam.getDocActionPreCondition(1).length()}>0) #if(${rtcParam.IsNotImplemented(1)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(1)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(1).length()}>0) #if(${rtcParam.IsNotImplemented(1)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(1)})}
+#end
+ #if(${rtcParam.IsNotImplemented(1)})--#end --
+ #if(${rtcParam.IsNotImplemented(1)})--#end funtion obj:onFinalize()
+ #if(${rtcParam.IsNotImplemented(1)})--#end
+#if(${tmpltHelper.checkDetailContent(1,${rtcParam})}) ${rtcParam.getDetailContent(1)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(1)})--#end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(1)})--#end end
+
+#if(${rtcParam.getDocActionOverView(2).length()}>0) #if(${rtcParam.IsNotImplemented(2)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(2)})}
+#end
+ #if(${rtcParam.IsNotImplemented(2)})-- #end--
+ #if(${rtcParam.IsNotImplemented(2)})-- #end-- The startup action when ExecutionContext startup
+ #if(${rtcParam.IsNotImplemented(2)})-- #end-- former rtc_starting_entry()
+ #if(${rtcParam.IsNotImplemented(2)})-- #end--
+ #if(${rtcParam.IsNotImplemented(2)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(2)})-- #end--
+ #if(${rtcParam.IsNotImplemented(2)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(2)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(2).length()}>0) #if(${rtcParam.IsNotImplemented(2)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(2)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(2).length()}>0) #if(${rtcParam.IsNotImplemented(2)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(2)})}
+#end
+ #if(${rtcParam.IsNotImplemented(2)})-- #end--
+ #if(${rtcParam.IsNotImplemented(2)})-- #end function obj:onStartup(ec_id)
+ #if(${rtcParam.IsNotImplemented(2)})-- #end
+#if(${tmpltHelper.checkDetailContent(2,${rtcParam})}) ${rtcParam.getDetailContent(2)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(2)})-- #end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(2)})-- #end end
+
+#if(${rtcParam.getDocActionOverView(3).length()}>0) #if(${rtcParam.IsNotImplemented(3)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(3)})}
+#end
+ #if(${rtcParam.IsNotImplemented(3)})-- #end--
+ #if(${rtcParam.IsNotImplemented(3)})-- #end-- The shutdown action when ExecutionContext stop
+ #if(${rtcParam.IsNotImplemented(3)})-- #end-- former rtc_stopping_entry()
+ #if(${rtcParam.IsNotImplemented(3)})-- #end--
+ #if(${rtcParam.IsNotImplemented(3)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(3)})-- #end--
+ #if(${rtcParam.IsNotImplemented(3)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(3)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(3).length()}>0) #if(${rtcParam.IsNotImplemented(3)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(3)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(3).length()}>0) #if(${rtcParam.IsNotImplemented(3)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(3)})}
+#end
+ #if(${rtcParam.IsNotImplemented(3)})-- #end--
+ #if(${rtcParam.IsNotImplemented(3)})-- #end function obj:onShutdown(ec_id)
+ #if(${rtcParam.IsNotImplemented(3)})-- #end
+#if(${tmpltHelper.checkDetailContent(3,${rtcParam})}) ${rtcParam.getDetailContent(3)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(3)})-- #end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(3)})-- #end end
+
+#if(${rtcParam.getDocActionOverView(4).length()}>0) #if(${rtcParam.IsNotImplemented(4)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(4)})}
+#end
+ #if(${rtcParam.IsNotImplemented(4)})-- #end--
+ #if(${rtcParam.IsNotImplemented(4)})-- #end-- The activated action (Active state entry action)
+ #if(${rtcParam.IsNotImplemented(4)})-- #end-- former rtc_active_entry()
+ #if(${rtcParam.IsNotImplemented(4)})-- #end--
+ #if(${rtcParam.IsNotImplemented(4)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(4)})-- #end--
+ #if(${rtcParam.IsNotImplemented(4)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(4)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(4).length()}>0) #if(${rtcParam.IsNotImplemented(4)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(4)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(4).length()}>0) #if(${rtcParam.IsNotImplemented(4)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(4)})}
+#end
+ #if(${rtcParam.IsNotImplemented(4)})--#end--
+ #if(${rtcParam.IsNotImplemented(4)})--#end function obj:onActivated(ec_id)
+ #if(${rtcParam.IsNotImplemented(4)})--#end
+#if(${tmpltHelper.checkDetailContent(4,${rtcParam})}) ${rtcParam.getDetailContent(4)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(4)})--#end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(4)})--#end end
+
+#if(${rtcParam.getDocActionOverView(5).length()}>0) #if(${rtcParam.IsNotImplemented(5)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(5)})}
+#end
+ #if(${rtcParam.IsNotImplemented(5)})-- #end--
+ #if(${rtcParam.IsNotImplemented(5)})-- #end-- The deactivated action (Active state exit action)
+ #if(${rtcParam.IsNotImplemented(5)})-- #end-- former rtc_active_exit()
+ #if(${rtcParam.IsNotImplemented(5)})-- #end--
+ #if(${rtcParam.IsNotImplemented(5)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(5)})-- #end--
+ #if(${rtcParam.IsNotImplemented(5)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(5)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(5).length()}>0) #if(${rtcParam.IsNotImplemented(5)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(5)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(5).length()}>0) #if(${rtcParam.IsNotImplemented(5)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(5)})}
+#end
+ #if(${rtcParam.IsNotImplemented(5)})-- #end--
+ #if(${rtcParam.IsNotImplemented(5)})-- #end function obj:onDeactivated(ec_id)
+ #if(${rtcParam.IsNotImplemented(5)})-- #end
+#if(${tmpltHelper.checkDetailContent(5,${rtcParam})}) ${rtcParam.getDetailContent(5)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(5)})-- #end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(5)})-- #end end
+
+#if(${rtcParam.getDocActionOverView(9).length()}>0) #if(${rtcParam.IsNotImplemented(9)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(9)})}
+#end
+ #if(${rtcParam.IsNotImplemented(9)})-- #end--
+ #if(${rtcParam.IsNotImplemented(9)})-- #end-- The execution action that is invoked periodically
+ #if(${rtcParam.IsNotImplemented(9)})-- #end-- former rtc_active_do()
+ #if(${rtcParam.IsNotImplemented(9)})-- #end--
+ #if(${rtcParam.IsNotImplemented(9)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(9)})-- #end--
+ #if(${rtcParam.IsNotImplemented(9)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(9)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(9).length()}>0) #if(${rtcParam.IsNotImplemented(9)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(9)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(9).length()}>0) #if(${rtcParam.IsNotImplemented(9)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(9)})}
+#end
+ #if(${rtcParam.IsNotImplemented(9)})-- #end--
+ #if(${rtcParam.IsNotImplemented(9)})-- #end function obj:onExecute(ec_id)
+ #if(${rtcParam.IsNotImplemented(9)})-- #end
+#if(${tmpltHelper.checkDetailContent(9,${rtcParam})}) ${rtcParam.getDetailContent(9)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(9)})--#end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(9)})--#end end
+
+#if(${rtcParam.getDocActionOverView(6).length()}>0) #if(${rtcParam.IsNotImplemented(6)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(6)})}
+#end
+ #if(${rtcParam.IsNotImplemented(6)})-- #end--
+ #if(${rtcParam.IsNotImplemented(6)})-- #end-- The aborting action when main logic error occurred.
+ #if(${rtcParam.IsNotImplemented(6)})-- #end-- former rtc_aborting_entry()
+ #if(${rtcParam.IsNotImplemented(6)})-- #end--
+ #if(${rtcParam.IsNotImplemented(6)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(6)})-- #end--
+ #if(${rtcParam.IsNotImplemented(6)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(6)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(6).length()}>0) #if(${rtcParam.IsNotImplemented(6)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(6)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(6).length()}>0) #if(${rtcParam.IsNotImplemented(6)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(6)})}
+#end
+ #if(${rtcParam.IsNotImplemented(6)})-- #end--
+ #if(${rtcParam.IsNotImplemented(6)})-- #end function obj:onAborting(ec_id)
+ #if(${rtcParam.IsNotImplemented(6)})-- #end
+#if(${tmpltHelper.checkDetailContent(6,${rtcParam})}) ${rtcParam.getDetailContent(6)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(6)})--#end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(6)})--#end end
+
+#if(${rtcParam.getDocActionOverView(7).length()}>0) #if(${rtcParam.IsNotImplemented(7)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(7)})}
+#end
+ #if(${rtcParam.IsNotImplemented(7)})-- #end--
+ #if(${rtcParam.IsNotImplemented(7)})-- #end-- The error action in ERROR state
+ #if(${rtcParam.IsNotImplemented(7)})-- #end-- former rtc_error_do()
+ #if(${rtcParam.IsNotImplemented(7)})-- #end--
+ #if(${rtcParam.IsNotImplemented(7)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(7)})-- #end--
+ #if(${rtcParam.IsNotImplemented(7)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(7)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(7).length()}>0) #if(${rtcParam.IsNotImplemented(7)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(7)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(7).length()}>0) #if(${rtcParam.IsNotImplemented(7)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(7)})}
+#end
+ #if(${rtcParam.IsNotImplemented(7)})-- #end--
+ #if(${rtcParam.IsNotImplemented(7)})-- #end function obj:onError(ec_id)
+ #if(${rtcParam.IsNotImplemented(7)})-- #end
+#if(${tmpltHelper.checkDetailContent(7,${rtcParam})}) ${rtcParam.getDetailContent(7)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(7)})-- #end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(7)})-- #end end
+
+#if(${rtcParam.getDocActionOverView(8).length()}>0) #if(${rtcParam.IsNotImplemented(8)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(8)})}
+#end
+ #if(${rtcParam.IsNotImplemented(8)})-- #end--
+ #if(${rtcParam.IsNotImplemented(8)})-- #end-- The reset action that is invoked resetting
+ #if(${rtcParam.IsNotImplemented(8)})-- #end-- This is same but different the former rtc_init_entry()
+ #if(${rtcParam.IsNotImplemented(8)})-- #end--
+ #if(${rtcParam.IsNotImplemented(8)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(8)})-- #end--
+ #if(${rtcParam.IsNotImplemented(8)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(8)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(8).length()}>0) #if(${rtcParam.IsNotImplemented(8)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(8)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(8).length()}>0) #if(${rtcParam.IsNotImplemented(8)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(8)})}
+#end
+ #if(${rtcParam.IsNotImplemented(8)})-- #end--
+ #if(${rtcParam.IsNotImplemented(8)})-- #end function obj:onReset(ec_id)
+ #if(${rtcParam.IsNotImplemented(8)})-- #end
+#if(${tmpltHelper.checkDetailContent(8,${rtcParam})}) ${rtcParam.getDetailContent(8)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(8)})-- #end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(8)})-- #end end
+
+#if(${rtcParam.getDocActionOverView(10).length()}>0) #if(${rtcParam.IsNotImplemented(10)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(10)})}
+#end
+ #if(${rtcParam.IsNotImplemented(10)})-- #end--
+ #if(${rtcParam.IsNotImplemented(10)})-- #end-- The state update action that is invoked after onExecute() action
+ #if(${rtcParam.IsNotImplemented(10)})-- #end-- no corresponding operation exists in OpenRTm-aist-0.2.0
+ #if(${rtcParam.IsNotImplemented(10)})-- #end--
+ #if(${rtcParam.IsNotImplemented(10)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(10)})-- #end--
+ #if(${rtcParam.IsNotImplemented(10)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(10)})-- #end--
+
+#if(${rtcParam.getDocActionPreCondition(10).length()}>0) #if(${rtcParam.IsNotImplemented(10)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(10)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(10).length()}>0) #if(${rtcParam.IsNotImplemented(10)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(10)})}
+#end
+ #if(${rtcParam.IsNotImplemented(10)})-- #end--
+ #if(${rtcParam.IsNotImplemented(10)})-- #end function obj:onStateUpdate(ec_id)
+ #if(${rtcParam.IsNotImplemented(10)})-- #end
+#if(${tmpltHelper.checkDetailContent(10,${rtcParam})}) ${rtcParam.getDetailContent(10)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(10)})-- #end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(10)})-- #end end
+
+#if(${rtcParam.getDocActionOverView(11).length()}>0) #if(${rtcParam.IsNotImplemented(11)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(11)})}
+#end
+ #if(${rtcParam.IsNotImplemented(11)})-- #end--
+ #if(${rtcParam.IsNotImplemented(11)})-- #end-- The action that is invoked when execution context's rate is changed
+ #if(${rtcParam.IsNotImplemented(11)})-- #end-- no corresponding operation exists in OpenRTm-aist-0.2.0
+ #if(${rtcParam.IsNotImplemented(11)})-- #end--
+ #if(${rtcParam.IsNotImplemented(11)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(11)})-- #end--
+ #if(${rtcParam.IsNotImplemented(11)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(11)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(11).length()}>0) #if(${rtcParam.IsNotImplemented(11)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(11)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(11).length()}>0) #if(${rtcParam.IsNotImplemented(11)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(11)})}
+#end
+ #if(${rtcParam.IsNotImplemented(11)})-- #end--
+ #if(${rtcParam.IsNotImplemented(11)})-- #end function obj:onRateChanged(ec_id)
+ #if(${rtcParam.IsNotImplemented(11)})-- #end
+#if(${tmpltHelper.checkDetailContent(11,${rtcParam})}) ${rtcParam.getDetailContent(11)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(11)})-- #end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(11)})-- #end end
+ return obj
+end
+
+
+
+${rtcParam.name}.Init = function(manager)
+ local profile = openrtm.Properties.new{defaults_map=${luaConv.convToLower(${rtcParam.name})}_spec}
+ manager:registerFactory(profile,
+ ${rtcParam.name}.new,
+ openrtm.Factory.Delete)
+end
+
+local MyModuleInit = function(manager)
+ ${rtcParam.name}.Init(manager)
+
+ -- Create a component
+ local comp = manager:createComponent("${rtcParam.name}")
+end
+
+if openrtm.Manager.is_main() then
+ local manager = openrtm.Manager
+ manager:init(arg)
+ manager:setModuleInitProc(MyModuleInit)
+ manager:activateManager()
+ manager:runManager()
+else
+ return ${rtcParam.name}
+end
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/Lua_SVC_idl_example.lua.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/Lua_SVC_idl_example.lua.vsl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/Lua_SVC_idl_example.lua.vsl 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,80 @@
+local openrtm = require "openrtm"
+
+
+--[[
+ @file ${idlFileParam.idlFileNoExt}_idl_examplefile.py
+ @brief Lua example implementations generated from ${idlFileParam.idlFile}
+#set( $Date$ = "dummy" )
+ @date \$Date$
+
+#if( ${rtcParam.docCreator.length()} > 0 )
+ @author ${tmpltHelperLua.convertAuthorDocLua(${rtcParam.docCreator})}
+#end
+#if( ${rtcParam.docLicense.length()} > 0 )
+
+ ${tmpltHelperLua.convertDocLua(${rtcParam.docLicense})}
+#end
+
+--]]
+
+
+local ${idlFileParam.idlFileNoExt}_idl_example = {}
+
+
+#foreach($serviceClassParam in ${idlFileParam.serviceClassParams})
+
+${idlFileParam.idlFileNoExt}_idl_example.${tmpltHelper.getBasename(${serviceClassParam.name})}_i = {}
+${idlFileParam.idlFileNoExt}_idl_example.${tmpltHelper.getBasename(${serviceClassParam.name})}_i.new = function()
+ --[[
+ @class ${tmpltHelper.getBasename(${serviceClassParam.name})}_i
+ Example class implementing IDL interface ${tmpltHelper.convFormat(${serviceClassParam.name})}
+ --]]
+ local obj = {}
+
+ --[[
+ @brief standard constructor
+ Initialise member variables here
+ --]]
+
+#foreach($serviceMethodParam in ${serviceClassParam.methods})
+ -- ${luaConv.convCORBA2LuaArg(${serviceMethodParam.type})} ${serviceMethodParam.name}(#foreach($serviceArgumentParam in ${serviceMethodParam.arguments})#if($velocityCount > 1), #end${serviceArgumentParam.direction} ${luaConv.convCORBA2LuathonArg(${serviceArgumentParam.type})} ${serviceArgumentParam.name}#end)
+ function obj:${serviceMethodParam.name}(${luaConv.selectInParamName(${serviceMethodParam},${serviceClassParam})})
+ error(openrtm.Manager:getORB():newexcept{"CORBA::NO_IMPLEMENT",
+ minor=0,
+ completed=openrtm.Manager:getORB().types:lookup("::CORBA::CompletionStatus").labelvalue.COMPLETED_NO})
+ -- *** Implement me
+ -- Must return:${luaConv.selectOutParamName(${serviceMethodParam},${serviceClassParam})}
+ end
+
+#end
+ return obj
+end
+
+#end
+if openrtm.Manager.is_main() then
+
+ local oil = require "oil"
+ oil.main(function()
+ -- Initialise the ORB
+ local orb = oil.init{ flavor = "cooperative;corba;intercepted;typed;base;" }
+
+ oil.newthread(self._orb.run, self._orb)
+
+ -- Create an instance of a servant class
+ local obj = ${idlFileParam.idlFileNoExt}_idl_example.${tmpltHelper.getBasename(${idlFileParam.serviceClassParams.get(0).name})}_i.new()
+ local servant = orb:newservant(obj, nil, "${tmpltHelperLua.convertServiceInterfaceName(${idlFileParam.serviceClassParams.get(0).name})}")
+
+
+
+ -- Get the object reference to the object
+ local objref = openrtm.RTCUtil.getReference()
+
+ -- Print a stringified IOR for it
+ print(orb:tostring(servant))
+
+ -- Run the ORB, blocking this thread
+ orb:run()
+ end)
+end
+
+return ${idlFileParam.idlFileNoExt}_idl_example
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/_doc.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/_doc.vsl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/_doc.vsl 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,9 @@
+
+#if( ${rtcParam.docCreator.length()} > 0 )
+ \author ${tmpltHelper.convertAuthorDocLua(${rtcParam.docCreator})}
+#end
+#if( ${rtcParam.docLicense.length()} > 0 )
+
+ ${tmpltHelper.convertDocLua(${rtcParam.docLicense})}
+#end
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/delete.bat.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/delete.bat.vsl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/delete.bat.vsl 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,8 @@
+echo off
+cd /d %~dp0
+for /d %%i in (*) do (
+ rmdir /s/q %%i
+)
+for %%i in (*.py*) do (
+ del /s/q %%i
+)
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/idlcompile.bat.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/idlcompile.bat.vsl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/idlcompile.bat.vsl 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,12 @@
+ at echo off
+cd /d %~dp0
+setlocal
+for %%I in (python.exe) do if exist %%~$path:I set f=%%~$path:I
+if exist %f% (
+ %f:python.exe=%omniidl.exe -bpython -I"%RTM_ROOT%rtm\idl" #foreach($IdlPath in ${idlPathes})-I"${IdlPath}" #end#foreach($IdlFile in ${allIdlFileParamBuild})idl/${IdlFile.IdlFile} #end
+
+) else (
+ echo "python.exe" can not be found.
+ echo Please modify PATH environmental variable for python command.
+)
+endlocal
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/idlcompile.sh.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/idlcompile.sh.vsl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/idlcompile.sh.vsl 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,2 @@
+#!/bin/sh
+omniidl -bpython -I"%RTM_ROOT%rtm\idl" #foreach($IdlPath in ${idlPathes})-I"${IdlPath}" #end#foreach($IdlFile in ${allIdlFileParamBuild})idl/${IdlFile.IdlFile} #end
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/test/Lua_Test_RTC.lua.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/test/Lua_Test_RTC.lua.vsl (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/template/lua/test/Lua_Test_RTC.lua.vsl 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,548 @@
+---------------------------------
+--! @file ${rtcParam.name}Test.py
+--! @brief ${rtcParam.description}
+#set( $Date$ = "dummy" )
+--! @date \$Date$
+
+#if( ${rtcParam.docCreator.length()} > 0 )
+--! @author ${tmpltHelperPy.convertAuthorDocPy(${rtcParam.docCreator})}
+#end
+#if( ${rtcParam.docLicense.length()} > 0 )
+
+--! ${tmpltHelperPy.convertDocPy(${rtcParam.docLicense})}
+#end
+---------------------------------
+
+local openrtm = require "openrtm"
+
+
+
+-- Import Service implementation class
+-- <rtc-template block="service_impl">
+#foreach($consumerIdlFile in ${rtcParam.consumerIdlPathes})
+local ${tmpltHelper.getFilenameNoExt(${consumerIdlFile.idlFile})}_idl_example = require "${tmpltHelper.getFilenameNoExt(${consumerIdlFile.idlFile})}_idl_example"
+#end
+
+
+-- </rtc-template>
+
+
+-- This module's spesification
+-- <rtc-template block="module_spec">
+local ${luaConv.convToLower(${rtcParam.name})}test_spec = {["implementation_id"]="${rtcParam.name}Test",
+ ["type_name"[="${rtcParam.name}Test",
+ ["description"]="${rtcParam.description}",
+ ["version"]="${rtcParam.version}",
+ ["vendor"]="${rtcParam.vender}",
+ ["category"]="${rtcParam.category}",
+ ["activity_type"]="${rtcParam.componentType}",
+ ["max_instance"]="${rtcParam.maxInstance}",
+ ["language"]="Lua",
+ ["lang_type"]="SCRIPT",
+#foreach($configParam in ${rtcParam.configParams})
+ ["conf.default.${configParam.name}"]="${configParam.defaultVal}",
+#end
+#if( ${rtcParam.configParams.size()} > 0 )
+#foreach($configParam in ${rtcParam.configParams})
+#if( ${configParam.widget.length()} > 0 )
+ ["conf.__widget__.${configParam.name}"]="${configParam.widget}#if( ${configParam.step.length()} > 0 ).${configParam.step}#end",
+#end
+#end
+#foreach($configParam in ${rtcParam.configParams})
+#if( ${configParam.constraint.length()} > 0 )
+ ["conf.__constraints__.${configParam.name}"]="${configParam.constraint}",
+#end
+#end
+#foreach($configParam in ${rtcParam.configParams})
+ ["conf.__type__.${configParam.name}"]="${configParam.type}",
+#end
+#end
+#if( ${rtcParam.configParameterParams.size()} > 0 )
+#foreach($parameterParam in ${rtcParam.configParameterParams})
+#if( ${parameterParam.isNonPeriodic()} )
+ ["${parameterParam.configName}"]="${parameterParam.defaultVal}",
+#end
+#end
+#end
+ ""}
+-- </rtc-template>
+
+-- @class ${rtcParam.name}Test
+-- @brief ${rtcParam.description}
+#if( ${rtcParam.docDescription.length()} > 0 )
+--
+-- ${tmpltHelperLua.convertModuleDocLua(${rtcParam.docDescription})}
+#end
+#if( ${rtcParam.docInOut.length()} > 0 )
+--
+-- ${tmpltHelperLua.convertModuleDocLua(${rtcParam.docInOut})}
+#end
+#if( ${rtcParam.docAlgorithm.length()} > 0 )
+--
+-- ${tmpltHelperLua.convertModuleDocLua(${rtcParam.docAlgorithm})}
+#end
+#if( ${rtcParam.docReference.length()} > 0 )
+--
+-- ${tmpltHelperLua.convertModuleDocLua(${rtcParam.docReference})}
+#end
+local ${rtcParam.name}Test = {}
+${rtcParam.name}Test.new = function(manager)
+ local obj = {}
+ setmetatable(obj, {__index=openrtm.RTObject.new(manager)})
+
+#foreach($IdlFile in ${allIdlFileParam})
+#if(${IdlFile.dataPort})
+ manager:loadIdLFile("idl/${tmpltHelper.getFileName(${IdlFile.IdlFile})}")
+#end
+#end
+
+
+#foreach($port in ${rtcParam.outports})
+ obj._d_${port.tmplVarName} = openrtm.RTCUtil.instantiateDataType("${luaConv.getDataportInitMethodName(${port.type})}")
+ --[[
+#if(${port.docDescription.length()}>0) ${tmpltHelperLua.convertDescDocLua(${port.docDescription})}
+#end
+#if(${port.docType.length()}>0) - Type: ${tmpltHelperLua.convertTypeDocLua(${port.docType})}
+#end
+#if(${port.docNum.length()}>0) - Number: ${tmpltHelperLua.convertNumberDocLua(${port.docNum})}
+#end
+#if(${port.docSemantics.length()}>0) - Semantics: ${tmpltHelperLua.convertSemanticsDocLua(${port.docSemantics})}
+#end
+#if(${port.docUnit.length()}>0) - Unit: ${tmpltHelperLua.convertTypeDocLua(${port.docUnit})}
+#end
+#if(${port.docOccurrence.length()}>0) - Frequency: ${tmpltHelperLua.convertFrequencyDocLua(${port.docOccurrence})}
+#end
+#if(${port.docOperation.length()}>0) - Operation Cycle: ${tmpltHelperLua.convertCycleDocLua(${port.docOperation})}
+#end
+ --]]
+ obj._${port.name}In = openrtm.InPort.new("${port.name}", obj._d_${port.tmplVarName}, "${luaConv.getDataportInitMethodName(${port.type})}")
+#end
+#foreach($port in ${rtcParam.inports})
+ obj._d_${port.tmplVarName} = openrtm.RTCUtil.instantiateDataType("${luaConv.getDataportInitMethodName(${port.type})}")
+ --[[
+#if(${port.docDescription.length()}>0) ${tmpltHelperLua.convertDescDocLua(${port.docDescription})}
+#end
+#if(${port.docType.length()}>0) - Type: ${tmpltHelperLua.convertTypeDocLua(${port.docType})}
+#end
+#if(${port.docNum.length()}>0) - Number: ${tmpltHelperLua.convertNumberDocLua(${port.docNum})}
+#end
+#if(${port.docSemantics.length()}>0) - Semantics: ${tmpltHelperLua.convertSemanticsDocLua(${port.docSemantics})}
+#end
+#if(${port.docUnit.length()}>0) - Unit: ${tmpltHelperLua.convertTypeDocLua(${port.docUnit})}
+#end
+#if(${port.docOccurrence.length()}>0) - Frequency: ${tmpltHelperLua.convertFrequencyDocLua(${port.docOccurrence})}
+#end
+#if(${port.docOperation.length()}>0) - Operation Cycle: ${tmpltHelperLua.convertCycleDocLua(${port.docOperation})}
+#end
+ --]]
+ obj._${port.name}Out = openrtm.OutPort.new("${port.name}", obj._d_${port.tmplVarName}, "${luaConv.getDataportInitMethodName(${port.type})}")
+#end
+
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+ --[[
+#if(${servicePort.docDescription.length()}>0) ${tmpltHelperLua.convertDescDocLua(${servicePort.docDescription})}
+#end
+#if(${servicePort.docIfDescription.length()}>0) Interface: ${tmpltHelperLua.convertInterfaceLua(${servicePort.docIfDescription})}
+#end
+ --]]
+ obj._${servicePort.name}Port = openrtm.CorbaPort.new("${servicePort.name}")
+#end#end#end
+
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+#foreach($serviceInterface in ${servicePort.servicePortInterfaces})
+#if(${serviceInterface.index}==1)
+ --[[
+#if(${serviceInterface.docDescription.length()}>0) ${tmpltHelperLua.convertDescDocLua(${serviceInterface.docDescription})}
+#end
+#if(${serviceInterface.docArgument.length()}>0) - Argument: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docArgument})}
+#end
+#if(${serviceInterface.docReturn.length()}>0) - Return Value: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docReturn})}
+#end
+#if(${serviceInterface.docException.length()}>0) - Exception: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docException})}
+#end
+#if(${serviceInterface.docPreCondition.length()}>0) - PreCondition: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docPreCondition})}
+#end
+#if(${serviceInterface.docPostCondition.length()}>0) - PostCondition: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docPostCondition})}
+#end
+ --]]
+ obj._${serviceInterface.tmplVarName} = ${tmpltHelper.getFilenameNoExt(${serviceInterface.IdlFile})}_idl_example.${tmpltHelper.getBasename(${serviceInterface.interfaceType})}_i.new()
+#end#end#end#end#end
+
+
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+#foreach($serviceInterface in ${servicePort.servicePortInterfaces})
+#if(${serviceInterface.index}==0)
+ --[[
+#if(${serviceInterface.docDescription.length()}>0) ${tmpltHelperLua.convertDescDocLua(${serviceInterface.docDescription})}
+#end
+#if(${serviceInterface.docArgument.length()}>0) - Argument: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docArgument})}
+#end
+#if(${serviceInterface.docReturn.length()}>0) - Return Value: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docReturn})}
+#end
+#if(${serviceInterface.docException.length()}>0) - Exception: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docException})}
+#end
+#if(${serviceInterface.docPreCondition.length()}>0) - PreCondition: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docPreCondition})}
+#end
+#if(${serviceInterface.docPostCondition.length()}>0) - PostCondition: ${tmpltHelperLua.convertDetailLua(${serviceInterface.docPostCondition})}
+#end
+ --]]
+ obj._${serviceInterface.tmplVarName} = openrtm.CorbaConsumer.new("${tmpltHelperLua.convertServiceInterfaceName(${serviceInterface.interfaceType})}")
+#end#end#end#end#end
+
+ -- initialize of configuration-data.
+ -- <rtc-template block="init_conf_param">
+#foreach($configParam in ${rtcParam.configParams})
+ --[[
+ ${tmpltHelperLua.convertDescDocLua(${configParam.docDescription})}
+ - Name: ${configParam.docDataName} ${configParam.tmplVarName}
+ - DefaultValue: ${configParam.defaultVal}
+#if(${configParam.docUnit.length()}>0) - Unit: ${tmpltHelperLua.convertUnitDocLua(${configParam.docUnit})}
+#end
+#if(${configParam.docRange.length()}>0) - Range: ${tmpltHelperLua.convertRangeDocLua(${configParam.docRange})}
+#end
+#if(${configParam.docConstraint.length()}>0) - Constraint: ${tmpltHelperLua.convertConstraintDocLua(${configParam.docConstraint})}
+#end
+ --]]
+ obj._${configParam.tmplVarName} = {_value=${luaConv.convDefaultVal(${configParam})}}
+#end
+
+ -- </rtc-template>
+
+#if(${rtcParam.getDocActionOverView(0).length()}>0) -- ${tmpltHelperLua.convertDescDocLua(${rtcParam.getDocActionOverView(0)})}
+#end
+ --
+ -- The initialize action (on CREATED->ALIVE transition)
+ -- formaer rtc_init_entry()
+ --
+ -- @return RTC::ReturnCode_t
+ --
+#if(${rtcParam.getDocActionPreCondition(0).length()}>0) -- @pre ${tmpltHelperLua.convertPreDocLua(${rtcParam.getDocActionPreCondition(0)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(0).length()}>0) -- @post ${tmpltHelperLua.convertPostDocLua(${rtcParam.getDocActionPostCondition(0)})}
+#end
+ --
+ function obj:onInitialize()
+ -- Bind variables and configuration variable
+#foreach($configParam in ${rtcParam.configParams})
+ self:bindParameter("${configParam.name}", self._${configParam.tmplVarName}, "${configParam.defaultVal}")
+#end
+
+ -- Set OutPort buffers
+#foreach($port in ${rtcParam.outports})
+ self:addInPort("${port.name}",self._${port.name}In)
+#end
+
+ -- Set InPort buffers
+#foreach($port in ${rtcParam.inports})
+ self:addOutPort("${port.name}",self._${port.name}Out)
+#end
+
+ -- Set service provider to Ports
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+#foreach($serviceInterface in ${servicePort.servicePortInterfaces})
+#if(${serviceInterface.index}==1)
+ self._${servicePort.name}Port:registerProvider("${serviceInterface.name}", "${serviceInterface.interfaceType}", self._${serviceInterface.tmplVarName}, "idl/${tmpltHelper.getFileName(${serviceInterface.IdlFile})}", "${tmpltHelperLua.convertServiceInterfaceName(${serviceInterface.interfaceType})}")
+#end#end#end#end#end
+
+ -- Set service consumers to Ports
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+#foreach($serviceInterface in ${servicePort.servicePortInterfaces})
+#if(${serviceInterface.index}==0)
+ self._${servicePort.name}Port:registerConsumer("${serviceInterface.name}", "${serviceInterface.interfaceType}", self._${serviceInterface.tmplVarName}, "idl/${tmpltHelper.getFileName(${serviceInterface.IdlFile})}")
+#end#end#end#end#end
+
+ -- Set CORBA Service Ports
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+ self:addPort(self._${servicePort.name}Port)
+#end#end#end
+#if(${tmpltHelper.checkDetailContent(0,${rtcParam})}) ${rtcParam.getDetailContent(0)}
+#end
+
+ return self._ReturnCode_t.RTC_OK
+ end
+
+#if(${rtcParam.getDocActionOverView(1).length()}>0) #if(${rtcParam.IsNotImplemented(1)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(1)})}
+#end
+ #if(${rtcParam.IsNotImplemented(1)})-- #end--
+ #if(${rtcParam.IsNotImplemented(1)})-- #end-- The finalize action (on ALIVE->END transition)
+ #if(${rtcParam.IsNotImplemented(1)})-- #end-- formaer rtc_exiting_entry()
+ #if(${rtcParam.IsNotImplemented(1)})-- #end--
+ #if(${rtcParam.IsNotImplemented(1)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(1)})--#end
+
+#if(${rtcParam.getDocActionPreCondition(1).length()}>0) #if(${rtcParam.IsNotImplemented(1)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(1)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(1).length()}>0) #if(${rtcParam.IsNotImplemented(1)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(1)})}
+#end
+ #if(${rtcParam.IsNotImplemented(1)})--#end --
+ #if(${rtcParam.IsNotImplemented(1)})--#end funtion obj:onFinalize()
+ #if(${rtcParam.IsNotImplemented(1)})--#end
+#if(${tmpltHelper.checkDetailContent(1,${rtcParam})}) ${rtcParam.getDetailContent(1)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(1)})--#end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(1)})--#end end
+
+#if(${rtcParam.getDocActionOverView(2).length()}>0) #if(${rtcParam.IsNotImplemented(2)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(2)})}
+#end
+ #if(${rtcParam.IsNotImplemented(2)})-- #end--
+ #if(${rtcParam.IsNotImplemented(2)})-- #end-- The startup action when ExecutionContext startup
+ #if(${rtcParam.IsNotImplemented(2)})-- #end-- former rtc_starting_entry()
+ #if(${rtcParam.IsNotImplemented(2)})-- #end--
+ #if(${rtcParam.IsNotImplemented(2)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(2)})-- #end--
+ #if(${rtcParam.IsNotImplemented(2)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(2)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(2).length()}>0) #if(${rtcParam.IsNotImplemented(2)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(2)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(2).length()}>0) #if(${rtcParam.IsNotImplemented(2)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(2)})}
+#end
+ #if(${rtcParam.IsNotImplemented(2)})-- #end--
+ #if(${rtcParam.IsNotImplemented(2)})-- #end function obj:onStartup(ec_id)
+ #if(${rtcParam.IsNotImplemented(2)})-- #end
+#if(${tmpltHelper.checkDetailContent(2,${rtcParam})}) ${rtcParam.getDetailContent(2)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(2)})-- #end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(2)})-- #end end
+
+#if(${rtcParam.getDocActionOverView(3).length()}>0) #if(${rtcParam.IsNotImplemented(3)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(3)})}
+#end
+ #if(${rtcParam.IsNotImplemented(3)})-- #end--
+ #if(${rtcParam.IsNotImplemented(3)})-- #end-- The shutdown action when ExecutionContext stop
+ #if(${rtcParam.IsNotImplemented(3)})-- #end-- former rtc_stopping_entry()
+ #if(${rtcParam.IsNotImplemented(3)})-- #end--
+ #if(${rtcParam.IsNotImplemented(3)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(3)})-- #end--
+ #if(${rtcParam.IsNotImplemented(3)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(3)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(3).length()}>0) #if(${rtcParam.IsNotImplemented(3)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(3)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(3).length()}>0) #if(${rtcParam.IsNotImplemented(3)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(3)})}
+#end
+ #if(${rtcParam.IsNotImplemented(3)})-- #end--
+ #if(${rtcParam.IsNotImplemented(3)})-- #end function obj:onShutdown(ec_id)
+ #if(${rtcParam.IsNotImplemented(3)})-- #end
+#if(${tmpltHelper.checkDetailContent(3,${rtcParam})}) ${rtcParam.getDetailContent(3)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(3)})-- #end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(3)})-- #end end
+
+#if(${rtcParam.getDocActionOverView(4).length()}>0) #if(${rtcParam.IsNotImplemented(4)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(4)})}
+#end
+ #if(${rtcParam.IsNotImplemented(4)})-- #end--
+ #if(${rtcParam.IsNotImplemented(4)})-- #end-- The activated action (Active state entry action)
+ #if(${rtcParam.IsNotImplemented(4)})-- #end-- former rtc_active_entry()
+ #if(${rtcParam.IsNotImplemented(4)})-- #end--
+ #if(${rtcParam.IsNotImplemented(4)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(4)})-- #end--
+ #if(${rtcParam.IsNotImplemented(4)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(4)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(4).length()}>0) #if(${rtcParam.IsNotImplemented(4)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(4)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(4).length()}>0) #if(${rtcParam.IsNotImplemented(4)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(4)})}
+#end
+ #if(${rtcParam.IsNotImplemented(4)})--#end--
+ #if(${rtcParam.IsNotImplemented(4)})--#end function obj:onActivated(ec_id)
+ #if(${rtcParam.IsNotImplemented(4)})--#end
+#if(${tmpltHelper.checkDetailContent(4,${rtcParam})}) ${rtcParam.getDetailContent(4)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(4)})--#end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(4)})--#end end
+
+#if(${rtcParam.getDocActionOverView(5).length()}>0) #if(${rtcParam.IsNotImplemented(5)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(5)})}
+#end
+ #if(${rtcParam.IsNotImplemented(5)})-- #end--
+ #if(${rtcParam.IsNotImplemented(5)})-- #end-- The deactivated action (Active state exit action)
+ #if(${rtcParam.IsNotImplemented(5)})-- #end-- former rtc_active_exit()
+ #if(${rtcParam.IsNotImplemented(5)})-- #end--
+ #if(${rtcParam.IsNotImplemented(5)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(5)})-- #end--
+ #if(${rtcParam.IsNotImplemented(5)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(5)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(5).length()}>0) #if(${rtcParam.IsNotImplemented(5)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(5)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(5).length()}>0) #if(${rtcParam.IsNotImplemented(5)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(5)})}
+#end
+ #if(${rtcParam.IsNotImplemented(5)})-- #end--
+ #if(${rtcParam.IsNotImplemented(5)})-- #end function obj:onDeactivated(ec_id)
+ #if(${rtcParam.IsNotImplemented(5)})-- #end
+#if(${tmpltHelper.checkDetailContent(5,${rtcParam})}) ${rtcParam.getDetailContent(5)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(5)})-- #end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(5)})-- #end end
+
+#if(${rtcParam.getDocActionOverView(9).length()}>0) #if(${rtcParam.IsNotImplemented(9)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(9)})}
+#end
+ #if(${rtcParam.IsNotImplemented(9)})-- #end--
+ #if(${rtcParam.IsNotImplemented(9)})-- #end-- The execution action that is invoked periodically
+ #if(${rtcParam.IsNotImplemented(9)})-- #end-- former rtc_active_do()
+ #if(${rtcParam.IsNotImplemented(9)})-- #end--
+ #if(${rtcParam.IsNotImplemented(9)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(9)})-- #end--
+ #if(${rtcParam.IsNotImplemented(9)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(9)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(9).length()}>0) #if(${rtcParam.IsNotImplemented(9)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(9)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(9).length()}>0) #if(${rtcParam.IsNotImplemented(9)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(9)})}
+#end
+ #if(${rtcParam.IsNotImplemented(9)})-- #end--
+ #if(${rtcParam.IsNotImplemented(9)})-- #end function obj:onExecute(ec_id)
+ #if(${rtcParam.IsNotImplemented(9)})-- #end
+#if(${tmpltHelper.checkDetailContent(9,${rtcParam})}) ${rtcParam.getDetailContent(9)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(9)})--#end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(9)})--#end end
+
+#if(${rtcParam.getDocActionOverView(6).length()}>0) #if(${rtcParam.IsNotImplemented(6)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(6)})}
+#end
+ #if(${rtcParam.IsNotImplemented(6)})-- #end--
+ #if(${rtcParam.IsNotImplemented(6)})-- #end-- The aborting action when main logic error occurred.
+ #if(${rtcParam.IsNotImplemented(6)})-- #end-- former rtc_aborting_entry()
+ #if(${rtcParam.IsNotImplemented(6)})-- #end--
+ #if(${rtcParam.IsNotImplemented(6)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(6)})-- #end--
+ #if(${rtcParam.IsNotImplemented(6)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(6)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(6).length()}>0) #if(${rtcParam.IsNotImplemented(6)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(6)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(6).length()}>0) #if(${rtcParam.IsNotImplemented(6)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(6)})}
+#end
+ #if(${rtcParam.IsNotImplemented(6)})-- #end--
+ #if(${rtcParam.IsNotImplemented(6)})-- #end function obj:onAborting(ec_id)
+ #if(${rtcParam.IsNotImplemented(6)})-- #end
+#if(${tmpltHelper.checkDetailContent(6,${rtcParam})}) ${rtcParam.getDetailContent(6)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(6)})--#end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(6)})--#end end
+
+#if(${rtcParam.getDocActionOverView(7).length()}>0) #if(${rtcParam.IsNotImplemented(7)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(7)})}
+#end
+ #if(${rtcParam.IsNotImplemented(7)})-- #end--
+ #if(${rtcParam.IsNotImplemented(7)})-- #end-- The error action in ERROR state
+ #if(${rtcParam.IsNotImplemented(7)})-- #end-- former rtc_error_do()
+ #if(${rtcParam.IsNotImplemented(7)})-- #end--
+ #if(${rtcParam.IsNotImplemented(7)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(7)})-- #end--
+ #if(${rtcParam.IsNotImplemented(7)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(7)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(7).length()}>0) #if(${rtcParam.IsNotImplemented(7)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(7)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(7).length()}>0) #if(${rtcParam.IsNotImplemented(7)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(7)})}
+#end
+ #if(${rtcParam.IsNotImplemented(7)})-- #end--
+ #if(${rtcParam.IsNotImplemented(7)})-- #end function obj:onError(ec_id)
+ #if(${rtcParam.IsNotImplemented(7)})-- #end
+#if(${tmpltHelper.checkDetailContent(7,${rtcParam})}) ${rtcParam.getDetailContent(7)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(7)})-- #end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(7)})-- #end end
+
+#if(${rtcParam.getDocActionOverView(8).length()}>0) #if(${rtcParam.IsNotImplemented(8)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(8)})}
+#end
+ #if(${rtcParam.IsNotImplemented(8)})-- #end--
+ #if(${rtcParam.IsNotImplemented(8)})-- #end-- The reset action that is invoked resetting
+ #if(${rtcParam.IsNotImplemented(8)})-- #end-- This is same but different the former rtc_init_entry()
+ #if(${rtcParam.IsNotImplemented(8)})-- #end--
+ #if(${rtcParam.IsNotImplemented(8)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(8)})-- #end--
+ #if(${rtcParam.IsNotImplemented(8)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(8)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(8).length()}>0) #if(${rtcParam.IsNotImplemented(8)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(8)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(8).length()}>0) #if(${rtcParam.IsNotImplemented(8)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(8)})}
+#end
+ #if(${rtcParam.IsNotImplemented(8)})-- #end--
+ #if(${rtcParam.IsNotImplemented(8)})-- #end function obj:onReset(ec_id)
+ #if(${rtcParam.IsNotImplemented(8)})-- #end
+#if(${tmpltHelper.checkDetailContent(8,${rtcParam})}) ${rtcParam.getDetailContent(8)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(8)})-- #end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(8)})-- #end end
+
+#if(${rtcParam.getDocActionOverView(10).length()}>0) #if(${rtcParam.IsNotImplemented(10)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(10)})}
+#end
+ #if(${rtcParam.IsNotImplemented(10)})-- #end--
+ #if(${rtcParam.IsNotImplemented(10)})-- #end-- The state update action that is invoked after onExecute() action
+ #if(${rtcParam.IsNotImplemented(10)})-- #end-- no corresponding operation exists in OpenRTm-aist-0.2.0
+ #if(${rtcParam.IsNotImplemented(10)})-- #end--
+ #if(${rtcParam.IsNotImplemented(10)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(10)})-- #end--
+ #if(${rtcParam.IsNotImplemented(10)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(10)})-- #end--
+
+#if(${rtcParam.getDocActionPreCondition(10).length()}>0) #if(${rtcParam.IsNotImplemented(10)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(10)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(10).length()}>0) #if(${rtcParam.IsNotImplemented(10)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(10)})}
+#end
+ #if(${rtcParam.IsNotImplemented(10)})-- #end--
+ #if(${rtcParam.IsNotImplemented(10)})-- #end function obj:onStateUpdate(ec_id)
+ #if(${rtcParam.IsNotImplemented(10)})-- #end
+#if(${tmpltHelper.checkDetailContent(10,${rtcParam})}) ${rtcParam.getDetailContent(10)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(10)})-- #end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(10)})-- #end end
+
+#if(${rtcParam.getDocActionOverView(11).length()}>0) #if(${rtcParam.IsNotImplemented(11)})--#end-- ${tmpltHelperLua.convertActivityDocLua(${rtcParam.getDocActionOverView(11)})}
+#end
+ #if(${rtcParam.IsNotImplemented(11)})-- #end--
+ #if(${rtcParam.IsNotImplemented(11)})-- #end-- The action that is invoked when execution context's rate is changed
+ #if(${rtcParam.IsNotImplemented(11)})-- #end-- no corresponding operation exists in OpenRTm-aist-0.2.0
+ #if(${rtcParam.IsNotImplemented(11)})-- #end--
+ #if(${rtcParam.IsNotImplemented(11)})-- #end-- @param ec_id target ExecutionContext Id
+ #if(${rtcParam.IsNotImplemented(11)})-- #end--
+ #if(${rtcParam.IsNotImplemented(11)})-- #end-- @return RTC::ReturnCode_t
+ #if(${rtcParam.IsNotImplemented(11)})-- #end--
+#if(${rtcParam.getDocActionPreCondition(11).length()}>0) #if(${rtcParam.IsNotImplemented(11)})--#end -- @pre ${tmpltHelperLua.convertPreShDocLua(${rtcParam.getDocActionPreCondition(11)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(11).length()}>0) #if(${rtcParam.IsNotImplemented(11)})--#end -- @post ${tmpltHelperLua.convertPostShDocLua(${rtcParam.getDocActionPostCondition(11)})}
+#end
+ #if(${rtcParam.IsNotImplemented(11)})-- #end--
+ #if(${rtcParam.IsNotImplemented(11)})-- #end function obj:onRateChanged(ec_id)
+ #if(${rtcParam.IsNotImplemented(11)})-- #end
+#if(${tmpltHelper.checkDetailContent(11,${rtcParam})}) ${rtcParam.getDetailContent(11)}
+#end
+
+ #if(${rtcParam.IsNotImplemented(11)})-- #end return self._ReturnCode_t.RTC_OK
+ #if(${rtcParam.IsNotImplemented(11)})-- #end end
+ return obj
+end
+
+
+local MyModuleInit = function(manager)
+ ${rtcParam.name}Test.Init(manager)
+
+ -- Create a component
+ local comp = manager:createComponent("${rtcParam.name}Test")
+end
+
+if openrtm.Manager.is_main() then
+ local manager = openrtm.Manager
+ manager:init(arg)
+ manager:setModuleInitProc(MyModuleInit)
+ manager:activateManager()
+ manager:runManager()
+else
+ return ${rtcParam.name}Test
+end
+
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/ui/Perspective/LuaProperty.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/ui/Perspective/LuaProperty.java (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.lua/src/jp/go/aist/rtm/rtcbuilder/lua/ui/Perspective/LuaProperty.java 2018-03-05 13:39:11 UTC (rev 807)
@@ -0,0 +1,31 @@
+package jp.go.aist.rtm.rtcbuilder.lua.ui.Perspective;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import jp.go.aist.rtm.rtcbuilder.ui.Perspective.LanguageProperty;
+
+public class LuaProperty extends LanguageProperty {
+ private String PerspectiveId = "org.lua.ldt.ui.LuaPerspective";
+ private String PerspectiveName = "Lua";
+ private String PluginId = "org.lua.ldt";
+
+ public String getPerspectiveId() {
+ return PerspectiveId;
+ }
+
+ public String getPerspectiveName() {
+ return PerspectiveName;
+ }
+
+ public String getPluginId() {
+ return PluginId;
+ }
+
+ @Override
+ public List<String> getNatures() {
+ List<String> natures = new ArrayList<String>();
+ natures.add("org.lua.ldt.luaNature");
+ return natures;
+ }
+}
More information about the openrtm-commit
mailing list