chiark / gitweb /
new settlement for movfeats - not yet in .c files
authorian <ian>
Sun, 20 Mar 2005 13:07:56 +0000 (13:07 +0000)
committerian <ian>
Sun, 20 Mar 2005 13:07:56 +0000 (13:07 +0000)
hostside/safety.h

index 81015ca98915cca2a2f7ee29cac2153bb92e41b5..0d3118a498c7ae3f1fcdfa54fa200945a83990c0 100644 (file)
@@ -8,6 +8,8 @@
 typedef unsigned short TrainNum;
 typedef unsigned short SegmentNum;
 typedef unsigned short LocationNum;
+typedef unsigned short MovPosComb;
+typedef unsigned char Small;
 typedef short TimeInterval;
 typedef short Distance;
 typedef char Speed; /* non-negative, units of 4mm/s */
@@ -26,28 +28,40 @@ typedef struct {
   unsigned
     owned:1, /* this track segment is reserved for a train */
     tr_backwards:1, /* train's motion is (would be) backwards wrt track */
-    pt_sideways:1, /* points are set to `alternative'. (no points?: 0) */
-    pt_moving:1, /* points have been told to change to pt_sideways */
+    movfeat_moving:1, /* feature(s) have been told to change to movposcomb */
     cm_autostop:1, /* train should stop on detection */
-    cm_pointchange:1, /* points should change when they can */
     seg_inverted:1, /* polarity is inverted */
     tr_updated:1; /* for use by safety.c:lay_train etc.; otherwise 0 */
   TimeInterval until_here, /* ) nonnegative; */  /* ) always valid but */
     until_detect;          /* ) 0 if already */  /* )  only meaningful */
   TrainNum owner;                                /* )  iff owned       */
+  MovPosComb movposcomb;
   /*polarity?*/
 } SegmentState;
 
 typedef struct {
   unsigned next_backwards:1;
   SegmentNum next;
-  Distance dist;
 } SegmentLinkInfo;
 
 typedef struct {
-  unsigned invertible:1;
-  SegmentLink backwards, forwards, sideways;
   const char *pname;
+  Small posns;
+  MovPosComb weight;
+} MovFeatInfo;
+
+typedef struct {
+  SegmentLinkInfo backwards, forwards;
+  Distance dist;
+} SegPosCombInfo;
+
+typedef struct {
+  const char *pname;
+  unsigned invertible:1;
+  Small n_movfeats;
+  const MovFeatInfo *movfeats;
+  MovPosComb n_poscombs;
+  const SegPosCombInfo *poscombs;
 } SegmentInfo;
 
 typedef struct {