[openrtm-commit:00751] r2340 - trunk/OpenRTM-aist/src/ext/ec/logical_time/example
openrtm @ openrtm.org
openrtm @ openrtm.org
2012年 3月 8日 (木) 23:13:17 JST
Author: kurihara
Date: 2012-03-08 23:13:17 +0900 (Thu, 08 Mar 2012)
New Revision: 2340
Modified:
trunk/OpenRTM-aist/src/ext/ec/logical_time/example/TickApp.py
Log:
The problem on windows has been fixed. refs #2376
Modified: trunk/OpenRTM-aist/src/ext/ec/logical_time/example/TickApp.py
===================================================================
--- trunk/OpenRTM-aist/src/ext/ec/logical_time/example/TickApp.py 2012-03-08 14:02:46 UTC (rev 2339)
+++ trunk/OpenRTM-aist/src/ext/ec/logical_time/example/TickApp.py 2012-03-08 14:13:17 UTC (rev 2340)
@@ -34,6 +34,7 @@
# See details in rtc.conf
#
+import os
import Tkinter as Tk
class Frame(Tk.Frame):
@@ -118,9 +119,11 @@
self.lttsample.shutdown()
import time
time.sleep(1.0)
- import os
- os.popen("killall -q LTTSampleComp")
- os.popen("killall -q lt-LTTSampleComp")
+ if os.sep == '\\':
+ os.popen("TaskKill /im LTTSampleComp.exe")
+ else:
+ os.popen("killall -q LTTSampleComp")
+ os.popen("killall -q lt-LTTSampleComp")
import CORBA
@@ -131,12 +134,14 @@
self.ior = open("LTTSample0.rtc").read()
except:
print "LTTSample0.rtc not found"
- import os
import time, sys
write = sys.stdout.write
write("Launching LTTSampleComp...")
sys.stdout.flush()
- os.system("./LTTSampleComp&")
+ if os.sep == '\\':
+ os.system("start LTTSampleComp.exe")
+ else:
+ os.system("./LTTSampleComp&")
while True:
try:
self.ior = open("LTTSample0.rtc").read()
@@ -150,7 +155,10 @@
obj = self.orb.string_to_object(self.ior)
if CORBA.is_nil(obj):
print "Object in LTTSample0.rtc is nil. Restarting LTTSampleComp..."
- os.system("./LTTSampleComp&")
+ if os.sep == '\\':
+ os.system("start LTTSampleComp.exe")
+ else:
+ os.system("./LTTSampleComp&")
self.ior = open("LTTSample0.rtc").read()
obj = self.orb.string_to_object(self.ior)
if CORBA.is_nil(obj):
@@ -160,21 +168,27 @@
import omniORB
import sys
- self.sdo_idl = omniORB.importIDL("idl/SDOPackage.idl")
- self.rtc_idl = omniORB.importIDL("idl/RTC.idl", ["-Iidl"])
- self.ltt_idl = omniORB.importIDL("idl/LogicalTimeTriggeredEC.idl",
+ if os.sep == '\\':
+ os.system("omniidl -I. -bpython SDOPackage.idl RTC.idl LogicalTimeTriggeredEC.idl")
+ import RTC
+ import OpenRTM
+ else:
+ self.sdo_idl = omniORB.importIDL("idl/SDOPackage.idl")
+ self.rtc_idl = omniORB.importIDL("idl/RTC.idl", ["-Iidl"])
+ self.ltt_idl = omniORB.importIDL("idl/LogicalTimeTriggeredEC.idl",
["-Iidl"])
-
- RTC = sys.modules["RTC"]
- OpenRTM = sys.modules["OpenRTM"]
+ RTC = sys.modules["RTC"]
+ OpenRTM = sys.modules["OpenRTM"]
try:
self.rtobj = obj._narrow(RTC.RTObject)
except:
print "Narrowing failed. Restarting LTTSampleComp..."
- import os
import time
print "Launching LTTSampleComp..."
- os.system("./LTTSampleComp&")
+ if os.sep == '\\':
+ os.system("start LTTSampleComp.exe")
+ else:
+ os.system("./LTTSampleComp&")
time.sleep(1.0)
obj = self.orb.string_to_object(open("LTTSample0.rtc").read())
self.rtobj = obj._narrow(RTC.RTObject)
openrtm-commit メーリングリストの案内