# HG changeset patch # User Malte Bayer # Date 1351417299 -3600 # Node ID 039ab094f79ba4ffcef5c801987a599c075ad736 # Parent 434d60dc9b12f106d6a1f39b7f462835a3a946c1 renamed --speed to --accel and added minimum value 6 diff -r 434d60dc9b12 -r 039ab094f79b slotUI/SlotCli.py --- a/slotUI/SlotCli.py Sat Dec 17 18:58:35 2011 +0100 +++ b/slotUI/SlotCli.py Sun Oct 28 10:41:39 2012 +0100 @@ -452,8 +452,8 @@ help="Set maximum CAR fuel level", metavar="[0-15]") parser.add_option("--brake", dest="brake", help="Set CAR brake strength", metavar="[0-15]") - parser.add_option("--speed", dest="speed", - help="Set maximum CAR speed", metavar="[0-15]") + parser.add_option("--accel", dest="accel", + help="Set CAR acceleration ", metavar="[6-15]") parser.add_option("--blink", dest="blink", help="Set car lights blinking state", metavar="[on|off]") parser.add_option("--limit", dest="limit", @@ -480,8 +480,8 @@ if options.fuel: print "setFuel: " + cli.box.progcar(int(options.carid), "fuel", int(options.fuel)) - if options.speed: - print "setSpeed: " + cli.box.progcar(int(options.carid), "speed", int(options.speed)) + if options.accel: + print "setAccel: " + cli.box.progcar(int(options.carid), "accel", int(options.accel)) if options.brake: print "setBrake: " + cli.box.progcar(int(options.carid), "brake", int(options.brake)) diff -r 434d60dc9b12 -r 039ab094f79b slotUI/freeslot.py --- a/slotUI/freeslot.py Sat Dec 17 18:58:35 2011 +0100 +++ b/slotUI/freeslot.py Sun Oct 28 10:41:39 2012 +0100 @@ -104,7 +104,7 @@ if (carid < 0) or (carid > 5): return "ERR - invalid carid" cmd = -1 - if command == "speed": + if command == "accel": cmd = 0 if command == "brake": cmd = 1 @@ -114,6 +114,8 @@ return "ERR - invalid command" if (value<0) or (value>15): return "ERR - invalid value" + if command == "accel" and value < 6: + return "ERR - value too low" # transform value 10..15 to A..F if (value>9): value = chr(ord("A") + (value-10))