FreeCalypso > hg > ueda-linux
annotate ueda/uschem-print/decor.c @ 39:242f73e61ef0
pads2gpcb: implemented parsing of the header line with units spec
author | Mychaela Falconia <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 11 Jan 2016 05:09:25 +0000 |
parents | cd92449fdb51 |
children |
rev | line source |
---|---|
0
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
1 /* |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
2 * Printing object decorations |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
3 */ |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
4 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
5 #include <sys/types.h> |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
6 #include <stdio.h> |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
7 #include <strings.h> |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
8 #include "../libueda/mcl.h" |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
9 #include "../libuschem/schemstruct.h" |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
10 #include "../libuschem/graphsym.h" |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
11 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
12 extern char *get_comp_attr(); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
13 extern struct graphsym_pininst *find_comp_pininst(); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
14 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
15 extern struct schem *schem_being_printed; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
16 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
17 extern char *gschem_text_halign[9]; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
18 extern char *gschem_text_valign[9]; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
19 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
20 static int decor_font_ptsize; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
21 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
22 char * |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
23 pull_attr_from_obj(obj, attrname) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
24 register struct schemobj *obj; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
25 register char *attrname; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
26 { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
27 register struct decoration *decor; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
28 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
29 if (obj->obj_type == OBJTYPE_COMPINST) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
30 if (!strcmp(attrname, "refdes")) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
31 return(obj->compobj_mclcomp->name); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
32 if (!strcmp(attrname, "instname")) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
33 return(obj->compobj_instname); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
34 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
35 for (decor = obj->obj_decorations; decor; decor = decor->decor_next) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
36 if (decor->decor_type == DECOR_TYPE_ATTR && |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
37 !strcmp(decor->decorattr_name, attrname)) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
38 return(decor->decorattr_value); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
39 if (obj->obj_type == OBJTYPE_COMPINST) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
40 return(get_comp_attr(obj->compobj_mclcomp, attrname)); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
41 else |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
42 return(NULL); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
43 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
44 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
45 reset_decor_font() |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
46 { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
47 decor_font_ptsize = 0; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
48 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
49 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
50 print_obj_decors(obj) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
51 struct schemobj *obj; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
52 { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
53 register struct decoration *decor; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
54 register char *dispval; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
55 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
56 for (decor = obj->obj_decorations; decor; decor = decor->decor_next) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
57 switch (decor->decor_type) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
58 case DECOR_TYPE_DISPLAYATTR: |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
59 dispval = pull_attr_from_obj(obj, decor->decordisp_attr); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
60 if (dispval) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
61 print_textdisp_decor(decor, dispval); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
62 else |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
63 fprintf(stderr, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
64 "%s: line %d: DisplayAttr: attribute %s unknown\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
65 schem_being_printed->orig_filename, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
66 decor->decor_lineno, decor->decordisp_attr); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
67 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
68 case DECOR_TYPE_DISPLAYNETNAME: |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
69 if (obj->obj_type != OBJTYPE_GRAPHNET) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
70 fprintf(stderr, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
71 "%s: line %d: DisplayNetName invalid in objects other than GraphNet\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
72 schem_being_printed->orig_filename, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
73 decor->decor_lineno); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
74 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
75 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
76 dispval = obj->netobj_netname; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
77 if (dispval) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
78 print_textdisp_decor(decor, dispval); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
79 else |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
80 fprintf(stderr, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
81 "%s: line %d: DisplayNetName on an unnamed GraphNet\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
82 schem_being_printed->orig_filename, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
83 decor->decor_lineno); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
84 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
85 case DECOR_TYPE_SYMONPIN: |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
86 if (obj->obj_type != OBJTYPE_COMPINST) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
87 fprintf(stderr, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
88 "%s: line %d: SymOnPin invalid in objects other than components\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
89 schem_being_printed->orig_filename, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
90 decor->decor_lineno); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
91 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
92 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
93 print_symonpin(obj, decor); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
94 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
95 case DECOR_TYPE_GRAPHBLOCK: |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
96 print_graphblock(decor->decorgraph_body); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
97 continue; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
98 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
99 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
100 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
101 print_textdisp_decor(decor, dispval) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
102 register struct decoration *decor; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
103 char *dispval; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
104 { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
105 if (decor->decordisp_alignment < 0 || decor->decordisp_alignment > 8) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
106 fprintf(stderr, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
107 "%s: line %d: display decoration: alignment %d is invalid\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
108 schem_being_printed->orig_filename, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
109 decor->decor_lineno, decor->decordisp_alignment); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
110 return; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
111 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
112 if (decor_font_ptsize != decor->decordisp_ptsize) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
113 decor_font_ptsize = decor->decordisp_ptsize; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
114 printf("/Helvetica %d selisofnt\n", decor_font_ptsize); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
115 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
116 emit_ps_string(dispval); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
117 printf(" %s %s %d %d %d Tshow\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
118 gschem_text_halign[decor->decordisp_alignment], |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
119 gschem_text_valign[decor->decordisp_alignment], |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
120 decor->decordisp_rotate, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
121 decor->decordisp_x, decor->decordisp_y); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
122 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
123 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
124 print_symonpin(comp, symdec) |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
125 struct schemobj *comp; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
126 struct decoration *symdec; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
127 { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
128 struct graphsym *sop_gs; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
129 register struct graphsym_pindef *sop_pindef; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
130 register char *soughtpin; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
131 int bynum; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
132 register struct graphsym_pininst *hostpin; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
133 struct schemobj fakeobj; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
134 |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
135 sop_gs = symdec->decorpinsym_gs; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
136 if (sop_gs->gs_npins > 1) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
137 fprintf(stderr, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
138 "%s: line %d: SymOnPin symbols may not have more than 1 pin\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
139 schem_being_printed->orig_filename, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
140 symdec->decor_lineno); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
141 return; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
142 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
143 sop_pindef = sop_gs->gs_pins; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
144 soughtpin = symdec->decorpinsym_pin; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
145 if (soughtpin[0] == '#') { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
146 bynum = 1; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
147 soughtpin++; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
148 } else |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
149 bynum = 0; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
150 hostpin = find_comp_pininst(comp, soughtpin, bynum); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
151 if (!hostpin) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
152 fprintf(stderr, "%s: line %d: SymOnPin: %s pin %s not found\n", |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
153 schem_being_printed->orig_filename, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
154 symdec->decor_lineno, comp->compobj_instname, |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
155 symdec->decorpinsym_pin); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
156 return; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
157 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
158 /* everything located, do it */ |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
159 bzero(&fakeobj, sizeof fakeobj); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
160 fakeobj.obj_type = OBJTYPE_GRAPHSYM; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
161 fakeobj.obj_lineno = symdec->decor_lineno; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
162 fakeobj.compobj_graphsym = sop_gs; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
163 fakeobj.compobj_x = -sop_pindef->gspd_x; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
164 fakeobj.compobj_y = -sop_pindef->gspd_y; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
165 if (symdec->decorpinsym_mirror) { |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
166 fakeobj.compobj_mirror = 1; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
167 fakeobj.compobj_x = -fakeobj.compobj_x; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
168 } |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
169 fakeobj.compobj_x += hostpin->x; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
170 fakeobj.compobj_y += hostpin->y; |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
171 print_graph_compinst(&fakeobj); |
cd92449fdb51
initial import of ueda and ifctf-part-lib from ifctfvax CVS
Space Falcon <falcon@ivan.Harhan.ORG>
parents:
diff
changeset
|
172 } |