kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #31600
Re: [RFC] new connectivity algorithm - testers needed
old thread, but I think it's relevant to my issue. My interest is mostly in
the python interface to pcbnew.[0]
With the new connectivity stuff, what's the proper way to ask a net what
pads belong to it?
In python, I used to be able to do net.Pads() [1]
I tried adding connectivity.h[2] to boards.i via a new connectivity.i but
then I realized that GetConnectedPads can't take a net. net is not a
board_connected_item
I could iterate through all pads and compare each one's net. Seems like a
not so good way to do it.
I do see that the implementation of GetPadCount(aNet) does just that.[3]
Also, in that implementation, it's referencing connAlgo's padList. Is this
better than asking board for its pads? I'm thinking the whole "don't repeat
yourself" thing [4]
So, what is the recommended way to get a net's list of pads?
Miles
[0] my tutorials are referenced from kicad's tutorials list
http://kicad-pcb.org/help/tutorials/ ->
https://kicad.mmccoo.com/kicad-scripting-table-of-contents/
[1]: removed with this checkin:
Author: Tomasz Włostowski <tomasz.wlostowski@xxxxxxx> 2017-03-22 14:51:07
Committer: Tomasz Włostowski <tomasz.wlostowski@xxxxxxx> 2017-06-23
11:12:37
Parent: 8b59350e44a9894f02977ae26da166b239ef7da3 (Pcbnew: fix override
release build error.)
Child: 75cda5021d72011f2de54cadbca32581a5319fa9 (Assure that NETINFO_ITEMs
have a NETCLASS object assigned)
Branches: master, remotes/origin/master
Follows: 4.0.0-rc2
Precedes:
Removed legacy connectivity/ratsnest algorithm, replaced with the new
one. No legacy autorouting for the moment
[2]: shouldn't this be called class_connectivity_data.h?
[3] here's GetPadCount
unsigned int CONNECTIVITY_DATA::GetPadCount( int aNet ) const
{
int n = 0;
for( auto pad : m_connAlgo->PadList() )
{
if( !pad->Valid() )
continue;
auto dpad = static_cast<D_PAD*>( pad->Parent() );
if( aNet < 0 || aNet == dpad->GetNetCode() )
{
n++;
}
}
return n;
}
[4] https://en.wikipedia.org/wiki/Don%27t_repeat_yourself
<https://en.wikipedia.org/wiki/Don%27t_repeat_yourself>
On Mon, Jul 3, 2017 at 11:47 AM, Kristoffer Ödmark <
kristofferodmark90@xxxxxxxxx> wrote:
> Hey Tom!
>
> Any ETA for the new Via tool dialog? It's some solid work you have done,
> thanks!
>
> - Kristoffer
>
>
> On 2017-06-27 21:54, Tomasz Wlostowski wrote:
>
>> On 27.06.2017 21:24, Simon Küppers wrote:
>>
>>> Small Bump.
>>>
>>> Can anyone shed some light on the new Via Tool? Is it supposed to be not
>>> ready yet? The Track & Via Properties Dialog looks really unfinished and
>>> I cannot modify anything beside Position and Via Size there. Is it
>>> because I am using the Cairo Canvas?
>>>
>>> Sorry, I forgot that I left the dialog unfinished. Will fix in a couple
>> of days...
>>
>> Tom
>>
>> _______________________________________________
>> 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
>
Follow ups
References