[openrtm-commit:02409] r938 - in trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src: RTMExamples/StaticFsm jp/go/aist/rtm/RTC/port
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 2月 9日 (木) 16:19:17 JST
Author: win-ei
Date: 2017-02-09 16:19:17 +0900 (Thu, 09 Feb 2017)
New Revision: 938
Modified:
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/InputbuttonImpl.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/Top.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorDataListener.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/EventInPort.java
Log:
[FSM4RTC,bugfix] Fixed bugs. refs #3775
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/InputbuttonImpl.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/InputbuttonImpl.java 2017-02-07 07:59:08 UTC (rev 937)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/InputbuttonImpl.java 2017-02-09 07:19:17 UTC (rev 938)
@@ -86,7 +86,7 @@
// The initialize action (on CREATED->ALIVE transition)
// formaer rtc_init_entry()
-// @Override
+ @Override
protected ReturnCode_t onInitialize() {
try {
@@ -99,47 +99,27 @@
} catch (Exception e) {
e.printStackTrace();
}
-/*
- m_outOut.addConnectorDataListener(
- ConnectorDataListenerType.ON_BUFFER_WRITE,
- new DataListener("ON_BUFFER_WRITE"));
- m_outOut.addConnectorDataListener(
- ConnectorDataListenerType.ON_BUFFER_FULL,
- new DataListener("ON_BUFFER_FULL"));
- m_outOut.addConnectorDataListener(
- ConnectorDataListenerType.ON_BUFFER_WRITE_TIMEOUT,
- new DataListener("ON_BUFFER_WRITE_TIMEOUT"));
- m_outOut.addConnectorDataListener(
- ConnectorDataListenerType.ON_BUFFER_OVERWRITE,
- new DataListener("ON_BUFFER_OVERWRITE"));
- m_outOut.addConnectorDataListener(
- ConnectorDataListenerType.ON_BUFFER_READ,
- new DataListener("ON_BUFFER_READ"));
- m_outOut.addConnectorDataListener(
- ConnectorDataListenerType.ON_SEND,
- new DataListener("ON_SEND"));
- m_outOut.addConnectorDataListener(
- ConnectorDataListenerType.ON_RECEIVED,
- new DataListener("ON_RECEIVED"));
- m_outOut.addConnectorDataListener(
- ConnectorDataListenerType.ON_RECEIVER_FULL,
- new DataListener("ON_RECEIVER_FULL"));
- m_outOut.addConnectorDataListener(
- ConnectorDataListenerType.ON_RECEIVER_TIMEOUT,
- new DataListener("ON_RECEIVER_TIMEOUT"));
- m_outOut.addConnectorDataListener(
- ConnectorDataListenerType.ON_RECEIVER_ERROR,
- new DataListener("ON_RECEIVER_ERROR"));
-*/
-/*
- m_outOut.addConnectorListener(
+
+ m_openOut.addConnectorListener(
ConnectorListenerType.ON_CONNECT,
new Listener("ON_CONNECT"));
- m_outOut.addConnectorListener(
- ConnectorListenerType.ON_DISCONNECT,
- new Listener("ON_DISCONNECT"));
-*/
+ m_closeOut.addConnectorListener(
+ ConnectorListenerType.ON_CONNECT,
+ new Listener("ON_CONNECT"));
+ m_minuteOut.addConnectorListener(
+ ConnectorListenerType.ON_CONNECT,
+ new Listener("ON_CONNECT"));
+ m_startOut.addConnectorListener(
+ ConnectorListenerType.ON_CONNECT,
+ new Listener("ON_CONNECT"));
+ m_stopOut.addConnectorListener(
+ ConnectorListenerType.ON_CONNECT,
+ new Listener("ON_CONNECT"));
+ m_tickOut.addConnectorListener(
+ ConnectorListenerType.ON_CONNECT,
+ new Listener("ON_CONNECT"));
+
return super.onInitialize();
}
@@ -192,7 +172,7 @@
System.out.println(" stop : Stop the microwave.");
System.out.println(" tick : Proceed time.");
System.out.println(" -> others are interpreted as tick commnad.");
- System.out.println(">> ");
+ System.out.print(">> ");
BufferedReader buff = new BufferedReader(new InputStreamReader( System.in ));
try {
@@ -207,7 +187,7 @@
System.out.print(cmds[ic]+" ");
}
}
- System.out.print("");
+ System.out.println("");
if(cmds[0].equals("open")){
m_open_val.data = 0;
m_openOut.write();
@@ -367,16 +347,13 @@
System.out.println("------------------------------");
System.out.println("Listener: "+m_name);
System.out.println("Profile::name: "+arg.name);
- System.out.println("Profile::id: "+arg.id);
String str = new String();
- //System.out.println("Profile::data_type:"+arg.properties.getProperty("data_type"));
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(arg.properties._dump(str,arg.properties,0));
System.out.println("------------------------------");
return ReturnCode.NO_CHANGE;
}
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-07 07:59:08 UTC (rev 937)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/MicrowaveImpl.java 2017-02-09 07:19:17 UTC (rev 938)
@@ -70,11 +70,12 @@
// Set InPort buffers
addInPort("event", m_eventIn);
- m_eventIn.bindEvent("open", "open");
- m_eventIn.bindEvent("close", "close");
- m_eventIn.bindEvent("minute", "minute");
- m_eventIn.bindEvent("start", "start");
- m_eventIn.bindEvent("stop", "stop");
+ m_eventIn.bindEvent("eventopen", "open");
+ m_eventIn.bindEvent("eventclose", "close");
+ m_eventIn.bindEvent("eventminute", "minute");
+ m_eventIn.bindEvent("eventstart", "start");
+ m_eventIn.bindEvent("eventstop", "stop");
+ m_eventIn.bindEvent("eventtick", "tick");
// Set OutPort buffer
@@ -176,6 +177,11 @@
*/
@Override
protected ReturnCode_t onExecute(int ec_id) {
+ try {
+ Thread.sleep(1000);
+ }catch (InterruptedException e) {
+ e.printStackTrace();
+ }
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-02-07 07:59:08 UTC (rev 937)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples/StaticFsm/Top.java 2017-02-09 07:19:17 UTC (rev 938)
@@ -23,7 +23,7 @@
}
public void printTimer() {
- System.out.println(" Timer set to {} minutes"+ myCookingTime);
+ System.out.println(" Timer set to "+ myCookingTime+ " minutes" );
}
public void incrementTimer() {
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorDataListener.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorDataListener.java 2017-02-07 07:59:08 UTC (rev 937)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorDataListener.java 2017-02-09 07:19:17 UTC (rev 938)
@@ -284,8 +284,10 @@
// implements Observer, ConnectorListenerStatus{
implements Observer{
public void update(Observable o, Object obj) {
- ConnectorDataListenerArgument arg
- = (ConnectorDataListenerArgument)obj;
+// ConnectorDataListenerArgument arg
+// = (ConnectorDataListenerArgument)obj;
+ ConnectorDataListenerArgumentDataRef<OutputStream> arg
+ = (ConnectorDataListenerArgumentDataRef<OutputStream>)obj;
operator(arg.m_info,arg.m_data);
}
//public abstract void operator(final ConnectorBase.ConnectorInfo info,
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/EventInPort.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/EventInPort.java 2017-02-07 07:59:08 UTC (rev 937)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/EventInPort.java 2017-02-09 07:19:17 UTC (rev 938)
@@ -50,7 +50,7 @@
}
public ReturnCode operator(ConnectorBase.ConnectorInfo info,
OutputStream data){
- if (info.properties.getProperty("fsm_event_name").equals(m_eventName) || info.name == m_eventName) {
+ if (info.properties.getProperty("fsm_event_name").equals(m_eventName) || info.name.equals(m_eventName)) {
m_fsm.dispatch(new Event(m_handler,null,null));
System.out.println("Event dispatched: " + m_eventName);
return ReturnCode.NO_CHANGE;
@@ -71,7 +71,7 @@
}
public ReturnCode operator(ConnectorBase.ConnectorInfo info,
DataType data){
- if (info.properties.getProperty("fsm_event_name").equals(m_eventName) || info.name == m_eventName) {
+ if (info.properties.getProperty("fsm_event_name").equals(m_eventName) || info.name.equals(m_eventName)) {
Class<?>[] args = new Class<?>[1];
args[0] = data.getClass();
m_fsm.dispatch(new Event(m_handler,args,data));
@@ -135,7 +135,9 @@
final String name, DataRef<FsmType> fsm,
boolean read_block, boolean write_block,
long read_timeout, long write_timeout) {
- super(name,"any");
+// super(name,"any");
+ super(name,"IDL:RTC/TimedLong:1.0");
+
m_name = name;
m_fsm = fsm;
More information about the openrtm-commit
mailing list