kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #08813
Re: Decoupling issues with python
On Mon, Aug 13, 2012 at 10:01:18AM +0200, Miguel Angel Ajo Pelayo wrote:
> but may be BOARD and "schematic file" have a common ancestor that can hold
> the method to get the filename?
There is a base class with an accessor only, the filename is get/set
separately (usually during I/O). Then there is the PCB_FRAME and the
SCH_FRAME (idem for the SCREEN). For eeschema it is more complicated
since there are many SCREENs (one for sheet); if the SCREEN and FRAME
are view/controller classes it is logical that the filename should go
in the model (BOARD and... well, it seems that the SCREEN in eeschema is
the model too:((((
I could try this: move the filename from BASE_SCREEN to SCH_SCREEN (thus
leaving eeschema unfazed and still correct since SCH_SCREEN is the
eeschema model), and then adding it to BOARD; a quick grep
shows that the filename in pcbnew is not required very often and most
probably the BOARD would be available near there.
(this refactoring reminds me a binary tree balancing act :P:P)
--
Lorenzo Marcantonio
Logos Srl
Follow ups
References