[openrtm-commit:00874] r335 - in trunk/rtmtools/jp.go.aist.rtm.rtcbuilder: META-INF resource/100/CXX resource/100/CXX/Content src/jp/go/aist/rtm/rtcbuilder src/jp/go/aist/rtm/rtcbuilder/generator/param src/jp/go/aist/rtm/rtcbuilder/template src/jp/go/aist/rtm/rtcbuilder/template/cpp src/jp/go/aist/rtm/rtcbuilder/ui/editors test/jp/go/aist/rtm/rtcbuilder/_test/_100

openrtm @ openrtm.org openrtm @ openrtm.org
2012年 8月 1日 (水) 23:56:46 JST


Author: 
Date: 2012-08-01 23:56:46 +0900 (Wed, 01 Aug 2012)
New Revision: 335

Added:
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Content/
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Content/foo.cpp
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Content/foo.h
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Content/fooComp.cpp
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/CXXContentTest.java
Modified:
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/META-INF/MANIFEST.MF
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/Generator.java
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/RtcParam.java
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/TemplateHelper.java
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_RTC.cpp.vsl
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_RTC.h.vsl
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/ui/editors/BasicEditorFormPage.java
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/AllTestsCXX.java
Log:
Modified Error processing when target project is closed

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/META-INF/MANIFEST.MF
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/META-INF/MANIFEST.MF	2012-07-14 09:48:15 UTC (rev 334)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/META-INF/MANIFEST.MF	2012-08-01 14:56:46 UTC (rev 335)
@@ -15,6 +15,7 @@
  jp.go.aist.rtm.rtcbuilder.generator,
  jp.go.aist.rtm.rtcbuilder.generator.param,
  jp.go.aist.rtm.rtcbuilder.generator.param.idl,
+ jp.go.aist.rtm.rtcbuilder.generator.parser,
  jp.go.aist.rtm.rtcbuilder.manager,
  jp.go.aist.rtm.rtcbuilder.model.component,
  jp.go.aist.rtm.rtcbuilder.model.component.impl,

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Content/foo.cpp
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Content/foo.cpp	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Content/foo.cpp	2012-08-01 14:56:46 UTC (rev 335)
@@ -0,0 +1,170 @@
+// -*- C++ -*-
+/*!
+ * @file  foo.cpp
+ * @brief MDesc
+ * @date $Date$
+ *
+ * $Id$
+ */
+
+#include "foo.h"
+
+// Module specification
+// <rtc-template block="module_spec">
+static const char* foo_spec[] =
+  {
+    "implementation_id", "foo",
+    "type_name",         "foo",
+    "description",       "MDesc",
+    "version",           "1.0.1",
+    "vendor",            "TA",
+    "category",          "Manip",
+    "activity_type",     "PERIODIC2",
+    "kind",              "DataFlowComponent",
+    "max_instance",      "5",
+    "language",          "C++",
+    "lang_type",         "compile",
+    ""
+  };
+// </rtc-template>
+
+/*!
+ * @brief constructor
+ * @param manager Maneger Object
+ */
+foo::foo(RTC::Manager* manager)
+    // <rtc-template block="initializer">
+  : RTC::DataFlowComponentBase(manager)
+
+    // </rtc-template>
+{
+}
+
+/*!
+ * @brief destructor
+ */
+foo::~foo()
+{
+}
+
+
+
+RTC::ReturnCode_t foo::onInitialize()
+{
+  // Registration: InPort/OutPort/Service
+  // <rtc-template block="registration">
+  // Set InPort buffers
+  
+  // Set OutPort buffer
+  
+  // Set service provider to Ports
+  
+  // Set service consumers to Ports
+  
+  // Set CORBA Service Ports
+  
+  // </rtc-template>
+
+  // <rtc-template block="bind_config">
+  // </rtc-template>
+  init();
+  
+  return RTC::RTC_OK;
+}
+
+
+RTC::ReturnCode_t foo::onFinalize()
+{
+  fin();
+  return RTC::RTC_OK;
+}
+
+/*
+RTC::ReturnCode_t foo::onStartup(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onShutdown(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onActivated(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onDeactivated(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onExecute(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onAborting(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onError(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onReset(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onStateUpdate(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+/*
+RTC::ReturnCode_t foo::onRateChanged(RTC::UniqueId ec_id)
+{
+  return RTC::RTC_OK;
+}
+*/
+
+  public void publicOpe(){}
+  protected void protectedOpe(){}
+  private void privateOpe(){}
+
+
+extern "C"
+{
+ 
+  void fooInit(RTC::Manager* manager)
+  {
+    coil::Properties profile(foo_spec);
+    manager->registerFactory(profile,
+                             RTC::Create<foo>,
+                             RTC::Delete<foo>);
+  }
+  
+};
+
+

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Content/foo.h
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Content/foo.h	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Content/foo.h	2012-08-01 14:56:46 UTC (rev 335)
@@ -0,0 +1,279 @@
+// -*- C++ -*-
+/*!
+ * @file  foo.h
+ * @brief MDesc
+ * @date  $Date$
+ *
+ * $Id$
+ */
+
+#ifndef FOO_H
+#define FOO_H
+
+#include <rtm/Manager.h>
+#include <rtm/DataFlowComponentBase.h>
+#include <rtm/CorbaPort.h>
+#include <rtm/DataInPort.h>
+#include <rtm/DataOutPort.h>
+#include <rtm/idl/BasicDataTypeSkel.h>
+#include <rtm/idl/ExtendedDataTypesSkel.h>
+#include <rtm/idl/InterfaceDataTypesSkel.h>
+
+// Service implementation headers
+// <rtc-template block="service_impl_h">
+
+// </rtc-template>
+
+// Service Consumer stub headers
+// <rtc-template block="consumer_stub_h">
+
+// </rtc-template>
+
+using namespace RTC;
+
+/*!
+ * @class foo
+ * @brief MDesc
+ *
+ */
+class foo
+  : public RTC::DataFlowComponentBase
+{
+ public:
+  /*!
+   * @brief constructor
+   * @param manager Maneger Object
+   */
+  foo(RTC::Manager* manager);
+
+  /*!
+   * @brief destructor
+   */
+  ~foo();
+
+  // <rtc-template block="public_attribute">
+    publicdParam;
+  
+  // </rtc-template>
+
+  // <rtc-template block="public_operation">
+    publicOpe();
+  
+  // </rtc-template>
+
+  /***
+   *
+   * The initialize action (on CREATED->ALIVE transition)
+   * formaer rtc_init_entry() 
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+   virtual RTC::ReturnCode_t onInitialize();
+
+  /***
+   *
+   * The finalize action (on ALIVE->END transition)
+   * formaer rtc_exiting_entry()
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+   virtual RTC::ReturnCode_t onFinalize();
+
+  /***
+   *
+   * The startup action when ExecutionContext startup
+   * former rtc_starting_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onStartup(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The shutdown action when ExecutionContext stop
+   * former rtc_stopping_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onShutdown(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The activated action (Active state entry action)
+   * former rtc_active_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onActivated(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The deactivated action (Active state exit action)
+   * former rtc_active_exit()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onDeactivated(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The execution action that is invoked periodically
+   * former rtc_active_do()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onExecute(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The aborting action when main logic error occurred.
+   * former rtc_aborting_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onAborting(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * The error action in ERROR state
+   * former rtc_error_do()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onError(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * 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
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onReset(RTC::UniqueId ec_id);
+  
+  /***
+   *
+   * 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
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onStateUpdate(RTC::UniqueId ec_id);
+
+  /***
+   *
+   * 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
+   * 
+   * 
+   */
+  // virtual RTC::ReturnCode_t onRateChanged(RTC::UniqueId ec_id);
+
+
+ protected:
+  // <rtc-template block="protected_attribute">
+    protectedParam;
+  
+  // </rtc-template>
+
+  // <rtc-template block="protected_operation">
+    protectedOpe();
+  
+  // </rtc-template>
+
+  // Configuration variable declaration
+  // <rtc-template block="config_declare">
+
+  // </rtc-template>
+
+  // DataInPort declaration
+  // <rtc-template block="inport_declare">
+  
+  // </rtc-template>
+
+
+  // DataOutPort declaration
+  // <rtc-template block="outport_declare">
+  
+  // </rtc-template>
+
+  // CORBA Port declaration
+  // <rtc-template block="corbaport_declare">
+  
+  // </rtc-template>
+
+  // Service declaration
+  // <rtc-template block="service_declare">
+  
+  // </rtc-template>
+
+  // Consumer declaration
+  // <rtc-template block="consumer_declare">
+  
+  // </rtc-template>
+
+ private:
+  // <rtc-template block="private_attribute">
+    privateParam;
+    privateParam2;
+  
+  // </rtc-template>
+
+  // <rtc-template block="private_operation">
+    privateOpe();
+  
+  // </rtc-template>
+
+};
+
+
+extern "C"
+{
+  DLL_EXPORT void fooInit(RTC::Manager* manager);
+};
+
+#endif // FOO_H

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Content/fooComp.cpp
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Content/fooComp.cpp	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/resource/100/CXX/Content/fooComp.cpp	2012-08-01 14:56:46 UTC (rev 335)
@@ -0,0 +1,97 @@
+// -*- C++ -*-
+/*!
+ * @file fooComp.cpp
+ * @brief Standalone component
+ * @date $Date$
+ *
+ * $Id$
+ */
+
+#include <rtm/Manager.h>
+#include <iostream>
+#include <string>
+#include <stdlib.h>
+#include "foo.h"
+
+
+void MyModuleInit(RTC::Manager* manager)
+{
+  fooInit(manager);
+  RTC::RtcBase* comp;
+
+  // Create a component
+  comp = manager->createComponent("foo");
+
+  if (comp==NULL)
+  {
+    std::cerr << "Component create failed." << std::endl;
+    abort();
+  }
+
+  // Example
+  // The following procedure is examples how handle RT-Components.
+  // These should not be in this function.
+
+  // Get the component's object reference
+//  RTC::RTObject_var rtobj;
+//  rtobj = RTC::RTObject::_narrow(manager->getPOA()->servant_to_reference(comp));
+
+  // Get the port list of the component
+//  PortServiceList* portlist;
+//  portlist = rtobj->get_ports();
+
+  // getting port profiles
+//  std::cout << "Number of Ports: ";
+//  std::cout << portlist->length() << std::endl << std::endl; 
+//  for (CORBA::ULong i(0), n(portlist->length()); i < n; ++i)
+//  {
+//    PortService_ptr port;
+//    port = (*portlist)[i];
+//    std::cout << "Port" << i << " (name): ";
+//    std::cout << port->get_port_profile()->name << std::endl;
+//    
+//    RTC::PortInterfaceProfileList iflist;
+//    iflist = port->get_port_profile()->interfaces;
+//    std::cout << "---interfaces---" << std::endl;
+//    for (CORBA::ULong i(0), n(iflist.length()); i < n; ++i)
+//    {
+//      std::cout << "I/F name: ";
+//      std::cout << iflist[i].instance_name << std::endl;
+//      std::cout << "I/F type: ";
+//      std::cout << iflist[i].type_name << std::endl;
+//      const char* pol;
+//      pol = iflist[i].polarity == 0 ? "PROVIDED" : "REQUIRED";
+//      std::cout << "Polarity: " << pol << std::endl;
+//    }
+//    std::cout << "---properties---" << std::endl;
+//    NVUtil::dump(port->get_port_profile()->properties);
+//    std::cout << "----------------" << std::endl << std::endl;
+//  }
+
+  return;
+}
+
+int main (int argc, char** argv)
+{
+  RTC::Manager* manager;
+  manager = RTC::Manager::init(argc, argv);
+
+  // Initialize manager
+  manager->init(argc, argv);
+
+  // Set module initialization proceduer
+  // This procedure will be invoked in activateManager() function.
+  manager->setModuleInitProc(MyModuleInit);
+
+  // Activate manager and register to naming service
+  manager->activateManager();
+
+  // run the manager in blocking mode
+  // runManager(false) is the default.
+  manager->runManager();
+
+  // If you want to run the manager in non-blocking mode, do like this
+  // manager->runManager(true);
+
+  return 0;
+}

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/Generator.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/Generator.java	2012-07-14 09:48:15 UTC (rev 334)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/Generator.java	2012-08-01 14:56:46 UTC (rev 335)
@@ -111,6 +111,12 @@
 		List<ServiceClassParam> IDLPathParams = new ArrayList<ServiceClassParam>();
 		List<GeneratedResult> result = new ArrayList<GeneratedResult>();
 		for( RtcParam rtcParam : generatorParam.getRtcParams() ) {
+			//onImplementedフラグの修正
+			for(int index=IRtcBuilderConstants.ACTIVITY_INITIALIZE;index<IRtcBuilderConstants.ACTIVITY_DUMMY;index++) {
+				if(rtcParam.getDetailContent(index)!=null && 0<rtcParam.getDetailContent(index).length()) {
+					rtcParam.setActionImplemented(index, true);
+				}
+			}
 			rtcParam.checkAndSetParameter();
 			for( ServicePortParam serviceport : rtcParam.getServicePorts() ) {
 				for( ServicePortInterfaceParam serviceInterfaces : serviceport.getServicePortInterfaces() ) {
@@ -506,6 +512,8 @@
 						}
 	
 						isOutput = true;
+					} catch (NullPointerException e) {
+						e.printStackTrace();
 					} catch (CoreException e) {
 						e.printStackTrace();
 					}

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/RtcParam.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/RtcParam.java	2012-07-14 09:48:15 UTC (rev 334)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/generator/param/RtcParam.java	2012-08-01 14:56:46 UTC (rev 335)
@@ -99,6 +99,10 @@
 	private RecordedList<String> protectedOperations = new RecordedList<String>();
 	private RecordedList<String> publicOperations = new RecordedList<String>();
 	//
+	private String[] detailContent = new String[IRtcBuilderConstants.ACTIVITY_DUMMY];
+	private String privateOpeSource;
+	private String protectedOpeSource;
+	private String publicOpeSource;
 	//Prefix,Suffix
 	private String commonPrefix;
 	private String commonSuffix;
@@ -779,7 +783,35 @@
 		}
 		return false;
 	}
+	
+	public void setDetailContent(int index, String target) {
+		detailContent[index] = target;
+	}
+	public String getDetailContent(int index) {
+		return detailContent[index];
+	}
 
+	public String getPrivateOpeSource() {
+		return privateOpeSource;
+	}
+	public void setPrivateOpeSource(String privateOpeSource) {
+		this.privateOpeSource = privateOpeSource;
+	}
+
+	public String getProtectedOpeSource() {
+		return protectedOpeSource;
+	}
+	public void setProtectedOpeSource(String protectedOpeSource) {
+		this.protectedOpeSource = protectedOpeSource;
+	}
+
+	public String getPublicOpeSource() {
+		return publicOpeSource;
+	}
+	public void setPublicOpeSource(String publicOpeSource) {
+		this.publicOpeSource = publicOpeSource;
+	}
+
 	@Override
 	public boolean isUpdated() {
 		if (super.isUpdated()) {

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/TemplateHelper.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/TemplateHelper.java	2012-07-14 09:48:15 UTC (rev 334)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/TemplateHelper.java	2012-08-01 14:56:46 UTC (rev 335)
@@ -317,4 +317,16 @@
 		}
 		return true;
 	}
+	
+	public boolean checkDetailContent(int index, RtcParam param) {
+		if(param.getDetailContent(index)==null || param.getDetailContent(index).length()==0)
+			return false;
+		return true;
+	}
+	
+	public boolean checkContents(String target) {
+		if( target==null || target.length()==0 )
+			return false;
+		return true;
+	}
 }

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_RTC.cpp.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_RTC.cpp.vsl	2012-07-14 09:48:15 UTC (rev 334)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_RTC.cpp.vsl	2012-08-01 14:56:46 UTC (rev 335)
@@ -140,6 +140,8 @@
 #end
 #end
   // </rtc-template>
+#if(${tmpltHelper.checkDetailContent(0,${rtcParam})})${rtcParam.getDetailContent(0)}
+#end
   
   return RTC::RTC_OK;
 }
@@ -154,6 +156,8 @@
 
 RTC::ReturnCode_t ${rtcParam.name}::onFinalize()
 {
+#if(${tmpltHelper.checkDetailContent(1,${rtcParam})})${rtcParam.getDetailContent(1)}
+#end
   return RTC::RTC_OK;
 }
 #if(${rtcParam.IsNotImplemented(1)})*/
@@ -167,6 +171,8 @@
 
 RTC::ReturnCode_t ${rtcParam.name}::onStartup(RTC::UniqueId ec_id)
 {
+#if(${tmpltHelper.checkDetailContent(2,${rtcParam})})${rtcParam.getDetailContent(2)}
+#end
   return RTC::RTC_OK;
 }
 #if(${rtcParam.IsNotImplemented(2)})*/
@@ -180,6 +186,8 @@
 
 RTC::ReturnCode_t ${rtcParam.name}::onShutdown(RTC::UniqueId ec_id)
 {
+#if(${tmpltHelper.checkDetailContent(3,${rtcParam})})${rtcParam.getDetailContent(3)}
+#end
   return RTC::RTC_OK;
 }
 #if(${rtcParam.IsNotImplemented(3)})*/
@@ -193,6 +201,8 @@
 
 RTC::ReturnCode_t ${rtcParam.name}::onActivated(RTC::UniqueId ec_id)
 {
+#if(${tmpltHelper.checkDetailContent(4,${rtcParam})})${rtcParam.getDetailContent(4)}
+#end
   return RTC::RTC_OK;
 }
 #if(${rtcParam.IsNotImplemented(4)})*/
@@ -206,6 +216,8 @@
 
 RTC::ReturnCode_t ${rtcParam.name}::onDeactivated(RTC::UniqueId ec_id)
 {
+#if(${tmpltHelper.checkDetailContent(5,${rtcParam})})${rtcParam.getDetailContent(5)}
+#end
   return RTC::RTC_OK;
 }
 #if(${rtcParam.IsNotImplemented(5)})*/
@@ -219,6 +231,8 @@
 
 RTC::ReturnCode_t ${rtcParam.name}::onExecute(RTC::UniqueId ec_id)
 {
+#if(${tmpltHelper.checkDetailContent(9,${rtcParam})})${rtcParam.getDetailContent(9)}
+#end
   return RTC::RTC_OK;
 }
 #if(${rtcParam.IsNotImplemented(9)})*/
@@ -232,6 +246,8 @@
 
 RTC::ReturnCode_t ${rtcParam.name}::onAborting(RTC::UniqueId ec_id)
 {
+#if(${tmpltHelper.checkDetailContent(6,${rtcParam})})${rtcParam.getDetailContent(6)}
+#end
   return RTC::RTC_OK;
 }
 #if(${rtcParam.IsNotImplemented(6)})*/
@@ -245,6 +261,8 @@
 
 RTC::ReturnCode_t ${rtcParam.name}::onError(RTC::UniqueId ec_id)
 {
+#if(${tmpltHelper.checkDetailContent(7,${rtcParam})})${rtcParam.getDetailContent(7)}
+#end
   return RTC::RTC_OK;
 }
 #if(${rtcParam.IsNotImplemented(7)})*/
@@ -258,6 +276,8 @@
 
 RTC::ReturnCode_t ${rtcParam.name}::onReset(RTC::UniqueId ec_id)
 {
+#if(${tmpltHelper.checkDetailContent(8,${rtcParam})})${rtcParam.getDetailContent(8)}
+#end
   return RTC::RTC_OK;
 }
 #if(${rtcParam.IsNotImplemented(8)})*/
@@ -271,6 +291,8 @@
 
 RTC::ReturnCode_t ${rtcParam.name}::onStateUpdate(RTC::UniqueId ec_id)
 {
+#if(${tmpltHelper.checkDetailContent(10,${rtcParam})})${rtcParam.getDetailContent(10)}
+#end
   return RTC::RTC_OK;
 }
 #if(${rtcParam.IsNotImplemented(10)})*/
@@ -284,11 +306,19 @@
 
 RTC::ReturnCode_t ${rtcParam.name}::onRateChanged(RTC::UniqueId ec_id)
 {
+#if(${tmpltHelper.checkDetailContent(11,${rtcParam})})${rtcParam.getDetailContent(11)}
+#end
   return RTC::RTC_OK;
 }
 #if(${rtcParam.IsNotImplemented(11)})*/
 #end
 
+#if(${tmpltHelper.checkContents(${rtcParam.publicOpeSource})})${rtcParam.publicOpeSource}
+#end
+#if(${tmpltHelper.checkContents(${rtcParam.protectedOpeSource})})${rtcParam.protectedOpeSource}
+#end
+#if(${tmpltHelper.checkContents(${rtcParam.privateOpeSource})})${rtcParam.privateOpeSource}
+#end
 
 
 extern "C"

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_RTC.h.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_RTC.h.vsl	2012-07-14 09:48:15 UTC (rev 334)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/template/cpp/CXX_RTC.h.vsl	2012-08-01 14:56:46 UTC (rev 335)
@@ -78,14 +78,14 @@
 
   // <rtc-template block="public_attribute">
 #foreach($publicAttribute in ${rtcParam.publicAttributes})
-  ${publicAttribute};
+  ${publicAttribute}
 #end
   
   // </rtc-template>
 
   // <rtc-template block="public_operation">
 #foreach($publicOperation in ${rtcParam.publicOperations})
-  ${publicOperation};
+  ${publicOperation}
 #end
   
   // </rtc-template>
@@ -318,14 +318,14 @@
  protected:
   // <rtc-template block="protected_attribute">
 #foreach($protectedAttribute in ${rtcParam.protectedAttributes})
-  ${protectedAttribute};
+  ${protectedAttribute}
 #end
   
   // </rtc-template>
 
   // <rtc-template block="protected_operation">
 #foreach($protectedOperation in ${rtcParam.protectedOperations})
-  ${protectedOperation};
+  ${protectedOperation}
 #end
   
   // </rtc-template>
@@ -475,14 +475,14 @@
  private:
   // <rtc-template block="private_attribute">
 #foreach($privateAttribute in ${rtcParam.privateAttributes})
-  ${privateAttribute};
+  ${privateAttribute}
 #end
   
   // </rtc-template>
 
   // <rtc-template block="private_operation">
 #foreach($privateOperation in ${rtcParam.privateOperations})
-  ${privateOperation};
+  ${privateOperation}
 #end
   
   // </rtc-template>

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/ui/editors/BasicEditorFormPage.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/ui/editors/BasicEditorFormPage.java	2012-07-14 09:48:15 UTC (rev 334)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/src/jp/go/aist/rtm/rtcbuilder/ui/editors/BasicEditorFormPage.java	2012-08-01 14:56:46 UTC (rev 335)
@@ -1,11 +1,7 @@
 package jp.go.aist.rtm.rtcbuilder.ui.editors;
 
 import java.io.ByteArrayInputStream;
-import java.io.File;
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
 import java.util.GregorianCalendar;
 import java.util.Iterator;
 import java.util.List;
@@ -29,7 +25,6 @@
 import jp.go.aist.rtm.rtcbuilder.util.StringUtil;
 
 import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IProjectDescription;
 import org.eclipse.core.resources.IResource;

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/AllTestsCXX.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/AllTestsCXX.java	2012-07-14 09:48:15 UTC (rev 334)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/AllTestsCXX.java	2012-08-01 14:56:46 UTC (rev 335)
@@ -31,6 +31,7 @@
 		suite.addTestSuite(CXXConfigSetTest.class);
 		suite.addTestSuite(CXXIDLStructTest.class);
 		suite.addTestSuite(CXXManipTest.class);
+		suite.addTestSuite(CXXContentTest.class);
 		//$JUnit-END$
 		return suite;
 	}

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/CXXContentTest.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/CXXContentTest.java	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder/test/jp/go/aist/rtm/rtcbuilder/_test/_100/CXXContentTest.java	2012-08-01 14:56:46 UTC (rev 335)
@@ -0,0 +1,68 @@
+package jp.go.aist.rtm.rtcbuilder._test._100;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import jp.go.aist.rtm.rtcbuilder.Generator;
+import jp.go.aist.rtm.rtcbuilder.IRtcBuilderConstants;
+import jp.go.aist.rtm.rtcbuilder._test.TestBase;
+import jp.go.aist.rtm.rtcbuilder.generator.GeneratedResult;
+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;
+import jp.go.aist.rtm.rtcbuilder.generator.param.ServicePortInterfaceParam;
+import jp.go.aist.rtm.rtcbuilder.generator.param.ServicePortParam;
+
+public class CXXContentTest extends TestBase {
+
+	RtcParam rtcParam;
+	GeneratorParam genParam;
+
+	protected void setUp() throws Exception {
+		genParam = new GeneratorParam();
+		rtcParam = new RtcParam(genParam, true);
+		rtcParam.setOutputProject(rootPath + "/resource/work");
+		rtcParam.setLanguage(IRtcBuilderConstants.LANG_CPP);
+		rtcParam.setLanguageArg(IRtcBuilderConstants.LANG_CPP_ARG);
+		rtcParam.setRtmVersion("1.0.0");
+		rtcParam.setIsTest(true);
+		genParam.getRtcParams().add(rtcParam);
+	}
+
+	public void testBasic() throws Exception {
+		rtcParam.setName("foo");
+		rtcParam.setDescription("MDesc");
+		rtcParam.setVersion("1.0.1");
+		rtcParam.setVender("TA");
+		rtcParam.setCategory("Manip");
+		rtcParam.setComponentType("STATIC2");
+		rtcParam.setComponentKind("DataFlowComponent");
+		rtcParam.setActivityType("PERIODIC2");
+		rtcParam.setMaxInstance(5);
+		rtcParam.setEnableOldBuildEnv(true);
+		//
+		rtcParam.setDetailContent(IRtcBuilderConstants.ACTIVITY_INITIALIZE, "  init();");
+		rtcParam.setDetailContent(IRtcBuilderConstants.ACTIVITY_FINALIZE, "  fin();");
+		rtcParam.getPrivateAttributes().add("  privateParam");
+		rtcParam.getPrivateAttributes().add("  privateParam2");
+		rtcParam.getProtectedAttributes().add("  protectedParam");
+		rtcParam.getPublicAttributes().add("  publicdParam");
+		rtcParam.getPrivateOperations().add("  privateOpe()");
+		rtcParam.getProtectedOperations().add("  protectedOpe()");
+		rtcParam.getPublicOperations().add("  publicOpe()");
+		rtcParam.setPrivateOpeSource("  private void privateOpe(){}");
+		rtcParam.setProtectedOpeSource("  protected void protectedOpe(){}");
+		rtcParam.setPublicOpeSource("  public void publicOpe(){}");
+
+		Generator generator = new Generator();
+		List<GeneratedResult> result = generator.generateTemplateCode(genParam);
+
+		String resourceDir = rootPath + "/resource/100/CXX/Content/";
+
+		assertEquals(15, result.size());
+		checkCode(result, resourceDir, "fooComp.cpp");
+		checkCode(result, resourceDir, "foo.h");
+		checkCode(result, resourceDir, "foo.cpp");
+	}
+
+}



More information about the openrtm-commit mailing list