Re: [Kicad-developers] Track cleanup (broken or changed?)

2013-09-17 Thread Lorenzo Marcantonio
On Tue, Sep 17, 2013 at 09:39:12PM +0200, Lorenzo Marcantonio wrote:
> That's a good news. Now need to find why doesn't work on by side:(

Found the problem. An ugly mixup of similar names and random memory
content. The issue is in the dialog option transfer code...

In DIALOG_CLEANING_OPTION_BASE the members variables for the options are
declarated (by the wxFormStuff, I presume). I take mergeSegments as an
example (the same is valid for the other two options). These are
declared and not initialized => random value taken.

In the derived DIALOG_CLEANING_OPTION the static members for the options
are declared (I presume the idea is for keeping the options between
invocations); this is m_mergeSegments. Initialized to true and shuttled
to the controls during dialog construction and from the controls by
GetOpts at various times, especially when clicking OK (side note: why in
the destructor? wouldn't this save the settings even on the cancel
flow?)

HOWEVER PCB_EDIT_FRAME::Clean_Pcb(), during configuration of the
TRACK_CLEANER uses the *instance* members, not the *class* one i.e. the
autogenerated uninitialized variables generated by wxForm. So, it works
on luck:P

I suggest this to fix it (more thinking is required for the GetOpts in 
destructor thingy)

=== modified file 'pcbnew/clean.cpp'
--- pcbnew/clean.cpp2013-04-09 20:06:00 +
+++ pcbnew/clean.cpp2013-09-17 20:18:18 +
@@ -117,9 +117,9 @@
 
 wxBusyCursor( dummy );
 TRACKS_CLEANER cleaner( GetBoard() );
-cleaner.SetdeleteUnconnectedTracksOpt( dlg.deleteUnconnectedSegm );
-cleaner.SetMergeSegmentsOpt( dlg.mergeSegments );
-cleaner.SetCleanViasOpt( dlg.cleanVias );
+cleaner.SetdeleteUnconnectedTracksOpt( dlg.m_deleteUnconnectedSegm );
+cleaner.SetMergeSegmentsOpt( dlg.m_mergeSegments );
+cleaner.SetCleanViasOpt( dlg.m_cleanVias );
 
 if( cleaner.CleanupBoard() )
 {

-- 
Lorenzo Marcantonio
Logos Srl

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Track cleanup (broken or changed?)

2013-09-17 Thread Lorenzo Marcantonio
On Tue, Sep 17, 2013 at 08:35:53PM +0200, jp charras wrote:
> Cleanup function works for me, 0 length segments are removed and
> collinear segment are merged.

That's a good news. Now need to find why doesn't work on by side:(

-- 
Lorenzo Marcantonio
Logos Srl

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Track cleanup (broken or changed?)

2013-09-17 Thread jp charras
Le 17/09/2013 19:43, Lorenzo Marcantonio a écrit :
> I remember last time I did a board the track cleanup function
> a) merged consecutive parallel track segments and
> b) removed zero length segments
> 
> also *way* more time ago it deleted 'floating' tracks; I agree that's
> not desiderable since kills tuning stubs and some kind of guard loops.
> 
> However the 'track merge' behaviour was very useful (especially due to
> the 'limitation' of the drag track tool). Zero length segment also pop
> up quite often (example: drag this
> 
> 
> \
>  
> 
> to this (typical cleanup operation)
> 
> 0
> 
> I think the desired behaviour for the cleanup function is to obtain
> a single segment from the three above. 
> 
> What is the design decision for not doing so anymore? in that case, what
> is meant with the merge option in the dialog?
> 

Cleanup function works for me, 0 length segments are removed and
collinear segment are merged.


-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


[Kicad-developers] Track cleanup (broken or changed?)

2013-09-17 Thread Lorenzo Marcantonio
I remember last time I did a board the track cleanup function
a) merged consecutive parallel track segments and
b) removed zero length segments

also *way* more time ago it deleted 'floating' tracks; I agree that's
not desiderable since kills tuning stubs and some kind of guard loops.

However the 'track merge' behaviour was very useful (especially due to
the 'limitation' of the drag track tool). Zero length segment also pop
up quite often (example: drag this


\
 

to this (typical cleanup operation)

0

I think the desired behaviour for the cleanup function is to obtain
a single segment from the three above. 

What is the design decision for not doing so anymore? in that case, what
is meant with the merge option in the dialog?

-- 
Lorenzo Marcantonio
Logos Srl

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp