[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: gEDA-user: GATTRIB attribute editor program



I would be happy to do the file read/parsing part of this; that's the
kinda thing I have some experience with.  My vision is this:

*  I would probably do it in Python, cause Python is a good
rapid-prototyping language.  Also, Python has bindings to wxWindows,
although I have never programmed to them.  As for doing it in C:
Whenever I have to write stuff in C, I spend most of my time chasing
down pointer problems, which is a real PITA.  I am the first to admit
that I still don't "grok" pointers completely.  Also, since most
schematics are small, "speed of program running" is not as important
as "speed of program development". 

*  I could certainly create a program which reads & writes a tab
separated list of values.  However, wouldn't it be better to just
integrate your GUI with a file handling/parsing back end directly?  In
this case, the question for the GUI becomes: What kind of data
structure would best inverface to your GUI? 

If I were left to do it myself, my preferred data structure holding
attrib info would just be a Python list of (attribute value) pairs.
The entire design would be a list of those lists, like this:

(
  ((REFDES U1) (DEVICE uA 741) (FOOTPRINT DIP8))
  ((REFDES R1) (DEVICE RESISTOR) (VALUE 100) (FOOTPRINT 1206))
  ( etc etc  )
)

How would this data structure integrate with your GUI?  You would need
to do two things with this datastructure:  Get the device & attributes
out for display, and Put (possibly new) device & attribute pairs back
into it.

How does that work?  Or is there a better way?  If you have a
preferred data structure, what is it?  Or can you share the part of
your GUI code which handles the spreadsheet datastructure.

Note that I have not programmed spreadsheets & am totally unaware of
what the "cannonical" spreadsheet data structure looks like.

Stuart

> 
> 
> > As an aisde: a useful gEDA tool might be an attribute editor program
> > (gattrib) which reads in a  schematic,
> 
> =46rom a non-related project I already have the basic spreadsheet interface=
>  done.
> 
> It is based on the wxWindows library.  http://www.wxwindows.org/
> It will run on several different platforms.
> 
> I've already wrote a program for changing the refdes across multiple-sheet =
> schematics with it,
> no GUI version yet.
> 
> I know how to read the schematics to get the existing info, like the foot p=
> rints out, but I don't
> know how to insert them if they are not already there.
> 
> If some one else can come up with code that could pass each part to me as a=
>  tab-separated list of items,
> and I return it in the same format, I can deal with the GUI part.
> 
> > REFDES	DEVICE		VALUE	FOOTPRINT	MODEL-NAME	FILE
> > U1 	LM311			so8		LM311		/path/to/spice-model
> > R1	RESISTOR	100K	0603
> > C1	CAPACITOR	1uF	0603	=09
> > U2	LF356		LF356	so8=09
> >=20
> 
> =2D-=20
>                     http://www.softwaresafety.net/
>        http://www.unusualresearch.com/ http://www.bpaddock.com/
> 
>