[openrtm-commit:02337] r921 - in trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC: . connectorListener port port/publisher
openrtm @ openrtm.org
openrtm @ openrtm.org
2017年 1月 26日 (木) 18:19:52 JST
Author: win-ei
Date: 2017-01-26 18:19:52 +0900 (Thu, 26 Jan 2017)
New Revision: 921
Modified:
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/DataFlowComponent_impl.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/connectorListener/ReturnCode.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorDataListenerArgumentDataRef.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorDataListenerHolder.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorDataListenerT.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorListenerArgument.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortCorbaCdrProvider.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortDSProvider.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortDirectProvider.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortSHMProvider.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortCorbaCdrConsumer.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortCorbaCdrProvider.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortDSConsumer.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortDSProvider.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortDirectProvider.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortSHMConsumer.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortSHMProvider.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/Timestamp.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/publisher/PublisherFlush.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/publisher/PublisherNew.java
trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/publisher/PublisherPeriodic.java
Log:
[FSM4RTC,bugfix]Fixed bugs. refs #3886
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/DataFlowComponent_impl.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/DataFlowComponent_impl.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/DataFlowComponent_impl.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -128,7 +128,6 @@
public static final int ECOTHER_OFFSET = 1000;
public DataFlowComponent_impl() {
-System.out.println("--20170113 00A00");
}
/**
* {@.ja コンストラクタ。}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/connectorListener/ReturnCode.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/connectorListener/ReturnCode.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/connectorListener/ReturnCode.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -37,9 +37,28 @@
private ReturnCode(int val){
m_val = val;
}
- public void or(int flag){
-// m_flag.add(flag);
- m_val = m_val | flag;
+ public static ReturnCode or(ReturnCode ret, ReturnCode flag){
+
+ if(flag == ret){
+ return ret;
+ }
+ if(flag == ReturnCode.BOTH_CHANGED || ret == ReturnCode.BOTH_CHANGED){
+ return ret;
+ }
+ if(flag == ReturnCode.NO_CHANGE){
+ return ret;
+ }
+ if(ret == ReturnCode.NO_CHANGE){
+ return flag;
+ }
+ if(flag == ReturnCode.INFO_CHANGED || ret == ReturnCode.DATA_CHANGED){
+ return ReturnCode.BOTH_CHANGED;
+ }
+ if(flag == ReturnCode.DATA_CHANGED || ret == ReturnCode.INFO_CHANGED){
+ return ReturnCode.BOTH_CHANGED;
+ }
+
+ return ReturnCode.BOTH_CHANGED;
}
public int getValue(){
return m_val;
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorDataListenerArgumentDataRef.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorDataListenerArgumentDataRef.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorDataListenerArgumentDataRef.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -31,7 +31,7 @@
// public EnumSet<ReturnCode> m_ret;
public ReturnCode m_ret;
public void setReturnCode(ReturnCode ret) {
- //m_ret.or(ret);
+ m_ret = ReturnCode.or(m_ret,ret);
}
public ReturnCode getReturnCode() {
return m_ret;
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorDataListenerHolder.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorDataListenerHolder.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorDataListenerHolder.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -15,21 +15,21 @@
*
*/
public class ConnectorDataListenerHolder<DataType> extends Observable
-// implements ConnectorListenerStatus{
{
public ConnectorDataListenerHolder(){
rtcout = new Logbuf("ConnectorDataListenerHolder");
}
- //public void notify(final ConnectorBase.ConnectorInfo info,
- public ReturnCode notify(final ConnectorBase.ConnectorInfo info,
- final OutputStream cdrdata) {
+ public ReturnCode notify(ConnectorBase.ConnectorInfo info,
+ DataRef<OutputStream> cdrdata) {
+// OutputStream cdrdata) {
super.setChanged();
ReturnCode ret = ReturnCode.NO_CHANGE;
//ConnectorDataListenerArgument arg
// = new ConnectorDataListenerArgument(info,cdrdata);
ConnectorDataListenerArgumentDataRef<OutputStream> arg
- = new ConnectorDataListenerArgumentDataRef<OutputStream>(info,cdrdata);
- super.notifyObservers((Object)arg);
+ = new ConnectorDataListenerArgumentDataRef<OutputStream>(info,cdrdata.v);
+ super.notifyObservers((Object)arg);
+ cdrdata.v = arg.m_data;
ret = arg.getReturnCode();
return ret;
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorDataListenerT.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorDataListenerT.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorDataListenerT.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -10,6 +10,8 @@
import jp.go.aist.rtm.RTC.connectorListener.ReturnCode;
import jp.go.aist.rtm.RTC.log.Logbuf;
+import jp.go.aist.rtm.RTC.util.ORBUtil;
+
import RTC.ReturnCode_t;
/**
@@ -108,20 +110,41 @@
}
ReturnCode ret = operator(arg.m_info,m_datatype);
if (ret == ReturnCode.DATA_CHANGED || ret == ReturnCode.BOTH_CHANGED) {
- //cdrdata.rewindPtrs();
- //data >>= cdrdata;
+ arg.m_data = m_datatype;
try {
- OutputStream out_data = (OutputStream)arg.m_data;
+
+ String endian_type = arg.m_info.properties.
+ getProperty("serializer.cdr.endian","little");
+ rtcout.println(Logbuf.PARANOID,
+ "serializer.cdr.endian:"+endian_type);
+ String[] endian = endian_type.split(",");
+ boolean endian_flag = true;
+ rtcout.println(Logbuf.PARANOID,
+ "serializer.cdr.endian[0]:"+endian[0]);
+ if(!endian[0].equals("little")){
+ endian_flag = false;
+ }
+ OutputStream out_data
+ = new EncapsOutputStreamExt(ORBUtil.getOrb(),endian_flag);
m_field.set(m_streamable,m_datatype);
m_streamable._write(out_data);
+
+ Class cl = obj.getClass();
+ String str = cl.getName();
+ rtcout.println(Logbuf.PARANOID,"class name:"+str);
+ cl.getField("m_data").set(obj,out_data);
}
+ catch(NoSuchFieldException e){
+ rtcout.println(Logbuf.WARN,
+ "Exception caught."+e.toString());
+ }
catch(IllegalAccessException e){
- //set throws
- e.printStackTrace();
+ rtcout.println(Logbuf.WARN,
+ "Exception caught."+e.toString());
}
catch(IllegalArgumentException e){
- //invoke throws
- e.printStackTrace();
+ rtcout.println(Logbuf.WARN,
+ "Exception caught."+e.toString());
}
}
arg.setReturnCode(ret);
@@ -143,8 +166,6 @@
* {@.en Data}
*
*/
- //public abstract void operator(final ConnectorBase.ConnectorInfo info,
- // final DataType data);
public abstract ReturnCode operator(ConnectorBase.ConnectorInfo info,
DataType data);
private Streamable m_streamable = null;
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorListenerArgument.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorListenerArgument.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/ConnectorListenerArgument.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -19,8 +19,9 @@
public ReturnCode m_ret;
// public EnumSet<ReturnCode> m_ret;
public void setReturnCode(ReturnCode ret) {
- m_ret.or(ret.getValue());
+ //m_ret.or(ret.getValue());
// EnumSet<ReturnCode> m_flag = EnumSet.noneOf(ReturnCode.class);
+ m_ret = ReturnCode.or(m_ret,ret);
}
public ReturnCode getReturnCode() {
return m_ret;
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortCorbaCdrProvider.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortCorbaCdrProvider.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortCorbaCdrProvider.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -6,6 +6,7 @@
import jp.go.aist.rtm.RTC.buffer.BufferBase;
import jp.go.aist.rtm.RTC.log.Logbuf;
import jp.go.aist.rtm.RTC.util.CORBA_SeqUtil;
+import jp.go.aist.rtm.RTC.util.DataRef;
import jp.go.aist.rtm.RTC.util.NVListHolderFactory;
import jp.go.aist.rtm.RTC.util.NVUtil;
import jp.go.aist.rtm.RTC.util.ORBUtil;
@@ -164,7 +165,9 @@
int len = cdr.getByteArray().length;
rtcout.println(Logbuf.PARANOID, "converted CDR data size: "+len);
- onReceived(cdr);
+ DataRef<OutputStream> dataref = new DataRef<OutputStream>(cdr);
+ onReceived(dataref);
+ cdr = (EncapsOutputStreamExt)dataref.v;
jp.go.aist.rtm.RTC.buffer.ReturnCode ret = m_buffer.write(cdr);
return convertReturn(ret,cdr);
}
@@ -535,7 +538,7 @@
* {@.ja OutputStream}
* {@.en OutputStream}
*/
- private void onReceived(OutputStream data) {
+ private void onReceived(DataRef<OutputStream> data) {
m_listeners.connectorData_[ConnectorDataListenerType.ON_RECEIVED].notify(m_profile, data);
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortDSProvider.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortDSProvider.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortDSProvider.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -6,6 +6,7 @@
import jp.go.aist.rtm.RTC.buffer.BufferBase;
import jp.go.aist.rtm.RTC.log.Logbuf;
import jp.go.aist.rtm.RTC.util.CORBA_SeqUtil;
+import jp.go.aist.rtm.RTC.util.DataRef;
import jp.go.aist.rtm.RTC.util.NVListHolderFactory;
import jp.go.aist.rtm.RTC.util.NVUtil;
import jp.go.aist.rtm.RTC.util.ORBUtil;
@@ -523,7 +524,8 @@
* {@.ja OutputStream}
* {@.en OutputStream}
*/
- private void onReceived(final OutputStream data) {
+ //private void onReceived(final OutputStream data) {
+ private void onReceived(DataRef<OutputStream> data) {
m_listeners.connectorData_[ConnectorDataListenerType.ON_RECEIVED].notify(m_profile, data);
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortDirectProvider.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortDirectProvider.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortDirectProvider.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -6,6 +6,7 @@
import jp.go.aist.rtm.RTC.buffer.BufferBase;
import jp.go.aist.rtm.RTC.log.Logbuf;
//import jp.go.aist.rtm.RTC.util.CORBA_SeqUtil;
+import jp.go.aist.rtm.RTC.util.DataRef;
import jp.go.aist.rtm.RTC.util.NVListHolderFactory;
import jp.go.aist.rtm.RTC.util.NVUtil;
//import jp.go.aist.rtm.RTC.util.ORBUtil;
@@ -549,7 +550,8 @@
* {@.ja OutputStream}
* {@.en OutputStream}
*/
- private void onReceived(OutputStream data) {
+ //private void onReceived(OutputStream data) {
+ private void onReceived(DataRef<OutputStream> data) {
m_listeners.connectorData_[ConnectorDataListenerType.ON_RECEIVED].notify(m_profile, data);
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortSHMProvider.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortSHMProvider.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/InPortSHMProvider.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -6,6 +6,7 @@
import jp.go.aist.rtm.RTC.buffer.BufferBase;
import jp.go.aist.rtm.RTC.log.Logbuf;
import jp.go.aist.rtm.RTC.util.CORBA_SeqUtil;
+import jp.go.aist.rtm.RTC.util.DataRef;
import jp.go.aist.rtm.RTC.util.NVListHolderFactory;
import jp.go.aist.rtm.RTC.util.NVUtil;
import jp.go.aist.rtm.RTC.util.ORBUtil;
@@ -523,7 +524,8 @@
* {@.ja OutputStream}
* {@.en OutputStream}
*/
- private void onReceived(final OutputStream data) {
+ //private void onReceived(final OutputStream data) {
+ private void onReceived(DataRef<OutputStream> data) {
m_listeners.connectorData_[ConnectorDataListenerType.ON_RECEIVED].notify(m_profile, data);
}
@@ -697,7 +699,10 @@
int len = cdr.getByteArray().length;
rtcout.println(Logbuf.PARANOID, "converted CDR data size: "+len);
- onReceived(cdr);
+ DataRef<OutputStream> dataref = new DataRef<OutputStream>(cdr);
+ //onReceived(cdr);
+ onReceived(dataref);
+ cdr = (EncapsOutputStreamExt)dataref.v;
if(m_connector==null){
return OpenRTM.PortStatus.PORT_ERROR;
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortCorbaCdrConsumer.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortCorbaCdrConsumer.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortCorbaCdrConsumer.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -6,6 +6,7 @@
import jp.go.aist.rtm.RTC.OutPortConsumerFactory;
import jp.go.aist.rtm.RTC.buffer.BufferBase;
import jp.go.aist.rtm.RTC.log.Logbuf;
+import jp.go.aist.rtm.RTC.util.DataRef;
import jp.go.aist.rtm.RTC.util.NVUtil;
import jp.go.aist.rtm.RTC.util.Properties;
@@ -169,7 +170,10 @@
rtcout.println(Logbuf.PARANOID,
"CDR data length: "+cdr_data.value.length);
- onReceived(data);
+ DataRef<OutputStream> dataref = new DataRef<OutputStream>(data);
+ onReceived(dataref);
+ data = (EncapsOutputStreamExt)dataref.v;
+ //onReceived(data);
onBufferWrite(data);
if (m_buffer.full()) {
@@ -463,7 +467,8 @@
* {@.ja OutputStream}
* {@.en OutputStream}
*/
- private void onReceived(OutputStream data) {
+ //private void onReceived(OutputStream data) {
+ private void onReceived(DataRef<OutputStream> data) {
m_listeners.connectorData_[ConnectorDataListenerType.ON_RECEIVED].notify(m_profile, data);
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortCorbaCdrProvider.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortCorbaCdrProvider.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortCorbaCdrProvider.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -484,8 +484,7 @@
connectorData_[ConnectorDataListenerType.ON_BUFFER_READ].notify(m_profile, data);
}
- private void onSend(OutputStream data)
- {
+ private void onSend(DataRef<OutputStream> data) {
m_listeners.
connectorData_[ConnectorDataListenerType.ON_SEND].notify(m_profile, data);
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortDSConsumer.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortDSConsumer.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortDSConsumer.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -6,6 +6,7 @@
import jp.go.aist.rtm.RTC.OutPortConsumerFactory;
import jp.go.aist.rtm.RTC.buffer.BufferBase;
import jp.go.aist.rtm.RTC.log.Logbuf;
+import jp.go.aist.rtm.RTC.util.DataRef;
import jp.go.aist.rtm.RTC.util.NVUtil;
import jp.go.aist.rtm.RTC.util.POAUtil;
import jp.go.aist.rtm.RTC.util.Properties;
@@ -216,7 +217,10 @@
rtcout.println(Logbuf.PARANOID,
"CDR data length: "+cdr_data.value.length);
- onReceived(data);
+ DataRef<OutputStream> dataref = new DataRef<OutputStream>(data);
+ onReceived(dataref);
+ data = (EncapsOutputStreamExt)dataref.v;
+ //onReceived(data);
onBufferWrite(data);
if (m_buffer.full()) {
@@ -510,7 +514,8 @@
* {@.ja OutputStream}
* {@.en OutputStream}
*/
- private void onReceived(final OutputStream data) {
+ //private void onReceived(final OutputStream data) {
+ private void onReceived(DataRef<OutputStream> data) {
m_listeners.connectorData_[ConnectorDataListenerType.ON_RECEIVED].notify(m_profile, data);
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortDSProvider.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortDSProvider.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortDSProvider.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -485,8 +485,7 @@
connectorData_[ConnectorDataListenerType.ON_BUFFER_READ].notify(m_profile, data);
}
- private void onSend(final OutputStream data)
- {
+ private void onSend(DataRef<OutputStream> data) {
m_listeners.
connectorData_[ConnectorDataListenerType.ON_SEND].notify(m_profile, data);
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortDirectProvider.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortDirectProvider.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortDirectProvider.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -5,7 +5,7 @@
import jp.go.aist.rtm.RTC.ObjectDestructor;
import jp.go.aist.rtm.RTC.buffer.BufferBase;
import jp.go.aist.rtm.RTC.log.Logbuf;
-//import jp.go.aist.rtm.RTC.util.CORBA_SeqUtil;
+import jp.go.aist.rtm.RTC.util.DataRef;
import jp.go.aist.rtm.RTC.util.NVListHolderFactory;
import jp.go.aist.rtm.RTC.util.NVUtil;
//import jp.go.aist.rtm.RTC.util.ORBUtil;
@@ -549,7 +549,8 @@
* {@.ja OutputStream}
* {@.en OutputStream}
*/
- private void onReceived(final OutputStream data) {
+ //private void onReceived(final OutputStream data) {
+ private void onReceived(DataRef<OutputStream> data) {
m_listeners.connectorData_[ConnectorDataListenerType.ON_RECEIVED].notify(m_profile, data);
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortSHMConsumer.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortSHMConsumer.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortSHMConsumer.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -6,6 +6,7 @@
import jp.go.aist.rtm.RTC.OutPortConsumerFactory;
import jp.go.aist.rtm.RTC.buffer.BufferBase;
import jp.go.aist.rtm.RTC.log.Logbuf;
+import jp.go.aist.rtm.RTC.util.DataRef;
import jp.go.aist.rtm.RTC.util.NVUtil;
import jp.go.aist.rtm.RTC.util.POAUtil;
import jp.go.aist.rtm.RTC.util.Properties;
@@ -213,7 +214,10 @@
rtcout.println(Logbuf.PARANOID,
"CDR data length: "+cdr_data.value.length);
- onReceived(data);
+ DataRef<OutputStream> dataref = new DataRef<OutputStream>(data);
+ onReceived(dataref);
+ data = (EncapsOutputStreamExt)dataref.v;
+ //onReceived(data);
onBufferWrite(data);
if (m_buffer.full()) {
rtcout.println(Logbuf.INFO,
@@ -508,7 +512,8 @@
* {@.ja OutputStream}
* {@.en OutputStream}
*/
- private void onReceived(final OutputStream data) {
+ //private void onReceived(final OutputStream data) {
+ private void onReceived(DataRef<OutputStream> data) {
m_listeners.connectorData_[ConnectorDataListenerType.ON_RECEIVED].notify(m_profile, data);
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortSHMProvider.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortSHMProvider.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/OutPortSHMProvider.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -476,8 +476,7 @@
connectorData_[ConnectorDataListenerType.ON_BUFFER_READ].notify(m_profile, data);
}
- private void onSend(final OutputStream data)
- {
+ private void onSend(DataRef<OutputStream> data) {
m_listeners.
connectorData_[ConnectorDataListenerType.ON_SEND].notify(m_profile, data);
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/Timestamp.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/Timestamp.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/Timestamp.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -21,6 +21,7 @@
TimeValue tv = m_clock.getTime();
RTC.Time tm = new RTC.Time((int)(tv.getSec()),
(int)(tv.getUsec()*1000));
+// RTC.Time tm = new RTC.Time((int)0, (int)0);
Class cl = data.getClass();
String str = cl.getName();
try {
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/publisher/PublisherFlush.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/publisher/PublisherFlush.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/publisher/PublisherFlush.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -8,8 +8,10 @@
import jp.go.aist.rtm.RTC.port.ConnectorBase;
import jp.go.aist.rtm.RTC.port.ConnectorDataListenerType;
import jp.go.aist.rtm.RTC.port.ConnectorListeners;
+import jp.go.aist.rtm.RTC.port.EncapsOutputStreamExt;
import jp.go.aist.rtm.RTC.port.InPortConsumer;
import jp.go.aist.rtm.RTC.port.ReturnCode;
+import jp.go.aist.rtm.RTC.util.DataRef;
import jp.go.aist.rtm.RTC.util.Properties;
import org.omg.CORBA.portable.OutputStream;
@@ -178,12 +180,16 @@
return m_retcode;
}
- onSend(data);
- //return m_consumer.put(data);
+ DataRef<OutputStream> dataref = new DataRef<OutputStream>(data);
+ onSend(dataref);
+ data = (EncapsOutputStreamExt)dataref.v;
ReturnCode ret = m_consumer.put(data);
switch (ret) {
case PORT_OK:
- onReceived(data);
+ dataref.v = data;
+ onReceived(dataref);
+ data = (EncapsOutputStreamExt)dataref.v;
+ //onReceived(data);
return ret;
case PORT_ERROR:
onReceiverError(data);
@@ -309,11 +315,12 @@
// m_listeners.connectorData_[ConnectorDataListenerType.ON_BUFFER_READ].notify(m_profile, data);
// }
- protected void onSend(OutputStream data) {
+ protected void onSend(DataRef<OutputStream> data) {
m_listeners.connectorData_[ConnectorDataListenerType.ON_SEND].notify(m_profile, data);
}
- protected void onReceived(OutputStream data) {
+ //protected void onReceived(OutputStream data) {
+ protected void onReceived(DataRef<OutputStream> data) {
m_listeners.connectorData_[ConnectorDataListenerType.ON_RECEIVED].notify(m_profile, data);
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/publisher/PublisherNew.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/publisher/PublisherNew.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/publisher/PublisherNew.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -13,8 +13,10 @@
import jp.go.aist.rtm.RTC.port.ConnectorDataListenerType;
import jp.go.aist.rtm.RTC.port.ConnectorListenerType;
import jp.go.aist.rtm.RTC.port.ConnectorListeners;
+import jp.go.aist.rtm.RTC.port.EncapsOutputStreamExt;
import jp.go.aist.rtm.RTC.port.InPortConsumer;
import jp.go.aist.rtm.RTC.port.ReturnCode;
+import jp.go.aist.rtm.RTC.util.DataRef;
import jp.go.aist.rtm.RTC.util.Properties;
import jp.go.aist.rtm.RTC.util.StringUtil;
@@ -105,14 +107,20 @@
OutputStream cdr = m_buffer.get();
onBufferRead(cdr);
- onSend(cdr);
+ DataRef<OutputStream> dataref = new DataRef<OutputStream>(cdr);
+ onSend(dataref);
+ //onSend(cdr);
+ cdr = (EncapsOutputStreamExt)dataref.v;
ReturnCode ret = m_consumer.put(cdr);
if (!ret.equals(ReturnCode.PORT_OK)) {
rtcout.println(Logbuf.DEBUG, ret + " = consumer.put()");
return invokeListener(ret, cdr);
}
- onReceived(cdr);
+ dataref.v = cdr;
+ onReceived(dataref);
+ cdr = (EncapsOutputStreamExt)dataref.v;
+ //onReceived(cdr);
m_buffer.advanceRptr();
}
@@ -134,14 +142,20 @@
OutputStream cdr = m_buffer.get();
onBufferRead(cdr);
- onSend(cdr);
+ DataRef<OutputStream> dataref = new DataRef<OutputStream>(cdr);
+ onSend(dataref);
+ //onSend(cdr);
+ cdr = (EncapsOutputStreamExt)dataref.v;
ReturnCode ret = m_consumer.put(cdr);
if (!ret.equals(ReturnCode.PORT_OK)) {
rtcout.println(Logbuf.DEBUG, ret + " = consumer.put()");
return invokeListener(ret, cdr);
}
- onReceived(cdr);
+ dataref.v = cdr;
+ onReceived(dataref);
+ cdr = (EncapsOutputStreamExt)dataref.v;
+ //onReceived(cdr);
m_buffer.advanceRptr();
@@ -170,14 +184,20 @@
OutputStream cdr = m_buffer.get();
onBufferRead(cdr);
- onSend(cdr);
+ DataRef<OutputStream> dataref = new DataRef<OutputStream>(cdr);
+ onSend(dataref);
+ //onSend(cdr);
+ cdr = (EncapsOutputStreamExt)dataref.v;
ret = m_consumer.put(cdr);
if (!ret.equals(ReturnCode.PORT_OK)) {
m_buffer.advanceRptr(-postskip);
rtcout.println(Logbuf.DEBUG, ret + " = consumer.put()");
return invokeListener(ret, cdr);
}
- onReceived(cdr);
+ dataref.v = cdr;
+ onReceived(dataref);
+ cdr = (EncapsOutputStreamExt)dataref.v;
+ //onReceived(cdr);
postskip = m_skipn +1;
}
m_buffer.advanceRptr(m_buffer.readable());
@@ -212,14 +232,20 @@
OutputStream cdr = m_buffer.get();
onBufferRead(cdr);
- onSend(cdr);
+ DataRef<OutputStream> dataref = new DataRef<OutputStream>(cdr);
+ //onSend(cdr);
+ onSend(dataref);
+ cdr = (EncapsOutputStreamExt)dataref.v;
ReturnCode ret = m_consumer.put(cdr);
if (!ret.equals(ReturnCode.PORT_OK)) {
rtcout.println(Logbuf.DEBUG, ret + " = consumer.put()");
return invokeListener(ret, cdr);
}
- onReceived(cdr);
+ dataref.v = cdr;
+ onReceived(dataref);
+ cdr = (EncapsOutputStreamExt)dataref.v;
+ //onReceived(cdr);
m_buffer.advanceRptr();
return ret;
}
@@ -749,11 +775,12 @@
m_listeners.connectorData_[ConnectorDataListenerType.ON_BUFFER_READ].notify(m_profile, data);
}
- protected void onSend(OutputStream data) {
+ protected void onSend(DataRef<OutputStream> data) {
m_listeners.connectorData_[ConnectorDataListenerType.ON_SEND].notify(m_profile, data);
}
- protected void onReceived(OutputStream data) {
+ //protected void onReceived(OutputStream data) {
+ protected void onReceived(DataRef<OutputStream> data) {
m_listeners.connectorData_[ConnectorDataListenerType.ON_RECEIVED].notify(m_profile, data);
}
Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/publisher/PublisherPeriodic.java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/publisher/PublisherPeriodic.java 2017-01-25 15:55:39 UTC (rev 920)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/jp/go/aist/rtm/RTC/port/publisher/PublisherPeriodic.java 2017-01-26 09:19:52 UTC (rev 921)
@@ -13,8 +13,10 @@
import jp.go.aist.rtm.RTC.port.ConnectorDataListenerType;
import jp.go.aist.rtm.RTC.port.ConnectorListenerType;
import jp.go.aist.rtm.RTC.port.ConnectorListeners;
+import jp.go.aist.rtm.RTC.port.EncapsOutputStreamExt;
import jp.go.aist.rtm.RTC.port.InPortConsumer;
import jp.go.aist.rtm.RTC.port.ReturnCode;
+import jp.go.aist.rtm.RTC.util.DataRef;
import jp.go.aist.rtm.RTC.util.Properties;
import jp.go.aist.rtm.RTC.util.StringUtil;
@@ -86,14 +88,20 @@
OutputStream cdr = m_buffer.get();
onBufferRead(cdr);
- onSend(cdr);
+ DataRef<OutputStream> dataref = new DataRef<OutputStream>(cdr);
+ //onSend(cdr);
+ onSend(dataref);
+ cdr = (EncapsOutputStreamExt)dataref.v;
ReturnCode ret = m_consumer.put(cdr);
if (!ret.equals(ReturnCode.PORT_OK)) {
rtcout.println(Logbuf.DEBUG, ret + " = consumer.put()");
return invokeListener(ret, cdr);
}
- onReceived(cdr);
+ dataref.v = cdr;
+ onReceived(dataref);
+ cdr = (EncapsOutputStreamExt)dataref.v;
+ //onReceived(cdr);
m_buffer.advanceRptr();
}
return ReturnCode.PORT_OK;
@@ -114,13 +122,19 @@
OutputStream cdr = m_buffer.get();
onBufferRead(cdr);
- onSend(cdr);
+ DataRef<OutputStream> dataref = new DataRef<OutputStream>(cdr);
+ //onSend(cdr);
+ onSend(dataref);
+ cdr = (EncapsOutputStreamExt)dataref.v;
ReturnCode ret = m_consumer.put(cdr);
if (!ret.equals(ReturnCode.PORT_OK)) {
rtcout.println(Logbuf.DEBUG, ret + " = consumer.put()");
return invokeListener(ret, cdr);
}
- onReceived(cdr);
+ dataref.v = cdr;
+ onReceived(dataref);
+ cdr = (EncapsOutputStreamExt)dataref.v;
+ //onReceived(cdr);
m_buffer.advanceRptr();
@@ -149,14 +163,20 @@
OutputStream cdr = m_buffer.get();
onBufferRead(cdr);
- onSend(cdr);
+ DataRef<OutputStream> dataref = new DataRef<OutputStream>(cdr);
+ //onSend(cdr);
+ onSend(dataref);
+ cdr = (EncapsOutputStreamExt)dataref.v;
ret = m_consumer.put(cdr);
if (!ret.equals(ReturnCode.PORT_OK)) {
m_buffer.advanceRptr(-postskip);
rtcout.println(Logbuf.DEBUG, ret + " = consumer.put()");
return invokeListener(ret, cdr);
}
- onReceived(cdr);
+ dataref.v = cdr;
+ onReceived(dataref);
+ cdr = (EncapsOutputStreamExt)dataref.v;
+ //onReceived(cdr);
postskip = m_skipn +1;
}
@@ -184,14 +204,20 @@
OutputStream cdr = m_buffer.get();
onBufferRead(cdr);
- onSend(cdr);
+ DataRef<OutputStream> dataref = new DataRef<OutputStream>(cdr);
+ //onSend(cdr);
+ onSend(dataref);
+ cdr = (EncapsOutputStreamExt)dataref.v;
ReturnCode ret = m_consumer.put(cdr);
if (!ret.equals(ReturnCode.PORT_OK)) {
rtcout.println(Logbuf.DEBUG, ret + " = consumer.put()");
return invokeListener(ret, cdr);
}
- onReceived(cdr);
+ dataref.v = cdr;
+ onReceived(dataref);
+ cdr = (EncapsOutputStreamExt)dataref.v;
+ //onReceived(cdr);
m_buffer.advanceRptr();
return ret;
}
@@ -756,11 +782,12 @@
m_listeners.connectorData_[ConnectorDataListenerType.ON_BUFFER_READ].notify(m_profile, data);
}
- protected void onSend(OutputStream data) {
+ protected void onSend(DataRef<OutputStream> data) {
m_listeners.connectorData_[ConnectorDataListenerType.ON_SEND].notify(m_profile, data);
}
- protected void onReceived(OutputStream data) {
+ //protected void onReceived(OutputStream data) {
+ protected void onReceived(DataRef<OutputStream> data) {
m_listeners.connectorData_[ConnectorDataListenerType.ON_RECEIVED].notify(m_profile, data);
}
More information about the openrtm-commit
mailing list