8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
+
+
+
|
# Copyright (c) P.J.Gawthrop, 1996.
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.42 2002/03/26 12:05:27 geraint
## Escaped characters to eliminate awk warnings.
##
## Revision 1.41 2001/06/13 10:41:06 gawthrop
## Further changes towards aouto creation of lbl files.
## Prettified lbl files
##
## Revision 1.40 2001/06/11 19:43:50 gawthrop
## MTT is now much more sophisticated in generating lbl files
## Labels can contain maths
|
263
264
265
266
267
268
269
270
271
272
273
274
275
276
|
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
|
+
+
+
+
+
+
+
+
+
+
+
|
function fig_info() {
# Grabs the fig-file information for a component
return(sprintf("%s %s %s %s %s %s %s %s %s %s %s ", \
$1, $2, $3, $4, $5, $6, $7, \
$8, $9, $10, $11))
}
function type_name(type) {
if (type==1)
return "one"
else {
if (type==0)
return "zero"
else
return type
}
}
function process_text() {
# The text string is field 14 onwards
str = $14;
for (i=15; i<=NF; i++) {
str = sprintf("%s %s", str, $i)
}
|
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
|
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
|
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
|
label[i_label,2] = CR;
label[i_label,3] = args
}
}
# Unnamed component
if (named_component==0) {
type = str;
i_name++;
name = sprintf("mtt%i", i_name);
type = str;
if (type in name_index)
name_index[type]++
else
name_index[type] = 1;
if (name_index[type]==1)
name = sprintf("%s", type_name(type))
else
name = sprintf("%s%i", type_name(type), name_index[type]);
i_label++;
label[i_label,1] = name;
label[i_label,2] = default_cr;
label[i_label,3] = default_args
}
# Save in associative arrays by name
|
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
|
679
680
681
682
683
684
685
686
687
688
689
690
691
692
|
-
|
i_bond = 0;
i_port = 0;
i_stroke = 0;
i_arrow = 0;
i_label = 0;
i_text = 0;
i_name = 0;
i_port_component = 0;
component_index = 0;
}
{
# Start of .fig file?
if ($1=="#FIG") {
|