[openrtm-commit:02412] r939 - trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 2月 9日 (木) 17:21:17 JST
Author: win-ei
Date: 2017-02-09 17:21:16 +0900 (Thu, 09 Feb 2017)
New Revision: 939
Modified:
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Idle.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/MicrowaveImpl.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/MicrowaveProtocol.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Programmed.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Top.java
Log:
[FSM4RTC,bugfix] Fixed bugs. refs #3775
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Idle.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Idle.java 2017-02-09 07:19:17 UTC (rev 938)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Idle.java 2017-02-09 08:21:16 UTC (rev 939)
@@ -18,10 +18,12 @@
}
@Override
- public void minute() {
+ public void minute(TimedLong time) {
System.out.println("[Microwave] >>> Timer incremented <<<");
setState(new State(Programmed.class));
- dispatch(new Event("minute"));
+ Class<?>[] args = new Class<?>[1];
+ args[0] = time.getClass();
+ dispatch(new Event("minute",args,time));
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/MicrowaveImpl.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/MicrowaveImpl.java 2017-02-09 07:19:17 UTC (rev 938)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/MicrowaveImpl.java 2017-02-09 08:21:16 UTC (rev 939)
@@ -25,6 +25,8 @@
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.port.ConnectorListener;
+import jp.go.aist.rtm.RTC.port.ConnectorListenerType;
import jp.go.aist.rtm.RTC.util.DataRef;
import RTC.TimedLong;
@@ -72,7 +74,7 @@
m_eventIn.bindEvent("eventopen", "open");
m_eventIn.bindEvent("eventclose", "close");
- m_eventIn.bindEvent("eventminute", "minute");
+ m_eventIn.bindEvent("eventminute", "minute", new TimedLong(new RTC.Time(0,0),0));
m_eventIn.bindEvent("eventstart", "start");
m_eventIn.bindEvent("eventstop", "stop");
m_eventIn.bindEvent("eventtick", "tick");
@@ -81,6 +83,9 @@
// Set OutPort buffer
// </rtc-template>
+ m_eventIn.addConnectorListener(
+ ConnectorListenerType.ON_CONNECT,
+ new Listener("ON_CONNECT"));
return super.onInitialize();
@@ -375,4 +380,25 @@
private String m_name;
private Queue<Event> m_que;
}
+ class Listener extends ConnectorListener{
+ public Listener(final String name){
+ m_name = name;
+ }
+
+ public ReturnCode operator(ConnectorBase.ConnectorInfo arg){
+ System.out.println("------------------------------");
+ System.out.println("Listener: "+m_name);
+ System.out.println("Profile::name: "+arg.name);
+ String str = new String();
+ System.out.println("Profile::properties:");
+ System.out.print("["+arg.properties.getProperty("interface_type"));
+ System.out.print("]["+arg.properties.getProperty("dataflow_type"));
+ System.out.print("]["+arg.properties.getProperty("subscription_type"));
+ System.out.print("]["+arg.properties.getProperty("publisher.push_policy"));
+ System.out.println("]["+arg.properties.getProperty("timestamp_policy")+"]");
+ System.out.println("------------------------------");
+ return ReturnCode.NO_CHANGE;
+ }
+ public String m_name;
+ }
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/MicrowaveProtocol.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/MicrowaveProtocol.java 2017-02-09 07:19:17 UTC (rev 938)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/MicrowaveProtocol.java 2017-02-09 08:21:16 UTC (rev 939)
@@ -11,7 +11,7 @@
void close();
- void minute();
+ void minute(TimedLong time);
void start();
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Programmed.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Programmed.java 2017-02-09 07:19:17 UTC (rev 938)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Programmed.java 2017-02-09 08:21:16 UTC (rev 939)
@@ -11,10 +11,12 @@
public class Programmed extends Operational {
@Override
- public void minute() {
+ public void minute(TimedLong time) {
System.out.println("[Microwave] >>> Timer incremented <<<");
Top.Data data = data(Top.class);
- data.incrementTimer();
+ for(int ic=0;ic<time.data;++ic){
+ data.incrementTimer();
+ }
data.printTimer();
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Top.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Top.java 2017-02-09 07:19:17 UTC (rev 938)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Top.java 2017-02-09 08:21:16 UTC (rev 939)
@@ -70,7 +70,7 @@
}
@Override
- public void minute() {
+ public void minute(TimedLong time) {
// do nothing
}
More information about the openrtm-commit
mailing list