[openrtm-commit:01787] r679 - trunk/OpenRTM-aist-Python/OpenRTM_aist
openrtm @ openrtm.org
openrtm @ openrtm.org
2016年 2月 29日 (月) 12:21:18 JST
Author: miyamoto
Date: 2016-02-29 12:21:18 +0900 (Mon, 29 Feb 2016)
New Revision: 679
Modified:
trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortSHMConsumer.py
trunk/OpenRTM-aist-Python/OpenRTM_aist/OutPortSHMConsumer.py
trunk/OpenRTM-aist-Python/OpenRTM_aist/OutPortSHMProvider.py
Log:
[compat,bugfix,->RELENG_1_2] bug fix. refs #3410
Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortSHMConsumer.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortSHMConsumer.py 2016-02-28 08:04:26 UTC (rev 678)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/InPortSHMConsumer.py 2016-02-29 03:21:18 UTC (rev 679)
@@ -130,6 +130,17 @@
return
+ def setObject(self, obj):
+ if OpenRTM_aist.CorbaConsumer.setObject(self, obj):
+ ref_ = self.getObject()
+ if ref_:
+ inportcdr = ref_._narrow(OpenRTM__POA.PortSharedMemory)
+ self._shmem.setInterface(inportcdr)
+
+ return True
+ return False
+
+
##
# @if jp
# @brief 接続先へのデータ送信
@@ -163,10 +174,7 @@
guard = OpenRTM_aist.ScopedLock(self._mutex)
-
- self._shmem.setInterface(inportcdr)
- if self._shmem._shmem is None:
- self._shmem.create_memory(self._memory_size, self._shm_address)
+ self._shmem.create_memory(self._memory_size, self._shm_address)
self._shmem.write(data)
Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/OutPortSHMConsumer.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/OutPortSHMConsumer.py 2016-02-28 08:04:26 UTC (rev 678)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/OutPortSHMConsumer.py 2016-02-29 03:21:18 UTC (rev 679)
@@ -79,7 +79,8 @@
def __del__(self, CorbaConsumer=OpenRTM_aist.CorbaConsumer):
self._rtcout.RTC_PARANOID("~OutPortSHMConsumer()")
CorbaConsumer.__del__(self)
- self._outportcdr.close_memory(True)
+ if self._outportcdr:
+ self._outportcdr.close_memory(True)
@@ -106,7 +107,14 @@
return
-
+ def setObject(self, obj):
+ if OpenRTM_aist.CorbaConsumer.setObject(self, obj):
+ ref_ = self.getObject()
+ if ref_:
+ outportcdr = self.getObject()._narrow(OpenRTM__POA.PortSharedMemory)
+ outportcdr.setInterface(self._shmem._this())
+ return True
+ return False
@@ -141,9 +149,7 @@
try:
outportcdr = self.getObject()._narrow(OpenRTM__POA.PortSharedMemory)
- if self._outportcdr is None:
- outportcdr.setInterface(self._shmem._this())
- self._outportcdr = outportcdr
+ self._outportcdr = outportcdr
guard = OpenRTM_aist.ScopedLock(self._mutex)
ret = outportcdr.get()
Modified: trunk/OpenRTM-aist-Python/OpenRTM_aist/OutPortSHMProvider.py
===================================================================
--- trunk/OpenRTM-aist-Python/OpenRTM_aist/OutPortSHMProvider.py 2016-02-28 08:04:26 UTC (rev 678)
+++ trunk/OpenRTM-aist-Python/OpenRTM_aist/OutPortSHMProvider.py 2016-02-29 03:21:18 UTC (rev 679)
@@ -164,8 +164,7 @@
self._rtcout.RTC_TRACE(OpenRTM_aist.Logger.print_exception())
return OpenRTM.UNKNOWN_ERROR
- if self._shmem is None:
- self.create_memory(self._memory_size, self._shm_address)
+ self.create_memory(self._memory_size, self._shm_address)
self.write(cdr[0])
return self.convertReturn(ret, cdr[0])
More information about the openrtm-commit
mailing list