chiark / gitweb /
fixes from testing session
authorian <ian>
Thu, 5 Jan 2006 20:19:52 +0000 (20:19 +0000)
committerian <ian>
Thu, 5 Jan 2006 20:19:52 +0000 (20:19 +0000)
hostside/eventrun.procs
hostside/gui-displayer
hostside/stopgap-controller

index 168a8569cf459fc95c4bb17262c4de4a2f5efb70..fa2739ad99ddbd736735e2d785cc83047ea36450 100644 (file)
@@ -6,28 +6,30 @@ exec xsetroot -solid #00000f
 set trainscmd {
     set -x
     savelog -c 7 bessar.log
-#    (set -ex
+    (set -ex
     cd /u/ian/things/trains-bessar/hostside
     ./stopgap-controller | ./gui-displayer -
-#    ) 2>&1 | tee bessar.log
+    ) 2>&1 | tee >(tail -10000 >bessar.log)
 }
 
 proc trains_start {} {
     global trainsf trainscmd
     trains_stop
-    set cmdl [list sh -ec $trainscmd 2>@ stderr]
+    set cmdl [list bash -ec $trainscmd 2>@ stderr]
     set trainsf [open |$cmdl w]
     fconfigure $trainsf -buffering none -blocking no
 }
 
-proc tw {s} {
+proc tw {args} {
     global trainsf
     if {![info exists trainsf]} return
     if {[catch {
-       puts $trainsf $s
+       puts $trainsf $args
     } emsg]} {
        puts stderr "tw: $emsg"
        trains_stop
+    } else {
+       puts "tw: $args"
     }
 }
 
index eadac7d9fa4a603520de7e336704bdc2c8362171..30751b3abcd5f522fc7de644b9b2bce981100254 100755 (executable)
@@ -117,6 +117,7 @@ proc setup {} {
     global power segrev segdet segown movpos
     set power 0
     set f [open ../layout/ours.dgram-bot.segcmap]
+    fconfigure stdout -buffering none
     while {[gets $f l] >= 0} {
        if {[regexp {^S (\w+) (\w+)$} $l dummy segname num]} {
            set segnum($segname) $num
index 45de0e8ab274f8478de597f59c73f9526c2958c5..607609d0bd64ec5a117a560a007aea6c09a47a1e 100755 (executable)
@@ -188,7 +188,7 @@ proc pt_maybe {point oneisright} {
        }
        set pointasked M
     } elseif {![string compare $pointasked M]} {
-       debug "leave point $point pos=$pos manual"
+       debug "leave point $point manual"
        return
     } else {
        set pos $pointasked
@@ -445,6 +445,7 @@ proc onreadcmd {} {
 
 proc setup {} {
     global port p testonly
+    fconfigure stdout -buffering none
     if {!$testonly} {
        set p [open $port {RDWR NONBLOCK} 0]
     
@@ -494,7 +495,7 @@ proc ask_randspeed {} {
 }    
 
 proc ask_manual {rightp} { global pointasked; set pointasked M$rightp }
-proc ask_figureeightt {} { global pointasked; set pointasked 0 }
+proc ask_figureeight {} { global pointasked; set pointasked 0 }
 proc ask_loop {} { global pointasked; set pointasked 1 }
 proc ask_randpath {} { global pointasked; catch { unset pointasked } }