chiark / gitweb /
gui-display on bessar wip
authorian <ian>
Thu, 5 Jan 2006 00:58:42 +0000 (00:58 +0000)
committerian <ian>
Thu, 5 Jan 2006 00:58:42 +0000 (00:58 +0000)
hostside/gui-displayer
hostside/gui-plan.c
hostside/stopgap-controller

index 828314ffc1ceaf61d7dea2a6090111fb824500e1..93320b7da57c7cfade46beda9ecaa5acd5b567b1 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/wish
+#!/usr/bin/wish8.2
 
 proc widgets {} {
     global widg_pipe
index 73bdbeef5cbb79a7f0572adecc4f875499bdd694..6ae3c58de9a1571397166340ec4982e4d510e82e 100644 (file)
@@ -104,7 +104,7 @@ static int lstrpdbsearch(const char *str, int l,
   min= 0;
   maxe= n_items;
   for (;;) {
-    if (min >= maxe) badcmd(0,"unknown %s",what);
+    if (min >= maxe) badcmd(0,"unknown %s `%.*s'",what,l,str);
     try= min + (maxe - min) / 2;
     try_item= (const char*)items + itemsz * try;
     try_name= *(const char *const *)try_item;
index 065db6b15b6f101e4a3d8d0613c00d91a423ad18..dd955a4497cb241a6ed88cb44c7a0483e32961b2 100755 (executable)
@@ -25,9 +25,10 @@ set nmradiv 0
 set segs {xx yy}
 set segsasgot {xx yy}
 set pq {} ;# unset: cdu charged and waiting
-#set speeddirn ff7f
-set speeddirn ffff80c3fbcced7f
+set speeddirn ff7f
+#set speeddirn ffff80c3fbcced7f
 #set speeddirn_fixed {speed126 2 80 0}
+set speeddirn_fixed {}
 set funcs ff7f
 # unset pointpos($point)
 # unset segdetect($seg) ;# unset: shown D0; {}: shown D1; or: after id, D1->0
@@ -39,8 +40,8 @@ proc gui {m} {
 proc gui_init {} {
     global watchdog polarity segdetect
     gui "M A2 0"
-    gui "M A5 0 J"
-    gui "M A6 0 J"
+#    gui "M A5 0 J"
+#    gui "M A6 0 J"
     if {[info exists watchdog]} { gui "P 1" }
     gui_polarity
     foreach seg [array names segdetect] {
@@ -383,6 +384,7 @@ proc maybechange {thing} {
     } else {
        debug "fixed $thing $fixed"
        set l $fixed
+       if {![llength $l]} { return 0 }
     }
     set bin [eval exec ./hostside-old -s/dev/stdout $l]
     binary scan $bin H* x
@@ -404,7 +406,11 @@ proc changewhat {} {
 
 proc onreadcmd {} {
     if {[gets stdin l] < 0} {
-       if {[eof stdin]} { fileevent stdin readable {} }
+       if {[eof stdin]} {
+           puts stderr "stopgap-controller got eof, quitting"
+           puts "GUI exit 0"
+           exit 0
+       }
        return
     }
     eval $l
@@ -443,6 +449,20 @@ proc setup_complete {} {
     tellpic 0a
 }
 
+
+#----------
+# for keyboard control
+
+proc ask_fast {} {
+    global speeddirn_fixed; set speeddirn_fixed {speed126 2 126 0}
+}
+proc ask_slow {} {
+    global speeddirn_fixed; set speeddirn_fixed {speed126 2 126 10}
+}
+proc ask_randspeed {} {
+    global speeddirn_fixed; catch { unset speeddirn_fixed }
+}    
+
 setup
 gui_init
 vwait end