kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #16445
Re: more pythonic scripting API for pcbnew
Miguel Ángel Ajo
On Friday, 16 de January de 2015 at 20:01, LordBlick wrote:
> In response to a message written on 16.01.2015, 18:43, from Miguel Ángel Ajo:
> > About using mm as the default unit, other people may disagree, we should provide
> > facilities to let people specify their unit.
> >
>
> wxPoint and wxSize can be subclassed to allow any arithmetical operation and
> unit conversion with propietary methods.
> > > As Jean-Pierre Charras wrote in thread nearly, board names for cooper layers may
> > > vary:
> > > brd = pcbnew
> > > pcb = brd.GetBoard()
> > > > > > pcb.SetLayerName(0, 'Top')
> > > > >
> > > >
> > >
> > > True
> > > > > > pcb.SetLayerName(31, 'Bottom')
> > > > >
> > > >
> > >
> > > True
> > > > > > pcb.SetLayerName(32, 'BottomGlue')
> > > > >
> > > >
> > >
> > > False
> > > > > >
> > > > >
> > > >
> > >
> > >
> >
> >
> > Hmm, that’s an important point for not referencing layers by names dynamically,
> > (I was proposing that too)
> >
> > may be we should be defining a set of 32 constants for the layers we can reference
> > and keep up to date with any ID changes at the C++ side. Although I suppose ID’s
> > are not
> > going to change for compatibility reasons.
> >
>
> Seems to be unessary creating independent data. Simply:
> lsLayers = tuple([(idl, brd.BOARD_GetStandardLayerName(idl)) for idl in
> range(brd.LAYER_ID_COUNT)])
> lsCuLayers = tuple(filter(lambda idl, layerName: layerName.endswith('.Cu'),
> lsLayers))
>
Yes, you already told me, but wasn’t the point against using provided names
that they could eventualy change?.
This is why I was suggesting constants. It’s not an awful work ;) but I understand you may
not want to do it ;)
> --
> Best Regards,
> LordBlick
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx (mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx)
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
>
>
Follow ups
References
-
more pythonic scripting API for pcbnew
From: PTT, 2015-01-07
-
Re: more pythonic scripting API for pcbnew
From: LordBlick, 2015-01-07
-
Re: more pythonic scripting API for pcbnew
From: Adam Wolf, 2015-01-07
-
Re: more pythonic scripting API for pcbnew
From: LordBlick, 2015-01-15
-
Re: more pythonic scripting API for pcbnew
From: Miguel Ángel Ajo, 2015-01-15
-
Re: more pythonic scripting API for pcbnew
From: Brian Sidebotham, 2015-01-16
-
Re: more pythonic scripting API for pcbnew
From: Miguel Ángel Ajo, 2015-01-16
-
Re: more pythonic scripting API for pcbnew
From: LordBlick, 2015-01-16
-
Re: more pythonic scripting API for pcbnew
From: Miguel Ángel Ajo, 2015-01-16
-
Re: more pythonic scripting API for pcbnew
From: LordBlick, 2015-01-16
-
Re: more pythonic scripting API for pcbnew
From: Tomasz Wlostowski, 2015-01-16
-
Re: more pythonic scripting API for pcbnew
From: LordBlick, 2015-01-16
-
Re: more pythonic scripting API for pcbnew
From: Miguel Ángel Ajo, 2015-01-16
-
Re: more pythonic scripting API for pcbnew
From: Piers Titus van der Torren, 2015-01-16
-
Re: more pythonic scripting API for pcbnew
From: LordBlick, 2015-01-16
-
Re: more pythonic scripting API for pcbnew
From: Miguel Ángel Ajo, 2015-01-16
-
Re: more pythonic scripting API for pcbnew
From: LordBlick, 2015-01-16