[openrtm-commit:02282] r911 - in trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src: RTMExamples/StaticFsm jp/go/aist/rtm/RTC/jfsm/machine
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 1月 20日 (金) 16:00:03 JST
Author: win-ei
Date: 2017-01-20 16:00:03 +0900 (Fri, 20 Jan 2017)
New Revision: 911
Modified:
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Configuring.java
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/NotShooting.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Off.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera_Focused.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera_Focusing.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera_Shooting.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera_Storing.java
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/Top.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/jfsm/machine/MachineBase.java
Log:
[FSM4RTC]Fixed bugs. refs #3775
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Configuring.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Configuring.java 2017-01-19 16:06:25 UTC (rev 910)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Configuring.java 2017-01-20 07:00:03 UTC (rev 911)
@@ -13,6 +13,7 @@
@Override
public void onEntry() {
System.out.println("Configuring::onEntry");
+ setOutputData(4);
}
@Override
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-01-19 16:06:25 UTC (rev 910)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Idle.java 2017-01-20 07:00:03 UTC (rev 911)
@@ -13,6 +13,7 @@
@Override
public void onEntry() {
System.out.println("Idle::onEntry");
+ setOutputData(3);
}
@Override
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/NotShooting.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/NotShooting.java 2017-01-19 16:06:25 UTC (rev 910)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/NotShooting.java 2017-01-20 07:00:03 UTC (rev 911)
@@ -13,6 +13,7 @@
@Override
public void onEntry() {
System.out.println("NotShooting::onEntry");
+ setOutputData(2);
}
@Override
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Off.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Off.java 2017-01-19 16:06:25 UTC (rev 910)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Off.java 2017-01-20 07:00:03 UTC (rev 911)
@@ -13,6 +13,7 @@
@Override
public void onEntry() {
System.out.println("Off::onEntry");
+ setOutputData(1);
}
@Override
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera.java 2017-01-19 16:06:25 UTC (rev 910)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera.java 2017-01-20 07:00:03 UTC (rev 911)
@@ -13,11 +13,13 @@
@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
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera_Focused.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera_Focused.java 2017-01-19 16:06:25 UTC (rev 910)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera_Focused.java 2017-01-20 07:00:03 UTC (rev 911)
@@ -13,6 +13,7 @@
@Override
public void onEntry() {
System.out.println("ShootingCamera_Focused::onEntry");
+ setOutputData(8);
}
@Override
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera_Focusing.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera_Focusing.java 2017-01-19 16:06:25 UTC (rev 910)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera_Focusing.java 2017-01-20 07:00:03 UTC (rev 911)
@@ -1,6 +1,7 @@
package RTMExamples.StaticFsm;
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;
@@ -13,6 +14,7 @@
@Override
public void onEntry() {
System.out.println("ShootingCamera_Focusing::onEntry");
+ setOutputData(7);
}
@Override
@@ -34,6 +36,9 @@
@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));
}
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera_Shooting.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera_Shooting.java 2017-01-19 16:06:25 UTC (rev 910)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera_Shooting.java 2017-01-20 07:00:03 UTC (rev 911)
@@ -13,6 +13,7 @@
@Override
public void onEntry() {
System.out.println("ShootingCamera_Shooting::onEntry");
+ setOutputData(6);
}
@Override
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera_Storing.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera_Storing.java 2017-01-19 16:06:25 UTC (rev 910)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/ShootingCamera_Storing.java 2017-01-20 07:00:03 UTC (rev 911)
@@ -14,6 +14,7 @@
@Override
public void onEntry() {
System.out.println("ShootingCamera_Storing::onEntry");
+ setOutputData(9);
}
@Override
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 16:06:25 UTC (rev 910)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/StaticFsmImpl.java 2017-01-20 07:00:03 UTC (rev 911)
@@ -120,7 +120,7 @@
new DataListener("EvOn",m_que));
m_EvShutterFullIn.addConnectorDataListener(
ConnectorDataListenerType.ON_RECEIVED,
- new DataListener("EvShutter",m_que));
+ new DataListener("EvShutterFull",m_que));
m_EvShutterHalfIn.addConnectorDataListener(
ConnectorDataListenerType.ON_RECEIVED,
new DataListener("EvShutterHalf",m_que));
@@ -234,6 +234,11 @@
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);
}
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-01-19 16:06:25 UTC (rev 910)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Top.java 2017-01-20 07:00:03 UTC (rev 911)
@@ -5,13 +5,16 @@
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 {
- //private static final Logger LOGGER = LoggerFactory.getLogger(Top.class);
/*
public static class Data {
@@ -65,6 +68,7 @@
@Override
public void onEntry() {
System.out.println("Top::onEntry");
+ setOutputData(0);
}
@Override
@@ -104,35 +108,22 @@
@Override
public void EvShutterReleased(TimedLong param){
}
-/*
- public void open() {
- // do nothing
- }
@Override
- public void close() {
- // do nothing
+ public int getOutputData() {
+ return m_que.poll();
}
@Override
- public void minute() {
- // do nothing
+ public boolean isOutputData() {
+ return m_que.isEmpty();
}
- @Override
- public void start() {
- // do nothing
+ protected void setOutputData(int val) {
+ m_que.offer(val);
}
- @Override
- public void stop() {
- // do nothing
- }
-
- @Override
- public void tick() {
- // do nothing
- }
-*/
+ private int m_val;
+ private static Queue<Integer> m_que = new ArrayDeque<Integer>();;
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/jfsm/machine/MachineBase.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/jfsm/machine/MachineBase.java 2017-01-19 16:06:25 UTC (rev 910)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/jfsm/machine/MachineBase.java 2017-01-20 07:00:03 UTC (rev 911)
@@ -16,7 +16,8 @@
//import org.slf4j.LoggerFactory;
import jp.go.aist.rtm.RTC.log.Logbuf;
-public class MachineBase extends ExtendedFsmServiceProvider {
+//public class MachineBase extends ExtendedFsmServiceProvider {
+public class MachineBase {
//private static final Logger LOGGER = LoggerFactory.getLogger(MachineBase.class);
More information about the openrtm-commit
mailing list