From: ian Date: Sun, 1 Jun 2008 22:58:25 +0000 (+0000) Subject: speed, for replay X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=e4e488a4a4a34bc51d64040717cb251f41a09cda;p=trains.git speed, for replay --- diff --git a/hostside/README.commands b/hostside/README.commands index fdf97c9..dba3a57 100644 --- a/hostside/README.commands +++ b/hostside/README.commands @@ -49,6 +49,8 @@ POSSIBLY-ASYNCHRONOUS REPORTING OF MESSAGES TO/FROM (MASTER) PIC -v2 suppressed cooked raw with type cooked -v3 both both raw with type both +POSSIBLY-ASYNCHRONOUS REPORTING OF INTERNAL STATE CHANGES ETC. + U< ?resolving R< ?resolution inexplicable @@ -77,6 +79,8 @@ POSSIBLY-ASYNCHRONOUS REPORTING OF MESSAGES TO/FROM (MASTER) PIC ! for foredetect @ for det_ignore + R< ?train speed commanding + R< ?movpos feat point|relay R< ?movpos position moving R< ?movpos position stable diff --git a/hostside/gui-plan-testdata b/hostside/gui-plan-testdata index 064bad2..58fb7f3 100644 --- a/hostside/gui-plan-testdata +++ b/hostside/gui-plan-testdata @@ -10,3 +10,4 @@ movpos A5 feat P 2 point movpos Q0 feat Q 0 two movpos X8 feat P 0 three picio out polarity +train shinkansen speed commanded 100 diff --git a/hostside/multiplex b/hostside/multiplex index feeb6f2..480e25a 100755 --- a/hostside/multiplex +++ b/hostside/multiplex @@ -107,6 +107,14 @@ proc savereplay-clear {pk} { upvar #0 replay($pk) rep; catch { unset rep } } +proc savereplay-clear-re {re} { # re is anchored at start + global replay + if {![info exists replay]} return + foreack pk [array names replay] { + if {[regexp -- ^$re $pk]} { unset replay($pk) } + } +} + proc save-dump-failed-warn {fpre howpre emsg} { global errorCode switch -glob $errorCode { @@ -542,13 +550,14 @@ proc realtime-inputline {dummy l} { Resolving { catch { unset replay("50 resolution") } } } set pri 10 + savereplay-clear-re {^60 train \S+ speed } } elseif {[regexp {^(resolution) (.*)$} $l dummy key addvalue]} { set pri 50 } elseif {[regexp {^(picio out) (on|off)$} $l dummy key value]} { set pri 55 } elseif {[regexp -expanded { ^( movpos \s \S+ \s (?: feat \s \S+ | position) | - train \s \S+ \s (?: has | at ) | + train \s \S+ \s (?: has | at | speed \s commanded ) | picio \s out \s polarity ) \s (.*) $ } $l dummy key value]} { diff --git a/hostside/speed.c b/hostside/speed.c index 4f966b8..d957766 100644 --- a/hostside/speed.c +++ b/hostside/speed.c @@ -9,6 +9,7 @@ void actual_speed(Train *tra, int step) { Nmra n; enco_nmra_speed126(&n, tra->addr, step, tra->backwards); + ouprintf("train %s speed commanding %d\n", tra->pname, step); retransmit_urgent_requeue(&tra->speed.rn, &n); }