From: ian Date: Wed, 28 May 2008 18:34:16 +0000 (+0000) Subject: incorporate info about fixed segments X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=477230c95ead4840d68ff9c22b4613c343b3ad80;p=trains.git incorporate info about fixed segments --- diff --git a/hostside/Makefile b/hostside/Makefile index 7971012..25443e1 100644 --- a/hostside/Makefile +++ b/hostside/Makefile @@ -52,6 +52,7 @@ topology-dump: topology-dump.o utils.o ../layout/ours.layout-data.o gui-plan-bot: gui-plan-%: gui-plan.o utils.o parseutils.o obc.o \ ../layout/ours.dgram-%.plandata.o \ + ../layout/ours.layout-data.o \ __oop-read-copy.o -loop $(LINK) -L/usr/X11R6/lib -lXpm -lX11 diff --git a/hostside/gui-plan.c b/hostside/gui-plan.c index 92e17aa..de3f45b 100644 --- a/hostside/gui-plan.c +++ b/hostside/gui-plan.c @@ -25,6 +25,7 @@ typedef int ErrorCode; #include "daemons.h" #include "dliste.h" #include "../layout/plan-data-format.h" +#include "../layout/layout-data.h" #include #include @@ -678,6 +679,35 @@ static void si_connected(ParseState *ps) { sockprintf("%s",mxi->remainpat); } sockprintf("\n"); + + /* set the fixed moveable features */ + const SegmentInfo *segi; + const MovFeatInfo *mfi; + const PlanSegmentData *planseg; + const PlanSegmovfeatData *planfeat; + int segn, s, mfn, f; + + for (segn=0; segnn_fixedmovfeats) continue; + for (s=0; spname, (planseg=&ui_plan_data.segments[s])->segname)) + goto found_ld_seg; + die("layout data segment %s not found\n",segi->pname); + found_ld_seg: + for (mfn=0, mfi= segi->movfeats + segi->n_movfeats; + mfn < segi->n_fixedmovfeats; + mfn++, mfi++) { + for (f=1; fn_movfeats; f++) + if (!strcmp(mfi->pname, (planfeat=&planseg->movfeats[f])->movfeatname)) + goto found_ld_feat; + die("layout data movfeat %s/%s not found\n",segi->pname,mfi->pname); + found_ld_feat: + state[s].mfs[f].posn= mfi->posns; + if (debug) fprintf(debug,"fixed %s/%s=%d\n", + segi->pname,mfi->pname,mfi->posns); + } + } } static void si_fatal(ParseState *ps) {