← Back to team overview

kicad-developers team mailing list archive

Re: plugins and the import/export features

 

Thanks Wayne,  I'll get onto it and get back when I've got a plan.

- Cirilo


On Wed, Jan 7, 2015 at 5:03 AM, Wayne Stambaugh <stambaughw@xxxxxxxxx>
wrote:

> Cirilo,
>
> I apologize for not responding sooner but I took some time for myself
> and my family over the holidays.  I would like to see some type of clean
> up of this code.  I have a few suggestions that you might want to consider.
>
> 1) Separate out the 3D model stuff from the other plot/export code.
>
> 2) Organize the export code based on whether or not individual layer
> output is required.  If individual layer plotting is required then it
> should remain in the plot dialog.  I think exporting should be an all or
> nothing proposition.
>
> 3) Your plugin code could optionally support layers.  Take a look at the
> optional PROPERTIES passed to the Load and Save functions.  This might
> provide a solution.
>
> 4) You may want to have a separate plugin for 3D models.  There most
> likely will be a requirement to manage 3D model libraries similar to the
> footprint library code.
>
> 5) Before you spend any time coding, please submit a reasonably detailed
> proposal so other  developers can comment on it.
>
> 6) Make changes in small doses.  I've found when changing legacy code
> that any attempt to do a massive rewrite does nothing but create
> headaches.  If you choose to do a massive rewrite, that will have to be
> done in a separate branch so other devs can test your code without
> severely breaking the product branch.
>
> Thanks,
>
> Wayne
>
>
> On 12/20/2014 7:42 PM, Cirilo Bernardo wrote:
> > I've been thinking about the various import/export features and looking
> > into whether some
> > refactoring is worthwhile to decouple the code via a scheme similar to
> > the IO_MGR plugin.
> > I was also thinking maybe the IO_MGR plugin itself might be used but
> > eventually decided
> > against that since the features really are better described as an
> > Import/Export rather than
> > a Load/Save.
> >
> > I have made a few notes about the current state of Import and Export
> > features and
> > would appreciate any comments on the idea of refactoring these into a
> > plugin. My
> > preliminary notes are reproduced here:
> >
> > Notes on the refactoring of Import / Export modules:
> > ----------------------------------------------------
> >
> > Items currently under Import:
> >     + Specctra session
> >     + DXF
> >
> > Items currently under Export:
> >     + Specctra DSN
> >     + GenCAD
> >     + VRML
> >     + IDFv3
> >
> > Comments on existing features:
> >     + DXF: Although there is an import, production of
> >       DXF files from within KiCad is via Plot. Does it make
> >       sense to retain the plot function as an unrelated entity
> >       or should an Import/Export API be used and the "Export"
> >       simply brings up the appropriate Plot dialog?
> >     + SVG: There is an Export SVG within the File menu
> >       under the print features section. This is a shortcut
> >       to File->Plot->(SVG Format). Should this be retained
> >       or removed? Should this be labeled as an 'Export' at all,
> >       in which case it can be treated in a similar fashion to DXF?
> >       Is there a corresponding 'Import' function somewhere or
> >       is it likely that there will ever be one?
> >     + Specctra: Although the files created are different from
> >       the files being read into KiCad, does it make sense to
> >       put both of these operations under an Import/Export API
> >       or will the operation be unclear? (After all a Specctra
> >       DSN file is exported and a Session file is imported.)
> >     + GenCAD: At the moment we export GenCAD; are we likely to
> >       ever import GenCAD?
> >     + VRML: There will never be a VRML Import since this makes
> >       no sense at all; however putting it into an Import/Export
> >       API (plugin) makes sense since the decoupling from the
> >       pcbnew code will be cleaner.
> >     + IDFv3: The current IDF framework actually makes it
> >       possible to import an IDF file even though no one has yet
> >       requested this feature. In an Import/Export plugin it
> >       should only be necessary to extend the IDF plugin to
> >       provide the Import feature.
> >
> >
> > - Cirilo
> >
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~kicad-developers
> > Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> > Unsubscribe : https://launchpad.net/~kicad-developers
> > More help   : https://help.launchpad.net/ListHelp
> >
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>

References