chiark / gitweb /
realtime: break out new function movpos.c:ouposn_feat
[trains.git] / hostside / movpos.c
index 4bbc7f7f78c579f16c2d2919a1714d28a752fe18..b13326761792cb50868b7ebb44cdab775948ed25 100644 (file)
@@ -113,6 +113,15 @@ static void ouposn_moving(const MovPosChange *indep) {
   ouprintf("movpos %s position %s moving\n",
           move->i->pname, movpos_pname(move, indep->actual));
 }
+static void ouposn_stable(const Segment *move) {
+  ouprintf("movpos %s position %s stable\n",
+          move->i->pname, movpos_pname(move, move->movposcomb));
+}
+static void ouposn_feat(const Segment *move, const MovFeatInfo *feati,
+                       MovPosComb posn, const Method *m) {
+  ouprintf("movpos %s feat %s %d %s\n", move->i->pname,
+          feati->pname, posn, m->pname);
+}
 
 MovPosComb movposcomb_update_feature(MovPosComb startpoint,
                                     const MovFeatInfo *mfi,
@@ -694,8 +703,7 @@ static Method *methods[]= {
 
 static void method_update_feature(Method *m, MovPosChange *indep,
                                  const Motion *mo) {
-  ouprintf("movpos %s feat %s %d %s\n", indep->move->i->pname,
-          mo->i->pname, mo->posn, m->pname);
+  ouposn_feat(indep->move, mo->i, mo->posn, m);
   if (SOMEP(indep->actual))
     indep->actual=
       movposcomb_update_feature(indep->actual, mo->i, mo->posn);
@@ -730,8 +738,7 @@ static void indep_indep_done(Indep *indep) {
   move->moving= 0;
   move->motion= 0;
   move->movposcomb= indep->target;
-  ouprintf("movpos %s position %s stable\n",
-          move->i->pname, movpos_pname(move, move->movposcomb));
+  ouposn_stable(move);
   free(indep);
 }