Root/
Source at commit a9ed5b30aa457704a4c0c912367bfe8c57db8d03 created 8 years 7 days ago. By Werner Almesberger, fped.1: update for new options; fix typo; bump date | |
---|---|
1 | fped - Footprint editor |
2 | ======================= |
3 | |
4 | fped is an editor that allows the interactive creation of footprints of |
5 | electronic components. Footprint definitions are stored in a text format |
6 | that resembles a programming language. |
7 | |
8 | The language is constrained such that anything that can be expressed in |
9 | the textual definition also has a straightforward equivalent operation |
10 | that can be performed through the GUI. |
11 | |
12 | This README describes only the footprint definition language. A |
13 | description of the GUI can be found here: |
14 | |
15 | http://downloads.qi-hardware.com/people/werner/fped/gui.html |
16 | |
17 | This work is distributed under the terms of the GNU GENERAL PUBLIC |
18 | LICENSE, Version 2: |
19 | |
20 | This program is free software; you can redistribute it and/or modify |
21 | it under the terms of the GNU General Public License as published by |
22 | the Free Software Foundation; either version 2 of the License, or |
23 | (at your option) any later version. |
24 | |
25 | For your convenience, a copy of the complete license has been included |
26 | in the file COPYING.GPLv2. |
27 | |
28 | |
29 | Building |
30 | -------- |
31 | |
32 | Prerequisites: |
33 | |
34 | - bash |
35 | - flex |
36 | - bison |
37 | - fig2dev (transfig) |
38 | - ImageMagick |
39 | - Netpbm |
40 | - Gtk+ 2.x development package (libgtk2.0-dev or similar) |
41 | - Liberation Fonts (ttf-liberation or similar) |
42 | |
43 | Check out the repository: |
44 | |
45 | git clone git://projects.qi-hardware.com/fped.git |
46 | cd fped |
47 | |
48 | Get updates: |
49 | |
50 | git pull |
51 | |
52 | Compile: |
53 | |
54 | make |
55 | |
56 | Run an example: |
57 | |
58 | ./fped examples/qfn.fpd |
59 | |
60 | |
61 | Motivation |
62 | ---------- |
63 | |
64 | KiCad already includes a footprint ("module") editor, so why do we need |
65 | a new one ? The issue with footprint generation for KiCad is that the |
66 | built-in module editor is basically a drawing program that only captures |
67 | the result of the module author's interpretation of a footprint drawing, |
68 | but does not include the steps that led to this construction. |
69 | |
70 | Furthermore, accurate measuring of dimensions in the drawing can only be |
71 | done manually in the module editor, which makes review difficult and |
72 | time-consuming. |
73 | |
74 | In fped, the construction process is made explicit and each step can be |
75 | expressed in terms of the parameters that appear in the vendor's |
76 | drawing. Dimensions can be explicitly measured and the results can be |
77 | included in the graphical output generated by fped. |
78 | |
79 | Directly using parameters and construction steps from the reference |
80 | drawing reduces the risk of mistakes. Visualizing the construction |
81 | process and verificative measurements helps efficient and accurate |
82 | review. |
83 | |
84 | |
85 | Footprint definition file format |
86 | -------------------------------- |
87 | |
88 | Footprint definitions are stored in text files. The program "fped" reads |
89 | and (soon) writes such files, visualizes their content, and provides a |
90 | graphical editor for them. |
91 | |
92 | The syntax is unique and draws from elements of a variety of languages |
93 | commonly found on unix systems. One specialty is that there are no |
94 | reserved words - the language keywords appear only at the beginning of |
95 | a line and can thus be recognized as such without restricting their use |
96 | for identifiers. This reduces the risk of creating incompatibilities |
97 | with existing designs when introduction future language features. |
98 | |
99 | fped uses the C preprocessor for comments, conditional compilation, |
100 | and - to a limited extent - also macros. Long lines can be split by |
101 | ending them with a backslash. If multiple items need to be placed in a |
102 | single line, e.g., in a macro, they can be separated with semicolons. |
103 | |
104 | The file has the following structure: |
105 | |
106 | frame definitions |
107 | ... |
108 | package name |
109 | setup |
110 | objects |
111 | ... |
112 | |
113 | |
114 | Geometry model |
115 | -------------- |
116 | |
117 | The geometry model consists of frames, vectors, and objects. The shape of |
118 | objects is defined by a number of points. These points are produced by |
119 | concatenating vectors. |
120 | |
121 | E.g., to draw a line from (1mm, 1mm) to (2mm, 2mm), one would make a |
122 | vector from the origin to (1mm, 1mm) and one either from the origin or |
123 | from the previous vector to (2mm, 2mm), and then make a line connecting |
124 | the two points. |
125 | |
126 | |
127 | Setup |
128 | - - - |
129 | |
130 | The setup section defines settings that affect the entire footprint. |
131 | It is optional and can contain a "unit" directive and an "allow" |
132 | directive. |
133 | |
134 | |
135 | Units |
136 | - - - |
137 | |
138 | fped can calculate in mm and mil. Units are specified by following a |
139 | number with "mm" or "mil", separated by zero or more spaces or tabs. |
140 | |
141 | Examples: |
142 | |
143 | 1mm |
144 | 2 mil |
145 | |
146 | Units can be mixed in calculations, e.g., |
147 | |
148 | set a = 1mm+20mil |
149 | set b = 10*1mm |
150 | |
151 | All values used as dimensions must be either mm or mil. |
152 | |
153 | The default unit can be set with one of the following directives: |
154 | |
155 | unit mm |
156 | unit mil |
157 | unit auto |
158 | |
159 | If the "unit" directive is omitted, fped defaults to millimeters. |
160 | |
161 | When saving a footprint definition, the default unit is set to the |
162 | unit set in the GUI. |
163 | |
164 | |
165 | Allow |
166 | - - - |
167 | |
168 | fped normally disallows overlapping pads. This restriction can be |
169 | relaxed with the "allow" directive. |
170 | |
171 | allow touch |
172 | |
173 | Allows pads touching but not having more than their border in common. |
174 | |
175 | allow overlap |
176 | |
177 | Do not check for overlaps at all. |
178 | |
179 | If the "allow" directive is omitted, fped defaults to allowing |
180 | neither overlap nor touch. |
181 | |
182 | There is also the following experimental directive that can be used |
183 | alone or without one of the overlap-checking directives: |
184 | |
185 | allow holes |
186 | |
187 | Allow multiple holes per pad. |
188 | |
189 | |
190 | Vectors |
191 | - - - - |
192 | |
193 | Vectors can be anonymous or they can be named for future reference: |
194 | |
195 | vec <base> ( <x-expr>, <y-expr> ) |
196 | <identifier>: vec <base> ( <x-expr>, <y-expr> ) |
197 | |
198 | The base can be one of the following items: |
199 | |
200 | - @ is the origin of the frame containing the vector |
201 | - . is the end of the previous vector in this frame |
202 | - <identifier> is the name of a previous vector in the same frame |
203 | |
204 | The following example would draw the line described in the previous |
205 | section: |
206 | |
207 | a: vec @(1mm, 1mm) |
208 | b: vec .(1mm, 1mm) |
209 | line a b |
210 | |
211 | |
212 | Silk screen objects |
213 | - - - - - - - - - - |
214 | |
215 | The output of fped is a footprint definition that contains pads and silk |
216 | screen drawings (we may add more layers in the future). These items are |
217 | called "objects". Their geometry is defined through points obtained with |
218 | vectors. |
219 | |
220 | A line connects two points: |
221 | |
222 | line <point-a> <point-b> [<width>] |
223 | |
224 | The points can be specified with @, ., and an identifier, just like |
225 | a vector base. The option width specifies the thickness of the silk |
226 | screen line. If omitted, a hard-coded default of 15 mil is used. |
227 | |
228 | A rectangle has sides parallel to the x and y axis and is defined |
229 | by two diagonally opposite corners: |
230 | |
231 | rect <point-a> <point-b> [<width>] |
232 | |
233 | A circle is defined by its center and a point on the circle: |
234 | |
235 | circ <center> <point> [<width>] |
236 | |
237 | This example draws a unit circle: |
238 | |
239 | vec @(1mm, 0mm) |
240 | circ @ . |
241 | |
242 | An arc is like a circle, but the part of the circle drawn is determined |
243 | by two points. The first point determines the radius and the starting |
244 | angle. The second point only determines the end angle but its distance |
245 | from the center is ignored. |
246 | |
247 | arc <center> <radius> <end> [<width>] |
248 | |
249 | The arc is drawn in a counter-clockwise direction. The following example |
250 | draws an arc of the unit circle in the x > 0, y > 0 quadrant: |
251 | |
252 | from: vec @(1mm, 0mm) |
253 | to: vec @(0mm, 1mm) |
254 | arc @ from to |
255 | |
256 | |
257 | Pads |
258 | - - |
259 | |
260 | Pads are similar to rectangles, but they also have a name. |
261 | |
262 | pad "<name>" <point-a> <point-b> [<type>] |
263 | |
264 | Variables can be expanded in a pad's name by prefixing their name with |
265 | a dollar sign. The ${name} syntax is also available. |
266 | |
267 | Example: |
268 | |
269 | vec @(1mm, 1mm) |
270 | pad "1" @ . |
271 | |
272 | Pads normally affect the surface copper layer, the solder mask layer, |
273 | and the solder paste layer. This can be modified with the optional |
274 | type argument: |
275 | |
276 | Type Layers |
277 | --------- ------------------------------------- |
278 | (default) copper, solder mask, and solder paste |
279 | bare copper and solder mask |
280 | trace copper without solder mask opening |
281 | paste solder paste |
282 | mask solder mask |
283 | |
284 | Typical uses: |
285 | - "bare": connectors printed directly on the PCB |
286 | - "trace": connections or antennas |
287 | - "paste": sparse solder paste, e.g., for QFN center pads |
288 | - "mask": non-standard mask openings, e.g., for solder mask defined |
289 | pads |
290 | |
291 | |
292 | Rounded pads |
293 | - - - - - - |
294 | |
295 | Rounded pads are like rectangular pads except that they end with a |
296 | semi-circle at each of the smaller sides of the enclosing rectangle. |
297 | If enclosed in a square, rounded pads form a circle. |
298 | |
299 | rpad "<name>" <point-a> <point-b> [<type>] |
300 | |
301 | |
302 | Holes |
303 | - - - |
304 | |
305 | Holes can be used for through-hole pins or for mechanical support. |
306 | In the former case, the hole must be placed inside a pad. Only one |
307 | hole per pad is allowed. Mechanical holes must be outside any pads. |
308 | |
309 | Through-hole pads are always present on both sides of the board, i.e., |
310 | when fped generates a KiCad module, the surface layers of a pad |
311 | containing a hole are propagated to the opposite side of the board. |
312 | |
313 | Holes have the same shape as a rounded pad and their geometry is |
314 | defined in the same way: |
315 | |
316 | hole <point-a> <point-b> |
317 | |
318 | |
319 | Measurements |
320 | - - - - - - |
321 | |
322 | *** This is obsolete - see the section on new-style mesurements at the end. *** |
323 | |
324 | Measurements show the distance between two points: |
325 | |
326 | meas <point-a> <point-b> <offset> |
327 | |
328 | The offset is the distance from the imaginary line connecting points A |
329 | and B the measurement line is draw: |
330 | |
331 | - if the offset is 0mm, the line will connect A and B |
332 | - if the offset is positive, the line would be on the left-hand side when |
333 | traveling from A to B |
334 | - if the offset is negative , the line would be on the right-hand side when |
335 | traveling from A to B |
336 | |
337 | Example: |
338 | |
339 | a: vec @(-1mm, 1mm) |
340 | b: vec @(1mm, 1mm) |
341 | meas a b 0.2 mm |
342 | |
343 | |
344 | Package name |
345 | - - - - - - |
346 | |
347 | The package name is a non-empty string of printable ASCII characters, |
348 | including spaces. If the "package" directive is omitted, fped defaults |
349 | to using the name "_". |
350 | |
351 | package "<name>" |
352 | |
353 | Examples: |
354 | |
355 | package "48-SSOP" |
356 | package "0603" |
357 | |
358 | Like in pad names, variables are expanded in package names. This allows |
359 | the generation of multiple packages from a single definition. |
360 | |
361 | |
362 | Frames |
363 | - - - |
364 | |
365 | Frames are used to group things and to reuse them multiple times. Frames |
366 | must be defined before they can be used: |
367 | |
368 | frame <name> { |
369 | ... items ... |
370 | } |
371 | |
372 | Once defined, a frame is placed at a given location with |
373 | |
374 | frame <name> <point> |
375 | |
376 | The frame definitions must precede all other items in a footprint |
377 | description. Frames cannot be defined inside other frames, but frames |
378 | can invoke each other recursively. |
379 | |
380 | For example, this puts two unity squares, one centered at (0 mm, 0 mm), |
381 | the other at (2 mm, 0 mm): |
382 | |
383 | frame unit_square { |
384 | a: vec @(-0.5mm, -0.5mm) |
385 | b: vec .(1mm, 1mm) |
386 | rect a b |
387 | } |
388 | |
389 | frame unit_square @ |
390 | vec @(2mm, 0mm) |
391 | frame unit_square . |
392 | |
393 | |
394 | Names and variables |
395 | ------------------- |
396 | |
397 | fped uses several name spaces: |
398 | |
399 | - frame names occupy one global name space |
400 | |
401 | - vector names occupy name spaces delimited by the frame they're |
402 | contained in. A vector name is only visible inside the frame in which |
403 | it is defined. |
404 | |
405 | - variable names occupy name spaces delimited by the frame they're |
406 | contained in. A variable lookup starts in the frame in which the |
407 | corresponding expression appears and propagates to outer frames |
408 | until the variable is found. |
409 | |
410 | - pads occupy one global name space (this is currently not enforced) |
411 | |
412 | Note that names cannot be redefined. E.g., this does not work: |
413 | |
414 | set a = 1 |
415 | set a = a+1 |
416 | |
417 | The names spaces of frames, vectors, variables, and pads are separate |
418 | from each other. |
419 | |
420 | |
421 | Simple variables |
422 | - - - - - - - - |
423 | |
424 | A variable with a single value is defined with the following |
425 | assignment syntax: |
426 | |
427 | set <identifier> = <expression> |
428 | |
429 | Example: |
430 | |
431 | set a = b+2 |
432 | |
433 | |
434 | Loops |
435 | - - - |
436 | |
437 | A loop is a variable with a range of values: |
438 | |
439 | loop <identifier> = <from>, <to> |
440 | |
441 | The variable assumes all the values i for <from> <= i <= <to>, in |
442 | increments of one. E.g., |
443 | |
444 | loop n = 1, 3 |
445 | |
446 | and |
447 | |
448 | loop n = 1, 3.5 |
449 | |
450 | both assign the values 1, 2, and 3 to the variable "n". The |
451 | following loop would not execute at all: |
452 | |
453 | loop n = 1, 0 |
454 | |
455 | This can be used to implement conditional execution. For example, |
456 | the items in the following frame would be instantiated if the |
457 | variable "enable" is set to 1 but not it is set to 0: |
458 | |
459 | frame ... { |
460 | loop dummy = 1, enable |
461 | ... |
462 | } |
463 | |
464 | When a loop is executed, the objects contained in the body of the |
465 | enclosing frame are generated for each value of the variable. If |
466 | a frame contains multiple loops, all possible combinations of the |
467 | values are generated. |
468 | |
469 | The following example draws three concentric circles around the |
470 | origin, with radii 1, 2, and 3: |
471 | |
472 | loop x = 1, 3 |
473 | vec @(x*1mm, 0mm) |
474 | circ @ . |
475 | |
476 | |
477 | Tables |
478 | - - - |
479 | |
480 | Tables combine values for multiple variables. Like loops, they are |
481 | used to iteratively generate objects. A table begins with a row of |
482 | variable names, followed by one or more rows with values. Rows are |
483 | enclosed in curly braces and their elements are separated by commas. |
484 | |
485 | table |
486 | { <identifier>, ... } |
487 | { <expression>, ... } |
488 | ... |
489 | |
490 | Like loops, tables are iterated to generate objects. The following |
491 | example is equivalent to the one in the previous section: |
492 | |
493 | table |
494 | { x } |
495 | { 1mm } |
496 | { 2mm } |
497 | { 3mm } |
498 | vec @(x, 0mm) |
499 | circ @ . |
500 | |
501 | Note that we can set the unit of the values directly in this case. |
502 | |
503 | Iteration is performed over rows. All variables of the table are set |
504 | to the value in the respective row at the same time. For example, in |
505 | |
506 | table |
507 | { x, y } |
508 | { 1, 2 } |
509 | { 3, 4 } |
510 | |
511 | (x, y) assume the values (1, 2) and (3, 4). |
512 | |
513 | Tables can also be used to provide information that depends on |
514 | other variables. The value of such a variable acts as a key, and a |
515 | row is only selected if all the keys in that row match the |
516 | respective variables. To mark a variable as being used as key, its |
517 | name it prefixed with a question mark. |
518 | |
519 | Example: |
520 | |
521 | loop n = 1, 2, 3 |
522 | table |
523 | { ?n, name } |
524 | { 1, "one" } |
525 | { 2, "two" } |
526 | { 3, "three" } |
527 | |
528 | |
529 | Expressions |
530 | ----------- |
531 | |
532 | Expressions can contain numeric constants (in non-exponential notation), |
533 | variable names, the arithmetic operations +, -, *, /, unary -, and the |
534 | functions sin(), cos(), sqrt(), and floor(). |
535 | |
536 | Parentheses can be used to change precedence. |
537 | |
538 | The argument of sin and cos is a dimensionless number that specifies the |
539 | angle in degrees. E.g., sin(90) yields 1. |
540 | |
541 | The argument of sqrt() can be dimensionless or have a dimension with an |
542 | exponent that's a multiple of two. E.g., sqrt(2) and sqrt(2mm*3mm) are |
543 | valid expressions, sqrt(2mm) isn't. |
544 | |
545 | The function floor() returns the next integer that is below or equal to |
546 | the argument. If the argument has a dimension, that dimension is |
547 | preserved. E.g., floor(-1.2) returns -2, floor(4.7mm) returns 4mm. |
548 | |
549 | |
550 | GUI |
551 | --- |
552 | |
553 | Part of the GUI is described in |
554 | http://downloads.qi-hardware.com/people/werner/fped/gui.html |
555 | |
556 | |
557 | Keyboard shortcuts |
558 | - - - - - - - - - |
559 | |
560 | Space reset user coordinates |
561 | +, = zoom in (like mouse wheel forward) |
562 | - zoom out (like mouse wheel backward) |
563 | . cursor position to screen center (like middle click) |
564 | * zoom and center to extents |
565 | # zoom and center to currently active frame instance |
566 | U undelete the previously deleted object |
567 | / Switch between variables, code, and packages display. |
568 | |
569 | |
570 | Canvas |
571 | - - - |
572 | |
573 | To create a new object, click on the corresponding tool icon, move the |
574 | mouse to the base point of the new object, then drag to the object's |
575 | second point. |
576 | |
577 | Frame references are created as follows: |
578 | |
579 | - select the frame you want to add |
580 | - click on the frame icon. A black dot should appear on the icon. |
581 | - select the frame on which you want to add the new reference. |
582 | The black dot should change to a green dot. If the current frame |
583 | is a child of the selected frame, the dot remains black. |
584 | - click on the desired base location |
585 | |
586 | To change a point of an object, select the object, then drag the point |
587 | to its new location. To edit the object's parameters, select it and |
588 | make the changes in the input area at the bottom. |
589 | |
590 | To delete an object, select the delete tool and click on the object. |
591 | Deleted objects can be undeleted by pressing "u". If any other changes |
592 | have been made since deletion, fped may misbehave. If deleting a vector, |
593 | all items that reference it are deleted as well. |
594 | |
595 | |
596 | Experimental: new-style measurements |
597 | ------------------------------------ |
598 | |
599 | New-style measurements can measure the distance between various pairs |
600 | of points, not only between points in the same instance and the same |
601 | frame. They operate on the set of points produced during instantiation. |
602 | |
603 | New-style measurements are placed in the root frame after all other |
604 | items. |
605 | |
606 | Known issues: |
607 | - they currently can't be edited through the GUI |
608 | - tie-breaking heuristics don't always do what one expects |
609 | |
610 | Syntax: |
611 | |
612 | <type> [<label>] <from> <op> <to> [<offset>] |
613 | |
614 | Types: |
615 | - meas: measure diagonally |
616 | - measx: measure along the X axis |
617 | - measy: measure along the y axis |
618 | |
619 | Note that the type also affects the selection of the points. E.g., |
620 | measx will select maximum x values. |
621 | |
622 | Operators: |
623 | - A -> B: smallest value of A and smallest B greater than A |
624 | - A <- B: like A -> B, but normal (for offset and text) is inverted |
625 | - A >> B: smallest value of A and greatest value of B |
626 | - A << B: like A -> B, but normal (for offset and text) is inverted |
627 | |
628 | Operands are qualified vector names. Vectors in the root frame are |
629 | referenced by their name. Vectors in other frames are prefixed with |
630 | the name of the frame followed by a dot. |
631 | |
632 | Example: |
633 | |
634 | measx pad.sw -> pad.se 1mm |
635 | |
636 | The optional label is printed directly before the distance. Example: |
637 | |
638 | a: vec @(0mm, 0mm) |
639 | b: vec @(1mm, 0mm) |
640 | measx "width = " a >> b 0mm |
641 | |
642 | would print "width = 1mm" |
643 | |
644 | |
645 | Additional qualifiers |
646 | - - - - - - - - - - - |
647 | |
648 | When using frames as reusable building blocks, similar to functions or |
649 | macros in many programming languages, one may need finer control over |
650 | the points that are selected for measurements. |
651 | |
652 | For example, let us consider a frame "square" that draws a square |
653 | centered at the frame's origin and with a side length given by the |
654 | variable "size". This variable be set in the frame referencing |
655 | "square". |
656 | |
657 | frame square { |
658 | a: vec @(-size/2, -size/2) |
659 | b: vec @(size/2, size/2) |
660 | rect a b |
661 | } |
662 | |
663 | frame small { |
664 | set size = 2mm |
665 | frame square @ |
666 | } |
667 | |
668 | frame big { |
669 | set size = 5mm |
670 | frame square @ |
671 | } |
672 | |
673 | frame small @ |
674 | vec @(5mm, 0mm) |
675 | frame big . |
676 | |
677 | If we want to measure the size of each square, we could use |
678 | |
679 | measx square.a -> square.b |
680 | |
681 | Unfortunately, this only measures the small square. To reach the |
682 | big frame, we need to tell fped to use only those points in "square" |
683 | that have been placed when "square" was invoked from the big frame. |
684 | |
685 | This is accomplished by prefixing the points in question with the |
686 | name(s) of the frames that need to be visited. The frame names are |
687 | separated by slashes (/). |
688 | |
689 | measx big/square.a -> square.b |
690 | |
691 | For clarity, it's better to qualify both points, e.g., |
692 | |
693 | measx big/square.a -> big/square.b |
694 | |
695 | If multiple frame names are given, they must be in the order in |
696 | which they are invoked. |
697 | |
698 | |
699 | Experimental: debugging directives |
700 | ---------------------------------- |
701 | |
702 | For debugging and regression tests, fped supports the following commands, |
703 | most of which mimick the effect of GUI operations: |
704 | |
705 | %del <qualified-identifier> |
706 | %move <identifier> [<number>] <identifier> |
707 | %frame <identifier> <qualified-base> |
708 | %print <expression> |
709 | %iprint <expression> |
710 | %meas <identifier> |
711 | %dump |
712 | %exit |
713 | %tsort { -<id> | +<id> | <id-before> <id-after> [<number>] ... } |
714 | |
715 | %del removes the specified item. This can be a vector, an object, or |
716 | a frame. If the vector or object is in a different frame than the |
717 | current, its name is qualified with the frame name, e.g., "foo.obj". |
718 | |
719 | For this purpose, also objects can be labeled. Object labels behave like |
720 | vector labels and share the same name space. They are not normally |
721 | accessible in the GUI. (You can see them in the code view.) |
722 | |
723 | %move take as its first argument the name of the vector or object to |
724 | manipulate. %move sets an anchor point to the vector named as its last |
725 | argument. The anchor point is identified by index as follows: |
726 | |
727 | anchor index vec/frame line/rect/pad arc measurement |
728 | -------------- --------- ------------- ------------ ----------- |
729 | 0 (or omitted) base first point center low point |
730 | 1 - second point end of arc high point |
731 | 2 - - start of arc - |
732 | |
733 | %frame creates a frame reference. Unlike "frame", the destination frame |
734 | can be different from the current frame. E.g., "%frame foo bar.a" would |
735 | add a reference to frame "foo" in frame "bar", rooted at vector "a". The |
736 | parent frame's origin can be references as "@". |
737 | |
738 | %dump writes the footprint definition in the fped language to standard |
739 | output. %exit immediately exits fped, without invoking the GUI. |
740 | |
741 | %print and %iprint evaluate the expression and print the result to |
742 | standard output. The difference between them is that %print runs only |
743 | once and without explicit instantiation, while %iprint is treated as |
744 | a regular object and is executed as many times as instantiation |
745 | demands. |
746 | |
747 | For example, after loop x = 1, 3 we would obtain just 1 with %print |
748 | while %iprint would display, 1, 2, and 3. |
749 | |
750 | %meas performs an instantiation and prints the value of the labeled |
751 | measurement. |
752 | |
753 | %tsort is used to test-drive the topological sort algorithm. The items |
754 | in the curly braces are declarations of nodes with (-<id>) or without |
755 | (+<id>) decay or edges in the partial order. The optional number is |
756 | the edge's priority. See tsort.c for details, test/tsort for examples. |
757 |
Branches:
master