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

Re: gEDA-user: GATTRIB attribute editor program



> *  I would probably do it in Python, cause Python is a good
> rapid-prototyping language. 

There is a thread about that right now on the wxWindows user list,
some say yes, some say no.  I've never used Python yet, so I'll
say nothing.

> Whenever I have to write stuff in C, I spend most of my time chasing
> down pointer problems, which is a real PITA. 

http://www.splint.org/ and http://www.gimpel.com/ for Lint.

> that I still don't "grok" pointers completely. 

Yes it can be confusing.  If you start learning at the assembly language level
then move to 'C' they make more sense.

http://www.function-pointer.org/


> schematics are small, "speed of program running" is not as important
> as "speed of program development". 

Yes.

> *  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? 

I already do that with my ref-designator program, that is not that part I don't know
how to do.

On the command line I read the files in order of the 'page'.  File A is page one etc.,
so you can restart the numbering on each file/page.

The format I read and build is FILE\t\LINE_NUMBER\tREFDES_PREFIX\tREFDES_DIGITS

Because a component always has a REFDES I always know what line to overwrite.

What I don't know how today, because I have not spent time reading the file format docs (so far), is how
to insert an attribute, versus replacing the attribute that I do now.

Lets say I have REFDES=U1, and there is no existing foot print in the schematic.

I add a footprint in the GUI.  Now what do I do with it to get it in inserted in the schematic,
in the right place?

> How does that work?  Or is there a better way?  If you have a
> preferred data structure, what is it? 

I'm just working with a long string, of tab separated values.
I know by their position what field they are.
  
#define TOKEN_FILE (0)
#define TOKEN_LINE_NUMBER (1)
#define TOKEN_REFDES_PREFIX (2)
#define TOKEN_REFDES_DIGITS (3)

KISS principle.

> 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.

I'm just doing treating it as a simple X/Y grid.


-- 
                    http://www.softwaresafety.net/
       http://www.unusualresearch.com/ http://www.bpaddock.com/