[openrtm-commit:02277] r909 - trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 1月 20日 (金) 00:49:05 JST
Author: win-ei
Date: 2017-01-20 00:49:05 +0900 (Fri, 20 Jan 2017)
New Revision: 909
Modified:
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/StaticFsmComp.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/StaticFsmImpl.java
Log:
[FSM4RTC]Fixed bugs. refs #3775
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/StaticFsmComp.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/StaticFsmComp.java 2017-01-19 08:03:39 UTC (rev 908)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/StaticFsmComp.java 2017-01-19 15:49:05 UTC (rev 909)
@@ -33,7 +33,7 @@
mgr.registerFactory(prop, new StaticFsm(), new StaticFsm());
// Create a component
- System.out.println("Creating a component: \"ConsoleOut\"....");
+ System.out.println("Creating a component: \"StaticFsm\"....");
RTObject_impl comp = mgr.createComponent("StaticFsm");
if( comp==null ) {
System.err.println("Component create failed.");
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/StaticFsmImpl.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/StaticFsmImpl.java 2017-01-19 08:03:39 UTC (rev 908)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/StaticFsmImpl.java 2017-01-19 15:49:05 UTC (rev 909)
@@ -228,11 +228,12 @@
*/
@Override
protected ReturnCode_t onExecute(int ec_id) {
- System.out.println(m_que.size());
- while (!m_que.isEmpty()) {
- Event ev = m_que.poll();
- machine_.dispatch(ev);
- //machine_.current().EvConfig(m_EvConfig_val);
+ synchronized (m_que) {
+ while (!m_que.isEmpty()) {
+ Event ev = m_que.poll();
+ machine_.dispatch(ev);
+ //machine_.current().EvConfig(m_EvConfig_val);
+ }
}
return super.onExecute(ec_id);
}
@@ -458,7 +459,11 @@
System.out.println("Listener: "+m_name);
System.out.println("Data: "+data.data);
System.out.println("------------------------------");
- m_que.offer(new Event(m_name,(Object)data));
+ synchronized (m_que) {
+ Class<?>[] args = new Class<?>[1];
+ args[0] = data.getClass();
+ m_que.offer(new Event(m_name,args,(Object)data));
+ }
}
private String m_name;
More information about the openrtm-commit
mailing list