Commit c7531d6c authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Fix minor bugs in cleanup dialog options and plot solder mask function (thanks...

Fix minor bugs in cleanup dialog options and plot solder mask function (thanks to Lorenzo to locate these bugs)
parents 5202ec58 bb399560
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1500,7 +1500,8 @@ void BOARD::RedrawFilledAreas( EDA_DRAW_PANEL* panel, wxDC* aDC, GR_DRAWMODE aDr

ZONE_CONTAINER* BOARD::HitTestForAnyFilledArea( const wxPoint& aRefPos,
                                                LAYER_NUM      aStartLayer,
                                                LAYER_NUM      aEndLayer )
                                                LAYER_NUM      aEndLayer,
                                                int aNetCode )
{
    if( aEndLayer < 0 )
        aEndLayer = aStartLayer;
@@ -1520,6 +1521,9 @@ ZONE_CONTAINER* BOARD::HitTestForAnyFilledArea( const wxPoint& aRefPos,
        if( area->GetState( BUSY ) )
            continue;

        if( aNetCode >= 0 && area->GetNet() != aNetCode )
            continue;

        if( area->HitTestFilledArea( aRefPos ) )
            return area;
    }
+4 −2
Original line number Diff line number Diff line
@@ -1079,12 +1079,14 @@ public:
     * Note: if a zone has its flag BUSY (in .m_State) is set, it is ignored.
     * @param aRefPos A wxPoint to test
     * @param aStartLayer the first layer to test
     * @param aEndLayer the last layer (-1 to ignore it) to test
     * @param aEndLayer the last layer to test
     * @param aNetCode = the netcode used to filter zones (-1 to to test all zones)
     * @return ZONE_CONTAINER* return a pointer to the ZONE_CONTAINER found, else NULL
     */
    ZONE_CONTAINER* HitTestForAnyFilledArea( const wxPoint& aRefPos,
                                             LAYER_NUM      aStartLayer,
                                             LAYER_NUM      aEndLayer = UNDEFINED_LAYER );
                                             LAYER_NUM      aEndLayer,
                                             int aNetCode );

    /**
     * Function RedrawAreasOutlines
+18 −9
Original line number Diff line number Diff line
@@ -117,9 +117,9 @@ void PCB_EDIT_FRAME::Clean_Pcb()

    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() )
    {
@@ -321,13 +321,16 @@ bool TRACKS_CLEANER::deleteUnconnectedTracks()
                    if( track->Type() != PCB_VIA_T )
                    {
                        zone = m_Brd->HitTestForAnyFilledArea( track->GetStart(),
                                                               track->GetLayer() );
                                                               track->GetLayer(),
                                                               track->GetLayer(),
                                                               track->GetNet() );
                    }
                    else
                    {
                        ((SEGVIA*)track)->ReturnLayerPair( &top_layer, &bottom_layer );
                        zone = m_Brd->HitTestForAnyFilledArea( track->GetStart(),
                                                               top_layer, bottom_layer );
                                                               top_layer, bottom_layer,
                                                               track->GetNet() );
                    }
                }

@@ -354,7 +357,9 @@ bool TRACKS_CLEANER::deleteUnconnectedTracks()
                        {
                            via->ReturnLayerPair( &top_layer, &bottom_layer );
                            zone = m_Brd->HitTestForAnyFilledArea( via->GetStart(),
                                                                   bottom_layer, top_layer );
                                                                   bottom_layer,
                                                                   top_layer,
                                                                   via->GetNet() );
                        }

                        if( (other == NULL) && (zone == NULL) )
@@ -376,13 +381,16 @@ bool TRACKS_CLEANER::deleteUnconnectedTracks()
                    if( track->Type() != PCB_VIA_T )
                    {
                        zone = m_Brd->HitTestForAnyFilledArea( track->GetEnd(),
                                                               track->GetLayer() );
                                                               track->GetLayer(),
                                                               track->GetLayer(),
                                                               track->GetNet() );
                    }
                    else
                    {
                        ((SEGVIA*)track)->ReturnLayerPair( &top_layer, &bottom_layer );
                        zone = m_Brd->HitTestForAnyFilledArea( track->GetEnd(),
                                                               top_layer, bottom_layer );
                                                               top_layer, bottom_layer,
                                                               track->GetNet() );
                    }
                }

@@ -410,7 +418,8 @@ bool TRACKS_CLEANER::deleteUnconnectedTracks()
                        {
                            via->ReturnLayerPair( &top_layer, &bottom_layer );
                            zone = m_Brd->HitTestForAnyFilledArea( via->GetEnd(),
                                                                   bottom_layer, top_layer );
                                                                   bottom_layer, top_layer,
                                                                   via->GetNet() );
                        }

                        if( (other == NULL) && (zone == NULL) )
+6 −6
Original line number Diff line number Diff line
@@ -155,10 +155,10 @@
                                <property name="subclass"></property>
                                <property name="toolbar_pane">0</property>
                                <property name="tooltip">remove vias on pads with a through hole</property>
                                <property name="validator_data_type">bool</property>
                                <property name="validator_data_type"></property>
                                <property name="validator_style">wxFILTER_NUMERIC</property>
                                <property name="validator_type">wxDefaultValidator</property>
                                <property name="validator_variable">cleanVias</property>
                                <property name="validator_variable"></property>
                                <property name="window_extra_style"></property>
                                <property name="window_name"></property>
                                <property name="window_style"></property>
@@ -243,10 +243,10 @@
                                <property name="subclass"></property>
                                <property name="toolbar_pane">0</property>
                                <property name="tooltip">merge aligned track segments, and remove null segments</property>
                                <property name="validator_data_type">bool</property>
                                <property name="validator_data_type"></property>
                                <property name="validator_style">wxFILTER_NUMERIC</property>
                                <property name="validator_type">wxDefaultValidator</property>
                                <property name="validator_variable">mergeSegments</property>
                                <property name="validator_variable"></property>
                                <property name="window_extra_style"></property>
                                <property name="window_name"></property>
                                <property name="window_style"></property>
@@ -331,10 +331,10 @@
                                <property name="subclass"></property>
                                <property name="toolbar_pane">0</property>
                                <property name="tooltip">delete track segment having a dangling end</property>
                                <property name="validator_data_type">bool</property>
                                <property name="validator_data_type"></property>
                                <property name="validator_style">wxFILTER_NUMERIC</property>
                                <property name="validator_type">wxDefaultValidator</property>
                                <property name="validator_variable">deleteUnconnectedSegm</property>
                                <property name="validator_variable"></property>
                                <property name="window_extra_style"></property>
                                <property name="window_name"></property>
                                <property name="window_style"></property>
+0 −3
Original line number Diff line number Diff line
@@ -50,9 +50,6 @@ class DIALOG_CLEANING_OPTIONS_BASE : public DIALOG_SHIM
		
	
	public:
		bool cleanVias; 
		bool mergeSegments; 
		bool deleteUnconnectedSegm; 
		
		DIALOG_CLEANING_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Cleaning Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 243,146 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); 
		~DIALOG_CLEANING_OPTIONS_BASE();
Loading