chiark / gitweb /
wip actual debugging
authorian <ian>
Thu, 24 Apr 2008 19:09:05 +0000 (19:09 +0000)
committerian <ian>
Thu, 24 Apr 2008 19:09:05 +0000 (19:09 +0000)
hostside/README.commands
hostside/TODO
hostside/analyse-speeds
hostside/errorcodes.h.gen
hostside/movpos.c
hostside/record.c
hostside/safety.h
hostside/x.gdb

index 74c368a5bcf56a1a6b9e4c0975a9e95f2a757cfd..c4e60c81a5455aa6343f0ac656277e9f072e7ea5 100644 (file)
@@ -55,6 +55,7 @@ POSSIBLY-ASYNCHRONOUS REPORTING OF MESSAGES TO/FROM (MASTER) PIC
  U< movpos <segment> point <feat><posn>
  U< movpos <segment> position <overallposn> moving
  U< movpos <segment> position <overallposn> stable
+            <overallposn> may be ? for unknown
 
  U< debug <context> : <debug message>
  U< info : <informational message>
index 566d1eae833faaaf3c821a4e37b3b6ea855c2e80..288da9c602f68ffc34a9ad7f858c4851bdcb0d13 100644 (file)
@@ -1,6 +1,11 @@
+bugs
+       see fixme in movpos.c
+       also startup resolve crashes due to findhead_nextseg returning -1
+
 want to
        document commands [!]movfeat and speed
        stop all trains command ?
+       stop and turn off calmly when ^D
 
 optional but maybe before can test:
        wiring to gui display
index 4df9ef91af724b0299519eba2df32d96d17ca155..22e5d5fdad38dcd36d884df7e2435776268a27a5 100755 (executable)
@@ -127,7 +127,7 @@ perl <$o.table.tmp >>$o.record.tmp -ne '
        $steps= $nxt-1;
        die "'$train': expected 126 steps, found $steps\n"
                unless $steps==126;
-       for ($step=0; $step<$nxt; $step++) {
+       for ($step=1; $step<$nxt; $step++) {
                printf  "train %s step %d=%f\n",
                        "'$train'", $step, $speed[$step]
                                or die $!;
index 64784a0d122837cc356b6f6e36bf78eab8446925..c5d5cbcd1d7f6ad9ae6d0eaf41fb3b51b388dc06 100755 (executable)
@@ -33,7 +33,7 @@ extern $decl;
 $decl= { \\
 END
     ."  ".(join ", \\\n  ", map {
-       '"'.(lc).'"';
+       '"'.$_.'"';
     } @f).<<END
  \\
 };
index aed8286e4f605bc70a91d3f74a509c5da880011b..977d9c96859dc1aa531e8f5f83abbf423db7b92d 100644 (file)
@@ -238,6 +238,20 @@ static ErrorCode pt_check_plan(void) {
   /* Checks whether we can meet the currently queued commitments */
   int future, conf, resv, usewhen;
 
+  fixme there is something wrong as
+    INT_MAX maxdelay_ms should not work as it overflows and makes
+    negative deadlines
+
+debug movpos/change : A5/P0 maxdelay_ms=2147483647 actual=?
+  point allocate 1
+debug movpos/change-needed : point:P(2*1) -1<-0 => 1debug movpos/change : confirm point:1...
+debug movpos/point : confirm A5 n=1 maxdelay=2147483647 (res: n=1 deadline=[t+]-1)
+debug movpos/point :  newdeadline=t+-8589933 allow_failure=1
+  pt_enqueue
+debug movpos/point :  pt_enqueue=OK
+movpos A5 position ? moving
+debug movpos/change : confirm => OK
+
   conf=resv=0;
 
   /* If CDU is charged we can do one thing right away */
@@ -334,7 +348,7 @@ static ErrorCode point_confirm(Change *chg, Segment *move,
    * it back if it doesn't work.
    */
 
-  if (n_motions >= r->n_motions)
+  if (n_motions > r->n_motions)
     return EC_MovFeatReservationInapplicable;
   assert(n_motions <= r->n_motions);
   if (maxdelay_ms == -1) {
index b2e1e53a9b0cf9978672aa962ad1095c5a8964d8..ab504e4c91b47c4ddbe77b034ee4723c7fdd2c59 100644 (file)
@@ -191,7 +191,7 @@ void record_train_home(Train *tra, int backw, Segment *seg) {
   
 void record_train_step_speed(Train *tra, int step, double speed) {
   if (step<1 || step>SPEEDSTEPS)
-    record_yyerror("speed step out of range 0..127");
+    record_yyerror("speed step out of range 0..126");
   tra->speedcurve[step]= speed;
 }
   
@@ -434,6 +434,7 @@ static void parse_file(const char *why) {
   f= fopen(filename,"r");
   if (!f) diee("config: cannot open %s: %s", why, filename);
   record_yyrestart(f);
+  record_yylineno= 0;
   r= record_yyparse();
   assert(!r); /* we're supposed to call yyerror which dies */
 }
index 09eb2b18aa739bd5278480b14d7187fe3fa7065e..f00292d8655fbc8db13e36fdd5252c5f857ef1ef 100644 (file)
@@ -57,7 +57,7 @@ struct Train {
 
   int n_speedregimes;
   SpeedRange *speedregimes;
-  float speedcurve[SPEEDSTEPS];
+  float speedcurve[SPEEDSTEPS+1];
 };
 
 struct Segment {
index a260c706b30b130a581c257d46727a2a56749abe..a1620129a488ab11169dacdde935241e70e00c60 100644 (file)
@@ -6,7 +6,7 @@ set args -s/dev/ttyUSB0 shinkansen.speeds.record homes.record
 
 break vdie
 break nmra_errchk_fail
-break safety_problem
+break predict_problem
 #break resolve.c:337
 
 run