set always 0
set nmrawhich 0
-set polarity 908000
+set polmsg(l) 908000
+set polmsg(x) 90f802
+set polmsg(y) 90807c
set pname l
set m {}
set segs {xx yy}
gui "M A5 0 J"
gui "M A6 0 J"
if {[info exists watchdog]} { gui "P 1" }
- gui_polarity 0x$polarity
+# gui_polarity 0x$polarity
foreach seg [array names segdetect] {
gui "D1 $seg"
}
}
}
-proc polarity {newpname m} {
- global pname polarity
- debug "polarising $m"
- if {![string compare $m $polarity]} return
- tellpic $m
+proc polarity {newpname} {
+ global pname polmsg
+ debug "polarising $newpname"
+ if {![string compare $pname $newpname]} return
+ tellpic $polmsg($newpname)
+# gui_polarity
set pname $newpname
- gui_polarity [expr "0x$m ^ 0x$polarity"]
- set polarity $m
}
-proc polarity_l {} { polarity l 908000 }
-proc polarity_p {} { polarity p 97ff79 }
-proc polarity_x {} { polarity x 97ff7f }
proc pt_now {how point pos xtra} {
set msg a0[lindex $point $pos]
}
debug "pm_detect $seg ($segsasgot) ($segs) $pname$seg"
switch -exact $pname$seg {
- p07 - p06 { polarity_l }
- p02 - p09 { polarity_x }
- l16 - l1c - l10 - l1a { polarity_p }
- l03 - l05 - l08 - l0b { polarity_x }
- x07 - x06 { polarity_l }
- x14 - x16 - x1c - x20 - x1c - x10 { polarity_p }
+ l16 - l1c - l08 - l0b { polarity y }
+ l10 - l1a - l03 - l05 { polarity x }
+ x07 - x04 - x0a { polarity l }
+ x16 - x1c - x14 - x0b { polarity y }
+ y06 - y04 - y0a { polarity l }
+ y20 - y10 - y1a - y05 { polarity x }
}
switch -exact $seg {
04 - 0a { pt_must "00 01 X7" 1; pt_must "40 41 X8" 1 }
- 03 - 05 { pt_must "00 01 X7" 0 }
- 08 - 0b { pt_must "40 41 X8" 0 }
+ 05 { pt_must "00 01 X7" 0 }
+ 0b { pt_must "40 41 X8" 0 }
16 - 1c { pt_must "02 03 A5" 0 }
1a - 10 { pt_must "42 43 A6" 0 }
}