This is a first crude attempt at allowing reloading without exiting
fped. This should be useful when writing a design as text and using
the GUI only to visualize it.
Reload is only enabled (in the File menu) if the file doesn't have
the "MACHINE-GENERATED" header.
Known bugs:
- exits on parse errors
- leaks memory badly
- current frame is reset to root
Until now, everything used the bounding box of the root frame which
contains all the packages, visible or not. We now also record what
ends up in which package, allowing inst_get_bbox to return the
bounding box of a specific package.
This is mainly useful for scaling Postscript output where only one
package is printed per sheet and there is not much point in reserving
space for any other packages that may be generated from the same
footprint definition.
Before, they were silently ignored but still included in output.
This produced invalid Postscript (attempts to fit the pad name into
the zero-sized pad failed) and may also have produced artefacts
that could confuse KiCad.
This is a little awkward: to change a variable used as key to an
assignment, one first had to change the name such that it doesn't
clash, hit Enter, and then edit the variable again to change its
type.
Variable type changes should pick up the edit in progress and allow
a type change to also imply acceptance of the variable.
If the package whose name is produced by the active variable values
is active and the variables change, then make the newly active
package the one whose name is produced by the changed variables.
This way, iterating through a table or a loop will automatically
switch to the right package, with the exception that, if the user
choses to explicitly select a different package (by clicking on
its name in the packages line), then that selection takes priority.
Explicit selection loses its priority when active package and active
variables coincide again. I.e., one can simply "catch" the active
package by activating the corresponding values.
active_pkg can become NULL if the root frame contains a loop that
will never execute, i.e., loop x = 1, 0
This caused fped to segfault when FOR_PKG_INSTS was called from
FOR_ALL_INSTS in inst_draw.
We need explicit rules to compile lex.yy.c and y.tab.c for the relaxed
CFLAGS. However, this means that the implicit rule was not used and
therefore no dependencies were generated.
Instances of measurements referencing vectors not instantiated were
only partially initialized (because only inst_meas_hint was called
on them but never inst_meas) but still left in the list of instances.
They were thus displayed, producing confusing results.
We now trace a measurement instance's validity and remove all invalid
instances at the end of instantiate_meas.