[openrtm-commit:02386] r933 - in trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples: . Fsm

openrtm @ openrtm.org openrtm @ openrtm.org
2017年 2月 6日 (月) 17:30:33 JST


Author: win-ei
Date: 2017-02-06 17:30:33 +0900 (Mon, 06 Feb 2017)
New Revision: 933

Added:
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/CameraProtocol.java
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Configuring.java
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Fsm.bat
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Fsm.conf
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Fsm.java
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Fsm.sh
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/FsmComp.java
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/FsmImpl.java
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Idle.java
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/NotShooting.java
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Off.java
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera.java
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera_Focused.java
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera_Focusing.java
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera_Shooting.java
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera_Storing.java
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Top.java
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/rtc.conf
Log:
[FSM4RTC,example] StaticFsm -> Fsm  refs #3775

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/CameraProtocol.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/CameraProtocol.java	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/CameraProtocol.java	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,22 @@
+package RTMExamples.Fsm;
+
+import RTC.TimedLong;
+/**
+ * 
+ */
+public interface CameraProtocol {
+
+    void on_do();
+
+    void EvOn(TimedLong param);
+    void EvOff(TimedLong param);
+    void EvConfig(TimedLong param);
+    void EvInFocus(TimedLong param);
+    void EvShutterHalf(TimedLong param);
+    void EvShutterFull(TimedLong param);
+    void EvShutterReleased(TimedLong param);
+
+    public boolean isOutputData(); 
+    public int getOutputData(); 
+}
+

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Configuring.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Configuring.java	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Configuring.java	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,36 @@
+package RTMExamples.Fsm;
+
+import jp.go.aist.rtm.RTC.jfsm.DeepHistory;
+import jp.go.aist.rtm.RTC.jfsm.State;
+
+import RTC.TimedLong;
+/**
+ * 
+ */
+ at DeepHistory
+public class Configuring extends NotShooting {
+
+    @Override
+    public void onEntry() {
+        System.out.println("Configuring::onEntry");
+        setOutputData(4);
+    }
+
+    @Override
+    public void onExit() {
+        System.out.println("Configuring::onExit");
+    }
+
+    @Override
+    public void on_do() {
+        System.out.println("Configuring::on_do");
+    }
+
+    @Override
+    public void EvConfig(TimedLong param){
+        System.out.println("Configuring::EvConfig");
+        setState(new State(Idle.class));
+    }
+
+}
+

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Fsm.bat
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Fsm.bat	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Fsm.bat	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,3 @@
+ at call set_classpath.bat
+java FsmComp  -f RTMExamples\Fsm\rtc.conf %*
+pause;

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Fsm.conf
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Fsm.conf	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Fsm.conf	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,140 @@
+# -*- sh -*-
+#------------------------------------------------------------
+# Configuration file for StaticFsm
+#
+# This configuration file name should be specified in rtc.conf (or other
+# configuration file specified by -f option) by "config_file" property.
+#
+# example.StaticFsm.config_file: StaticFsm.conf
+# or
+# example.StaticFsm0.config_file: StaticFsm0.conf
+# example.StaticFsm1.config_file: StaticFsm1.conf
+# example.StaticFsm2.config_file: StaticFsm2.conf
+#
+# ------------------------------------------------------------
+# An example configuration file for StaticFsm
+#
+# See details in the following reference manual
+#
+
+# Execution context configuration
+# exec_cxt.periodic.type: PeriodicExecutionContext
+# exec_cxt.periodic.rate: 1000
+#
+#
+# configuration.active_config: mode0
+
+# Additional configuration-set example named "mode0"
+#
+# conf.mode0.int_param0: 0
+# conf.mode0.int_param1: 1
+# conf.mode0.double_param0: 0.99
+# conf.mode0.double_param1: -0.99
+# conf.mode0.str_param0: default
+# conf.mode0.str_param1: default set in conf file
+# conf.mode0.vector_param0: 0.0,0.1,0.2,0.3,0.4,0.5,0.6
+#
+# Other configuration set named "mode1"
+#
+# conf.mode1.int_param0: 0
+# conf.mode1.int_param1: 1
+# conf.mode1.double_param0: 0.99
+# conf.mode1.double_param1: -0.99
+# conf.mode1.str_param0: default
+# conf.mode1.str_param1: default set in conf file
+# conf.mode1.vector_param0: 0.0,0.1,0.2,0.3,0.4,0.5,0.6
+
+
+
+
+
+##============================================================
+## Component configuration reference
+##
+
+##============================================================
+## Active configuration-set
+##============================================================
+##
+## Initial active configuration-set. The following "mode0" is a
+## configuration-set name.  A configuration-set named "mode0" should be
+## appear in this configuration file as follows.
+##
+## configuration.active_config: mode0
+##
+# conf.mode0.param0: hoge
+# conf.mode0.param1: fuga
+# conf.mode0.param2: munya
+
+##============================================================
+## GUI control option for RTSystemEditor
+##============================================================
+## Available GUI control options [__widget__]:
+##
+## - text:          text box [default].
+## - slider.<step>: Horizontal slider. <step> is step for the slider.
+##                  A range constraints option is required. 
+## - spin:          Spin button. A range constraitns option is required.
+## - radio:         Radio button. An enumeration constraints is required.
+## - checkbox:      Checkbox control. An enumeration constraints is
+##                  required. The parameter has to be able to accept a
+##                  comma separated list.
+## - orderd_list:   Orderd list control.  An enumeration constraint is
+##                  required. The parameter has to be able to accept a
+##                  comma separated list. In this control, Enumerated
+##                  elements can appear one or more times in the given list.
+##
+## Available GUI control constraint options [__constraints__]:
+##
+## - none:         blank
+## - direct value: 100 (constant value)
+## - range:        <, >, <=, >= can be used.
+## - enumeration:  (enum0, enum1, ...)
+## - array:        <constraints0>, ,constraints1>, ... for only array value
+## - hash:         {key0: value0, key1:, value0, ...}
+##
+## examples:
+# conf.__widget__.int_param0: slider.10
+# conf.__widget__.int_param1: spin
+# conf.__widget__.double_param0: slider.10
+# conf.__widget__.double_param1: text
+# conf.__widget__.str_param0: radio
+# conf.__widget__.vector_param0: checkbox
+# conf.__widget__.vector_param1: orderd_list
+
+
+# conf.__constraints__.int_param0: 0<=x<=150
+# conf.__constraints__.int_param1: 0<=x<=1000
+# conf.__constraints__.double_param0: 0<=x<=100
+# conf.__constraints__.double_param1:
+# conf.__constraints__.str_param0: (default,mode0,mode1)
+# conf.__constraints__.vector_param0: (dog,monky,pheasant,cat)
+# conf.__constraints__.vector_param1: (pita,gora,switch)
+
+
+##============================================================
+## Execution context settings
+##============================================================
+##
+## Periodic type ExecutionContext
+##
+## Other availabilities in OpenRTM-aist
+##
+## - ExtTrigExecutionContext: External triggered EC. It is embedded in
+##                            OpenRTM library.
+## - OpenHRPExecutionContext: External triggred paralell execution
+##                            EC. It is embedded in OpenRTM
+##                            library. This is usually used with
+##                            OpenHRP3.
+## - RTPreemptEC:             Real-time execution context for Linux
+##                            RT-preemptive pathed kernel.
+## - ArtExecutionContext:     Real-time execution context for ARTLinux
+##                            (http://sourceforge.net/projects/art-linux/)
+##
+# exec_cxt.periodic.type: PeriodicExecutionContext
+
+##
+## The execution cycle of ExecutionContext
+##
+exec_cxt.periodic.rate:1000.0
+

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Fsm.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Fsm.java	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Fsm.java	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,53 @@
+package RTMExamples.Fsm;
+/**
+ * {@.ja Fsm}
+ * {@.en Fsm}
+ *
+ */
+
+import jp.go.aist.rtm.RTC.Manager;
+import jp.go.aist.rtm.RTC.RTObject_impl;
+import jp.go.aist.rtm.RTC.RtcDeleteFunc;
+import jp.go.aist.rtm.RTC.RtcNewFunc;
+import jp.go.aist.rtm.RTC.RegisterModuleFunc;
+import jp.go.aist.rtm.RTC.util.Properties;
+
+/**
+ * {@.ja Definition class}
+ * {@.en Definition class}
+ * <p>
+ * {@.ja The class where ComponentProfile(etc) was defined.}
+ * {@.en The class where ComponentProfile(etc) was defined.}
+ */
+public class Fsm implements RtcNewFunc, RtcDeleteFunc, RegisterModuleFunc {
+
+//  Module specification
+//  <rtc-template block="module_spec">
+    public static String component_conf[] = {
+        "implementation_id", "Fsm",
+        "type_name",         "Fsm",
+        "description",       "Fsm",
+        "version",           "1.0.0",
+        "vendor",            "Noriaki Ando, AIST",
+        "category",          "example",
+        "activity_type",     "STATIC",
+        "max_instance",      "1",
+        "language",          "Java",
+        "lang_type",         "compile",
+        ""
+            };
+//  </rtc-template>
+
+    public RTObject_impl createRtc(Manager mgr) {
+        return new FsmImpl(mgr);
+    }
+
+    public void deleteRtc(RTObject_impl rtcBase) {
+        rtcBase = null;
+    }
+    public void registerModule() {
+        Properties prop = new Properties(component_conf);
+        final Manager manager = Manager.instance();
+        manager.registerFactory(prop, new Fsm(), new Fsm());
+    }
+}

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Fsm.sh
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Fsm.sh	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Fsm.sh	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+if test "x$RTM_JAVA_ROOT" = "x" ; then
+    echo "Environment variable RTM_JAVA_ROOT is not set."
+    echo "Please specify the OpenRTM-aist installation directory."
+    echo "Abort."
+    exit 1
+fi
+
+. ./search_classpath.func
+export CLASSPATH=`get_classpath`
+java RTMExamples.Fsm.FsmComp -f RTMExamples/Fsm/rtc.conf ${1+"$@"}

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/FsmComp.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/FsmComp.java	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/FsmComp.java	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,122 @@
+package RTMExamples.Fsm;
+/**
+ * 
+ * {@.ja Standalone component}
+ * {@.en Standalone component}
+ *
+ */
+
+import jp.go.aist.rtm.RTC.Manager;
+import jp.go.aist.rtm.RTC.ModuleInitProc;
+import jp.go.aist.rtm.RTC.RTObject_impl;
+import jp.go.aist.rtm.RTC.util.NVUtil;
+import jp.go.aist.rtm.RTC.util.Properties;
+
+import RTC.ComponentProfile;
+import RTC.PortService;
+import RTC.PortServiceListHolder;
+import RTC.PortInterfacePolarity;
+import RTC.PortInterfaceProfileListHolder;
+import RTC.RTObject;
+import RTC.RTObjectHelper;
+
+import _SDOPackage.NVListHolder;
+/**
+ * {@.ja Sample component of static FSM}
+ * {@.en Sample component of static FSM}
+ *
+ */
+public class FsmComp implements ModuleInitProc {
+
+    public void myModuleInit(Manager mgr) {
+        Properties prop = new Properties(Fsm.component_conf);
+        mgr.registerFactory(prop, new Fsm(), new Fsm());
+
+        // Create a component
+        System.out.println("Creating a component: \"Fsm\"....");
+        RTObject_impl comp = mgr.createComponent("Fsm");
+        if( comp==null ) {
+    	    System.err.println("Component create failed.");
+    	    System.exit(0);
+        }
+        System.out.println("succeed.");
+      
+        ComponentProfile prof = comp.get_component_profile();
+        System.out.println( "=================================================" );
+        System.out.println( " Component Profile" );
+        System.out.println( "-------------------------------------------------" );
+        System.out.println( "InstanceID:     " + prof.instance_name );
+        System.out.println( "Implementation: " + prof.type_name );
+        System.out.println( "Description:    " + prof.description );
+        System.out.println( "Version:        " + prof.version );
+        System.out.println( "Maker:          " + prof.vendor );
+        System.out.println( "Category:       " + prof.category );
+        System.out.println( "  Other properties   " );
+        NVUtil.dump(new NVListHolder(prof.properties));
+        System.out.println( "=================================================" );
+        // Example
+        // The following procedure is examples how handle RT-Components.
+        // These should not be in this function.
+
+        // Get the component's object reference
+        Manager manager = Manager.instance();
+        RTObject rtobj = null;
+        try {
+            rtobj = RTObjectHelper.narrow(manager.getPOA().servant_to_reference(comp));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        // Get the port list of the component
+        PortServiceListHolder ports = new PortServiceListHolder();
+        ports.value = rtobj.get_ports();
+
+        // getting port profiles
+        System.out.println( "Number of Ports: " );
+        System.out.println( ports.value.length );
+        for( int intIdx=0;intIdx<ports.value.length;++intIdx ) {
+            PortService port = ports.value[intIdx];
+            System.out.println( "Port" + intIdx + " (name): ");
+            System.out.println( port.get_port_profile().name );
+        
+            PortInterfaceProfileListHolder iflist = new PortInterfaceProfileListHolder();
+            iflist.value = port.get_port_profile().interfaces;
+            System.out.println( "---interfaces---" );
+            for( int intIdx2=0;intIdx2<iflist.value.length;++intIdx2 ) {
+                System.out.println( "I/F name: " );
+                System.out.println( iflist.value[intIdx2].instance_name  );
+                System.out.println( "I/F type: " );
+                System.out.println( iflist.value[intIdx2].type_name );
+                if( iflist.value[intIdx2].polarity==PortInterfacePolarity.PROVIDED ) {
+                    System.out.println( "Polarity: PROVIDED" );
+                } else {
+                    System.out.println( "Polarity: REQUIRED" );
+                }
+            }
+            System.out.println( "---properties---" );
+            NVUtil.dump( new NVListHolder(port.get_port_profile().properties) );
+            System.out.println( "----------------" );
+        }  
+    }
+
+    public static void main(String[] args) {
+        // Initialize manager
+        final Manager manager = Manager.init(args);
+
+        // Set module initialization proceduer
+        // This procedure will be invoked in activateManager() function.
+        FsmComp init = new FsmComp();
+        manager.setModuleInitProc(init);
+
+        // 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);
+    }
+
+}

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/FsmImpl.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/FsmImpl.java	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/FsmImpl.java	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,479 @@
+package RTMExamples.Fsm;
+/**
+ * {@.ja FsmImpl}
+ * {@.en FsmImpl}
+ */
+
+import java.lang.reflect.Array;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import java.util.ArrayDeque;
+import java.util.Queue;
+
+import jp.go.aist.rtm.RTC.DataFlowComponentBase;
+import jp.go.aist.rtm.RTC.Manager;
+import jp.go.aist.rtm.RTC.connectorListener.ReturnCode;
+import jp.go.aist.rtm.RTC.jfsm.Event;
+import jp.go.aist.rtm.RTC.jfsm.Machine;
+import jp.go.aist.rtm.RTC.jfsm.machine.EventBase;
+import jp.go.aist.rtm.RTC.port.ConnectorBase;
+import jp.go.aist.rtm.RTC.port.InPort;
+import jp.go.aist.rtm.RTC.port.OutPort;
+import jp.go.aist.rtm.RTC.port.ConnectorDataListenerT;
+import jp.go.aist.rtm.RTC.port.ConnectorDataListenerType;
+import jp.go.aist.rtm.RTC.util.DataRef;
+
+import RTC.TimedLong;
+import RTC.ReturnCode_t;
+
+/**
+ * {@.ja Implemented class of a sample component of static FSM}
+ * {@.en Implemented class of a sample component of static FSM}
+ *
+ */
+public class FsmImpl extends DataFlowComponentBase {
+
+  /**
+   * {@.ja  constructor}
+   * {@.en  constructor}
+   * @param manager 
+   *   {@.ja Maneger Object}
+   *   {@.en Maneger Object}
+   */
+  public FsmImpl(Manager manager) {  
+      super(manager);
+      // <rtc-template block="initializer">
+      m_EvConfig_val = new TimedLong();
+      initializeParam(m_EvConfig_val);
+      m_EvConfig = new DataRef<TimedLong>(m_EvConfig_val);
+      m_EvConfigIn = new InPort<TimedLong>("EvConfig", m_EvConfig);
+      m_EvInFocus_val = new TimedLong();
+      initializeParam(m_EvInFocus_val);
+      m_EvInFocus = new DataRef<TimedLong>(m_EvInFocus_val);
+      m_EvInFocusIn = new InPort<TimedLong>("EvInFocus", m_EvInFocus);
+      m_EvOff_val = new TimedLong();
+      initializeParam(m_EvOff_val);
+      m_EvOff = new DataRef<TimedLong>(m_EvOff_val);
+      m_EvOffIn = new InPort<TimedLong>("EvOff", m_EvOff);
+      m_EvOn_val = new TimedLong();
+      initializeParam(m_EvOn_val);
+      m_EvOn = new DataRef<TimedLong>(m_EvOn_val);
+      m_EvOnIn = new InPort<TimedLong>("EvOn", m_EvOn);
+      m_EvShutterFull_val = new TimedLong();
+      initializeParam(m_EvShutterFull_val);
+      m_EvShutterFull = new DataRef<TimedLong>(m_EvShutterFull_val);
+      m_EvShutterFullIn = new InPort<TimedLong>("EvShutterFull", m_EvShutterFull);
+      m_EvShutterHalf_val = new TimedLong();
+      initializeParam(m_EvShutterHalf_val);
+      m_EvShutterHalf = new DataRef<TimedLong>(m_EvShutterHalf_val);
+      m_EvShutterHalfIn = new InPort<TimedLong>("EvShutterHalf", m_EvShutterHalf);
+      m_EvShutterReleased_val = new TimedLong();
+      initializeParam(m_EvShutterReleased_val);
+      m_EvShutterReleased = new DataRef<TimedLong>(m_EvShutterReleased_val);
+      m_EvShutterReleasedIn = new InPort<TimedLong>("EvShutterReleased", m_EvShutterReleased);
+      m_out_val = new TimedLong();
+      m_out = new DataRef<TimedLong>(m_out_val);
+      m_outOut = new OutPort<TimedLong>("out", m_out);
+      // </rtc-template>
+
+  }
+
+  /**
+   *
+   * The initialize action (on CREATED->ALIVE transition)
+   * formaer rtc_init_entry() 
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  @Override
+  protected ReturnCode_t onInitialize() {
+      // Registration: InPort/OutPort/Service
+      // <rtc-template block="registration">
+      // Set InPort buffers
+      addInPort("EvConfig", m_EvConfigIn);
+      addInPort("EvInFocus", m_EvInFocusIn);
+      addInPort("EvOff", m_EvOffIn);
+      addInPort("EvOn", m_EvOnIn);
+      addInPort("EvShutterFull", m_EvShutterFullIn);
+      addInPort("EvShutterHalf", m_EvShutterHalfIn);
+      addInPort("EvShutterReleased", m_EvShutterReleasedIn);
+      
+      machine_ = new Machine<>(Top.class, CameraProtocol.class, null);
+      m_que = new ArrayDeque<Event>();
+
+
+      m_EvConfigIn.addConnectorDataListener(
+                            ConnectorDataListenerType.ON_RECEIVED,
+                            new DataListener("EvConfig",m_que));
+      m_EvInFocusIn.addConnectorDataListener(
+                            ConnectorDataListenerType.ON_RECEIVED,
+                            new DataListener("EvInFocus",m_que));
+      m_EvOffIn.addConnectorDataListener(
+                            ConnectorDataListenerType.ON_RECEIVED,
+                            new DataListener("EvOff",m_que));
+      m_EvOnIn.addConnectorDataListener(
+                            ConnectorDataListenerType.ON_RECEIVED,
+                            new DataListener("EvOn",m_que));
+      m_EvShutterFullIn.addConnectorDataListener(
+                            ConnectorDataListenerType.ON_RECEIVED,
+                            new DataListener("EvShutterFull",m_que));
+      m_EvShutterHalfIn.addConnectorDataListener(
+                            ConnectorDataListenerType.ON_RECEIVED,
+                            new DataListener("EvShutterHalf",m_que));
+      m_EvShutterReleasedIn.addConnectorDataListener(
+                            ConnectorDataListenerType.ON_RECEIVED,
+                            new DataListener("EvShutterReleased",m_que));
+
+      // Set OutPort buffer
+      addOutPort("out", m_outOut);
+      // </rtc-template>
+      
+      
+
+      return super.onInitialize();
+  }
+
+  /***
+   *
+   * The finalize action (on ALIVE->END transition)
+   * formaer rtc_exiting_entry()
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+//    @Override
+//    protected ReturnCode_t onFinalize() {
+//        return super.onFinalize();
+//    }
+
+  /***
+   *
+   * The startup action when ExecutionContext startup
+   * former rtc_starting_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+//    @Override
+//    protected ReturnCode_t onStartup(int ec_id) {
+//        return super.onStartup(ec_id);
+//    }
+
+  /***
+   *
+   * The shutdown action when ExecutionContext stop
+   * former rtc_stopping_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+//    @Override
+//    protected ReturnCode_t onShutdown(int ec_id) {
+//        return super.onShutdown(ec_id);
+//    }
+
+  /***
+   *
+   * The activated action (Active state entry action)
+   * former rtc_active_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+//    @Override
+//    protected ReturnCode_t onActivated(int ec_id) {
+//        return super.onActivated(ec_id);
+//    }
+
+  /***
+   *
+   * The deactivated action (Active state exit action)
+   * former rtc_active_exit()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+//    @Override
+//    protected ReturnCode_t onDeactivated(int ec_id) {
+//        return super.onDeactivated(ec_id);
+//    }
+
+  /**
+   *
+   * The execution action that is invoked periodically
+   * former rtc_active_do()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+  @Override
+  protected ReturnCode_t onExecute(int ec_id) {
+      synchronized (m_que) {
+          while (!m_que.isEmpty()) {
+              Event ev = m_que.poll();
+              machine_.dispatch(ev);
+          }
+      }
+      while (!machine_.current().isOutputData()) {
+          m_out_val.data = machine_.current().getOutputData();
+          System.out.println("output data: "  + m_out_val.data);
+          m_outOut.write();
+      }
+      machine_.current().on_do();
+      return super.onExecute(ec_id);
+  }
+
+  /***
+   *
+   * The aborting action when main logic error occurred.
+   * former rtc_aborting_entry()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+//  @Override
+//  public ReturnCode_t onAborting(int ec_id) {
+//      return super.onAborting(ec_id);
+//  }
+
+  /***
+   *
+   * The error action in ERROR state
+   * former rtc_error_do()
+   *
+   * @param ec_id target ExecutionContext Id
+   *
+   * @return RTC::ReturnCode_t
+   * 
+   * 
+   */
+//    @Override
+//    public ReturnCode_t onError(int ec_id) {
+//        return super.onError(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
+   * 
+   * 
+   */
+//    @Override
+//    protected ReturnCode_t onReset(int ec_id) {
+//        return super.onReset(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
+   * 
+   * 
+   */
+//    @Override
+//    protected ReturnCode_t onStateUpdate(int ec_id) {
+//        return super.onStateUpdate(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
+   * 
+   * 
+   */
+//    @Override
+//    protected ReturnCode_t onRateChanged(int ec_id) {
+//        return super.onRateChanged(ec_id);
+//    }
+//
+  // DataInPort declaration
+  // <rtc-template block="inport_declare">
+  protected TimedLong m_EvConfig_val;
+  protected DataRef<TimedLong> m_EvConfig;
+  /*!
+   */
+  protected InPort<TimedLong> m_EvConfigIn;
+
+  protected TimedLong m_EvInFocus_val;
+  protected DataRef<TimedLong> m_EvInFocus;
+  /*!
+   */
+  protected InPort<TimedLong> m_EvInFocusIn;
+
+  protected TimedLong m_EvOff_val;
+  protected DataRef<TimedLong> m_EvOff;
+  /*!
+   */
+  protected InPort<TimedLong> m_EvOffIn;
+
+  protected TimedLong m_EvOn_val;
+  protected DataRef<TimedLong> m_EvOn;
+  /*!
+   */
+  protected InPort<TimedLong> m_EvOnIn;
+
+  protected TimedLong m_EvShutterFull_val;
+  protected DataRef<TimedLong> m_EvShutterFull;
+  /*!
+   */
+  protected InPort<TimedLong> m_EvShutterFullIn;
+
+  protected TimedLong m_EvShutterHalf_val;
+  protected DataRef<TimedLong> m_EvShutterHalf;
+  /*!
+   */
+  protected InPort<TimedLong> m_EvShutterHalfIn;
+
+  protected TimedLong m_EvShutterReleased_val;
+  protected DataRef<TimedLong> m_EvShutterReleased;
+  /*!
+   */
+  protected InPort<TimedLong> m_EvShutterReleasedIn;
+
+    
+  // </rtc-template>
+
+  // DataOutPort declaration
+  // <rtc-template block="outport_declare">
+  protected TimedLong m_out_val;
+  protected DataRef<TimedLong> m_out;
+  /*!
+   */
+  protected OutPort<TimedLong> m_outOut;
+
+  private Machine<Top, CameraProtocol> machine_;
+  private Queue<Event> m_que;
+    
+  // </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 void initializeParam(Object target) {
+      Class<?> targetClass = target.getClass();
+      ClassLoader loader = target.getClass().getClassLoader();
+      //
+      Field[] fields = targetClass.getFields();
+      for(Field field : fields) {
+          if(field.getType().isPrimitive()) continue;
+			
+          try {
+              if(field.getType().isArray()) {
+                  Object arrayValue = null;
+                  Class<?> clazz = null;
+                  if(field.getType().getComponentType().isPrimitive()) {
+                      clazz = field.getType().getComponentType();
+                  } else {
+                      clazz = loader.loadClass(field.getType().getComponentType().getName());
+                  }
+                  arrayValue = Array.newInstance(clazz, 0);
+                  field.set(target, arrayValue);
+
+              } else {
+                  Constructor<?>[] constList = field.getType().getConstructors();
+                  if(constList.length==0) {
+                      Method[] methodList = field.getType().getMethods();
+                      for(Method method : methodList) {
+                          if(method.getName().equals("from_int")==false) continue;
+                              Object objFld = method.invoke(target, new Object[]{ new Integer(0) });
+                              field.set(target, objFld);
+                              break;
+                      }
+                  } else {
+                      Class<?> classFld = Class.forName(field.getType().getName(), true, loader);
+                      Object objFld = classFld.newInstance();
+                      initializeParam(objFld);
+                      field.set(target, objFld);
+                  }
+              }
+          } catch (ClassNotFoundException e) {
+              e.printStackTrace();
+          } catch (InstantiationException e) {
+              e.printStackTrace();
+          } catch (IllegalAccessException e) {
+              e.printStackTrace();
+          } catch (IllegalArgumentException e) {
+              e.printStackTrace();
+          } catch (InvocationTargetException e) {
+              e.printStackTrace();
+          }
+      }
+  }
+
+  class DataListener extends ConnectorDataListenerT<TimedLong>{
+      public DataListener(final String name, Queue<Event> que){
+          super(TimedLong.class);
+          m_name = name;
+          m_que = que;
+      }
+
+      public ReturnCode operator(ConnectorBase.ConnectorInfo arg,
+                             TimedLong data) {
+          ConnectorBase.ConnectorInfo info =(ConnectorBase.ConnectorInfo)arg;
+          System.out.println("------------------------------");
+          System.out.println("Listener:       "+m_name);
+          System.out.println("Data:           "+data.data);
+          System.out.println("------------------------------");
+          synchronized (m_que) {
+              Class<?>[] args = new Class<?>[1];
+              args[0] = data.getClass();
+              m_que.offer(new Event(m_name,args,(Object)data));
+          }
+          return ReturnCode.NO_CHANGE;
+      }
+
+      private String m_name;
+      private Queue<Event> m_que;
+  }
+}

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Idle.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Idle.java	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Idle.java	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,37 @@
+package RTMExamples.Fsm;
+
+import jp.go.aist.rtm.RTC.jfsm.DeepHistory;
+import jp.go.aist.rtm.RTC.jfsm.State;
+
+import RTC.TimedLong;
+/**
+ * 
+ */
+ at DeepHistory
+public class Idle extends NotShooting {
+
+    @Override
+    public void onEntry() {
+        System.out.println("Idle::onEntry");
+        setOutputData(3);
+    }
+
+    @Override
+    public void onExit() {
+        System.out.println("Idle::onExit");
+    }
+
+    @Override
+    public void on_do() {
+        System.out.println("Idle::on_do");
+    }
+
+    @Override
+    public void EvConfig(TimedLong param){
+        System.out.println("Idle::EvConfig");
+        setState(new State(Configuring.class));
+    }
+
+}
+
+

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/NotShooting.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/NotShooting.java	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/NotShooting.java	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,48 @@
+package RTMExamples.Fsm;
+
+import jp.go.aist.rtm.RTC.jfsm.DeepHistory;
+import jp.go.aist.rtm.RTC.jfsm.State;
+
+import RTC.TimedLong;
+/**
+ * 
+ */
+ at DeepHistory
+public class NotShooting extends Top {
+
+    @Override
+    public void onEntry() {
+        System.out.println("NotShooting::onEntry");
+        setOutputData(2);
+    }
+
+    @Override
+    public void onInit() {
+        System.out.println("NotShooting::onInit");
+        setState(new State(Idle.class));
+    }
+
+    @Override
+    public void onExit() {
+        System.out.println("NotShooting::onExit");
+    }
+
+    @Override
+    public void on_do() {
+        System.out.println("NotShooting::on_do");
+    }
+
+    @Override
+    public void EvOff(TimedLong param){
+        System.out.println("NotShooting::EvOff");
+        setState(new State(Off.class));
+    }
+
+    @Override
+    public void EvShutterHalf(TimedLong param){
+        System.out.println("NotShooting::EvShutterHalf");
+        setState(new State(ShootingCamera.class));
+    }
+}
+
+

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Off.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Off.java	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Off.java	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,35 @@
+package RTMExamples.Fsm;
+
+import jp.go.aist.rtm.RTC.jfsm.DeepHistory;
+import jp.go.aist.rtm.RTC.jfsm.State;
+
+import RTC.TimedLong;
+/**
+ * 
+ */
+ at DeepHistory
+public class Off extends Top {
+
+    @Override
+    public void onEntry() {
+        System.out.println("Off::onEntry");
+        setOutputData(1);
+    }
+
+    @Override
+    public void onExit() {
+        System.out.println("Off::onExit");
+    }
+
+    @Override
+    public void on_do() {
+        System.out.println("Off::on_do");
+    }
+
+    @Override
+    public void EvOn(TimedLong param){
+        System.out.println("Off::EvOn");
+        setState(new State(NotShooting.class));
+    }
+}
+

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera.java	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera.java	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,43 @@
+package RTMExamples.Fsm;
+
+import jp.go.aist.rtm.RTC.jfsm.DeepHistory;
+import jp.go.aist.rtm.RTC.jfsm.State;
+
+import RTC.TimedLong;
+/**
+ * 
+ */
+ at DeepHistory
+public class ShootingCamera extends Top {
+
+    @Override
+    public void onEntry() {
+        System.out.println("ShootingCamera::onEntry");
+        setOutputData(5);
+    }
+
+    @Override
+    public void onInit() {
+        System.out.println("ShootingCamera::onInit");
+        setState(new State(ShootingCamera_Shooting.class));
+    }
+
+    @Override
+    public void onExit() {
+        System.out.println("ShootingCamera::onExit");
+    }
+
+    @Override
+    public void on_do() {
+        System.out.println("ShootingCamera::on_do");
+    }
+
+    @Override
+    public void EvShutterReleased(TimedLong param){
+        System.out.println("ShootingCamera::EvShutterReleased");
+        setState(new State(NotShooting.class));
+    }
+
+}
+
+

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera_Focused.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera_Focused.java	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera_Focused.java	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,35 @@
+package RTMExamples.Fsm;
+
+import jp.go.aist.rtm.RTC.jfsm.DeepHistory;
+import jp.go.aist.rtm.RTC.jfsm.State;
+
+import RTC.TimedLong;
+/**
+ * 
+ */
+ at DeepHistory
+public class ShootingCamera_Focused extends ShootingCamera_Shooting {
+
+    @Override
+    public void onEntry() {
+        System.out.println("ShootingCamera_Focused::onEntry");
+        setOutputData(8);
+    }
+
+    @Override
+    public void onExit() {
+        System.out.println("ShootingCamera_Focused::onExit");
+    }
+
+    @Override
+    public void on_do() {
+        System.out.println("ShootingCamera_Focused::on_do");
+    }
+
+    @Override
+    public void EvShutterFull(TimedLong param){
+        System.out.println("ShootingCamera_Focused::EvShutterFull");
+        setState(new State(ShootingCamera_Storing.class));
+    }
+}
+

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera_Focusing.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera_Focusing.java	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera_Focusing.java	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,47 @@
+package RTMExamples.Fsm;
+
+import jp.go.aist.rtm.RTC.jfsm.DeepHistory;
+import jp.go.aist.rtm.RTC.jfsm.Event;
+import jp.go.aist.rtm.RTC.jfsm.State;
+
+import RTC.TimedLong;
+/**
+ * 
+ */
+ at DeepHistory
+public class ShootingCamera_Focusing extends ShootingCamera_Shooting {
+
+    @Override
+    public void onEntry() {
+        System.out.println("ShootingCamera_Focusing::onEntry");
+        setOutputData(7);
+    }
+
+    @Override
+    public void onExit() {
+        System.out.println("ShootingCamera_Focusing::onExit");
+    }
+
+    @Override
+    public void on_do() {
+        System.out.println("ShootingCamera_Focusing::on_do");
+    }
+
+    @Override
+    public void EvInFocus(TimedLong param){
+        System.out.println("ShootingCamera_Focusing::EvInFocus");
+        setState(new State(ShootingCamera_Focused.class));
+    }
+
+    @Override
+    public void EvShutterFull(TimedLong param){
+        System.out.println("ShootingCamera_Focusing::EvShutterFull");
+        Class<?>[] args = new Class<?>[1];
+        args[0] = param.getClass();
+        defer(new Event("EvShutterFull",args,param));
+    }
+}
+
+
+
+

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera_Shooting.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera_Shooting.java	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera_Shooting.java	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,33 @@
+package RTMExamples.Fsm;
+
+import jp.go.aist.rtm.RTC.jfsm.DeepHistory;
+import jp.go.aist.rtm.RTC.jfsm.State;
+
+import RTC.TimedLong;
+/**
+ * 
+ */
+ at DeepHistory
+public class ShootingCamera_Shooting extends ShootingCamera {
+
+    @Override
+    public void onEntry() {
+        System.out.println("ShootingCamera_Shooting::onEntry");
+        setOutputData(6);
+    }
+
+    @Override
+    public void onInit() {
+        System.out.println("ShootingCamera_Shooting::onInit");
+        setState(new State(ShootingCamera_Focusing.class));
+    }
+
+    @Override
+    public void on_do() {
+        System.out.println("ShootingCamera_Shooting::on_do");
+    }
+
+}
+
+
+

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera_Storing.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera_Storing.java	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/ShootingCamera_Storing.java	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,32 @@
+package RTMExamples.Fsm;
+
+import jp.go.aist.rtm.RTC.jfsm.DeepHistory;
+import jp.go.aist.rtm.RTC.jfsm.State;
+
+import RTC.TimedLong;
+/**
+ * 
+ */
+ at DeepHistory
+public class ShootingCamera_Storing extends ShootingCamera_Shooting {
+
+
+    @Override
+    public void onEntry() {
+        System.out.println("ShootingCamera_Storing::onEntry");
+        setOutputData(9);
+    }
+
+    @Override
+    public void onExit() {
+        System.out.println("ShootingCamera_Storing::onExit");
+    }
+
+    @Override
+    public void on_do() {
+        System.out.println("ShootingCamera_Storing::on_do");
+    }
+
+}
+
+

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Top.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Top.java	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/Top.java	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,129 @@
+package RTMExamples.Fsm;
+
+import jp.go.aist.rtm.RTC.jfsm.DataType;
+import jp.go.aist.rtm.RTC.jfsm.State;
+import jp.go.aist.rtm.RTC.jfsm.StateDef;
+
+import RTC.TimedLong;
+
+import java.util.ArrayDeque;
+import java.util.Queue;
+
+/**
+ * 
+ */
+//@DataType(Top.Data.class)
+public class Top extends StateDef implements CameraProtocol {
+
+/*
+    public static class Data {
+
+        private int myCookingTime;
+// pyfsm/test/api_test.py:10
+//    class Data(object):
+//        def __init__(self):
+//            self.my_cooking_time = 0
+//
+//        def print_timer(self):
+//            pyfsm_logger.debug("  Timer set to {0} minutes".format(self.my_cooking_time))
+//
+//        def increment_timer(self):
+//            self.my_cooking_time += 1
+//
+//        def decrement_timer(self):
+//            self.my_cooking_time -= 1
+//
+//        def reset_timer(self):
+//            self.my_cooking_time = 0
+//
+//        def get_remaining_time(self):
+//            return self.my_cooking_time
+
+        public Data() {
+            myCookingTime = 0;
+        }
+
+        public void printTimer() {
+            LOGGER.debug("  Timer set to {} minutes", myCookingTime);
+        }
+
+        public void incrementTimer() {
+            myCookingTime += 1;
+        }
+
+        public void decrementTimer() {
+            myCookingTime -= 1;
+        }
+
+        public void resetTimer() {
+            myCookingTime = 0;
+        }
+
+        public int getRemainingTime() {
+            return myCookingTime;
+        }
+    }
+*/
+
+    @Override
+    public void onEntry() {
+        System.out.println("Top::onEntry");
+        setOutputData(0);
+    }
+
+    @Override
+    public void onInit() {
+        System.out.println("Top::onInit");
+        setState(new State(Off.class));
+    }
+
+    @Override
+    public void onExit() {
+        System.out.println("Top::onExit");
+    }
+
+    @Override
+    public void on_do() {
+        System.out.println("Top::on_do");
+    }
+
+    @Override
+    public void EvOn(TimedLong param){ 
+    }
+    @Override
+    public void EvOff(TimedLong param){ 
+    }
+    @Override
+    public void EvConfig(TimedLong param){
+    }
+    @Override
+    public void EvInFocus(TimedLong param){
+    }
+    @Override
+    public void EvShutterHalf(TimedLong param){
+    }
+    @Override
+    public void EvShutterFull(TimedLong param){
+    }
+    @Override
+    public void EvShutterReleased(TimedLong param){
+    }
+
+    @Override
+    public int getOutputData() {
+        return m_que.poll();
+    }
+
+    @Override
+    public boolean isOutputData() {
+        return m_que.isEmpty();
+    }
+
+    protected void setOutputData(int val) {
+         m_que.offer(val);
+    }
+
+    private int m_val;
+    private static Queue<Integer> m_que = new ArrayDeque<Integer>();;
+}
+

Added: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/rtc.conf
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/rtc.conf	                        (rev 0)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/Fsm/rtc.conf	2017-02-06 08:30:33 UTC (rev 933)
@@ -0,0 +1,437 @@
+#------------------------------------------------------------
+# RT-Component manager configuration
+#
+# See details in the following reference manual or web page.
+# http://www.openrtm.org/openrtm/en/content/configuration
+# http://www.openrtm.org/openrtm/ja/content/rtcconf%E8%A8%AD%E5%AE%9A%E9%A0%85%E7%9B%AE%E4%B8%80%E8%A6%A7
+# http://www.openrtm.org/openrtm/ko/content/rtcconf-%EC%84%A4%EC%A0%95-%ED%95%AD%EB%AA%A9-%EC%9D%BC%EB%9E%8C
+#
+
+#------------------------------------------------------------
+# Typically used configuration parameters
+#
+# corba.name_servers: localhost, 192.168.0.1
+# corba.endpoints: <interface addess>, <interface addess>
+# logger.enable: YES
+# logger.file_name: ./rtc%p.log
+# logger.log_level: NORMAL
+#
+# The following properties should be specified in component specific
+# configuration files.
+# exec_cxt.periodic.type: PeriodicExecutionContext
+# exec_cxt.periodic.rate: 1000
+
+# Component specific configruation files:
+# If you want to load component specific configuration file, please
+# uncomment the following line.
+#
+# example.StaticFsm.config_file: StaticFsm.conf
+# or
+# example.StaticFsm0.config_file: StaticFsm0.conf
+# example.StaticFsm1.config_file: StaticFsm1.conf
+# example.StaticFsm2.config_file: StaticFsm2.conf
+#
+#------------------------------------------------------------
+
+example.Fsm.config_file: Fsm.conf
+
+#
+# Please delete the following part if you are familiar with OpenRTM's
+# configuration parameters.
+#
+##----------------------------------------------------------------------
+##
+## RT-Component manager configurations
+##
+##----------------------------------------------------------------------
+
+##------------------------------------------------------------
+## Configuration version (optional) 
+##
+# config.version: 1.0
+
+##------------------------------------------------------------
+## OpenRTM-aist version (optional)
+##
+# openrtm.version: 1.0.0
+
+##------------------------------------------------------------
+## The name of manager (default = manager)
+##
+# manager.name: manager
+
+##------------------------------------------------------------
+## Master manager
+## - manager.is_master: YES/NO, This process made a master or not.
+## - manager.corba_servant: YES/NO, create manager's corba service or not
+## - corba.master_manager: <host_name>:<port>, master manager's location
+# manager.is_master: YES
+# manager.corba_servant: YES
+# corba.master_manager: localhost:2810
+
+##------------------------------------------------------------
+## Manager auto shutdown options
+## - manager.shutdown_on_nortcs: YES/NO, 
+##   process will be shutdown in case no rtc exists when rtc is deleted.
+## - manager.shutdown_auto:
+##   process will be shutdown in case no rtc exists on periodic check.
+# manager.shutdown_on_nortcs: YES
+# manager.shutdown_auto: YES
+# manager.auto_shutdown_duration: 10.0
+
+##============================================================
+## CORBA configuration
+##============================================================
+##
+## CORBA ORB's arguments
+##
+## ORB specific command line options given to ORB_init().
+## See your ORB documentation.
+##
+## Example:
+##   corba.args: -ORBInitialHost myhost -ORBInitialPort 8888
+##
+##
+# corba.args:
+
+##
+## ORB endpoint
+##
+## If you have two or more network interfaces, ORB endpoint address and/or
+## port have to be specified. If hostname or port number is abbreviated,
+## default interface or port number is used. At least one colon ':'
+## is needed when you specify this option.
+##
+## Examples:
+##   corba.endpoint: myhost:      (use myhost and default port)
+##   corba.endpoint: :9876        (use default addr and port 9876)
+##   corba.endpoint: myhost:9876  (use myhost and port 9876)
+##
+# corba.endpoint:
+
+##
+## Multiple endpoint options (experimental)
+##
+## Multiple endpoint addresses and ports can be specified using this option.
+##
+## Example:
+##   corba.endpoints: 192.168.1.10:1111, 192.168.10.11:2222
+##   corba.endpoints: 192.168.1.10, 192.168.10.11
+##   corba.endpoints: all
+##
+# corba.endpoints:
+
+
+##
+## CORBA name server setting
+##
+## Multiple name servers can be specified separating by comma.
+## If port number is abbreviated, default port number is used.
+## The default port number is depend on ORB implementation.
+##
+## Examples:
+##   corba.nameservers: openrtm.aist.go.jp:9876
+##   corba.nameservers: rtm0.aist.go.jp, rtm1.aist.go.jp, rtm2.aist.go.jp
+##
+# corba.nameservers: localhost
+
+##
+## IOR host address replacement by guessed endpoint from routing (experimental)
+##
+## This option replaces a host address with an endpoint that is guessed
+## by route information to nameserver's address. This option may be
+## effective for CORBA implementation that does not supports IOR's
+## multiple profile or alternate IIOP address. However, since other
+## object references that are obtained from RT-Components or other are
+## not modified by this rule, other RTCs that are connected to this RTC
+## have to also support IOR multiple profile feature.  When this option
+## is used, corba.endpoints option should also be specified with
+## multiple endpoints.
+##
+# corba.nameservice.replace_endpoint: NO
+
+##
+## IOR alternate IIOP addresses
+##
+## This option adds alternate IIOP addresses into the IOR Profiles.
+## IOR can include additional endpoints for a servant. It is almost
+## same as "corba.endpoints" option, but this option does not create
+## actual endpoint on the ORB. (corba.endpoints try to create actual
+## endpoint, and if it cannot be created, error will be returned.)
+## This option just add alternate IIOP endpoint address information to
+## an IOR.
+##
+## This option can be used when RTCs are located inside of NAT or
+## router.  Generally speaking, RTCs in a private network cannot
+## connect to RTCs in the global network, because global client cannot
+## reach to private servants. However, if route (or NAT) is properly
+## configured for port forwarding, global RTCs can reach to RTCs in
+## private network.
+##
+## A setting example is as follows.
+## 1) Configure your router properly for port-forwarding.
+##    ex. global 2810 port is forwarded to private 2810
+## 2) Set the following options in rtc.conf
+##  corba.nameservers: my.global.nameserver.com <- name server in global network
+##  corba.endpoints: :2810 <- actual port number
+##  corba.additional_ior_addresses: w.x.y.z:2810 <- routers global IP addr/port
+## 3) Launch global RTCs and private RTC, and connect them.
+##
+# corba.alternate_iiop_addresses: addr:port
+
+##============================================================
+## Naming configurations
+##============================================================
+##
+## Enable/Disable naming functions
+##
+# naming.enable: YES
+
+##
+## Naming Types
+##
+## Now only "corba" is supported.
+##
+# naming.type: corba
+
+##
+## Naming format
+##
+## The name format of components that is bound to naming services.
+## The delimiter between names is "/".
+## The delimiter between name and kind is ".".
+##
+## example: (OpenRTM-aist-0.2.0 style)
+##       %h.host_cxt/%M.mgr_cxt/%c.cat_cxt/%m.mod_cxt/%n.rtc
+## This is formatted according to the following replacement rules.
+##
+## %n: The instance name of the component.
+## %t: The type name of the component.
+## %m: The module name of the component.
+## %v: The version of the component.
+## %V: The component vendor.
+## %c: The category of the component.
+## %h: The hostname.
+## %M: The manager name.
+## %p: PID of the manager.
+##
+# naming.formats: %h.host/%n.rtc
+
+##
+## Auto update to Naming Server
+##
+# naming.update.enable: YES
+##
+## Update interval [s] for auto update
+##
+# naming.update.interval: 10.0
+##
+## Rebind references in auto update
+##
+# naming.update.rebind: NO
+
+## End of Naming configuration section
+##------------------------------------------------------------
+
+##============================================================
+## Module management
+##============================================================
+##
+## Loadable module search path list
+##
+## Manager searches loadable modules from the specified search path list.
+## Path list elements should be separated by comma.
+## Path delimiter is '/' on UNIX, and '\\' on Windows
+## Valid path examples:
+##   manager.modules.load_path: C:/Program Files/OpenRTM-aist,  \
+##   			       C:\\Program Files\\OpenRTM-aist
+##   manager.modules.load_path: /usr/lib, /usr/local/lib,       \
+##   			       /usr/local/lib/OpenRTM-aist/libs
+##
+# manager.modules.load_path: ./
+
+##
+## Preload module list
+##
+## Manager can load loadable modules before starting up.
+## Loadable modules, which is specified only as its file name, is searched
+## in each module load path specified in the "manager.modules.load_path".
+## If the "manager.modules.abs_path_allowed" option is YES, loadable file
+## can be specified as full-path name,
+##
+## Valid settings:
+## manager.modules.preload: ConsoleIn.dll, ConsoleOut.dll
+## manager.modules.preload: ConsoleIn.so, ConsoleOut.so
+## manager.modules.abs_path_allowed: YES
+## manager.modules.preload: /usr/lib/OpenRTM-aist/ConsoleIn.so
+##
+# manager.modules.preload:
+
+##
+## Permission flag of absolute module path
+##
+## If this option is "YES", absolute path specification for module is allowed.
+##
+# manager.modules.abs_path_allowed: YES
+
+##
+## The following options are not implemented yet. 
+##
+## manager.modules.config_ext:
+## manager.modules.config_path:
+## manager.modules.detect_loadable:
+## manager.modules.init_func_suffix:
+## manager.modules.init_func_prefix:
+## manager.modules.download_allowed:
+## manager.modules.download_dir:
+## manager.modules.download_cleanup:
+##
+
+##
+## Advance component creation
+##
+## This option specifies components' names (module name) creating in advance
+## before starting the manager's event-loop. The components' factories should
+## be registered by manager.module.preload option or statically linked to the
+##  manager.
+##
+## Example:
+## manager.components.precreate: ConsoleIn, ConsoleOut, SeqIn, SeqOut
+##
+# manager.components.precreate: 
+
+
+##============================================================
+## Logger configurations
+##============================================================
+##
+## Enable/Disable logger [YES/NO]
+# logger.enable: YES
+
+##
+## Log file name (default = ./rtc%p.log)
+##
+## %p: PID
+##
+# logger.file_name: ./rtc%p.log
+
+##
+## Log date format (default = %b %d %H:%M:%S)
+##
+## The following strftime(3) like format expression is available.
+## If no prefix is needed, use "No" or "Disable".
+## 
+## %a abbreviated weekday name 
+## %A full weekday name 
+## %b abbreviated month name 
+## %B full month name 
+## %c the standard date and time string 
+## %d day of the month, as a number (1-31) 
+## %H hour, 24 hour format (0-23) 
+## %I hour, 12 hour format (1-12) 
+## %j day of the year, as a number (1-366) 
+## %m month as a number (1-12).
+##    Note: some versions of Microsoft Visual C++ may use values that range
+##    from 0-11. 
+## %M minute as a number (0-59) 
+## %p locale's equivalent of AM or PM 
+## %Q millisecond as a number (0-999) from ver 1.1
+## %q microsecond as a number (0-999) from ver 1.1
+## %S second as a number (0-59) 
+## %U week of the year, sunday as the first day 
+## %w weekday as a decimal (0-6, sunday=0) 
+## %W week of the year, monday as the first day 
+## %x standard date string 
+## %X standard time string 
+## %y year in decimal, without the century (0-99) 
+## %Y year in decimal, with the century 
+## %Z time zone name 
+## %% a percent sign 
+##  
+##
+## logger.date_format: No
+## logger.date_format: Disable
+## logger.date_format: [%Y-%m-%dT%H.%M.%S%Z]     // W3C standard format
+## logger.date_format: [%b %d %H:%M:%S]          // Syslog format
+## logger.date_format: [%a %b %d %Y %H:%M:%S %Z] // RFC2822 format
+## logger.date_format: [%a %b %d %H:%M:%S %Z %Y] // data command format
+## logger.date_format: [%Y-%m-%d %H.%M.%S]
+##
+# logger.date_format: %b %d %H:%M:%S
+
+##
+## Log level (default = NORMAL)
+##
+## The following LogLevels are allowed.
+## SILENT, ERROR, WARN, NORMAL, INFO, DEBUG, TRACE, VERBOSE, PARANOID
+##
+##
+## SILENT  : completely silent
+## ERROR   : includes (ERROR)
+## WARN    : includes (ERROR, WARN)
+## INFO    : includes (ERROR, WARN, INFO)
+## NORMAL  : includes (ERROR, WARN, INFO, NORMAL)
+## DEBUG   : includes (ERROR, WARN, INFO, NORMAL, DEBUG)
+## TRACE   : includes (ERROR, WARN, INFO, NORMAL, DEBUG, TRACE)
+## VERBOSE : includes (ERROR, WARN, INFO, NORMAL, DEBUG, TRACE, VERBOSE)
+## PARANOID: includes (ERROR, WARN, INFO, NORMAL, DEBUG, TRACE, VERBOSE, PARA)
+##
+## Warning!!!
+## "TRACE", "VERBOSE", "PARANOID" logging level will create a huge log file!!
+## "PARANOID" log level will tangle the log file.
+##
+# logger.log_level: NORMAL
+
+##============================================================
+## Timer configuration
+##============================================================
+##
+## Enable/disable timer function
+##
+# timer.enable: YES
+
+##
+## Timer clock tick setting [s]
+##
+# timer.tick: 0.1
+
+##============================================================
+## Execution context settings
+##============================================================
+##
+## Periodic type ExecutionContext
+##
+## Other availabilities in OpenRTM-aist
+##
+## - ExtTrigExecutionContext: External triggered EC. It is embedded in
+##                            OpenRTM library.
+## - OpenHRPExecutionContext: External triggred paralell execution
+##                            EC. It is embedded in OpenRTM
+##                            library. This is usually used with
+##                            OpenHRP3.
+## - RTPreemptEC:             Real-time execution context for Linux
+##                            RT-preemptive pathed kernel.
+## - ArtExecutionContext:     Real-time execution context for ARTLinux
+##                            (http://sourceforge.net/projects/art-linux/)
+##
+# exec_cxt.periodic.type: PeriodicExecutionContext
+
+##
+## The execution cycle of ExecutionContext
+##
+# exec_cxt.periodic.rate: 1000
+
+##============================================================
+## SDO service settings
+##============================================================
+##
+## SDO service provider settings
+##
+# sdo.service.provider.available_services: [read only]
+# sdo.service.provider.enabled_services: ALL
+# sdo.service.provider.providing_services: [read only]
+##
+## SDO service consumer settings
+##
+# sdo.service.consumer.available_services: [read only]
+# sdo.service.consumer.enabled_services: ALL



More information about the openrtm-commit mailing list