[openrtm-commit:01857] r696 - trunk/OpenRTM-aist-Python/OpenRTM_aist
openrtm @ openrtm.org
openrtm @ openrtm.org
2016年 3月 16日 (水) 14:28:55 JST
Author: miyamoto
Date: 2016-03-16 14:28:55 +0900 (Wed, 16 Mar 2016)
New Revision: 696
Modified:
trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortSHMProvider.py
trunk/OpenRTM-aist-Python/OpenRTM_aist/NamingManager.py
trunk/OpenRTM-aist-Python/OpenRTM_aist/SharedMemory.py
Log:
[compat,bugfix,->RELENG_1_2] bug fix.
Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortSHMProvider.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortSHMProvider.py 2016-03-12 04:10:25 UTC (rev 695)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortSHMProvider.py 2016-03-16 05:28:55 UTC (rev 696)
@@ -178,12 +178,9 @@
return OpenRTM.UNKNOWN_ERROR
return OpenRTM.UNKNOWN_ERROR
+
+
-
-
- return self.convertReturn(ret, data)
-
-
def onBufferWrite(self, data):
if self._listeners is not None and self._profile is not None:
self._listeners.connectorData_[OpenRTM_aist.ConnectorDataListenerType.ON_BUFFER_WRITE].notify(self._profile, data)
@@ -225,7 +222,35 @@
return
+ def convertReturn(self, status, data):
+ if status == OpenRTM_aist.BufferStatus.BUFFER_OK:
+ self.onBufferWrite(data)
+ return OpenRTM.PORT_OK
+
+ elif status == OpenRTM_aist.BufferStatus.BUFFER_ERROR:
+ self.onReceiverError(data)
+ return OpenRTM.PORT_ERROR
+ elif status == OpenRTM_aist.BufferStatus.BUFFER_FULL:
+ self.onBufferFull(data)
+ self.onReceiverFull(data)
+ return OpenRTM.BUFFER_FULL
+
+ elif status == OpenRTM_aist.BufferStatus.BUFFER_EMPTY:
+ return OpenRTM.BUFFER_EMPTY
+
+ elif status == OpenRTM_aist.BufferStatus.PRECONDITION_NOT_MET:
+ self.onReceiverError(data)
+ return OpenRTM.PORT_ERROR
+
+ elif status == OpenRTM_aist.BufferStatus.TIMEOUT:
+ self.onBufferWriteTimeout(data)
+ self.onReceiverTimeout(data)
+ return OpenRTM.BUFFER_TIMEOUT
+
+ else:
+ self.onReceiverError(data)
+ return OpenRTM.UNKNOWN_ERROR
Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/NamingManager.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/NamingManager.py 2016-03-12 04:10:25 UTC (rev 695)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/NamingManager.py 2016-03-16 05:28:55 UTC (rev 696)
@@ -1094,9 +1094,10 @@
# RTCList string_to_component(string name);
def string_to_component(self, name):
for n in self._names:
- comps = n.ns.string_to_component(name)
- if len(comps) > 0:
- return comps
+ if n.ns:
+ comps = n.ns.string_to_component(name)
+ if len(comps) > 0:
+ return comps
return []
# Name Servers' method/name and object
Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/SharedMemory.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/SharedMemory.py 2016-03-12 04:10:25 UTC (rev 695)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/SharedMemory.py 2016-03-16 05:28:55 UTC (rev 696)
@@ -141,7 +141,7 @@
elif size_str[-1] == "k":
memory_size = 1024 * int(size_str[0:-1])
else:
- memory_size = int(size_str[0:-1])
+ memory_size = int(size_str)
return memory_size
More information about the openrtm-commit
mailing list