Mail Archives: geda-user/2015/02/08/06:48:02
On Sunday 08 February 2015 00.38:42 you wrote:
> I wouldn't use ANY scripts in the PCB or sch file. That would make life
> very hard.
I think the approach of Jason White to prohibit the execution of scripts in
the loading stage is great. No loops, ifs or other constructs, just tables
with function-"pointers".
> I'd use <whatever scripting language> to parse the data in a
> file. This is the task to be done, just don't overcomplicate the solution. I
> would be happy if it was Lua, but we could roll our own language and
> parser.
I wouldn't write another custom parser. I would harness the power of an
existing parser and define a couple of functions like schematics.line(),
schematics.pin() etc. to define the data. Then some middlelayer to generate the
netlist. Now you have all the data with a simple interface. With a object
oriented aproach, you could also define a object for the attributes like the
coordinates, refdes etc. with proper recursion (define in the symbol, overwrite
in the instance) for free. Embedding the symbols would be a mater of defining
them in the header, so you could have selfcontained schematics with a
"schematic-globaly" editable instance.
Also serialising the data in lua is relatively easy, there are different
preexisting modules out there. To write another with custom logic like
alphabetic sorting with the refdes, or top left to bottom right for free lines
and nets should be possible.
If you use an versioning system for the schematics today, you get a mess of
chopped "gibberish" now, as the normal line based patches are not human
readable.
> If there is something we can do, it doesn't mean we must do it.
Yeah, absolutely. I'm just brainstorming ;)
I'm no fanboy of lua, but with an standartised, scriptable data format, adding
a custom netlister or other small housekeeping jobs like autonumbering,
autoslotting should be straightforward. My dream would be a console in gschem
(or standalone) for executing our own scriptlets directly on the life data.
--
mit freundlichem Gruss
Christian Riggenbach
- Raw text -