chiark / gitweb /
new ours-m<layer>.ps files for layout editing; pass input file to m4 by name rather...
authorian <ian>
Mon, 18 Sep 2006 00:28:05 +0000 (00:28 +0000)
committerian <ian>
Mon, 18 Sep 2006 00:28:05 +0000 (00:28 +0000)
layout/Makefile
layout/informat.txt
layout/layout
layout/ours.m4
layout/parts.i4

index c0d1c17dab13604f08e71b1b79280c16535a7158..bedb221ad88819e6d21210acd744dfb30853189b 100644 (file)
@@ -15,7 +15,8 @@ LAYERS_LS=    0 10 20
 LAYERS_PS=     $(addsuffix .ps, $(LAYERS_LS))
 LAYERS_L=      $(addprefix ours-l, $(LAYERS_PS))
 LAYERS_E=      $(addprefix ours-e, $(LAYERS_PS))
-LAYERS=                $(LAYERS_L) $(LAYERS_E)
+LAYERS_M=      $(addprefix ours-m, $(LAYERS_PS))
+LAYERS=                $(LAYERS_L) $(LAYERS_E) $(LAYERS_M)
 
 LPAGES=         $(foreach x, 0 1 2 3 4 5 6, $(foreach y, 1 2 3 4 5, ours-p0-$xx$y.ps))
 
@@ -80,7 +81,7 @@ compose-segenco: compose-segenco.o
                $(LINK)
 
 %.d4:          %.m4 $(M4INCS) Makefile
-               m4 -s <$< $o
+               m4 -s $< $o
 
 %-a.ps:                %.d4 layout
                ./layout <$< $(LAYOUTOPTS) '-E*lD' $o
@@ -116,6 +117,10 @@ ours.graph.c:      extractgraph ours.dgram-bot.p0.segenco.ps
 ours-l%.ps:    ours.d4 layout
                ./layout <$< -l$* $(LAYOUTOPTS) $(XLAYOUTOPTS_LAYER) $o
 
+ours-m%.ps:    ours.d4 layout
+               ./layout <$< -l$* -E'=*aRscLDMno' \
+                       -e'p=*rm' -E'=5RNLDA' -E'*~=5rCdsml' $o
+
 ours-e%.ps:    ours.d4 layout
                ./layout <$< -l$* -E'=*aRsclMno' \
                        -e'p=*rm' -e'=5RN' -E'*~=5rsm' -e'p~=5r' -e'*=*l' $o
index 29f5fe1925a19c422f51c2b34ad18cedabf609a7..916f1f6fbb10715c10c32d984dcc5fb91e3dfff4 100644 (file)
@@ -209,7 +209,7 @@ Command-line options
               in each direction.  xp is multiplied by 270mm; yp
               is multiplied by 190mm.
 
- -e<layersel>[ARSCcLlMNOm]...
+ -e<layersel>[ARSCcLlDdMNOm]...
           Turn on and off drawing of elements in groups.
           These are abbreviations for various -E... options.
             track                                                 -E.....
@@ -233,7 +233,7 @@ Command-line options
             subsegment encoding
               G  draw only subsegment encoding                 Garcslmno
 
- -E<layersel>[ARSCLMNOarsclmno]...
+ -E<layersel>[ARSCLDMNOarscldmno]...
           enable (capitals) or disable (lowercase) drawing of
           individual elements
               A  draw track swept area, with ticks
index 31d1daf83046261aadb66e548b9abe00225e4fe0..06dfb77e0f353728556a11c1edac3d3fd311fa71 100755 (executable)
@@ -7,6 +7,9 @@ use IO::File;
 use strict;
 no strict 'subs';
 
+our $file_lineno= 0;
+our $file_filename;
+
 our $scale= 7.0;
 our $page_x= 0;
 our $page_y= 0;
@@ -23,6 +26,7 @@ our $ps_page_ymul= 538.583;
 
 our @eopts;
 our @segments= ('/');
+our @ident_strings= ();
 our %subsegcmap;
 
 our $drawers= 'arscldmnog';
@@ -34,6 +38,8 @@ our %chdraw_emap= qw(A ARScgd
                     r arcs
                     L LMg
                     l l
+                    D D
+                    d d
                     M Mnog
                     N MNog
                     O MNOg
@@ -173,7 +179,7 @@ our $lmu_lenlabeloff=     $lmu_marklw * 0.5;
 
 our $olu_left= 10 * $scale;
 our $olu_right= 217 * $scale - $olu_left;
-our $olu_bottom= 20 * $scale;
+our $olu_bottom= 25 * $scale;
 our $olu_top= 270 * $scale - $olu_bottom;
 our $olu_gap_x= 30;
 our $olu_gap_y= 60;
@@ -568,6 +574,7 @@ sub o ($) { $o .= $_[0]; }
 sub ol ($) { $ol .= $_[0]; }
 sub oflushpage () {
     return if $subsegcmapreq;
+
     print $o, $ol, "  showpage\n"
        or die $!;
     $o=$ol='';
@@ -772,23 +779,7 @@ print DEBUG "ps $p0 $p1 $lenperp ($ppu)\n";
        parametric__o_pt(&$calcfn);
        o("      stroke\n");
     }
-    if ($draw =~ m/D/) {
-       my ($pt,$ad,$len,$off);
-       $param= ($p0+$p1)*0.5;
-       $pt= &$calcfn;
-       $ad= ang2deg($pt->{A});
-       $len= sprintf "%.0f", $lenperp * abs($p1-$p0);
-       $off= $draw =~ m/C/ ? $lmu_lenlabeloff : $lmu_lenlabeloffctr;
-       ol("      gsave\n".
-          "        $pt->{X} $pt->{Y} translate\n".
-          "        $ad rotate\n".
-          "        lf setfont\n".
-          "        0 $off moveto\n".
-          "        ($len) show\n".
-          "      grestore\n");
-    }
-    return unless $draw =~ m/[ARS]/;
-    for ($pa= $p0; $pa<$p1; $pa=$pb) {
+    if ($draw =~ m/[ARS]/) { for ($pa= $p0; $pa<$p1; $pa=$pb) {
        $pb= $pa + $ppu;
        $param= $pa; $ends[0]= @ends ? $ends[1] : &$calcfn;
        $param= $pb; $ends[1]= &$calcfn;
@@ -828,7 +819,22 @@ print DEBUG "ps $p0 $p1 $lenperp ($ppu)\n";
            }
        }
        o("      grestore\n");
-    }
+    } }
+    if ($draw =~ m/D/) {
+       my ($pt,$ad,$len,$off);
+       $param= ($p0+$p1)*0.5;
+       $pt= &$calcfn;
+       $ad= ang2deg($pt->{A});
+       $len= sprintf "%.0f", $lenperp * abs($p1-$p0);
+       $off= $draw =~ m/C/ ? $lmu_lenlabeloff : $lmu_lenlabeloffctr;
+       ol("      gsave\n".
+          "        $pt->{X} $pt->{Y} translate\n".
+          "        $ad rotate\n".
+          "        lf setfont\n".
+          "        0 $off moveto\n".
+          "        ($len) show\n".
+          "      grestore\n");
+    }    
 }
 
 sub arc ($$$$$) {
@@ -1496,6 +1502,23 @@ dv("cmd__do $ctx @al ",'$ctx',$ctx);
     }
 }
 
+sub cmd_ident {
+    my ($vs, @lt, $inf, $strft);
+    $vs= "@al";
+    $vs= $1 if $vs =~ m/^\$Revision\: ([0-9.]+)\ \$$/;
+    if (!defined $file_filename) {
+       $inf= "$vs (unknown file: $file_lineno)";
+    } elsif (!stat $file_filename ||
+            !(@lt= localtime((stat _)[9]))) {
+       $inf= "$file_filename ($1 $!)";
+    } else {
+       $strft= strftime "%Y-%m-%d %H:%M:%S +%Z", @lt;
+       $inf= "$file_filename ($1 $strft)";
+    }
+    push @ident_strings, $inf;
+    @al= ();
+}
+
 sub cmd_showlibrary {
     my ($obj_id, $y, $x, $ctx_save, $width, $height);
     my ($max_x, $min_x, $max_y, $min_y, $nxty, $obj, $loc, $pat, $got, $glob);
@@ -1570,7 +1593,8 @@ sub cmd__one {
 
 o("%!\n".
   "  /lf /Courier-New findfont $lmu_marktpt scalefont def\n".
-  "  $ps_page_shift 0 translate 90 rotate\n");
+  "  $ps_page_shift 0 translate 90 rotate\n".
+  "  gsave\n");
 
 if ($page_x || $page_y) {
     o("  /Courier-New findfont 15 scalefont setfont\n".
@@ -1596,6 +1620,14 @@ $ctx->{SegName}= '';
 cmd__one();
 
 while (<>) {
+    $file_lineno++;
+    if (m/^\#line (\d+)$/) { $file_lineno= $1; next; }
+    if (m/^\#line (\d+) (.*)$/) {
+       $file_lineno= $1;
+       $file_filename= $2;
+       $file_filename =~ s/^\"(.*)\"$/$1/;
+       next;
+    }
     next if m/^\s*\#/;
     chomp; s/^\s+//; s/\s+$//;
     @al= split /\s+/, $_;
@@ -1644,4 +1676,15 @@ while (<>) {
     }
 }
 
+ol("grestore\n");
+
+if (@ident_strings) {
+    my ($is);
+    $is= join('; ', @ident_strings);
+    $is =~ s/[()\\]/\\$&/g;
+    ol("25 50 moveto".
+       "/Courier-New findfont 6 scalefont setfont\n".
+       " ($is) show\n");
+}
+
 oflushpage();
index 32ec3bb1290e92e279ad217ab9107533abd57a92..bad343cc1919ccbe08c5dad6287291777957a73d 100644 (file)
@@ -463,5 +463,5 @@ extend sta_tt_out135 sta_9house len 200  -230
 extend sta_tt_out150 sta_8house len 230  -400
 extend sta_tt_out165 sta_7house upto sta_8house -2000
 
-#ident $Revision$
+ident $Revision$
 eof
index 43b54e484fde74af77de6dceb6ed1c1465630e71..4fc69e9b306bdf0e54deb937137b035415fc1634 100644 (file)
@@ -264,4 +264,5 @@ defpart tt_atlas_motor
  join tl -tr 0.1
 enddef
 
-#ident $Revision$
+ident $Revision$
+