Mail Archives: geda-user/2017/03/05/13:04:18
On Sun, 5 Mar 2017, karl AT aspodata DOT se wrote:
> Igor2:
>> going on with the tEDAx idea (reminder: minimal cost exchange formats),
> ...
>
> Re. "minimal cost exchenge format" (it sounds like this is a political
> thing), have you build up support for this outside of geda/pcb community
> so can we know if it is worth it to have yet another file format ?
I'm working on building up support. But it obviuosly won't happen if
eveyone is waiting for everyone else to implement it first.
I'm trying to lead by good example and implement these in pcb-rnd.
Btw, this is where the "cheap to implement" part kicks in. Unlike with
some bigger format, it's really cheap to do tEDAx so an implementor
doesn't lose much if it turns out noone else implemented it. I don't think
we could do more for getting something common adapted. You can call
this "political" if you want (I call this "design decision").
>
> A first thing to do would be to make other parties agree on the first
> line of the file, so programs have a chance to cheeply identify file
> format and switch in another parser on the fly.
>
> A few first lines:
> gschem: v 20111231 2
> pcb: anything
It should have PCB[] "in the header". As a convention it also starts with
a comment about the release (first line).
Of course we can write more comments in the beginning of the file, before
any of the release comment or PCB[] happens, but that's true for most of
the other formats that also allow comments. Kicad for example seems to
allow # comments too - I haven't tested this, but I think you can add
extra # comments in front of a kicad s-expression and it should still
load, so that first line assumption below may not be accurate.
> verilog-AMS: anything
> tEDAx: tEDAx v1
> kicad,
> wings: #!WINGS-1.0
> wrl: #VRML V2.0 utf8
> kicad_mod: (module CAP_RAD_5MM (layer F.Cu)
> kicad_pcb: (kicad_pcb (version 4) (host pcbnew "(2015-05-18 BZR 5668)-product")
>
> and there are too many choises here already (and neither gschem nor
> pcb shines here). Soo, convincing other parties to have the same
> format for the top line should be top priority.
Sorry, I don't see why different files formats should have the same format
in the first line - especially some formats is not even line based
(s-expr; well, excpet for the comments). As long as the files can be
identified by reading a reasonably small chunk from the beginning of the
file, it shouldn't matter too much.
Cheap ways to identify files:
1. pcb-rnd has a hook for testing file format plugin vs. a given input
file _before_ trying to parse it; each plugin can do whatever test it
needs to do to decide if the given file _looks like_ something it could
load. This usually includes looking for some sort of header.
2. just try parsing the file with all available importers; normally only
one will succeed.
3. just ask the user... Looking at pcb's import menu, you specify what
exaclty you are going to load (e.g. footprint, board, netlist) so it
doesn't even need to guess.
Best regards,
Igor2
- Raw text -