www.delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2017/03/05/13:04:18

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
Date: Sun, 5 Mar 2017 19:04:47 +0100 (CET)
X-X-Sender: igor2 AT igor2priv
To: geda-user AT delorie DOT com
X-Debug: to=geda-user AT delorie DOT com from="gedau AT igor2 DOT repo DOT hu"
From: gedau AT igor2 DOT repo DOT hu
Subject: Re: [geda-user] [dev][pcb] tEDAx - footprint format spec
In-Reply-To: <20170305173428.1355A81075DD@turkos.aspodata.se>
Message-ID: <alpine.DEB.2.00.1703051845550.7286@igor2priv>
References: <alpine DOT DEB DOT 2 DOT 00 DOT 1703051527300 DOT 7286 AT igor2priv> <20170305173428 DOT 1355A81075DD AT turkos DOT aspodata DOT se>
User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
MIME-Version: 1.0
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com


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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019