← Back to team overview

kicad-developers team mailing list archive

Re: Simplified vias patch proposal

 

On 6/27/2012 5:13 AM, Samuel Lesueur wrote:
Hi wayne,

On Tue, Jun 26, 2012 at 10:33:54AM -0400, Wayne Stambaugh wrote:
A few minor comments on your patch.  As Lorenzo already mentioned,
add a new line before comment lines to group the comment with the
code that it is associated with.  Also use a new line between the
break and next case statement to define the end of the last case
statement and the beginning of the next one.


Humm, actually, my patch was only a proof of concept, It is only a quick
and dirty patch that uses the functions from the shortcut keys, it was
not meant to be integrated but was here to say : "hey guys, i would like
this feature, here I found a dirty way to add vias, I know it is not the
right way to do it, but it is a start and it's better thant nothing"

I will look your coding style policy, but I was more expecting some
hints to add the vias directly in the memory mapping of the board, and
to get a general feeling about the way this feature should be implemented.

After testing, there is clearly a bug with this patch and the track
auto-remove subsystem. For example, if I add a via directly on a zone
and then remove the zone, the via becomes orphan and loose it net
attachement.

I see two potential paths to add vias that are not connected to a trace. I'll call these free vias to avoid confusion with normal vias. You could either create a new free via object type derived from SEGVIA or add the free via functionality to SEGVIA. My preference is a new object because it separates the special features of free vias. You will then need to add code to the board clean up function, the DRC, and file save/load plug-in to handle free vias. In the clean up code you would add tests for free vias that were not connected to the selected net on either end. In the DRC you would test free vias for clearance and connectivity issues. I would mark clearance issues and connections to invalid nets (also known as shorts) as errors and mark floating connections as warnings to let the user know that they will be deleted when board clean up is run. In the load/save file code you will have to support at least the new s-expression file format and if you need it immediately then you will need to update the current (legacy) file format. You will also potentially need to figure out how to load free vias from any other file formats currently supported in the Pcbnew plug-in (currently this is only Eagle). All of this will require input from the development team since it will impact the behavior of a large portion of Pcbnew.


There is also a small graphical bug : after adding a via it is not
displayed because drawn under the track. I have to zoom in or zoom out
to trigger a screen refresh before I can see it. Is there a function to
refresh the screen I can use in my patch?

You have to call wxWindow::Refresh() to tell wxWidgets to update the client area. The easiest way is to refresh the entire visible area of the drawing by calling Refresh() with no parameters or you can pass the area of the drawing that needs to be refreshed by the addition of the free via. The latter can cause redrawing issues depending on the objects that need to be redrawn. I usually give refreshing the area of the new object a try first. If there are no drawing issue you are good to go. Otherwise, you can always fall back to refreshing the entire visible area.

Wayne


On Wed, Jun 27, 2012 at 08:29:42AM +0200, jean-pierre charras wrote:
I also should say I do not understand why it is so hard to start a
track from$ and then press the v key to insert a via, as many times as
you want.

Jean-pierre : Well indeed it might be a solution but not acceptable if
you have to add 500 vias on a power board, either for power dissipation
or for connecting two cooper zones. If you knit tracks all around your
board just to add vias, the final outputs will just be aufull and each
time you will have to do minor layout changes on your board, those
tracks and vias will always be on your way ...

Imagine if we can add a feature that draw those termal vias during the
"zone filling" process. It would be so usefull for power designers !

I am willing to do it (or at least to try ;) ) but I need some
directions to find where I should look and work in the code.

Thanks for your time guys !

Samuel



_______________________________________________
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