chiark / gitweb /
some debugging of fdet_nextseg's elapsed etc. being preserved in junk
authorian <ian>
Sun, 14 Sep 2008 15:17:40 +0000 (15:17 +0000)
committerian <ian>
Sun, 14 Sep 2008 15:17:40 +0000 (15:17 +0000)
hostside/junk [new file with mode: 0644]
hostside/safety.c

diff --git a/hostside/junk b/hostside/junk
new file mode 100644 (file)
index 0000000..76a772e
--- /dev/null
@@ -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;
index bb3d2ed48d0767fdc619bb33b5be7cbabcda8c9f..dc7685b7fbdce94c59414dfacd3216750c724620 100644 (file)
@@ -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;