From 1081738e4b44984dcecf51e087904daf8acd6e59 Mon Sep 17 00:00:00 2001 From: ian Date: Sun, 14 Sep 2008 15:17:40 +0000 Subject: [PATCH] some debugging of fdet_nextseg's elapsed etc. being preserved in junk --- hostside/junk | 27 +++++++++++++++++++++++++++ hostside/safety.c | 6 ++++++ 2 files changed, 33 insertions(+) create mode 100644 hostside/junk diff --git a/hostside/junk b/hostside/junk new file mode 100644 index 0000000..76a772e --- /dev/null +++ b/hostside/junk @@ -0,0 +1,27 @@ +cvs diff: Diffing . +Index: safety.c +=================================================================== +RCS file: /u/ian/cvs/trains/hostside/safety.c,v +retrieving revision 1.101 +diff -u -r1.101 safety.c +--- safety.c 24 Aug 2008 22:53:58 -0000 1.101 ++++ safety.c 14 Sep 2008 15:12:59 -0000 +@@ -630,12 +630,18 @@ + u->done_first_new_fdet= 1; + } + ++DPRINTF(safety,predictseg," elapsed=%lu ?< %d si=%u trb=%u tpi=%u ^^=%u\n", ++ (unsigned long)u->elapsed, MARGIN_POLARISETIME, ++ t->seg->seg_inverted, t->backwards, u->train_polarity_inverted, ++ t->seg->seg_inverted ^ t->backwards ^ ++ u->train_polarity_inverted); + if (u->elapsed < MARGIN_POLARISETIME) { + u->need_polarise |= (t->seg->seg_inverted ^ t->backwards ^ + u->train_polarity_inverted); + } else { + u->walk_compute_polarise &= u->need_polarise; + } ++DPRINTF(safety,predictseg," nnp=%u\n", u->need_polarise); + + if (u->train->autopoint && !u->autopoint_distance) { + const SegPosCombInfo *pci; diff --git a/hostside/safety.c b/hostside/safety.c index bb3d2ed..dc7685b 100644 --- a/hostside/safety.c +++ b/hostside/safety.c @@ -630,12 +630,18 @@ static int fdet_nextseg(TrackLocation *t, TrackAdvanceContext *c, u->done_first_new_fdet= 1; } +DPRINTF(safety,predictseg," elapsed=%lu ?< %d si=%u trb=%u tpi=%u ^^=%u\n", + (unsigned long)u->elapsed, MARGIN_POLARISETIME, + t->seg->seg_inverted, t->backwards, u->train_polarity_inverted, + t->seg->seg_inverted ^ t->backwards ^ + u->train_polarity_inverted); if (u->elapsed < MARGIN_POLARISETIME) { u->need_polarise |= (t->seg->seg_inverted ^ t->backwards ^ u->train_polarity_inverted); } else { u->walk_compute_polarise &= u->need_polarise; } +DPRINTF(safety,predictseg," nnp=%u\n", u->need_polarise); if (u->train->autopoint && !u->autopoint_distance) { const SegPosCombInfo *pci; -- 2.30.2