← Back to team overview

kicad-developers team mailing list archive

Re: Decoupling issues with python

 

On Mon, Aug 13, 2012 at 11:23:54AM -0500, Dick Hollenbeck wrote:
> Anyways, I had given all this a lot of thought, because I could foresee these problems a
> year ago or more.
> 
> The BOARD_ACTIONS class is my preferred solution, and it diligently implemented would mean
> scripting is easier and you also can get rid of compiling things twice, because you can
> park the process main()s on top of the DLL/DSOs, which is what should happen eventually.

OK, got it. It seemed to me strange that dual compilation... namespace
or class is mostly a stylistic choice if the action has no long term
state (this is one of the reason for my preference of multiple dispatch
object systems contrasted to message based like smalltalk/C++/java and
80% of the other OO languages)

For the filename issue I've done this (as I have said before):

- Removed the filename from BASE_SCREEN (private variable and
  accessors);

- Put a 'compatibility' one in SCH_SCREEN to keep eeschema working. I.e.
  it is in SCH_SCREEN directly not, it's not inherited anymore...
  I could see that SCH_SCREEN is mostly the model of eeschema, so it
  isn't too bad.

- For gerbview I simply used a private member (since it's only used to
  keep the last filename selected and repropose the name)

- pcbnew get the filename in the BOARD; most of the access paths were:
  (parent->)frame->screen->filename which can be easily replaced with
  (parent->)frame->board->filename

- Profit :D we can have the filename from a BOARD* and (theorically)
  I could do a plot without even a screen or frame allocated (how to get
  hold of that board is another question...)

The other field in the title block (sheet number, number of sheet, sheet
description) are passed as parameters to the title block function, and
in fact have no significance for pcbnew (it's always page 1/1); it can
be useful to think we to put them: the numbers come directly from the screen, 
while the sheet description passes thru a virtual method in the frame.
IMHO a good place for them would be the title block.

I need to do a ton of tests to see if I broke something.

-- 
Lorenzo Marcantonio
Logos Srl


Follow ups

References