From: ian Date: Sun, 20 Mar 2005 13:07:56 +0000 (+0000) Subject: new settlement for movfeats - not yet in .c files X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=4ef6259ebfbeabb20cb13c7df2312aebf05bfe85;p=trains.git new settlement for movfeats - not yet in .c files --- diff --git a/hostside/safety.h b/hostside/safety.h index 81015ca..0d3118a 100644 --- a/hostside/safety.h +++ b/hostside/safety.h @@ -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 {