Commit dfffee82 authored by charras's avatar charras
Browse files

Pcbnew: in DRC dialog: removed options, that are no more useful with the new zone handling.

(all test are now always performed)
parent 17bf2435
Loading
Loading
Loading
Loading
+621 B (183 KiB)

File changed.

No diff preview for this file type.

+711 −655

File changed.

Preview size limit exceeded, changes collapsed.

+84 −70
Original line number Diff line number Diff line
/////////////////////////////////////////////////////////////////////////////

// Name:        dialog_drc.cpp
// Author:      jean-pierre Charras
// Licence:     GPL
/////////////////////////////////////////////////////////////////////////////




#include "fctsys.h"
#include "wxstruct.h"
#include "dialog_drc.h"
@@ -33,10 +32,18 @@ DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, WinEDA_PcbFrame* parent )
void DIALOG_DRC_CONTROL::Init()
{
    // Connect events and objects
    m_ClearanceListBox->Connect(ID_CLEARANCE_LIST, wxEVT_LEFT_DCLICK, wxMouseEventHandler(DIALOG_DRC_CONTROL::OnLeftDClickClearance), NULL, this);
    m_ClearanceListBox->Connect(ID_CLEARANCE_LIST, wxEVT_RIGHT_UP, wxMouseEventHandler(DIALOG_DRC_CONTROL::OnRightUpClearance), NULL, this);
    m_UnconnectedListBox->Connect(ID_UNCONNECTED_LIST, wxEVT_LEFT_DCLICK, wxMouseEventHandler(DIALOG_DRC_CONTROL::OnLeftDClickUnconnected), NULL, this);
    m_UnconnectedListBox->Connect(ID_UNCONNECTED_LIST, wxEVT_RIGHT_UP, wxMouseEventHandler(DIALOG_DRC_CONTROL::OnRightUpUnconnected), NULL, this);
    m_ClearanceListBox->Connect( ID_CLEARANCE_LIST, wxEVT_LEFT_DCLICK,
                                 wxMouseEventHandler(
                                     DIALOG_DRC_CONTROL::OnLeftDClickClearance ), NULL, this );
    m_ClearanceListBox->Connect( ID_CLEARANCE_LIST, wxEVT_RIGHT_UP,
                                 wxMouseEventHandler(
                                     DIALOG_DRC_CONTROL::OnRightUpClearance ), NULL, this );
    m_UnconnectedListBox->Connect( ID_UNCONNECTED_LIST, wxEVT_LEFT_DCLICK,
                                   wxMouseEventHandler( DIALOG_DRC_CONTROL::
                                                        OnLeftDClickUnconnected ), NULL, this );
    m_UnconnectedListBox->Connect( ID_UNCONNECTED_LIST, wxEVT_RIGHT_UP,
                                   wxMouseEventHandler(
                                       DIALOG_DRC_CONTROL::OnRightUpUnconnected ), NULL, this );

    AddUnitSymbol( *m_ClearenceTitle );
    AddUnitSymbol( *m_TrackMinWidthTitle );
@@ -88,17 +95,21 @@ void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event )
    g_DesignSettings.m_MicroViasMinSize =
        ReturnValueFromTextCtrl( *m_SetMicroViakMinSizeCtrl, m_Parent->m_InternalUnits );

    m_tester->SetSettings( m_Pad2PadTestCtrl->IsChecked(),
                        m_UnconnectedTestCtrl->IsChecked(),
                        m_ZonesTestCtrl->IsChecked(),
    m_tester->SetSettings( true,        // Pad to pad DRC test enabled
                          true,         // unconnected pdas DRC test enabled
                          true,         // DRC test for zones enabled
                          reportName, m_CreateRptCtrl->IsChecked() );


    DelDRCMarkers();

    wxBeginBusyCursor();

    // run all the tests, with no UI at this time.
    m_tester->RunTests();
    m_Messages->Clear();
    wxSafeYield();      // Allows time slice to refresh the m_Messages window
    m_tester->m_pcb->m_Status_Pcb = 0;                // Force full connectivity and ratsnest recalculations
    m_tester->RunTests(m_Messages);

#if wxCHECK_VERSION( 2, 8, 0 )
    m_Notebook->ChangeSelection( 0 );       // display the 1at tab "...Markers ..."
@@ -170,15 +181,16 @@ void DIALOG_DRC_CONTROL::OnListUnconnectedClick( wxCommandEvent& event )
    g_DesignSettings.m_MicroViasMinSize =
        ReturnValueFromTextCtrl( *m_SetMicroViakMinSizeCtrl, m_Parent->m_InternalUnits );

    m_tester->SetSettings( m_Pad2PadTestCtrl->IsChecked(),
                        m_UnconnectedTestCtrl->IsChecked(),
                        m_ZonesTestCtrl->IsChecked(),
    m_tester->SetSettings( true,        // Pad to pad DRC test enabled
                          true,         // unconnected pdas DRC test enabled
                          true,         // DRC test for zones enabled
                          reportName, m_CreateRptCtrl->IsChecked() );

    DelDRCMarkers();

    wxBeginBusyCursor();

    m_Messages->Clear();
    m_tester->ListUnconnectedPads();

#if wxCHECK_VERSION( 2, 8, 0 )
@@ -204,10 +216,11 @@ void DIALOG_DRC_CONTROL::OnListUnconnectedClick( wxCommandEvent& event )
    wxEndBusyCursor();

    /* there is currently nothing visible on the DrawPanel for unconnected pads
    RedrawDrawPanel();
     *  RedrawDrawPanel();
     */
}


/*!
 * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_BROWSE_RPT_FILE
 */
@@ -270,11 +283,11 @@ void DIALOG_DRC_CONTROL::OnReportCheckBoxClicked( wxCommandEvent& event )
        m_RptFilenameCtrl->Enable( false );
        m_BrowseButton->Enable( false );
    }

//    event.Skip();
}



/*!
 * wxEVT_LEFT_DCLICK event handler for ID_CLEARANCE_LIST
 */
@@ -295,9 +308,9 @@ void DIALOG_DRC_CONTROL::OnLeftDClickClearance( wxMouseEvent& event )
        if( item )
        {
            /*
            // after the goto, process a button OK command later.
            wxCommandEvent  cmd( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK );
            ::wxPostEvent( GetEventHandler(), cmd );
             *  // after the goto, process a button OK command later.
             *  wxCommandEvent  cmd( wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK );
             *  ::wxPostEvent( GetEventHandler(), cmd );
             */

            m_Parent->CursorGoto( item->GetPosition() );
@@ -328,16 +341,19 @@ void DIALOG_DRC_CONTROL::OnPopupMenu( wxCommandEvent& event )
        item = m_UnconnectedListBox->GetItem( selection );
        pos  = item->GetPointA();
        break;

    case ID_POPUP_UNCONNECTED_B:
        selection = m_UnconnectedListBox->GetSelection();
        item = m_UnconnectedListBox->GetItem( selection );
        pos  = item->GetPointB();
        break;

    case ID_POPUP_MARKERS_A:
        selection = m_ClearanceListBox->GetSelection();
        item = m_ClearanceListBox->GetItem( selection );
        pos  = item->GetPointA();
        break;

    case ID_POPUP_MARKERS_B:
        selection = m_ClearanceListBox->GetSelection();
        item = m_ClearanceListBox->GetItem( selection );
@@ -353,7 +369,6 @@ void DIALOG_DRC_CONTROL::OnPopupMenu( wxCommandEvent& event )
}



/*!
 * wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST
 */
@@ -462,6 +477,7 @@ void DIALOG_DRC_CONTROL::OnMarkerSelectionEvent( wxCommandEvent& event )
    event.Skip();
}


void DIALOG_DRC_CONTROL::OnUnconnectedSelectionEvent( wxCommandEvent& event )
{
    int selection = event.GetSelection();
@@ -540,7 +556,6 @@ void DIALOG_DRC_CONTROL::OnDeleteOneClick( wxCommandEvent& event )
            RedrawDrawPanel();
        }
    }

    else if( curTab == 1 )
    {
        selectedIndex = m_UnconnectedListBox->GetSelection();
@@ -549,9 +564,8 @@ void DIALOG_DRC_CONTROL::OnDeleteOneClick( wxCommandEvent& event )
            m_UnconnectedListBox->DeleteItem( selectedIndex );

            /* these unconnected DRC_ITEMs are not currently visible on the pcb
            RedrawDrawPanel();
             *  RedrawDrawPanel();
             */
        }
    }
}
+11 −23
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
	
	m_RptFilenameCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	m_RptFilenameCtrl->SetToolTip( _("Enter the report filename") );
	m_RptFilenameCtrl->SetMinSize( wxSize( 200,-1 ) );
	m_RptFilenameCtrl->SetMinSize( wxSize( 250,-1 ) );
	
	ReportFileSizer->Add( m_RptFilenameCtrl, 1, wxALL|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
	
@@ -95,33 +95,21 @@ DIALOG_DRC_CONTROL_BASE::DIALOG_DRC_CONTROL_BASE( wxWindow* parent, wxWindowID i
	
	sbSizerOptions->Add( bSizer7, 1, wxEXPAND, 5 );
	
	wxStaticBoxSizer* sbSizer3;
	sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Include Tests For:") ), wxVERTICAL );
	m_CommandSizer->Add( sbSizerOptions, 0, 0, 5 );
	
	m_Pad2PadTestCtrl = new wxCheckBox( this, wxID_ANY, _("Pad to pad"), wxDefaultPosition, wxDefaultSize, 0 );
	m_Pad2PadTestCtrl->SetValue(true);
	wxBoxSizer* bSizerMessages;
	bSizerMessages = new wxBoxSizer( wxVERTICAL );
	
	m_Pad2PadTestCtrl->SetToolTip( _("Include tests for clearances between pad to pads") );
	m_Pad2PadTestCtrl->SetHelpText( _("Include tests for clearances between pad to pads") );
	m_staticText6 = new wxStaticText( this, wxID_ANY, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 );
	m_staticText6->Wrap( -1 );
	bSizerMessages->Add( m_staticText6, 0, wxRIGHT|wxLEFT, 5 );
	
	sbSizer3->Add( m_Pad2PadTestCtrl, 0, wxALL, 5 );
	m_Messages = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxTE_MULTILINE|wxTE_READONLY );
	m_Messages->SetMinSize( wxSize( 160,-1 ) );
	
	m_ZonesTestCtrl = new wxCheckBox( this, wxID_ANY, _("Zones"), wxDefaultPosition, wxDefaultSize, 0 );
	bSizerMessages->Add( m_Messages, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );
	
	m_ZonesTestCtrl->SetToolTip( _("Include zones in clearance or unconnected tests") );
	
	sbSizer3->Add( m_ZonesTestCtrl, 0, wxALL, 5 );
	
	m_UnconnectedTestCtrl = new wxCheckBox( this, wxID_ANY, _("Unconnected pads"), wxDefaultPosition, wxDefaultSize, 0 );
	m_UnconnectedTestCtrl->SetValue(true);
	
	m_UnconnectedTestCtrl->SetToolTip( _("Find unconnected pads") );
	
	sbSizer3->Add( m_UnconnectedTestCtrl, 0, wxALL, 5 );
	
	sbSizerOptions->Add( sbSizer3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
	
	m_CommandSizer->Add( sbSizerOptions, 1, 0, 5 );
	m_CommandSizer->Add( bSizerMessages, 1, wxEXPAND, 5 );
	
	wxBoxSizer* bSizer11;
	bSizer11 = new wxBoxSizer( wxVERTICAL );
+112 −165
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
            <property name="minimum_size"></property>
            <property name="name">DIALOG_DRC_CONTROL_BASE</property>
            <property name="pos"></property>
            <property name="size">678,508</property>
            <property name="size">683,508</property>
            <property name="style">wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER</property>
            <property name="subclass"></property>
            <property name="title">DRC Control</property>
@@ -87,7 +87,7 @@
                        <object class="sizeritem" expanded="1">
                            <property name="border">5</property>
                            <property name="flag"></property>
                            <property name="proportion">1</property>
                            <property name="proportion">0</property>
                            <object class="wxStaticBoxSizer" expanded="1">
                                <property name="id">wxID_ANY</property>
                                <property name="label">Options</property>
@@ -625,7 +625,7 @@
                                                        <property name="id">wxID_ANY</property>
                                                        <property name="maximum_size"></property>
                                                        <property name="maxlength">0</property>
                                                        <property name="minimum_size">200,-1</property>
                                                        <property name="minimum_size">250,-1</property>
                                                        <property name="name">m_RptFilenameCtrl</property>
                                                        <property name="permission">public</property>
                                                        <property name="pos"></property>
@@ -722,98 +722,44 @@
                                        </object>
                                    </object>
                                </object>
                            </object>
                        </object>
                        <object class="sizeritem" expanded="1">
                            <property name="border">5</property>
                                    <property name="flag">wxALIGN_CENTER_VERTICAL|wxALL</property>
                                    <property name="proportion">0</property>
                                    <object class="wxStaticBoxSizer" expanded="1">
                                        <property name="id">wxID_ANY</property>
                                        <property name="label">Include Tests For:</property>
                            <property name="flag">wxEXPAND</property>
                            <property name="proportion">1</property>
                            <object class="wxBoxSizer" expanded="1">
                                <property name="minimum_size"></property>
                                        <property name="name">sbSizer3</property>
                                <property name="name">bSizerMessages</property>
                                <property name="orient">wxVERTICAL</property>
                                <property name="permission">none</property>
                                        <event name="OnUpdateUI"></event>
                                <object class="sizeritem" expanded="1">
                                    <property name="border">5</property>
                                            <property name="flag">wxALL</property>
                                    <property name="flag">wxRIGHT|wxLEFT</property>
                                    <property name="proportion">0</property>
                                            <object class="wxCheckBox" expanded="1">
                                                <property name="bg"></property>
                                                <property name="checked">1</property>
                                                <property name="context_help">Include tests for clearances between pad to pads</property>
                                                <property name="enabled">1</property>
                                                <property name="fg"></property>
                                                <property name="font"></property>
                                                <property name="hidden">0</property>
                                                <property name="id">wxID_ANY</property>
                                                <property name="label">Pad to pad</property>
                                                <property name="maximum_size"></property>
                                                <property name="minimum_size"></property>
                                                <property name="name">m_Pad2PadTestCtrl</property>
                                                <property name="permission">public</property>
                                                <property name="pos"></property>
                                                <property name="size"></property>
                                                <property name="style"></property>
                                                <property name="subclass"></property>
                                                <property name="tooltip">Include tests for clearances between pad to pads</property>
                                                <property name="window_extra_style"></property>
                                                <property name="window_name"></property>
                                                <property name="window_style"></property>
                                                <event name="OnChar"></event>
                                                <event name="OnCheckBox"></event>
                                                <event name="OnEnterWindow"></event>
                                                <event name="OnEraseBackground"></event>
                                                <event name="OnKeyDown"></event>
                                                <event name="OnKeyUp"></event>
                                                <event name="OnKillFocus"></event>
                                                <event name="OnLeaveWindow"></event>
                                                <event name="OnLeftDClick"></event>
                                                <event name="OnLeftDown"></event>
                                                <event name="OnLeftUp"></event>
                                                <event name="OnMiddleDClick"></event>
                                                <event name="OnMiddleDown"></event>
                                                <event name="OnMiddleUp"></event>
                                                <event name="OnMotion"></event>
                                                <event name="OnMouseEvents"></event>
                                                <event name="OnMouseWheel"></event>
                                                <event name="OnPaint"></event>
                                                <event name="OnRightDClick"></event>
                                                <event name="OnRightDown"></event>
                                                <event name="OnRightUp"></event>
                                                <event name="OnSetFocus"></event>
                                                <event name="OnSize"></event>
                                                <event name="OnUpdateUI"></event>
                                            </object>
                                        </object>
                                        <object class="sizeritem" expanded="1">
                                            <property name="border">5</property>
                                            <property name="flag">wxALL</property>
                                            <property name="proportion">0</property>
                                            <object class="wxCheckBox" expanded="1">
                                    <object class="wxStaticText" expanded="1">
                                        <property name="bg"></property>
                                                <property name="checked">0</property>
                                        <property name="context_help"></property>
                                        <property name="enabled">1</property>
                                        <property name="fg"></property>
                                        <property name="font"></property>
                                        <property name="hidden">0</property>
                                        <property name="id">wxID_ANY</property>
                                                <property name="label">Zones</property>
                                        <property name="label">Messages:</property>
                                        <property name="maximum_size"></property>
                                        <property name="minimum_size"></property>
                                                <property name="name">m_ZonesTestCtrl</property>
                                                <property name="permission">public</property>
                                        <property name="name">m_staticText6</property>
                                        <property name="permission">protected</property>
                                        <property name="pos"></property>
                                        <property name="size"></property>
                                        <property name="style"></property>
                                        <property name="subclass"></property>
                                                <property name="tooltip">Include zones in clearance or unconnected tests</property>
                                        <property name="tooltip"></property>
                                        <property name="window_extra_style"></property>
                                        <property name="window_name"></property>
                                        <property name="window_style"></property>
                                        <property name="wrap">-1</property>
                                        <event name="OnChar"></event>
                                                <event name="OnCheckBox"></event>
                                        <event name="OnEnterWindow"></event>
                                        <event name="OnEraseBackground"></event>
                                        <event name="OnKeyDown"></event>
@@ -840,32 +786,31 @@
                                </object>
                                <object class="sizeritem" expanded="1">
                                    <property name="border">5</property>
                                            <property name="flag">wxALL</property>
                                            <property name="proportion">0</property>
                                            <object class="wxCheckBox" expanded="1">
                                    <property name="flag">wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND</property>
                                    <property name="proportion">1</property>
                                    <object class="wxTextCtrl" expanded="1">
                                        <property name="bg"></property>
                                                <property name="checked">1</property>
                                        <property name="context_help"></property>
                                        <property name="enabled">1</property>
                                        <property name="fg"></property>
                                        <property name="font"></property>
                                        <property name="hidden">0</property>
                                        <property name="id">wxID_ANY</property>
                                                <property name="label">Unconnected pads</property>
                                        <property name="maximum_size"></property>
                                                <property name="minimum_size"></property>
                                                <property name="name">m_UnconnectedTestCtrl</property>
                                                <property name="permission">public</property>
                                        <property name="maxlength">0</property>
                                        <property name="minimum_size">160,-1</property>
                                        <property name="name">m_Messages</property>
                                        <property name="permission">protected</property>
                                        <property name="pos"></property>
                                        <property name="size"></property>
                                                <property name="style"></property>
                                        <property name="style">wxHSCROLL|wxTE_MULTILINE|wxTE_READONLY</property>
                                        <property name="subclass"></property>
                                                <property name="tooltip">Find unconnected pads</property>
                                        <property name="tooltip"></property>
                                        <property name="value"></property>
                                        <property name="window_extra_style"></property>
                                        <property name="window_name"></property>
                                        <property name="window_style"></property>
                                        <event name="OnChar"></event>
                                                <event name="OnCheckBox"></event>
                                        <event name="OnEnterWindow"></event>
                                        <event name="OnEraseBackground"></event>
                                        <event name="OnKeyDown"></event>
@@ -887,13 +832,15 @@
                                        <event name="OnRightUp"></event>
                                        <event name="OnSetFocus"></event>
                                        <event name="OnSize"></event>
                                        <event name="OnText"></event>
                                        <event name="OnTextEnter"></event>
                                        <event name="OnTextMaxLen"></event>
                                        <event name="OnTextURL"></event>
                                        <event name="OnUpdateUI"></event>
                                    </object>
                                </object>
                            </object>
                        </object>
                            </object>
                        </object>
                        <object class="sizeritem" expanded="1">
                            <property name="border">5</property>
                            <property name="flag">wxALIGN_CENTER_VERTICAL</property>
Loading