slotUI/slotCli.py

changeset 124
0b12a8bf23b2
parent 123
ec623e5fcbca
child 137
94d71156517b
--- a/slotUI/slotCli.py	Sat Dec 15 22:55:30 2012 +0100
+++ b/slotUI/slotCli.py	Sat Dec 15 23:15:32 2012 +0100
@@ -79,6 +79,7 @@
     def __init__(self, test = None, dev=""):
         self.box = Blackbox()
         self.nofuel = False
+        self.pitfinish = False
         if (not test):
             self.box.connect(dev)
             self.rpcserver = SlotServer(self.box)
@@ -300,6 +301,13 @@
         else:
             #print cli.box.fueldivisor(25)
             self.box.query("F1\n") # set fuel logic enabled
+
+        if self.pitfinish:
+            self.box.query("X1\n") # set pitlane finish function
+        else:
+            #print cli.box.fueldivisor(25)
+            self.box.query("X0\n")
+
         self.box.query("*%i\n" % live) # set live fuel info
 
     def monitor_learn(self, slot):
@@ -646,6 +654,8 @@
         help="Run Live monitor on console", metavar="[0-5]")
     parser.add_option("--nofuel", dest="nofuel", action="store_true", default=False,
         help="Disable Freeslot fuel management", metavar="[0-5]")
+    parser.add_option("--pit", dest="pitfinish", action="store_true", default=False,
+        help="Pitlane entry acts as finish line too", metavar="[0-5]")
     parser.add_option("--learn", dest="learn", action="store_true", default=False,
         help="Run Learning mode for [slot]", metavar="[0-5]")
     parser.add_option("--teach", dest="playback", 
@@ -683,6 +693,7 @@
     if options.live:
         # start the live monitor
         cli.nofuel = options.nofuel
+        cli.pitfinish = options.pitfinish
         cli.monitor()
         sys.exit(0)
 

mercurial