[openrtm-commit:01963] r630 - in trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python: resource/100/ConfigSet/ConfigSetType resource/100/ConfigSet/configset1 resource/100/ConfigSet/configset2 resource/100/ConfigSet/configset3 resource/100/ConfigSet/configset4 resource/100/Doc/full resource/100/aist resource/100/aist/AIST7 src/jp/go/aist/rtm/rtcbuilder/python/template/python test/jp/go/aist/rtm/rtcbuilder/python/_test/_100
openrtm @ openrtm.org
openrtm @ openrtm.org
2016年 5月 25日 (水) 19:59:54 JST
Author: ga
Date: 2016-05-25 19:59:54 +0900 (Wed, 25 May 2016)
New Revision: 630
Added:
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST7/
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST7/ModuleName.py
Modified:
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/ConfigSetType/foo.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/configset1/foo.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/configset2/foo.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/configset3/foo.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/configset4/foo.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/full/foo.py
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/src/jp/go/aist/rtm/rtcbuilder/python/template/python/Py_RTC.py.vsl
trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/test/jp/go/aist/rtm/rtcbuilder/python/_test/_100/AISTTest.java
Log:
fixed "conf.__type__.***".
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/ConfigSetType/foo.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/ConfigSetType/foo.py 2016-05-25 10:59:34 UTC (rev 629)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/ConfigSetType/foo.py 2016-05-25 10:59:54 UTC (rev 630)
@@ -37,13 +37,6 @@
"conf.default.double_param", "4.11",
"conf.default.str_param0", "hoge",
"conf.default.str_param1", "dara",
- "conf.default.__short_param", "short",
- "conf.default.__int_param", "int",
- "conf.default.__long_param", "long",
- "conf.default.__float_param", "float",
- "conf.default.__double_param", "double",
- "conf.default.__str_param0", "string",
- "conf.default.__str_param1", "string",
"conf.__type__.short_param", "short",
"conf.__type__.int_param", "int",
"conf.__type__.long_param", "long",
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/configset1/foo.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/configset1/foo.py 2016-05-25 10:59:34 UTC (rev 629)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/configset1/foo.py 2016-05-25 10:59:54 UTC (rev 630)
@@ -31,7 +31,6 @@
"language", "Python",
"lang_type", "SCRIPT",
"conf.default.int_param0", "0",
- "conf.default.__int_param0", "int",
"conf.__type__.int_param0", "int",
""]
# </rtc-template>
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/configset2/foo.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/configset2/foo.py 2016-05-25 10:59:34 UTC (rev 629)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/configset2/foo.py 2016-05-25 10:59:54 UTC (rev 630)
@@ -32,8 +32,6 @@
"lang_type", "SCRIPT",
"conf.default.int_param0", "0",
"conf.default.int_param1", "1",
- "conf.default.__int_param0", "int",
- "conf.default.__int_param1", "int",
"conf.__type__.int_param0", "int",
"conf.__type__.int_param1", "int",
""]
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/configset3/foo.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/configset3/foo.py 2016-05-25 10:59:34 UTC (rev 629)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/configset3/foo.py 2016-05-25 10:59:54 UTC (rev 630)
@@ -35,11 +35,6 @@
"conf.default.double_param0", "0.11",
"conf.default.str_param0", "hoge",
"conf.default.str_param1", "dara",
- "conf.default.__int_param0", "int",
- "conf.default.__int_param1", "int",
- "conf.default.__double_param0", "double",
- "conf.default.__str_param0", "String",
- "conf.default.__str_param1", "String",
"conf.__type__.int_param0", "int",
"conf.__type__.int_param1", "int",
"conf.__type__.double_param0", "double",
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/configset4/foo.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/configset4/foo.py 2016-05-25 10:59:34 UTC (rev 629)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/ConfigSet/configset4/foo.py 2016-05-25 10:59:54 UTC (rev 630)
@@ -36,12 +36,6 @@
"conf.default.str_param0", "hoge",
"conf.default.str_param1", "dara",
"conf.default.vector_param0", "0.0,1.0,2.0,3.0",
- "conf.default.__int_param0", "int",
- "conf.default.__int_param1", "int",
- "conf.default.__double_param0", "double",
- "conf.default.__str_param0", "String",
- "conf.default.__str_param1", "String",
- "conf.default.__vector_param0", "double",
"conf.__type__.int_param0", "int",
"conf.__type__.int_param1", "int",
"conf.__type__.double_param0", "double",
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/full/foo.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/full/foo.py 2016-05-25 10:59:34 UTC (rev 629)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/Doc/full/foo.py 2016-05-25 10:59:54 UTC (rev 630)
@@ -41,11 +41,6 @@
"conf.default.double_param0", "0.11",
"conf.default.str_param0", "hoge",
"conf.default.str_param1", "dara",
- "conf.default.__int_param0", "int",
- "conf.default.__int_param1", "int",
- "conf.default.__double_param0", "double",
- "conf.default.__str_param0", "String",
- "conf.default.__str_param1", "String",
"conf.__type__.int_param0", "int",
"conf.__type__.int_param1", "int",
"conf.__type__.double_param0", "double",
Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST7/ModuleName.py
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST7/ModuleName.py (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/resource/100/aist/AIST7/ModuleName.py 2016-05-25 10:59:54 UTC (rev 630)
@@ -0,0 +1,255 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+# -*- Python -*-
+"""
+ @file ModuleName.py
+ @brief ModuleDescription
+ @date $Date$
+"""
+import sys
+import time
+sys.path.append(".")
+# Import RTM module
+import RTC
+import OpenRTM_aist
+# Import Service implementation class
+# <rtc-template block="service_impl">
+# </rtc-template>
+# Import Service stub modules
+# <rtc-template block="consumer_import">
+# </rtc-template>
+# This module's spesification
+# <rtc-template block="module_spec">
+modulename_spec = ["implementation_id", "ModuleName",
+ "type_name", "ModuleName",
+ "description", "ModuleDescription",
+ "version", "1.0.0",
+ "vendor", "VenderName",
+ "category", "Category",
+ "activity_type", "DataFlowComponent",
+ "max_instance", "1",
+ "language", "Python",
+ "lang_type", "SCRIPT",
+ "conf.default.test", "0",
+ "conf.__widget__.test", "slider.0.2",
+ "conf.__constraints__.test", "-1.0<x<1.0",
+ "conf.__type__.test", "double",
+ ""]
+# </rtc-template>
+##
+# @class ModuleName
+# @brief ModuleDescription
+#
+#
+class ModuleName(OpenRTM_aist.DataFlowComponentBase):
+
+ ##
+ # @brief constructor
+ # @param manager Maneger Object
+ #
+ def __init__(self, manager):
+ OpenRTM_aist.DataFlowComponentBase.__init__(self, manager)
+
+ # initialize of configuration-data.
+ # <rtc-template block="init_conf_param">
+ """
+
+ - Name: test
+ - DefaultValue: 0
+ """
+ self._test = [0]
+
+ # </rtc-template>
+
+ ##
+ #
+ # The initialize action (on CREATED->ALIVE transition)
+ # formaer rtc_init_entry()
+ #
+ # @return RTC::ReturnCode_t
+ #
+ #
+ def onInitialize(self):
+ # Bind variables and configuration variable
+ self.bindParameter("test", self._test, "0")
+
+ # Set InPort buffers
+
+ # Set OutPort buffers
+
+ # Set service provider to Ports
+
+ # Set service consumers to Ports
+
+ # Set CORBA Service Ports
+
+ return RTC.RTC_OK
+
+ # ##
+ # #
+ # # The finalize action (on ALIVE->END transition)
+ # # formaer rtc_exiting_entry()
+ # #
+ # # @return RTC::ReturnCode_t
+ #
+ # #
+ #def onFinalize(self):
+ #
+ # return RTC.RTC_OK
+
+ # ##
+ # #
+ # # The startup action when ExecutionContext startup
+ # # former rtc_starting_entry()
+ # #
+ # # @param ec_id target ExecutionContext Id
+ # #
+ # # @return RTC::ReturnCode_t
+ # #
+ # #
+ #def onStartup(self, ec_id):
+ #
+ # return RTC.RTC_OK
+
+ # ##
+ # #
+ # # The shutdown action when ExecutionContext stop
+ # # former rtc_stopping_entry()
+ # #
+ # # @param ec_id target ExecutionContext Id
+ # #
+ # # @return RTC::ReturnCode_t
+ # #
+ # #
+ #def onShutdown(self, ec_id):
+ #
+ # return RTC.RTC_OK
+
+ # ##
+ # #
+ # # The activated action (Active state entry action)
+ # # former rtc_active_entry()
+ # #
+ # # @param ec_id target ExecutionContext Id
+ # #
+ # # @return RTC::ReturnCode_t
+ # #
+ # #
+ #def onActivated(self, ec_id):
+ #
+ # return RTC.RTC_OK
+
+ # ##
+ # #
+ # # The deactivated action (Active state exit action)
+ # # former rtc_active_exit()
+ # #
+ # # @param ec_id target ExecutionContext Id
+ # #
+ # # @return RTC::ReturnCode_t
+ # #
+ # #
+ #def onDeactivated(self, ec_id):
+ #
+ # return RTC.RTC_OK
+
+ # ##
+ # #
+ # # The execution action that is invoked periodically
+ # # former rtc_active_do()
+ # #
+ # # @param ec_id target ExecutionContext Id
+ # #
+ # # @return RTC::ReturnCode_t
+ # #
+ # #
+ #def onExecute(self, ec_id):
+ #
+ # return RTC.RTC_OK
+
+ # ##
+ # #
+ # # The aborting action when main logic error occurred.
+ # # former rtc_aborting_entry()
+ # #
+ # # @param ec_id target ExecutionContext Id
+ # #
+ # # @return RTC::ReturnCode_t
+ # #
+ # #
+ #def onAborting(self, ec_id):
+ #
+ # return RTC.RTC_OK
+
+ # ##
+ # #
+ # # The error action in ERROR state
+ # # former rtc_error_do()
+ # #
+ # # @param ec_id target ExecutionContext Id
+ # #
+ # # @return RTC::ReturnCode_t
+ # #
+ # #
+ #def onError(self, ec_id):
+ #
+ # return RTC.RTC_OK
+
+ # ##
+ # #
+ # # The reset action that is invoked resetting
+ # # This is same but different the former rtc_init_entry()
+ # #
+ # # @param ec_id target ExecutionContext Id
+ # #
+ # # @return RTC::ReturnCode_t
+ # #
+ # #
+ #def onReset(self, ec_id):
+ #
+ # return RTC.RTC_OK
+
+ # ##
+ # #
+ # # The state update action that is invoked after onExecute() action
+ # # no corresponding operation exists in OpenRTm-aist-0.2.0
+ # #
+ # # @param ec_id target ExecutionContext Id
+ # #
+ # # @return RTC::ReturnCode_t
+ # #
+ # #
+ #def onStateUpdate(self, ec_id):
+ #
+ # return RTC.RTC_OK
+
+ # ##
+ # #
+ # # The action that is invoked when execution context's rate is changed
+ # # no corresponding operation exists in OpenRTm-aist-0.2.0
+ # #
+ # # @param ec_id target ExecutionContext Id
+ # #
+ # # @return RTC::ReturnCode_t
+ # #
+ # #
+ #def onRateChanged(self, ec_id):
+ #
+ # return RTC.RTC_OK
+
+def ModuleNameInit(manager):
+ profile = OpenRTM_aist.Properties(defaults_str=modulename_spec)
+ manager.registerFactory(profile,
+ ModuleName,
+ OpenRTM_aist.Delete)
+def MyModuleInit(manager):
+ ModuleNameInit(manager)
+ # Create a component
+ comp = manager.createComponent("ModuleName")
+def main():
+ mgr = OpenRTM_aist.Manager.init(sys.argv)
+ mgr.setModuleInitProc(MyModuleInit)
+ mgr.activateManager()
+ mgr.runManager()
+if __name__ == "__main__":
+ main()
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/src/jp/go/aist/rtm/rtcbuilder/python/template/python/Py_RTC.py.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/src/jp/go/aist/rtm/rtcbuilder/python/template/python/Py_RTC.py.vsl 2016-05-25 10:59:34 UTC (rev 629)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/src/jp/go/aist/rtm/rtcbuilder/python/template/python/Py_RTC.py.vsl 2016-05-25 10:59:54 UTC (rev 630)
@@ -79,7 +79,7 @@
#end
#foreach($configParam in ${rtcParam.configParams})
- "conf.__type__.${configParam.name}", "${configParam.type}#if( ${configParam.step.length()} > 0 )#end",
+ "conf.__type__.${configParam.name}", "${configParam.type}",
#end
#end
Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/test/jp/go/aist/rtm/rtcbuilder/python/_test/_100/AISTTest.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/test/jp/go/aist/rtm/rtcbuilder/python/_test/_100/AISTTest.java 2016-05-25 10:59:34 UTC (rev 629)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.python/test/jp/go/aist/rtm/rtcbuilder/python/_test/_100/AISTTest.java 2016-05-25 10:59:54 UTC (rev 630)
@@ -6,6 +6,7 @@
import jp.go.aist.rtm.rtcbuilder.Generator;
import jp.go.aist.rtm.rtcbuilder.IRtcBuilderConstants;
import jp.go.aist.rtm.rtcbuilder.generator.GeneratedResult;
+import jp.go.aist.rtm.rtcbuilder.generator.param.ConfigSetParam;
import jp.go.aist.rtm.rtcbuilder.generator.param.DataPortParam;
import jp.go.aist.rtm.rtcbuilder.generator.param.GeneratorParam;
import jp.go.aist.rtm.rtcbuilder.generator.param.RtcParam;
@@ -37,6 +38,32 @@
generator.addGenerateManager(new PythonCMakeGenerateManager());
}
+ public void testAIST7() throws Exception {
+ rtcParam.setName("ModuleName");
+ rtcParam.setDescription("ModuleDescription");
+ rtcParam.setVersion("1.0.0");
+ rtcParam.setVender("VenderName");
+ rtcParam.setCategory("Category");
+ rtcParam.setComponentType("DataFlowComponent");
+ rtcParam.setActivityType("PERIODIC");
+ rtcParam.setMaxInstance(1);
+ rtcParam.setComponentKind("DataFlowComponent");
+
+ List<ConfigSetParam> configset = new ArrayList<ConfigSetParam>();
+ ConfigSetParam param01 = new ConfigSetParam("test", "double", "", "0");
+ param01.setWidget("slider");
+ param01.setStep("0.2");
+ param01.setConstraint("-1.0<x<1.0");
+ configset.add(param01);
+ rtcParam.getConfigParams().addAll(configset);
+
+ List<GeneratedResult> result = generator.generateTemplateCode(genParam);
+
+ String resourceDir = rootPath + "/resource/100/aist/AIST7/";
+
+ checkCode(result, resourceDir, "ModuleName.py");
+ }
+
public void testAIST6() throws Exception {
rtcParam.setName("test");
rtcParam.setDescription("test component");
More information about the openrtm-commit
mailing list