From: ian Date: Fri, 18 Apr 2008 21:10:25 +0000 (+0000) Subject: compute some variables for shell scripts eg the .stopping files in hostside X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ijackson/git?a=commitdiff_plain;h=66ec8be7fad5474bc1639c2401b0b56a77923f6e;p=trains.git compute some variables for shell scripts eg the .stopping files in hostside --- diff --git a/layout/.cvsignore b/layout/.cvsignore index 8bf1382..ebb5ca0 100644 --- a/layout/.cvsignore +++ b/layout/.cvsignore @@ -24,6 +24,7 @@ ours.raw.neato ours.redacted.neato.ps ours.redacted.neato ours.redacted.forsafety +ours.redacted.shellvars ours.layout-data.c detectors.pin-info reversers.pin-info diff --git a/layout/Makefile b/layout/Makefile index cfc43b0..ce9a23c 100644 --- a/layout/Makefile +++ b/layout/Makefile @@ -74,6 +74,9 @@ compose-segenco: compose-segenco.o %.redacted.forsafety: %.redactgraph ./$< $(REDACT) consistency printforforsafety $o +%.redacted.shellvars: %.redactgraph + ./$< $(REDACT) consistency printforshellscript $o + %.redacted.segjoins: %.redactgraph ./$< $(REDACT) consistency printforlayoutsegjoins $o diff --git a/layout/redactgraph.c b/layout/redactgraph.c index 16d2305..5ced177 100644 --- a/layout/redactgraph.c +++ b/layout/redactgraph.c @@ -725,6 +725,37 @@ static void printforforsafety(void) { output("end\n"); } +static void printforshellscript(void) { + Node *node; + Edge *edge; + EdgeEnd *edgeend; + int side, weight, i; + Segment *segment; + MovFeat *movfeat; + + FOR_ALL_NODES(node) { + FOR_EDGES(edge, node,side,edgeend) { + output("l"); + segment= edge->subseg->segment; + output(segment->segname); + if (segment->n_movfeats>1) { + if (!segment->starfeature) { + fprintf(stderr,"printforforsafety before movfeatsplitedges!\n"); + exit(8); + } + weight= 1; + FOR_SEGMENT_MOVFEATS(i,movfeat, segment) { + if (!movfeat->movfeat) continue; + output("%s%d", movfeat->movfeat, + (edge->movpos / weight) % movfeat->n_positions); + weight *= movfeat->n_positions; + } + } + output("=%d\n", (int)edge->distance); + } + } +} + static void printforlayoutsegjoins(void) { Node *node; EdgeEnd *edgeend, *edgeend2; @@ -843,6 +874,7 @@ static const OpInfo opinfos[]= { #define OI(x) { #x, x }, OI(printforneato) OI(printforforsafety) + OI(printforshellscript) OI(printforlayoutsegjoins) OI(consistency) OI(movfeatsplitedges)