[openrtm-commit:03036] r904 - in branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist: . examples/Throughput python3_examples

openrtm @ openrtm.org openrtm @ openrtm.org
2017年 12月 18日 (月) 12:02:44 JST


Author: kawauchi
Date: 2017-12-18 12:02:44 +0900 (Mon, 18 Dec 2017)
New Revision: 904

Added:
   branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/python3_examples/Throughput/
Modified:
   branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/Manager.py
   branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/RingBuffer.py
   branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/examples/Throughput/rtc.conf
Log:
[merge] r899, 901-902 have been merged from trunk.

Modified: branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/Manager.py
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/Manager.py	2017-12-15 02:11:05 UTC (rev 903)
+++ branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/Manager.py	2017-12-18 03:02:44 UTC (rev 904)
@@ -3070,7 +3070,7 @@
   # @if jp
   # @brief µ¯Æ°»þ¤Ërtc.conf¤Ç»ØÄꤷ¤¿¥Ý¡¼¥È¤òÀܳ¤¹¤ë
   # Îã:
-  # manager.components.preconnect: RTC0.port0^RTC0.port1(interface_type=corba_cdr&dataflow_type=pull&~),~
+  # manager.components.preconnect: RTC0.port0:RTC0.port1(interface_type=corba_cdr&dataflow_type=pull&~),~
   # @param self
   # @else
   #
@@ -3094,10 +3094,10 @@
         self._rtcout.RTC_ERROR("Invalid format for pre-connection.")
         continue
       conn_prop[1] = conn_prop[1].replace(")","")
-      comp_ports = conn_prop[0].split("^")
+      comp_ports = conn_prop[0].split(":")
       if len(comp_ports) != 2:
         self._rtcout.RTC_ERROR("Invalid format for pre-connection.")
-        self._rtcout.RTC_ERROR("Format must be Comp0.port0^Comp1.port1()")
+        self._rtcout.RTC_ERROR("Format must be Comp0.port0:Comp1.port1()")
         continue
       
       comp0_name = comp_ports[0].split(".")[0]
@@ -3159,6 +3159,14 @@
       for o in opt_props:
         temp = o.split("=")
         if len(temp) == 2:
+          s = [temp[0]]
+          OpenRTM_aist.eraseHeadBlank(s)
+          OpenRTM_aist.eraseTailBlank(s)
+          temp[0] = s[0]
+          s = [temp[1]]
+          OpenRTM_aist.eraseHeadBlank(s)
+          OpenRTM_aist.eraseTailBlank(s)
+          temp[1] = s[0]
           prop.setProperty("dataport."+temp[0],temp[1])
       
       if RTC.RTC_OK != OpenRTM_aist.CORBA_RTCUtil.connect(c, prop, port0_var, port1_var):

Modified: branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/RingBuffer.py
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/RingBuffer.py	2017-12-15 02:11:05 UTC (rev 903)
+++ branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/RingBuffer.py	2017-12-18 03:02:44 UTC (rev 904)
@@ -15,6 +15,7 @@
 #         Advanced Industrial Science and Technology (AIST), Japan
 #     All rights reserved.
 
+import sys
 import threading
 import OpenRTM_aist
 
@@ -370,9 +371,19 @@
             nsec = self._wtimeout.usec() * 1000
 
           # true: signaled, false: timeout
-          if not self._full_cond.wait(sec + (nsec/1000000000.0)):
-            self._full_cond.release()
-            return OpenRTM_aist.BufferStatus.TIMEOUT
+          if sec != 0 or nsec != 0:
+            wait_time = sec + (nsec/1000000000.0)
+          else:
+            wait_time = None
+          ret = self._full_cond.wait(wait_time)
+          if sys.version_info[0] == 3:
+            if not ret:
+              self._full_cond.release()
+              return OpenRTM_aist.BufferStatus.TIMEOUT
+          else:
+            if self.full():
+              self._full_cond.release()
+              return OpenRTM_aist.BufferStatus.TIMEOUT
 
         else: # unknown condition
           self._full_cond.release()
@@ -617,9 +628,19 @@
           sec = self._rtimeout.sec()
           nsec = self._rtimeout.usec() * 1000
         #  true: signaled, false: timeout
-        if not self._empty_cond.wait(sec + (nsec/1000000000.0)):
-          self._empty_cond.release()
-          return OpenRTM_aist.BufferStatus.TIMEOUT
+        if sec != 0 or nsec != 0:
+          wait_time = sec + (nsec/1000000000.0)
+        else:
+          wait_time = None
+        ret = self._empty_cond.wait(wait_time)
+        if sys.version_info[0] == 3:
+          if not ret:
+            self._empty_cond.release()
+            return OpenRTM_aist.BufferStatus.TIMEOUT
+        else:
+          if self.empty():
+            self._empty_cond.release()
+            return OpenRTM_aist.BufferStatus.TIMEOUT
 
       else:                              # unknown condition
         self._empty_cond.release()

Modified: branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/examples/Throughput/rtc.conf
===================================================================
--- branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/examples/Throughput/rtc.conf	2017-12-15 02:11:05 UTC (rev 903)
+++ branches/RELENG_1_2/OpenRTM-aist-Python/OpenRTM_aist/examples/Throughput/rtc.conf	2017-12-18 03:02:44 UTC (rev 904)
@@ -1,5 +1,5 @@
 corba.args: -ORBgiopMaxMsgSize 209715200
-manager.components.preconnect: Throughput_py0.out^Throughput_py0.in(dataflow_type=push&interface_type=corba_cdr)
+manager.components.preconnect: Throughput_py0.out:Throughput_py0.in(dataflow_type=push&interface_type=corba_cdr)
 manager.components.preactivation: Throughput_py0
 
 example.Throughput_py.conf.default.maxsize: 1000000



More information about the openrtm-commit mailing list