From b313abd7449af357d6815e1116975d5987a39364 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Sun, 8 May 2011 15:43:13 +0200 Subject: digital/*/tools: use robot specific init parameters --- digital/asserv/tools/inter_asserv.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'digital/asserv/tools/inter_asserv.py') diff --git a/digital/asserv/tools/inter_asserv.py b/digital/asserv/tools/inter_asserv.py index f2c74a5c..82a92c32 100644 --- a/digital/asserv/tools/inter_asserv.py +++ b/digital/asserv/tools/inter_asserv.py @@ -26,8 +26,7 @@ import math import asserv import asserv.init -import proto.popen_io -import serial +from utils.init_proto import init_proto from inter.inter import Inter from Tkinter import * @@ -35,15 +34,9 @@ from Tkinter import * class InterAsserv (Inter): """Inter, communicating with the asserv board.""" - def __init__ (self, argv): + def __init__ (self): # Asserv. - if argv[0] == '!': - io = proto.popen_io.PopenIO (argv[1:]) - i = asserv.init.host - else: - io = serial.Serial (argv[0]) - i = asserv.init.target - self.a = asserv.Proto (io, **i) + self.a = init_proto ('giboulee', asserv.Proto, asserv.init) self.a.async = True # Inter. Inter.__init__ (self) @@ -128,8 +121,7 @@ class InterAsserv (Inter): self.a.ftw (self.backwardVar.get ()) if __name__ == '__main__': - import sys - app = InterAsserv (sys.argv[1:]) + app = InterAsserv () try: app.mainloop () finally: -- cgit v1.2.3