chiark / gitweb /
path-setting
authorian <ian>
Thu, 5 Jan 2006 13:51:58 +0000 (13:51 +0000)
committerian <ian>
Thu, 5 Jan 2006 13:51:58 +0000 (13:51 +0000)
TODO
hostside/eventrun.events
hostside/stopgap-controller

diff --git a/TODO b/TODO
index 43910099dbcbba0560a1897fde8fc890f1274cb0..1fa020982733583f90fb8e3f98a7df1cbf4c7aca 100644 (file)
--- a/TODO
+++ b/TODO
@@ -2,8 +2,6 @@ more keystroke commands
 
 speed changes immediate
 
-labels for keys
-
 race between cdu off (due to watchdog or short) and points
 
 
index 1080b156cacd489ce075e90fc0502cb6c1d164be..b2f7fea876102b3504bd9e3015ba0ded73d9cc11 100644 (file)
@@ -7,3 +7,9 @@ eb      trains_start
 b2     tw ask_slow
 e6     tw ask_randspeed
 ec     tw ask_fast
+
+ea     tw ask_manualleft
+e9     tw ask_manualright
+e8     tw ask_figureeight
+e7     tw ask_loop
+e5     tw ask_randpath
index 0c4f3342c2e3846e6b58429e665cecfc22a77c45..3b3348f24d2ab92ccfc0a7f2d381ef884f074451 100755 (executable)
@@ -12,8 +12,10 @@ set ch(speeddirnevery) 30
 set ch(scale) 1
 
 set ch(minint) 5000
-# unset always
-# set always 0
+
+#unset pointasked
+# 0 1 (settings) M0 M1 (manual, settings) unset (random) M (manual)
+
 set nmrawhich 0
 set lastptchosen xx
 
@@ -170,15 +172,27 @@ proc randbyte {} {
 }
 
 proc pt_maybe {point oneisright} {
-    global always lastptchosen
-    if {[info exists always]} {
-       set pos $always
-    } else {
+    global pointasked lastptchosen
+    if {![info exists pointasked]} {
        if {![string compare $point $lastptchosen]} return
        set lastptchosen $point
        set x [randbyte]
        set pos [expr [regexp {^[89a-f]} $x] ? 1 : 0]
        debug "chose point $point pos=$pos (x=$x)"
+    } elseif {[regexp {^M([01])$} $pointasked dummy pos]} {
+       if {[lsearch -exact {40 02} [lindex $point 0]] >= 0} {
+           set pos [expr {!$pos}]
+           debug "chose point $point pos=$pos manual-rl"
+       } else {
+           debug "chose point $point pos=$pos manual-lr"
+       }
+       set pointasked M
+    } elseif {![string compare $pointasked M]} {
+       debug "leave point $point pos=$pos manual"
+       return
+    } else {
+       debug "fixed point $point pos=$pos"
+       set pos $pointasked
     }
     pt_must $point $pos
 }
@@ -472,6 +486,11 @@ proc ask_randspeed {} {
     global speeddirn_fixed; catch { unset speeddirn_fixed }
 }    
 
+proc ask_manual {rightp} { global pointasked; set pointasked M$rightp }
+proc ask_figureeightt {rightp} { global pointasked; set pointasked 0 }
+proc ask_loop {rightp} { global pointasked; set pointasked 1 }
+proc ask_randpath {rightp} { global pointasked; catch { unset pointasked } }
+
 setup
 gui_init
 vwait end