From 514c63c7755031247251f1497f8c75186240b366 Mon Sep 17 00:00:00 2001 From: dickelbeck Date: Tue, 27 Nov 2007 01:34:35 +0000 Subject: [PATCH] DRC rework start --- change_log.txt | 6 + pcbnew/dialog_drc.cpp | 524 +++++-- pcbnew/dialog_drc.h | 105 +- pcbnew/dialog_drc.pjd | 1826 ++++++++++++----------- pcbnew/dialog_graphic_items_options.cpp | 10 +- pcbnew/dialog_graphic_items_options.h | 10 +- pcbnew/dialog_graphic_items_options.pjd | 365 ++++- pcbnew/drc.cpp | 412 ++--- pcbnew/drc_stuff.h | 214 +++ 9 files changed, 2185 insertions(+), 1287 deletions(-) create mode 100644 pcbnew/drc_stuff.h diff --git a/change_log.txt b/change_log.txt index 5e2f83cbef..34efeeb22d 100644 --- a/change_log.txt +++ b/change_log.txt @@ -4,6 +4,12 @@ Started 2007-June-11 Please add newer entries at the top, list the date and your name with email address. +2007-Nov-26 UPDATE Dick Hollenbeck +================================================================================ ++pcbnew + DRC code and dialog rework start. This breaks DRC, until I get out the + other end of the tunnel. + 2007-Nov-24 UPDATE Dick Hollenbeck ================================================================================ diff --git a/pcbnew/dialog_drc.cpp b/pcbnew/dialog_drc.cpp index 16c18cf1ba..4cff970561 100644 --- a/pcbnew/dialog_drc.cpp +++ b/pcbnew/dialog_drc.cpp @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// // Name: dialog_drc.cpp -// Purpose: +// Purpose: // Author: jean-pierre Charras -// Modified by: +// Modified by: // Created: 27/02/2006 20:42:00 -// RCS-ID: +// RCS-ID: // Copyright: License GNU -// Licence: +// Licence: ///////////////////////////////////////////////////////////////////////////// // Generated by DialogBlocks (unregistered), 27/02/2006 20:42:00 @@ -26,6 +26,10 @@ #include "wx/wx.h" #endif + +#include +#include + ////@begin includes ////@end includes @@ -34,6 +38,95 @@ ////@begin XPM images ////@end XPM images + + + +DRC_LIST gList; // gets moved into DRC_TESTER later. + + +/** + * Class DRCLISTBOX + * is used to display a DRC_LIST, which contains DRC_ITEMs. + */ +class DRCLISTBOX : public wxHtmlListBox +{ +private: + DRC_LIST* m_List; ///< wxWidgets does not own the list items, we do + +public: + DRCLISTBOX( wxWindow* parent, wxWindowID id = wxID_ANY, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + long style = 0, const wxString& name = wxVListBoxNameStr) + : wxHtmlListBox( parent, id, pos, size, style, name ) + { + } + + + /** + * Function SetList + * sets the DRC_LIST for this listbox. However no ownership is + * given, the caller still owns the list and is responsible + * for deleting it. + * @param aList The DRC_LIST containing the DRC_ITEMs which will be + * displayed in the wxHtmlListBox + */ + void SetList( DRC_LIST* aList ) + { + m_List = aList; + SetItemCount( aList->size() ); + } + + + /** + * Function OnGetItem + * returns the html text associated with the given index 'n'. + * @param n An index into the list. + * @return wxString - the simply html text to show in the listbox. + */ + wxString OnGetItem( size_t n ) const + { + if( m_List ) + return (*m_List)[n].ShowHtml(); + else + return wxString(); + } + + + /** + * Function OnGetItem + * returns the html text associated with the given index 'n'. + * @param n An index into the list. + * @return wxString - the simply html text to show in the listbox. + */ + wxString OnGetItemMarkup( size_t n ) const + { + if( m_List ) + return (*m_List)[n].ShowHtml(); + else + return wxString(); + } + + + /** + * Function DeleteElement + * will delete one of the items in the list. + * @param ndx The index into the list to delete. + */ + void DeleteElmenent( int ndx ) + { + if( m_List ) + { + if( (size_t) ndx < m_List->size() ) + { + m_List->erase( m_List->begin()+ndx ); + SetItemCount( m_List->size() ); + } + } + } +}; + + + /*! * WinEDA_DrcFrame type definition */ @@ -47,22 +140,29 @@ IMPLEMENT_DYNAMIC_CLASS( WinEDA_DrcFrame, wxDialog ) BEGIN_EVENT_TABLE( WinEDA_DrcFrame, wxDialog ) ////@begin WinEDA_DrcFrame event table entries - EVT_BUTTON( ID_DRC_RUN, WinEDA_DrcFrame::OnDrcRunClick ) + EVT_INIT_DIALOG( WinEDA_DrcFrame::OnInitDialog ) - EVT_BUTTON( ID_STOP_CONTROL_DRC, WinEDA_DrcFrame::OnStopControlDrcClick ) - - EVT_BUTTON( ID_ERASE_DRC_MARKERS, WinEDA_DrcFrame::OnEraseDrcMarkersClick ) - - EVT_BUTTON( ID_LIST_UNCONNECTED_PADS, WinEDA_DrcFrame::OnListUnconnectedPadsClick ) + EVT_CHECKBOX( ID_CHECKBOX, WinEDA_DrcFrame::OnReportCheckBoxClicked ) EVT_BUTTON( ID_BUTTON_BROWSE_RPT_FILE, WinEDA_DrcFrame::OnButtonBrowseRptFileClick ) - EVT_BUTTON( wxID_OK, WinEDA_DrcFrame::OnOkClick ) + EVT_BUTTON( ID_STARTDRC, WinEDA_DrcFrame::OnStartdrcClick ) + + EVT_BUTTON( ID_LIST_UNCONNECTED, WinEDA_DrcFrame::OnListUnconnectedClick ) + + EVT_BUTTON( ID_DELETE_ALL, WinEDA_DrcFrame::OnDeleteAllClick ) EVT_BUTTON( wxID_CANCEL, WinEDA_DrcFrame::OnCancelClick ) + EVT_BUTTON( wxID_OK, WinEDA_DrcFrame::OnOkClick ) + ////@end WinEDA_DrcFrame event table entries + + // outside bracket: DialogBlocks does not know about the listbox events on a custom list box. + EVT_LISTBOX( ID_CLEARANCE_LIST, WinEDA_DrcFrame::OnMarkerSelectionEvent) + EVT_LISTBOX( ID_UNCONNECTED_LIST, WinEDA_DrcFrame::OnUnconnectedSelectionEvent) + END_EVENT_TABLE() /*! @@ -101,27 +201,43 @@ bool WinEDA_DrcFrame::Create( wxWindow* parent, wxWindowID id, const wxString& c m_CommandSizer = NULL; m_ClearenceTitle = NULL; m_SetClearance = NULL; + m_CreateRptCtrl = NULL; + m_RptFilenameCtrl = NULL; + m_BrowseButton = NULL; m_Pad2PadTestCtrl = NULL; m_UnconnectedTestCtrl = NULL; m_ZonesTestCtrl = NULL; - m_CreateRptCtrl = NULL; - m_RptFilenameCtrl = NULL; - m_logWindow = NULL; - Line = NULL; + m_DeleteCurrentMarkerButton = NULL; + m_ClearanceListBox = NULL; + m_UnconnectedListBox = NULL; StdDialogButtonSizer = NULL; ////@end WinEDA_DrcFrame member initialisation + ////@begin WinEDA_DrcFrame creation SetExtraStyle(wxWS_EX_BLOCK_EVENTS); wxDialog::Create( parent, id, caption, pos, size, style ); CreateControls(); - if( GetSizer() ) + if (GetSizer()) { GetSizer()->SetSizeHints(this); } Centre(); ////@end WinEDA_DrcFrame creation + + + DRC_ITEM a( 2, wxString( wxT("A item") ), wxString( wxT("B item") ), + wxPoint(12000,3000), wxPoint(13000,3000)); + + gList.push_back( a ); + gList.push_back( a ); + gList.push_back( a ); + gList.push_back( a ); + + m_ClearanceListBox->SetList( &gList ); + m_UnconnectedListBox->SetList( &gList ); + return true; } @@ -130,11 +246,11 @@ bool WinEDA_DrcFrame::Create( wxWindow* parent, wxWindowID id, const wxString& c */ void WinEDA_DrcFrame::CreateControls() -{ +{ SetFont( *g_DialogFont ); - + ////@begin WinEDA_DrcFrame content construction - // Generated by DialogBlocks, 13/11/2007 16:40:34 (unregistered) + // Generated by DialogBlocks, Mon 26 Nov 2007 19:22:56 CST (unregistered) WinEDA_DrcFrame* itemDialog1 = this; @@ -145,113 +261,144 @@ void WinEDA_DrcFrame::CreateControls() m_MainSizer->Add(m_CommandSizer, 0, wxGROW|wxALL, 5); wxStaticBox* itemStaticBoxSizer4Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Options")); - wxStaticBoxSizer* itemStaticBoxSizer4 = new wxStaticBoxSizer(itemStaticBoxSizer4Static, wxVERTICAL); - m_CommandSizer->Add(itemStaticBoxSizer4, 0, wxALIGN_TOP|wxLEFT|wxTOP|wxBOTTOM, 5); + wxStaticBoxSizer* itemStaticBoxSizer4 = new wxStaticBoxSizer(itemStaticBoxSizer4Static, wxHORIZONTAL); + m_CommandSizer->Add(itemStaticBoxSizer4, 20, wxGROW|wxTOP|wxBOTTOM, 8); - m_ClearenceTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Clearance"), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticBoxSizer4->Add(m_ClearenceTitle, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); + wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxVERTICAL); + itemStaticBoxSizer4->Add(itemBoxSizer5, 2, wxGROW|wxALL, 5); - m_SetClearance = new wxTextCtrl( itemDialog1, ID_TEXTCTRL_CLEARANCE, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticBoxSizer4->Add(m_SetClearance, 0, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 5); + wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL); + itemBoxSizer5->Add(itemBoxSizer6, 0, wxALIGN_LEFT|wxALL, 5); - itemStaticBoxSizer4->Add(5, 5, 0, wxGROW|wxALL, 5); + m_ClearenceTitle = new wxStaticText( itemDialog1, wxID_STATIC, _("Clearance"), wxDefaultPosition, wxDefaultSize, wxFULL_REPAINT_ON_RESIZE ); + itemBoxSizer6->Add(m_ClearenceTitle, 0, wxALIGN_TOP|wxLEFT|wxRIGHT|wxTOP|wxADJUST_MINSIZE, 5); - wxStaticBox* itemStaticBoxSizer8Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Test Drc:")); - wxStaticBoxSizer* itemStaticBoxSizer8 = new wxStaticBoxSizer(itemStaticBoxSizer8Static, wxVERTICAL); - itemStaticBoxSizer4->Add(itemStaticBoxSizer8, 0, wxGROW|wxALL, 5); + itemBoxSizer6->Add(5, 5, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 10); - m_Pad2PadTestCtrl = new wxCheckBox( itemDialog1, ID_CHECKBOX_PAD2PAD, _("Include pad to pad test"), wxDefaultPosition, wxDefaultSize, 0 ); - m_Pad2PadTestCtrl->SetValue(false); - itemStaticBoxSizer8->Add(m_Pad2PadTestCtrl, 0, wxGROW|wxALL, 5); + m_SetClearance = new wxTextCtrl( itemDialog1, ID_TEXTCTRL1, _T(""), wxDefaultPosition, wxSize(144, -1), 0 ); + if (WinEDA_DrcFrame::ShowToolTips()) + m_SetClearance->SetToolTip(_("In the clearance units, enter the clearance distance")); + itemBoxSizer6->Add(m_SetClearance, 1, wxALIGN_TOP|wxLEFT|wxRIGHT|wxBOTTOM|wxADJUST_MINSIZE, 5); - m_UnconnectedTestCtrl = new wxCheckBox( itemDialog1, ID_CHECKBOX_UNCONNECTED, _("Include unconnected"), wxDefaultPosition, wxDefaultSize, 0 ); - m_UnconnectedTestCtrl->SetValue(false); - itemStaticBoxSizer8->Add(m_UnconnectedTestCtrl, 0, wxGROW|wxALL, 5); + wxStaticBox* itemStaticBoxSizer10Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Create Report File")); + wxStaticBoxSizer* itemStaticBoxSizer10 = new wxStaticBoxSizer(itemStaticBoxSizer10Static, wxHORIZONTAL); + itemBoxSizer5->Add(itemStaticBoxSizer10, 1, wxGROW|wxALL, 5); - m_ZonesTestCtrl = new wxCheckBox( itemDialog1, ID_CHECKBOX_TEST_ZONES, _("Include zones"), wxDefaultPosition, wxDefaultSize, 0 ); - m_ZonesTestCtrl->SetValue(false); - itemStaticBoxSizer8->Add(m_ZonesTestCtrl, 0, wxGROW|wxALL, 5); - - m_CreateRptCtrl = new wxCheckBox( itemDialog1, ID_CHECKBOX_CREATE_FILE, _("Create Report file"), wxDefaultPosition, wxDefaultSize, 0 ); + m_CreateRptCtrl = new wxCheckBox( itemDialog1, ID_CHECKBOX, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); m_CreateRptCtrl->SetValue(false); - itemStaticBoxSizer8->Add(m_CreateRptCtrl, 0, wxGROW|wxALL, 5); + if (WinEDA_DrcFrame::ShowToolTips()) + m_CreateRptCtrl->SetToolTip(_("Enable writing report to this file")); + itemStaticBoxSizer10->Add(m_CreateRptCtrl, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); - m_CommandSizer->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5); + m_RptFilenameCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL3, _T(""), wxDefaultPosition, wxSize(250, -1), 0 ); + if (WinEDA_DrcFrame::ShowToolTips()) + m_RptFilenameCtrl->SetToolTip(_("Enter the report filename")); + itemStaticBoxSizer10->Add(m_RptFilenameCtrl, 2, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5); - wxBoxSizer* itemBoxSizer14 = new wxBoxSizer(wxVERTICAL); - m_CommandSizer->Add(itemBoxSizer14, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5); + m_BrowseButton = new wxButton( itemDialog1, ID_BUTTON_BROWSE_RPT_FILE, _("..."), wxDefaultPosition, wxSize(35, -1), 0 ); + if (WinEDA_DrcFrame::ShowToolTips()) + m_BrowseButton->SetToolTip(_("Pick a filename interactively")); + itemStaticBoxSizer10->Add(m_BrowseButton, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM|wxADJUST_MINSIZE, 5); - wxBoxSizer* itemBoxSizer15 = new wxBoxSizer(wxHORIZONTAL); - itemBoxSizer14->Add(itemBoxSizer15, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxTOP, 5); + wxStaticBox* itemStaticBoxSizer14Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Include Tests For:")); + wxStaticBoxSizer* itemStaticBoxSizer14 = new wxStaticBoxSizer(itemStaticBoxSizer14Static, wxVERTICAL); + itemStaticBoxSizer4->Add(itemStaticBoxSizer14, 0, wxGROW|wxALL, 5); - wxBoxSizer* itemBoxSizer16 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer15->Add(itemBoxSizer16, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + m_Pad2PadTestCtrl = new wxCheckBox( itemDialog1, ID_CHECKBOX2, _("Clearances"), wxDefaultPosition, wxDefaultSize, 0 ); + m_Pad2PadTestCtrl->SetValue(false); + if (WinEDA_DrcFrame::ShowToolTips()) + m_Pad2PadTestCtrl->SetToolTip(_("Test pad to pad, pad to track, and track to track clearances")); + itemStaticBoxSizer14->Add(m_Pad2PadTestCtrl, 0, wxGROW|wxALL, 5); - wxButton* itemButton17 = new wxButton( itemDialog1, ID_DRC_RUN, _("Test Drc"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton17->SetForegroundColour(wxColour(202, 0, 0)); - itemBoxSizer16->Add(itemButton17, 0, wxGROW|wxALL, 5); + m_UnconnectedTestCtrl = new wxCheckBox( itemDialog1, ID_CHECKBOX3, _("Unconnected"), wxDefaultPosition, wxDefaultSize, 0 ); + m_UnconnectedTestCtrl->SetValue(false); + if (WinEDA_DrcFrame::ShowToolTips()) + m_UnconnectedTestCtrl->SetToolTip(_("Find unconnected pads and tracks")); + itemStaticBoxSizer14->Add(m_UnconnectedTestCtrl, 0, wxGROW|wxALL, 5); - wxButton* itemButton18 = new wxButton( itemDialog1, ID_STOP_CONTROL_DRC, _("Stop Drc"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton18->SetForegroundColour(wxColour(0, 128, 128)); - itemBoxSizer16->Add(itemButton18, 0, wxGROW|wxALL, 5); + m_ZonesTestCtrl = new wxCheckBox( itemDialog1, ID_CHECKBOX7, _("Zones"), wxDefaultPosition, wxDefaultSize, 0 ); + m_ZonesTestCtrl->SetValue(false); + if (WinEDA_DrcFrame::ShowToolTips()) + m_ZonesTestCtrl->SetToolTip(_("Include zones in clearance or unconnected tests")); + itemStaticBoxSizer14->Add(m_ZonesTestCtrl, 0, wxGROW|wxALL, 5); - wxBoxSizer* itemBoxSizer19 = new wxBoxSizer(wxVERTICAL); - itemBoxSizer15->Add(itemBoxSizer19, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); + wxBoxSizer* itemBoxSizer18 = new wxBoxSizer(wxVERTICAL); + m_CommandSizer->Add(itemBoxSizer18, 0, wxALIGN_TOP|wxALL, 5); - wxButton* itemButton20 = new wxButton( itemDialog1, ID_ERASE_DRC_MARKERS, _("Del Markers"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton20->SetForegroundColour(wxColour(0, 128, 0)); - itemBoxSizer19->Add(itemButton20, 0, wxGROW|wxALL, 5); + wxButton* itemButton19 = new wxButton( itemDialog1, ID_STARTDRC, _("Start DRC"), wxDefaultPosition, wxDefaultSize, 0 ); + if (WinEDA_DrcFrame::ShowToolTips()) + itemButton19->SetToolTip(_("Start the Design Rule Checker")); + itemButton19->SetForegroundColour(wxColour(202, 0, 0)); + itemBoxSizer18->Add(itemButton19, 0, wxGROW|wxALL, 5); - wxButton* itemButton21 = new wxButton( itemDialog1, ID_LIST_UNCONNECTED_PADS, _("List Unconn"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton21->SetForegroundColour(wxColour(0, 0, 255)); - itemBoxSizer19->Add(itemButton21, 0, wxGROW|wxALL, 5); + wxButton* itemButton20 = new wxButton( itemDialog1, ID_LIST_UNCONNECTED, _("List Unconnected"), wxDefaultPosition, wxDefaultSize, 0 ); + if (WinEDA_DrcFrame::ShowToolTips()) + itemButton20->SetToolTip(_("List unconnected pads or tracks")); + itemButton20->SetForegroundColour(wxColour(0, 0, 255)); + itemBoxSizer18->Add(itemButton20, 0, wxGROW|wxALL, 5); - wxStaticBox* itemStaticBoxSizer22Static = new wxStaticBox(itemDialog1, wxID_ANY, _("Report File")); - wxStaticBoxSizer* itemStaticBoxSizer22 = new wxStaticBoxSizer(itemStaticBoxSizer22Static, wxVERTICAL); - itemBoxSizer14->Add(itemStaticBoxSizer22, 0, wxGROW|wxLEFT|wxRIGHT|wxTOP, 5); + wxButton* itemButton21 = new wxButton( itemDialog1, ID_DELETE_ALL, _("Delete All Markers"), wxDefaultPosition, wxDefaultSize, 0 ); + if (WinEDA_DrcFrame::ShowToolTips()) + itemButton21->SetToolTip(_("Delete every marker")); + itemButton21->SetForegroundColour(wxColour(0, 128, 0)); + itemBoxSizer18->Add(itemButton21, 0, wxGROW|wxALL, 5); - wxButton* itemButton23 = new wxButton( itemDialog1, ID_BUTTON_BROWSE_RPT_FILE, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton23->SetForegroundColour(wxColour(0, 128, 128)); - itemStaticBoxSizer22->Add(itemButton23, 0, wxALIGN_LEFT|wxALL, 5); + m_DeleteCurrentMarkerButton = new wxButton( itemDialog1, ID_DELETE_ONE, _("Delete Current Marker"), wxDefaultPosition, wxDefaultSize, 0 ); + if (WinEDA_DrcFrame::ShowToolTips()) + m_DeleteCurrentMarkerButton->SetToolTip(_("Delete the marker selected in the listBox below")); + m_DeleteCurrentMarkerButton->Enable(false); + itemBoxSizer18->Add(m_DeleteCurrentMarkerButton, 0, wxGROW|wxALL, 5); - m_RptFilenameCtrl = new wxTextCtrl( itemDialog1, ID_TEXTCTRL_GET_RPT_FILENAME, _T(""), wxDefaultPosition, wxDefaultSize, 0 ); - itemStaticBoxSizer22->Add(m_RptFilenameCtrl, 0, wxGROW|wxALL, 5); + wxStaticText* itemStaticText23 = new wxStaticText( itemDialog1, wxID_STATIC, _("Error Messages:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_MainSizer->Add(itemStaticText23, 0, wxGROW|wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 10); - wxStaticText* itemStaticText25 = new wxStaticText( itemDialog1, wxID_STATIC, _("Messages:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_MainSizer->Add(itemStaticText25, 0, wxGROW|wxLEFT|wxRIGHT|wxADJUST_MINSIZE, 10); + wxNotebook* itemNotebook24 = new wxNotebook( itemDialog1, ID_NOTEBOOK1, wxDefaultPosition, wxDefaultSize, wxNB_DEFAULT|wxRAISED_BORDER ); +#if !wxCHECK_VERSION(2,5,2) + wxNotebookSizer* itemNotebook24Sizer = new wxNotebookSizer(itemNotebook24); +#endif - m_logWindow = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, _T(""), wxDefaultPosition, wxSize(-1, 300), wxTE_MULTILINE|wxTE_READONLY|wxHSCROLL|wxFULL_REPAINT_ON_RESIZE ); - m_MainSizer->Add(m_logWindow, 1, wxGROW|wxLEFT|wxRIGHT|wxBOTTOM, 10); + m_ClearanceListBox = new DRCLISTBOX( itemNotebook24, ID_CLEARANCE_LIST, wxDefaultPosition, wxSize(100, 300), wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL ); + if (WinEDA_DrcFrame::ShowToolTips()) + m_ClearanceListBox->SetToolTip(_("MARKERs on the PCB, double click on any MARKER to go there in PCB")); - Line = new wxStaticLine( itemDialog1, ID_STATICLINE, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - m_MainSizer->Add(Line, 0, wxGROW|wxLEFT|wxRIGHT, 5); + itemNotebook24->AddPage(m_ClearanceListBox, _("Distance Problem Markers")); + + m_UnconnectedListBox = new DRCLISTBOX( itemNotebook24, ID_UNCONNECTED_LIST, wxDefaultPosition, wxSize(100, 100), wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL ); + if (WinEDA_DrcFrame::ShowToolTips()) + m_UnconnectedListBox->SetToolTip(_("Pad to pad, pad to track, and track to track clearance problems")); + + itemNotebook24->AddPage(m_UnconnectedListBox, _("Unconnected")); + +#if !wxCHECK_VERSION(2,5,2) + m_MainSizer->Add(itemNotebook24Sizer, 5, wxGROW|wxALL, 5); +#else + m_MainSizer->Add(itemNotebook24, 5, wxGROW|wxALL, 5); +#endif StdDialogButtonSizer = new wxStdDialogButtonSizer; m_MainSizer->Add(StdDialogButtonSizer, 0, wxGROW|wxALL, 10); - wxButton* itemButton29 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton29->SetForegroundColour(wxColour(200, 0, 0)); - StdDialogButtonSizer->AddButton(itemButton29); + wxButton* itemButton28 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); + itemButton28->SetForegroundColour(wxColour(0, 0, 255)); + StdDialogButtonSizer->AddButton(itemButton28); - wxButton* itemButton30 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); - itemButton30->SetForegroundColour(wxColour(0, 0, 255)); - StdDialogButtonSizer->AddButton(itemButton30); + wxButton* itemButton29 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 ); + itemButton29->SetDefault(); + StdDialogButtonSizer->AddButton(itemButton29); StdDialogButtonSizer->Realize(); // Set validators + m_CreateRptCtrl->SetValidator( wxGenericValidator(& s_CreateRptFileOpt) ); m_Pad2PadTestCtrl->SetValidator( wxGenericValidator(& s_Pad2PadTestOpt) ); m_UnconnectedTestCtrl->SetValidator( wxGenericValidator(& s_UnconnectedTestOpt) ); m_ZonesTestCtrl->SetValidator( wxGenericValidator(& s_ZonesTestOpt) ); - m_CreateRptCtrl->SetValidator( wxGenericValidator(& s_CreateRptFileOpt) ); + // Connect events and objects + m_ClearanceListBox->Connect(ID_CLEARANCE_LIST, wxEVT_LEFT_DCLICK, wxMouseEventHandler(WinEDA_DrcFrame::OnLeftDClickClearance), NULL, this); + m_ClearanceListBox->Connect(ID_CLEARANCE_LIST, wxEVT_RIGHT_UP, wxMouseEventHandler(WinEDA_DrcFrame::OnRightUpClearance), NULL, this); + m_UnconnectedListBox->Connect(ID_UNCONNECTED_LIST, wxEVT_LEFT_DCLICK, wxMouseEventHandler(WinEDA_DrcFrame::OnLeftDClickUnconnected), NULL, this); + m_UnconnectedListBox->Connect(ID_UNCONNECTED_LIST, wxEVT_RIGHT_UP, wxMouseEventHandler(WinEDA_DrcFrame::OnRightUpUnconnected), NULL, this); ////@end WinEDA_DrcFrame content construction - - AddUnitSymbol(*m_ClearenceTitle); - m_RptFilenameCtrl->SetValue(s_RptFilename); - - - // capture the text control's events, all of them. -// m_logWindow->PushEventHandler( this ); } /*! @@ -292,7 +439,7 @@ wxIcon WinEDA_DrcFrame::GetIconResource( const wxString& name ) * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DRC_RUN */ -void WinEDA_DrcFrame::OnDrcRunClick( wxCommandEvent& event ) +void WinEDA_DrcFrame::OnStartdrcClick( wxCommandEvent& event ) { TestDrc(event); } @@ -301,6 +448,7 @@ void WinEDA_DrcFrame::OnDrcRunClick( wxCommandEvent& event ) * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_STOP_CONTROL_DRC */ +/* void WinEDA_DrcFrame::OnStopControlDrcClick( wxCommandEvent& event ) { if( DrcInProgress ) @@ -308,12 +456,13 @@ void WinEDA_DrcFrame::OnStopControlDrcClick( wxCommandEvent& event ) else wxBell(); } +*/ /*! * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ERASE_DRC_MARKERS */ -void WinEDA_DrcFrame::OnEraseDrcMarkersClick( wxCommandEvent& event ) +void WinEDA_DrcFrame::OnDeleteAllClick( wxCommandEvent& event ) { DelDRCMarkers(event); } @@ -322,7 +471,7 @@ void WinEDA_DrcFrame::OnEraseDrcMarkersClick( wxCommandEvent& event ) * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LIST_UNCONNECTED_PADS */ -void WinEDA_DrcFrame::OnListUnconnectedPadsClick( wxCommandEvent& event ) +void WinEDA_DrcFrame::OnListUnconnectedClick( wxCommandEvent& event ) { ListUnconnectedPads(event); } @@ -333,7 +482,9 @@ void WinEDA_DrcFrame::OnListUnconnectedPadsClick( wxCommandEvent& event ) void WinEDA_DrcFrame::OnButtonBrowseRptFileClick( wxCommandEvent& event ) { -wxString FileName, Mask(wxT("*")), Ext(wxT(".rpt")); + wxString FileName; + wxString Mask(wxT("*")); + wxString Ext(wxT(".rpt")); FileName = m_Parent->m_CurrentScreen->m_FileName; ChangeFileNameExt(FileName, wxT("-drc") + Ext); @@ -356,53 +507,6 @@ wxString FileName, Mask(wxT("*")), Ext(wxT(".rpt")); } -/*! - * Override the event handler so we can direct the m_lowWindows events here initially - */ - -bool WinEDA_DrcFrame::ProcessEvent( wxEvent& event ) -{ - int id = event.GetId(); - - if( id == ID_TEXTCTRL ) - { - -//printf("ID_TEXTCTRL\n"); - - // this does not work yet - - if( event.GetEventType() == wxMOUSE_BTN_LEFT ) - { - wxMouseEvent& mouseEvent = (wxMouseEvent&) event; - - if( mouseEvent.LeftUp() ) - { - wxTextCoord col; - wxTextCoord row; - - wxPoint pos = mouseEvent.GetPosition(); - - if( wxTE_HT_UNKNOWN != m_logWindow->HitTest( pos, &col, &row ) ) - { - wxString text = m_logWindow->GetLineText( row ); - } - } - } - - return false; - } - - else - { - bool ret; -// printf("ProcessEvent(%d)\n", id); - ret = static_cast(this)->wxDialog::ProcessEvent( event ); -// printf("~ProcessEvent\n"); - return ret; - } -} - - /*! * wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK */ @@ -426,5 +530,141 @@ void WinEDA_DrcFrame::OnCancelClick( wxCommandEvent& event ) ////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_DrcFrame. // Before editing this code, remove the block markers. event.Skip(); -////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_DrcFrame. +////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in WinEDA_DrcFrame. } + + +/*! + * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX1 + */ + +void WinEDA_DrcFrame::OnReportCheckBoxClicked( wxCommandEvent& event ) +{ + // @todo: see if the checkbox is selected, if so, enable the report name field + // and browse button, else disable them. + if( m_CreateRptCtrl->IsChecked() ) + { + m_RptFilenameCtrl->Enable(true); + m_BrowseButton->Enable(true); + } + else + { + m_RptFilenameCtrl->Enable(false); + m_BrowseButton->Enable(false); + } + event.Skip(); +} + + +/*! + * wxEVT_INIT_DIALOG event handler for ID_DIALOG + */ + +void WinEDA_DrcFrame::OnInitDialog( wxInitDialogEvent& event ) +{ + wxCommandEvent junk; + + // Set the initial status of the browse button and the text + // field for report name + OnReportCheckBoxClicked( junk ); + + AddUnitSymbol(*m_ClearenceTitle); + m_RptFilenameCtrl->SetValue(s_RptFilename); + + m_SetClearance->SetFocus(); + + // deselect the existing text, seems SetFocus() wants to emulate + // Microsoft, which is not desireable here. + m_SetClearance->SetSelection(0,0); + + event.Skip(); +} + + +/*! + * wxEVT_LEFT_DCLICK event handler for ID_CLEARANCE_LIST + */ + +void WinEDA_DrcFrame::OnLeftDClickClearance( wxMouseEvent& event ) +{ + int selection = m_ClearanceListBox->GetSelection(); + + if( selection != wxNOT_FOUND ) + { + printf("get item number %d\n", selection ); + + // Find the selected MARKER in the PCB, position cursor there, + // and close this dialog. + EndModal( 0 ); + } + + event.Skip(); +} + + +/*! + * wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST + */ + +void WinEDA_DrcFrame::OnRightUpUnconnected( wxMouseEvent& event ) +{ + event.Skip(); +} + + +/*! + * wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST + */ + +void WinEDA_DrcFrame::OnRightUpClearance( wxMouseEvent& event ) +{ +////@begin wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST in WinEDA_DrcFrame. + // Before editing this code, remove the block markers. + event.Skip(); +////@end wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST in WinEDA_DrcFrame. +} + + +/*! + * wxEVT_LEFT_DCLICK event handler for ID_UNCONNECTED_LIST + */ + +void WinEDA_DrcFrame::OnLeftDClickUnconnected( wxMouseEvent& event ) +{ + int selection = m_UnconnectedListBox->GetSelection(); + + if( selection != wxNOT_FOUND ) + { + printf("get item number %d\n", selection ); + } + + event.Skip(); +} + + +void WinEDA_DrcFrame::OnMarkerSelectionEvent( wxCommandEvent& event ) +{ + int selection = event.GetSelection(); + + if( selection != wxNOT_FOUND ) + { + // until a MARKER is selected, this button is not enabled. + m_DeleteCurrentMarkerButton->Enable(true); + printf("get Marker number %d\n", selection ); + } + + event.Skip(); +} + +void WinEDA_DrcFrame::OnUnconnectedSelectionEvent( wxCommandEvent& event ) +{ + int selection = event.GetSelection(); + + if( selection != wxNOT_FOUND ) + { + printf("get Unconnected item number %d\n", selection ); + } + + event.Skip(); +} + diff --git a/pcbnew/dialog_drc.h b/pcbnew/dialog_drc.h index 1b7a4cf00d..c1628d470c 100644 --- a/pcbnew/dialog_drc.h +++ b/pcbnew/dialog_drc.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// // Name: dialog_drc.h -// Purpose: +// Purpose: // Author: jean-pierre Charras -// Modified by: +// Modified by: // Created: 27/02/2006 20:42:00 -// RCS-ID: +// RCS-ID: // Copyright: License GNU -// Licence: +// Licence: ///////////////////////////////////////////////////////////////////////////// // Generated by DialogBlocks (unregistered), 27/02/2006 20:42:00 @@ -24,38 +24,41 @@ ////@begin includes #include "wx/valgen.h" -#include "wx/statline.h" +#include "wx/notebook.h" ////@end includes + /*! * Forward declarations */ ////@begin forward declarations class wxBoxSizer; -class wxStaticLine; +class DRCLISTBOX; class wxStdDialogButtonSizer; ////@end forward declarations + /*! * Control identifiers */ ////@begin control identifiers #define ID_DIALOG 10000 -#define ID_TEXTCTRL_CLEARANCE 10002 -#define ID_CHECKBOX_PAD2PAD 10009 -#define ID_CHECKBOX_UNCONNECTED 10008 -#define ID_CHECKBOX_TEST_ZONES 10007 -#define ID_CHECKBOX_CREATE_FILE 10012 -#define ID_DRC_RUN 10003 -#define ID_STOP_CONTROL_DRC 10004 -#define ID_ERASE_DRC_MARKERS 10005 -#define ID_LIST_UNCONNECTED_PADS 10006 -#define ID_BUTTON_BROWSE_RPT_FILE 10011 -#define ID_TEXTCTRL_GET_RPT_FILENAME 10010 -#define ID_TEXTCTRL 10001 -#define ID_STATICLINE 10013 +#define ID_TEXTCTRL1 10002 +#define ID_CHECKBOX 10004 +#define ID_TEXTCTRL3 10014 +#define ID_BUTTON_BROWSE_RPT_FILE 10018 +#define ID_CHECKBOX2 10019 +#define ID_CHECKBOX3 10020 +#define ID_CHECKBOX7 10021 +#define ID_STARTDRC 10006 +#define ID_LIST_UNCONNECTED 10003 +#define ID_DELETE_ALL 10005 +#define ID_DELETE_ONE 10007 +#define ID_NOTEBOOK1 10008 +#define ID_CLEARANCE_LIST 10001 +#define ID_UNCONNECTED_LIST 10009 #define SYMBOL_WINEDA_DRCFRAME_STYLE wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER #define SYMBOL_WINEDA_DRCFRAME_TITLE _("DRC Control") #define SYMBOL_WINEDA_DRCFRAME_IDNAME ID_DIALOG @@ -63,6 +66,8 @@ class wxStdDialogButtonSizer; #define SYMBOL_WINEDA_DRCFRAME_POSITION wxDefaultPosition ////@end control identifiers +#define ID_DRCLISTCTRL 10001 // outside @end control identifiers since DialogBlocks knows not DRCLISTBOX + /*! * Compatibility */ @@ -76,7 +81,7 @@ class wxStdDialogButtonSizer; */ class WinEDA_DrcFrame: public wxDialog -{ +{ DECLARE_DYNAMIC_CLASS( WinEDA_DrcFrame ) DECLARE_EVENT_TABLE() @@ -96,32 +101,44 @@ public: /// Creates the controls and sizers void CreateControls(); - /// Override the event handler so we can direct the m_lowWindows events here initially - virtual bool ProcessEvent( wxEvent& event ); - ////@begin WinEDA_DrcFrame event handler declarations - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DRC_RUN - void OnDrcRunClick( wxCommandEvent& event ); + /// wxEVT_INIT_DIALOG event handler for ID_DIALOG + void OnInitDialog( wxInitDialogEvent& event ); - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_STOP_CONTROL_DRC - void OnStopControlDrcClick( wxCommandEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ERASE_DRC_MARKERS - void OnEraseDrcMarkersClick( wxCommandEvent& event ); - - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LIST_UNCONNECTED_PADS - void OnListUnconnectedPadsClick( wxCommandEvent& event ); + /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX + void OnReportCheckBoxClicked( wxCommandEvent& event ); /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON_BROWSE_RPT_FILE void OnButtonBrowseRptFileClick( wxCommandEvent& event ); - /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK - void OnOkClick( wxCommandEvent& event ); + /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_STARTDRC + void OnStartdrcClick( wxCommandEvent& event ); + + /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_LIST_UNCONNECTED + void OnListUnconnectedClick( wxCommandEvent& event ); + + /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_DELETE_ALL + void OnDeleteAllClick( wxCommandEvent& event ); + + /// wxEVT_LEFT_DCLICK event handler for ID_CLEARANCE_LIST + void OnLeftDClickClearance( wxMouseEvent& event ); + + /// wxEVT_RIGHT_UP event handler for ID_CLEARANCE_LIST + void OnRightUpClearance( wxMouseEvent& event ); + + /// wxEVT_LEFT_DCLICK event handler for ID_UNCONNECTED_LIST + void OnLeftDClickUnconnected( wxMouseEvent& event ); + + /// wxEVT_RIGHT_UP event handler for ID_UNCONNECTED_LIST + void OnRightUpUnconnected( wxMouseEvent& event ); /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL void OnCancelClick( wxCommandEvent& event ); + /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK + void OnOkClick( wxCommandEvent& event ); + ////@end WinEDA_DrcFrame event handler declarations ////@begin WinEDA_DrcFrame member function declarations @@ -133,6 +150,9 @@ public: wxIcon GetIconResource( const wxString& name ); ////@end WinEDA_DrcFrame member function declarations + void OnMarkerSelectionEvent( wxCommandEvent& event ); + void OnUnconnectedSelectionEvent( wxCommandEvent& event ); + /// Should we show tooltips? static bool ShowToolTips(); @@ -145,19 +165,22 @@ public: wxBoxSizer* m_CommandSizer; wxStaticText* m_ClearenceTitle; wxTextCtrl* m_SetClearance; + wxCheckBox* m_CreateRptCtrl; + wxTextCtrl* m_RptFilenameCtrl; + wxButton* m_BrowseButton; wxCheckBox* m_Pad2PadTestCtrl; wxCheckBox* m_UnconnectedTestCtrl; wxCheckBox* m_ZonesTestCtrl; - wxCheckBox* m_CreateRptCtrl; - wxTextCtrl* m_RptFilenameCtrl; - wxTextCtrl* m_logWindow; - wxStaticLine* Line; + wxButton* m_DeleteCurrentMarkerButton; + DRCLISTBOX* m_ClearanceListBox; + DRCLISTBOX* m_UnconnectedListBox; wxStdDialogButtonSizer* StdDialogButtonSizer; ////@end WinEDA_DrcFrame member variables + WinEDA_PcbFrame * m_Parent; wxDC * m_DC; int m_UnconnectedCount; }; -#endif - // _DIALOG_DRC_H_ +#endif // _DIALOG_DRC_H_ + diff --git a/pcbnew/dialog_drc.pjd b/pcbnew/dialog_drc.pjd index 45ad5c08db..79ca7daf91 100644 --- a/pcbnew/dialog_drc.pjd +++ b/pcbnew/dialog_drc.pjd @@ -108,10 +108,12 @@ 0 0 1 + 0 1 1 0 1 + 0 @@ -216,6 +218,7 @@ "" 0 0 + "wxEVT_INIT_DIALOG|OnInitDialog|NONE||WinEDA_DrcFrame" "ID_DIALOG" 10000 "WinEDA_DrcFrame" @@ -246,7 +249,6 @@ 1 0 1 - 0 0 0 0 @@ -276,7 +278,7 @@ 400 300 0 - "m_logWindow" + "" "wxBoxSizer V" "dialog-control-document" @@ -319,7 +321,7 @@ 0 "<Any platform>" - "wxStaticBoxSizer V" + "wxStaticBoxSizer H" "dialog-control-document" "" "sizer" @@ -327,7 +329,7 @@ 1 0 0 - "27/3/2006" + "25/11/2007" "wbStaticBoxSizerProxy" "wxID_ANY" -1 @@ -339,12 +341,12 @@ 0 1 "wxStaticBox" - "Vertical" - "Centre" - "Top" - 0 - 5 - 1 + "Horizontal" + "Expand" + "Expand" + 20 + 8 + 0 0 1 1 @@ -353,171 +355,21 @@ 0 "<Any platform>" - "wxStaticText: wxID_STATIC" + "wxBoxSizer V" "dialog-control-document" "" - "statictext" + "sizer" 0 1 0 0 - "27/3/2006" - "wbStaticTextProxy" - "wxID_STATIC" - 5105 - "wxStaticText" - "wxStaticText" - 1 - 0 - "" - "" - "m_ClearenceTitle" - "Clearance" - -1 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 0 - 0 - 1 - 0 - "" - "" - - - "wxTextCtrl: ID_TEXTCTRL_CLEARANCE" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "27/3/2006" - "wbTextCtrlProxy" - "ID_TEXTCTRL_CLEARANCE" - 10002 - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_SetClearance" - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "30/7/2007" - "wbSpacerProxy" - 5 - 5 - "Expand" - "Centre" - 0 + "25/11/2007" + "wbBoxSizerProxy" + "Vertical" + "" + "Centre" + "Expand" + 2 5 1 1 @@ -527,6 +379,459 @@ 0 0 "<Any platform>" + + "wxBoxSizer H" + "dialog-control-document" + "" + "sizer" + 0 + 1 + 0 + 0 + "25/11/2007" + "wbBoxSizerProxy" + "Horizontal" + "" + "Left" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + "<Any platform>" + + "wxStaticText: wxID_STATIC" + "dialog-control-document" + "" + "statictext" + 0 + 1 + 0 + 0 + "25/11/2007" + "wbStaticTextProxy" + "wxID_STATIC" + 5105 + "" + "wxStaticText" + "wxStaticText" + 0 + 0 + "" + "" + "m_ClearenceTitle" + "Clearance" + -1 + "" + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + "" + -1 + -1 + -1 + -1 + "Expand" + "Top" + 0 + 5 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + "" + "" + + + "Spacer" + "dialog-control-document" + "" + "spacer" + 0 + 1 + 0 + 0 + "26/11/2007" + "wbSpacerProxy" + 5 + 5 + "Centre" + "Centre" + 0 + 10 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + "<Any platform>" + + + "wxTextCtrl: ID_TEXTCTRL1" + "dialog-control-document" + "" + "textctrl" + 0 + 1 + 0 + 0 + "25/11/2007" + "wbTextCtrlProxy" + "ID_TEXTCTRL1" + 10002 + "" + "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" + "m_SetClearance" + "" + 0 + "" + "In the clearance units, enter the clearance distance" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 144 + -1 + "Expand" + "Top" + 1 + 5 + 1 + 1 + 0 + 1 + 0 + 1 + 0 + "" + "" + + + + "wxStaticBoxSizer H" + "dialog-control-document" + "" + "sizer" + 0 + 1 + 0 + 0 + "25/11/2007" + "wbStaticBoxSizerProxy" + "wxID_ANY" + -1 + "Create Report File" + "" + "" + "" + "" + 0 + 1 + "wxStaticBox" + "Horizontal" + "Expand" + "Centre" + 1 + 5 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + "<Any platform>" + + "wxCheckBox: ID_CHECKBOX" + "dialog-control-document" + "" + "checkbox" + 0 + 1 + 0 + 0 + "25/11/2007" + "wbCheckBoxProxy" + "wxEVT_COMMAND_CHECKBOX_CLICKED|OnReportCheckBoxClicked|NONE||WinEDA_DrcFrame" + "ID_CHECKBOX" + 10004 + "" + "wxCheckBox" + "wxCheckBox" + 1 + 0 + "" + "" + "m_CreateRptCtrl" + "" + 0 + "" + "Enable writing report to this file" + "s_CreateRptFileOpt" + "wxGenericValidator(& %VARIABLE%)" + "" + "" + "" + "" + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + -1 + -1 + "Expand" + "Centre" + 0 + 5 + 1 + 0 + 1 + 1 + 0 + 0 + 0 + "" + "" + + + "wxTextCtrl: ID_TEXTCTRL3" + "dialog-control-document" + "" + "textctrl" + 0 + 1 + 0 + 0 + "25/11/2007" + "wbTextCtrlProxy" + "ID_TEXTCTRL3" + 10014 + "" + "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" + "m_RptFilenameCtrl" + "" + 0 + "" + "Enter the report filename" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 250 + -1 + "Expand" + "Centre" + 2 + 5 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + "" + "" + + + "wxButton: ID_BUTTON_BROWSE_RPT_FILE" + "dialog-control-document" + "" + "dialogcontrol" + 0 + 1 + 0 + 0 + "25/11/2007" + "wbButtonProxy" + "wxEVT_COMMAND_BUTTON_CLICKED|OnButtonBrowseRptFileClick|NONE||WinEDA_DrcFrame" + "ID_BUTTON_BROWSE_RPT_FILE" + 10018 + "" + "wxButton" + "wxButton" + 0 + 0 + "" + "" + "m_BrowseButton" + "..." + 0 + "" + "Pick a filename interactively" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + 0 + 1 + "<Any platform>" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + 35 + -1 + "Left" + "Centre" + 0 + 5 + 0 + 1 + 1 + 1 + 0 + 1 + 0 + "" + "" + + "wxStaticBoxSizer V" @@ -537,11 +842,11 @@ 1 0 0 - "30/7/2007" + "25/11/2007" "wbStaticBoxSizerProxy" "wxID_ANY" -1 - "Test Drc:" + "Include Tests For:" "" "" "" @@ -551,7 +856,7 @@ "wxStaticBox" "Vertical" "Expand" - "Centre" + "Expand" 0 5 1 @@ -563,7 +868,7 @@ 0 "<Any platform>" - "wxCheckBox: ID_CHECKBOX_PAD2PAD" + "wxCheckBox: ID_CHECKBOX2" "dialog-control-document" "" "checkbox" @@ -571,10 +876,11 @@ 1 0 0 - "30/7/2007" + "25/11/2007" "wbCheckBoxProxy" - "ID_CHECKBOX_PAD2PAD" - 10009 + "ID_CHECKBOX2" + 10019 + "" "wxCheckBox" "wxCheckBox" 1 @@ -582,10 +888,10 @@ "" "" "m_Pad2PadTestCtrl" - "Include pad to pad test" + "Clearances" 0 "" - "" + "Test pad to pad, pad to track, and track to track clearances" "s_Pad2PadTestOpt" "wxGenericValidator(& %VARIABLE%)" "" @@ -626,7 +932,7 @@ "" - "wxCheckBox: ID_CHECKBOX_UNCONNECTED" + "wxCheckBox: ID_CHECKBOX3" "dialog-control-document" "" "checkbox" @@ -634,10 +940,11 @@ 1 0 0 - "30/7/2007" + "25/11/2007" "wbCheckBoxProxy" - "ID_CHECKBOX_UNCONNECTED" - 10008 + "ID_CHECKBOX3" + 10020 + "" "wxCheckBox" "wxCheckBox" 1 @@ -645,10 +952,10 @@ "" "" "m_UnconnectedTestCtrl" - "Include unconnected" + "Unconnected" 0 "" - "" + "Find unconnected pads and tracks" "s_UnconnectedTestOpt" "wxGenericValidator(& %VARIABLE%)" "" @@ -689,7 +996,7 @@ "" - "wxCheckBox: ID_CHECKBOX_TEST_ZONES" + "wxCheckBox: ID_CHECKBOX7" "dialog-control-document" "" "checkbox" @@ -697,10 +1004,11 @@ 1 0 0 - "30/7/2007" + "25/11/2007" "wbCheckBoxProxy" - "ID_CHECKBOX_TEST_ZONES" - 10007 + "ID_CHECKBOX7" + 10021 + "" "wxCheckBox" "wxCheckBox" 1 @@ -708,10 +1016,10 @@ "" "" "m_ZonesTestCtrl" - "Include zones" + "Zones" 0 "" - "" + "Include zones in clearance or unconnected tests" "s_ZonesTestOpt" "wxGenericValidator(& %VARIABLE%)" "" @@ -751,97 +1059,8 @@ "" "" - - "wxCheckBox: ID_CHECKBOX_CREATE_FILE" - "dialog-control-document" - "" - "checkbox" - 0 - 1 - 0 - 0 - "2/8/2007" - "wbCheckBoxProxy" - "ID_CHECKBOX_CREATE_FILE" - 10012 - "wxCheckBox" - "wxCheckBox" - 1 - 0 - "" - "" - "m_CreateRptCtrl" - "Create Report file" - 0 - "" - "" - "s_CreateRptFileOpt" - "wxGenericValidator(& %VARIABLE%)" - "" - "" - "" - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "Spacer" - "dialog-control-document" - "" - "spacer" - 0 - 1 - 0 - 0 - "13/11/2007" - "wbSpacerProxy" - 5 - 5 - "Centre" - "Centre" - 1 - 5 - 1 - 0 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - "wxBoxSizer V" "dialog-control-document" @@ -856,11 +1075,11 @@ "Vertical" "" "Centre" - "Centre" + "Top" 0 5 - 0 - 0 + 1 + 1 1 1 0 @@ -868,369 +1087,58 @@ 0 "<Any platform>" - "wxBoxSizer H" + "wxButton: ID_STARTDRC" "dialog-control-document" "" - "sizer" + "dialogcontrol" 0 1 0 0 - "30/7/2007" - "wbBoxSizerProxy" - "Horizontal" + "25/11/2007" + "wbButtonProxy" + "wxEVT_COMMAND_BUTTON_CLICKED|OnStartdrcClick|||WinEDA_DrcFrame" + "ID_STARTDRC" + 10006 + "" + "wxButton" + "wxButton" + 1 + 0 + "" + "" "" - "Centre" - "Expand" - 0 - 5 - 0 - 1 - 1 - 0 - 0 - 0 - 0 - "<Any platform>" - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "30/7/2007" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxButton: ID_DRC_RUN" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "30/7/2007" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnDrcRunClick" - "ID_DRC_RUN" - 10003 - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Test Drc" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "CA0000" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: ID_STOP_CONTROL_DRC" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "30/7/2007" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnStopControlDrcClick" - "ID_STOP_CONTROL_DRC" - 10004 - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Stop Drc" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "008080" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - "wxBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "30/7/2007" - "wbBoxSizerProxy" - "Vertical" - "" - "Centre" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "<Any platform>" - - "wxButton: ID_ERASE_DRC_MARKERS" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "30/7/2007" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnEraseDrcMarkersClick" - "ID_ERASE_DRC_MARKERS" - 10005 - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Del Markers" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "008000" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxButton: ID_LIST_UNCONNECTED_PADS" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "30/7/2007" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnListUnconnectedPadsClick" - "ID_LIST_UNCONNECTED_PADS" - 10006 - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "List Unconn" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "0000FF" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - - - "wxStaticBoxSizer V" - "dialog-control-document" - "" - "sizer" - 0 - 1 - 0 - 0 - "2/8/2007" - "wbStaticBoxSizerProxy" - "wxID_ANY" - -1 - "Report File" - "" - "" - "" + "Start DRC" + 0 + "" + "Start the Design Rule Checker" + "" + "" + "" + "" + "" + "" + "" + "" + "CA0000" "" 0 1 - "wxStaticBox" - "Vertical" + "<Any platform>" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + -1 + -1 "Expand" "Centre" 0 @@ -1238,158 +1146,212 @@ 1 1 1 - 0 + 1 0 0 0 + "" + "" + + + "wxButton: ID_LIST_UNCONNECTED" + "dialog-control-document" + "" + "dialogcontrol" + 0 + 1 + 0 + 0 + "25/11/2007" + "wbButtonProxy" + "wxEVT_COMMAND_BUTTON_CLICKED|OnListUnconnectedClick|||WinEDA_DrcFrame" + "ID_LIST_UNCONNECTED" + 10003 + "" + "wxButton" + "wxButton" + 1 + 0 + "" + "" + "" + "List Unconnected" + 0 + "" + "List unconnected pads or tracks" + "" + "" + "" + "" + "" + "" + "" + "" + "0000FF" + "" + 0 + 1 "<Any platform>" - - "wxButton: ID_BUTTON_BROWSE_RPT_FILE" - "dialog-control-document" - "" - "dialogcontrol" - 0 - 1 - 0 - 0 - "2/8/2007" - "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnButtonBrowseRptFileClick|NONE||" - "ID_BUTTON_BROWSE_RPT_FILE" - 10011 - "wxButton" - "wxButton" - 1 - 0 - "" - "" - "" - "Browse" - 0 - "" - "" - "" - "" - "" - "" - "" - "" - "" - "" - "008080" - "" - 0 - 1 - "<Any platform>" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Left" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - - - "wxTextCtrl: ID_TEXTCTRL_GET_RPT_FILENAME" - "dialog-control-document" - "" - "textctrl" - 0 - 1 - 0 - 0 - "2/8/2007" - "wbTextCtrlProxy" - "ID_TEXTCTRL_GET_RPT_FILENAME" - 10010 - "wxTextCtrl" - "wxTextCtrl" - 1 - 0 - "" - "" - "m_RptFilenameCtrl" - "" - 0 - "" - "" - "" - "" - "" - 0 - 1 - "<Any platform>" - "" - "" - "" - "" - "" - "" - "" - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - "" - -1 - -1 - -1 - -1 - "Expand" - "Centre" - 0 - 5 - 1 - 1 - 1 - 1 - 0 - 0 - 0 - "" - "" - + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + -1 + -1 + "Expand" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + "" + "" + + + "wxButton: ID_DELETE_ALL" + "dialog-control-document" + "" + "dialogcontrol" + 0 + 1 + 0 + 0 + "25/11/2007" + "wbButtonProxy" + "wxEVT_COMMAND_BUTTON_CLICKED|OnDeleteAllClick|||WinEDA_DrcFrame" + "ID_DELETE_ALL" + 10005 + "" + "wxButton" + "wxButton" + 1 + 0 + "" + "" + "" + "Delete All Markers" + 0 + "" + "Delete every marker" + "" + "" + "" + "" + "" + "" + "" + "" + "008000" + "" + 0 + 1 + "<Any platform>" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + -1 + -1 + "Expand" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + "" + "" + + + "wxButton: ID_DELETE_ONE" + "dialog-control-document" + "" + "dialogcontrol" + 0 + 1 + 0 + 0 + "25/11/2007" + "wbButtonProxy" + "ID_DELETE_ONE" + 10007 + "" + "wxButton" + "wxButton" + 1 + 0 + "" + "" + "m_DeleteCurrentMarkerButton" + "Delete Current Marker" + 0 + "" + "Delete the marker selected in the listBox below" + "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + "<Any platform>" + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + "" + -1 + -1 + -1 + -1 + "Expand" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + "" + "" @@ -1406,6 +1368,7 @@ "wbStaticTextProxy" "wxID_STATIC" 5105 + "" "wxStaticText" "wxStaticText" 1 @@ -1413,7 +1376,7 @@ "" "" "" - "Messages:" + "Error Messages:" -1 "" "" @@ -1463,27 +1426,27 @@ "" - "wxTextCtrl: ID_TEXTCTRL" + "wxNotebook: ID_NOTEBOOK1" "dialog-control-document" "" - "textctrl" + "notebook" 0 1 0 0 - "27/3/2006" - "wbTextCtrlProxy" - "ID_TEXTCTRL" - 10001 - "wxTextCtrl" - "wxTextCtrl" + "25/11/2007" + "wbNotebookProxy" + "ID_NOTEBOOK1" + 10008 + "" + "wxNotebook" + "wxNotebook" 1 0 "" "" - "m_logWindow" - "" - 0 + "" + 1 "" "" "" @@ -1499,103 +1462,192 @@ "" "" "" - 1 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 0 0 0 0 - 0 - 0 - 0 - 0 - 1 - "" - -1 - -1 - -1 - 300 - "Expand" - "Expand" - 1 - 10 - 1 - 1 - 0 - 1 - 0 - 0 - 0 - "" - "" - - - "wxStaticLine: ID_STATICLINE" - "dialog-control-document" - "" - "staticline" - 0 - 1 - 0 - 0 - "13/11/2007" - "wbStaticLineProxy" - "ID_STATICLINE" - 10013 - "wxStaticLine" - "wxStaticLine" - 1 - 0 - "" - "" - "Line" - "" - "" - "" - 0 - 1 - "<Any platform>" - 1 - 0 - 0 - 0 - 0 - 0 - 0 + 1 0 0 0 0 + 0 + 0 "" -1 -1 -1 -1 "Expand" - "Expand" - 0 + "Centre" + 5 5 1 1 - 0 - 0 + 1 + 1 0 0 0 + "" + "" + + "DRCLISTBOX: ID_CLEARANCE_LIST" + "dialog-control-document" + "" + "foreign" + 0 + 1 + 0 + 0 + "25/11/2007" + "wbForeignCtrlProxy" + "wxEVT_LEFT_DCLICK|OnLeftDClickClearance|NONE||WinEDA_DrcFrame" + "wxEVT_RIGHT_UP|OnRightUpClearance|NONE||WinEDA_DrcFrame" + "ID_CLEARANCE_LIST" + 10001 + "" + "DRCLISTBOX" + "wxListBox" + 1 + 0 + "" + "" + "m_ClearanceListBox" + "Distance Problem Markers" + "" + 1 + "" + "MARKERs on the PCB, double click on any MARKER to go there in PCB" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 0 + "" + -1 + -1 + 100 + 300 + "Centre" + "Centre" + 1 + 5 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + "" + "" + "" + + + "DRCLISTBOX: ID_UNCONNECTED_LIST" + "dialog-control-document" + "" + "foreign" + 0 + 1 + 0 + 0 + "25/11/2007" + "wbForeignCtrlProxy" + "wxEVT_LEFT_DCLICK|OnLeftDClickUnconnected|NONE||WinEDA_DrcFrame" + "wxEVT_RIGHT_UP|OnRightUpUnconnected|NONE||WinEDA_DrcFrame" + "ID_UNCONNECTED_LIST" + 10009 + "" + "DRCLISTBOX" + "wxListBox" + 1 + 0 + "" + "" + "m_UnconnectedListBox" + "Unconnected" + "" + 1 + "" + "Pad to pad, pad to track, and track to track clearance problems" + "" + "" + "" + 0 + 1 + "<Any platform>" + "" + "" + "" + "" + "" + "" + "" + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 1 + 0 + "" + -1 + -1 + 100 + 100 + "Centre" + "Centre" + 0 + 5 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + "" + "" + "" + "wxStdDialogButtonSizer" @@ -1630,7 +1682,7 @@ 0 "<Any platform>" - "wxButton: wxID_OK" + "wxButton: wxID_CANCEL" "dialog-control-document" "" "dialogcontrol" @@ -1640,9 +1692,10 @@ 1 "13/11/2007" "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnOkClick|NONE||" - "wxID_OK" - 5100 + "wxEVT_COMMAND_BUTTON_CLICKED|OnCancelClick|NONE||WinEDA_DrcFrame" + "wxID_CANCEL" + 5101 + "" "wxButton" "wxButton" 1 @@ -1650,7 +1703,7 @@ "" "" "" - "&OK" + "&Cancel" 0 "" "" @@ -1662,7 +1715,7 @@ "" "" "" - "C80000" + "0000FF" "" 0 1 @@ -1696,7 +1749,7 @@ "" - "wxButton: wxID_CANCEL" + "wxButton: wxID_OK" "dialog-control-document" "" "dialogcontrol" @@ -1704,11 +1757,12 @@ 1 0 1 - "13/11/2007" + "26/11/2007" "wbButtonProxy" - "wxEVT_COMMAND_BUTTON_CLICKED|OnCancelClick|NONE||" - "wxID_CANCEL" - 5101 + "wxEVT_COMMAND_BUTTON_CLICKED|OnOkClick|NONE||WinEDA_DrcFrame" + "wxID_OK" + 5100 + "" "wxButton" "wxButton" 1 @@ -1716,8 +1770,8 @@ "" "" "" - "&Cancel" - 0 + "&OK" + 1 "" "" "" @@ -1728,7 +1782,7 @@ "" "" "" - "0000FF" + "" "" 0 1 diff --git a/pcbnew/dialog_graphic_items_options.cpp b/pcbnew/dialog_graphic_items_options.cpp index 4ec0131933..84af1cc2c6 100644 --- a/pcbnew/dialog_graphic_items_options.cpp +++ b/pcbnew/dialog_graphic_items_options.cpp @@ -162,12 +162,14 @@ bool WinEDA_GraphicItemsOptionsDialog::Create( wxWindow* parent, wxWindowID id, ////@end WinEDA_GraphicItemsOptionsDialog member initialisation ////@begin WinEDA_GraphicItemsOptionsDialog creation - SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS); + SetExtraStyle(wxWS_EX_BLOCK_EVENTS); wxDialog::Create( parent, id, caption, pos, size, style ); CreateControls(); - GetSizer()->Fit(this); - GetSizer()->SetSizeHints(this); + if (GetSizer()) + { + GetSizer()->SetSizeHints(this); + } Centre(); ////@end WinEDA_GraphicItemsOptionsDialog creation return true; @@ -182,7 +184,7 @@ void WinEDA_GraphicItemsOptionsDialog::CreateControls() SetFont(*g_DialogFont); ////@begin WinEDA_GraphicItemsOptionsDialog content construction - // Generated by DialogBlocks, 25/02/2006 10:43:53 (unregistered) + // Generated by DialogBlocks, Mon 26 Nov 2007 18:58:29 CST (unregistered) WinEDA_GraphicItemsOptionsDialog* itemDialog1 = this; diff --git a/pcbnew/dialog_graphic_items_options.h b/pcbnew/dialog_graphic_items_options.h index b4b9834123..37d84814da 100644 --- a/pcbnew/dialog_graphic_items_options.h +++ b/pcbnew/dialog_graphic_items_options.h @@ -34,11 +34,6 @@ ////@begin control identifiers #define ID_DIALOG 10000 -#define SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER -#define SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_TITLE _("Texts and Drawings") -#define SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_IDNAME ID_DIALOG -#define SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_SIZE wxSize(400, 300) -#define SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_POSITION wxDefaultPosition #define ID_TEXTCTRL_SEGW 10001 #define ID_TEXTCTRL_EDGES 10002 #define ID_TEXTCTRL_TEXTW 10003 @@ -48,6 +43,11 @@ #define ID_TEXTCTRL_TXTMOD_W 10007 #define ID_TEXTCTRL_TXTMOD_V 10008 #define ID_TEXTCTRL_TXTMOD_H 10009 +#define SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_STYLE wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER +#define SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_TITLE _("Texts and Drawings") +#define SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_IDNAME ID_DIALOG +#define SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_SIZE wxSize(400, 300) +#define SYMBOL_WINEDA_GRAPHICITEMSOPTIONSDIALOG_POSITION wxDefaultPosition ////@end control identifiers /*! diff --git a/pcbnew/dialog_graphic_items_options.pjd b/pcbnew/dialog_graphic_items_options.pjd index 49a0c8aa0c..6f17f7425b 100644 --- a/pcbnew/dialog_graphic_items_options.pjd +++ b/pcbnew/dialog_graphic_items_options.pjd @@ -1,4 +1,4 @@ - +
0 @@ -6,18 +6,20 @@ "" "" "" - 34 "" 0 0 0 + 1 1 1 + 1 0 "jean-pierre Charras" "License GNU" "" 0 + 0 "<All platforms>" "<Any>" "///////////////////////////////////////////////////////////////////////////// @@ -43,12 +45,6 @@ // Licence: ///////////////////////////////////////////////////////////////////////////// -" - " -/*! - * %BODY% - */ - " "///////////////////////////////////////////////////////////////////////////// // Name: %SYMBOLS-FILENAME% @@ -82,6 +78,14 @@ #include "wx/wx.h" #endif +" + " /// %BODY% +" + " +/*! + * %BODY% + */ + " "app_resources.h" "app_resources.cpp" @@ -93,11 +97,23 @@ "" "<None>" "<System>" + "utf-8" "<System>" "" + 0 + 0 + 4 + " " + "" 0 + 0 + 1 + 0 1 1 + 0 + 1 + 0
@@ -174,7 +190,7 @@ 1 1 0 - 0 + 1 "Windows" "html-document" @@ -198,7 +214,10 @@ 10000 0 "" + 0 + "" 0 + 0 "ID_DIALOG" 10000 "WinEDA_GraphicItemsOptionsDialog" @@ -219,10 +238,16 @@ 0 1 "<Any platform>" + "" + "" + "" + "" + "" + "" + "Tiled" 0 1 0 - 0 1 0 0 @@ -237,7 +262,9 @@ 0 0 0 - 0 + 0 + 0 + 0 0 0 1 @@ -249,6 +276,7 @@ -1 400 300 + 0 "" "wxBoxSizer H" @@ -280,13 +308,14 @@ "wxID_ANY" "-1" "Graphics:" + "" "" "" "" 0 1 + "wxStaticBox" "Vertical" - "" "Centre" "Expand" 0 @@ -312,9 +341,16 @@ "wbStaticTextProxy" "wxID_STATIC" 5105 + "" "wxStaticText" + "wxStaticText" + 1 + 0 + "" + "" "m_GraphicSegmWidthTitle" "Graphic segm Width" + -1 "" "" "" @@ -325,6 +361,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -336,6 +377,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -368,7 +411,13 @@ "wbTextCtrlProxy" "ID_TEXTCTRL_SEGW" 10001 + "" "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" "m_OptPcbSegmWidth" "" 0 @@ -382,6 +431,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -395,8 +449,9 @@ 0 0 0 - 0 + 0 0 + 0 0 0 0 @@ -404,6 +459,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -422,6 +479,7 @@ 0 "" "" + 0 "wxStaticText: wxID_STATIC" @@ -436,9 +494,16 @@ "wbStaticTextProxy" "wxID_STATIC" 5105 + "" "wxStaticText" + "wxStaticText" + 1 + 0 + "" + "" "m_BoardEdgesWidthTitle" "Board Edges Width" + -1 "" "" "" @@ -449,6 +514,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -460,6 +530,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -492,7 +564,13 @@ "wbTextCtrlProxy" "ID_TEXTCTRL_EDGES" 10002 + "" "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" "m_OptPcbEdgesWidth" "" 0 @@ -506,6 +584,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -519,8 +602,9 @@ 0 0 0 - 0 + 0 0 + 0 0 0 0 @@ -528,6 +612,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -546,6 +632,7 @@ 0 "" "" + 0 "wxStaticText: wxID_STATIC" @@ -560,9 +647,16 @@ "wbStaticTextProxy" "wxID_STATIC" 5105 + "" "wxStaticText" + "wxStaticText" + 1 + 0 + "" + "" "m_CopperTextWidthTitle" "Copper Text Width" + -1 "" "" "" @@ -573,6 +667,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -584,6 +683,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -616,7 +717,13 @@ "wbTextCtrlProxy" "ID_TEXTCTRL_TEXTW" 10003 + "" "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" "m_OptPcbTextWidth" "" 0 @@ -630,6 +737,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -643,8 +755,9 @@ 0 0 0 - 0 + 0 0 + 0 0 0 0 @@ -652,6 +765,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -670,6 +785,7 @@ 0 "" "" + 0 "wxStaticText: wxID_STATIC" @@ -684,9 +800,16 @@ "wbStaticTextProxy" "wxID_STATIC" 5105 + "" "wxStaticText" + "wxStaticText" + 1 + 0 + "" + "" "m_TextSizeVTitle" "Text Size V" + -1 "" "" "" @@ -697,6 +820,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -708,6 +836,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -740,7 +870,13 @@ "wbTextCtrlProxy" "ID_TEXTCTRL_TEXTV" 10004 + "" "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" "m_OptPcbTextVSize" "" 0 @@ -754,6 +890,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -767,8 +908,9 @@ 0 0 0 - 0 + 0 0 + 0 0 0 0 @@ -776,6 +918,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -794,6 +938,7 @@ 0 "" "" + 0 "wxStaticText: wxID_STATIC" @@ -808,9 +953,16 @@ "wbStaticTextProxy" "wxID_STATIC" 5105 + "" "wxStaticText" + "wxStaticText" + 1 + 0 + "" + "" "m_TextSizeHTitle" "Text Size H" + -1 "" "" "" @@ -821,6 +973,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -832,6 +989,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -864,7 +1023,13 @@ "wbTextCtrlProxy" "ID_TEXTCTRL_TEXTH" 10005 + "" "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" "m_OptPcbTextHSize" "" 0 @@ -878,6 +1043,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -891,8 +1061,9 @@ 0 0 0 - 0 + 0 0 + 0 0 0 0 @@ -900,6 +1071,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -918,6 +1091,7 @@ 0 "" "" + 0 @@ -960,13 +1134,14 @@ "wxID_ANY" "-1" "Modules:" + "" "" "" "" 0 1 + "wxStaticBox" "Vertical" - "" "Centre" "Expand" 0 @@ -992,9 +1167,16 @@ "wbStaticTextProxy" "wxID_STATIC" 5105 + "" "wxStaticText" + "wxStaticText" + 1 + 0 + "" + "" "m_EdgeModWidthTitle" "Edges Module Width" + -1 "" "" "" @@ -1005,6 +1187,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -1016,6 +1203,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -1048,7 +1237,13 @@ "wbTextCtrlProxy" "ID_TEXTCTRL_EDGEMOD_W" 10006 + "" "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" "m_OptModuleEdgesWidth" "" 0 @@ -1062,6 +1257,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -1075,8 +1275,9 @@ 0 0 0 - 0 + 0 0 + 0 0 0 0 @@ -1084,6 +1285,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -1102,6 +1305,7 @@ 0 "" "" + 0 "wxStaticText: wxID_STATIC" @@ -1116,9 +1320,16 @@ "wbStaticTextProxy" "wxID_STATIC" 5105 + "" "wxStaticText" + "wxStaticText" + 1 + 0 + "" + "" "m_TextModWidthTitle" "Text Module Width" + -1 "" "" "" @@ -1129,6 +1340,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -1140,6 +1356,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -1172,7 +1390,13 @@ "wbTextCtrlProxy" "ID_TEXTCTRL_TXTMOD_W" 10007 + "" "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" "m_OptModuleTextWidth" "" 0 @@ -1186,6 +1410,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -1199,8 +1428,9 @@ 0 0 0 - 0 + 0 0 + 0 0 0 0 @@ -1208,6 +1438,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -1226,6 +1458,7 @@ 0 "" "" + 0 "wxStaticText: wxID_STATIC" @@ -1240,9 +1473,16 @@ "wbStaticTextProxy" "wxID_STATIC" 5105 + "" "wxStaticText" + "wxStaticText" + 1 + 0 + "" + "" "m_TextModSizeVTitle" "Text Module Size V" + -1 "" "" "" @@ -1253,6 +1493,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -1264,6 +1509,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -1296,7 +1543,13 @@ "wbTextCtrlProxy" "ID_TEXTCTRL_TXTMOD_V" 10008 + "" "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" "m_OptModuleTextVSize" "" 0 @@ -1310,6 +1563,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -1323,8 +1581,9 @@ 0 0 0 - 0 + 0 0 + 0 0 0 0 @@ -1332,6 +1591,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -1350,6 +1611,7 @@ 0 "" "" + 0 "wxStaticText: wxID_STATIC" @@ -1364,9 +1626,16 @@ "wbStaticTextProxy" "wxID_STATIC" 5105 + "" "wxStaticText" + "wxStaticText" + 1 + 0 + "" + "" "m_TextModSizeHTitle" "Text Module Size H" + -1 "" "" "" @@ -1377,6 +1646,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -1388,6 +1662,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -1420,7 +1696,13 @@ "wbTextCtrlProxy" "ID_TEXTCTRL_TXTMOD_H" 10009 + "" "wxTextCtrl" + "wxTextCtrl" + 1 + 0 + "" + "" "m_OptModuleTextHSize" "" 0 @@ -1434,6 +1716,11 @@ "<Any platform>" "" "" + "" + "" + "" + "" + "" 0 0 0 @@ -1447,8 +1734,9 @@ 0 0 0 - 0 + 0 0 + 0 0 0 0 @@ -1456,6 +1744,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -1474,6 +1764,7 @@ 0 "" "" + 0 @@ -1541,12 +1832,25 @@ "wxEVT_COMMAND_BUTTON_CLICKED|OnOkClick" "wxID_OK" 5100 + "" "wxButton" + "wxButton" + 1 + 0 + "" + "" "" "&OK" 0 "" "" + "" + "" + "" + "" + "" + "" + "" "" "CE0000" "" @@ -1560,6 +1864,8 @@ 0 0 0 + 0 + 0 "" -1 -1 @@ -1593,12 +1899,25 @@ "wxEVT_COMMAND_BUTTON_CLICKED|OnCancelClick" "wxID_CANCEL" 5101 + "" "wxButton" + "wxButton" + 1 + 0 + "" + "" "" "&Cancel" 0 "" "" + "" + "" + "" + "" + "" + "" + "" "" "0000FF" "" @@ -1612,6 +1931,8 @@ 0 0 0 + 0 + 0 "" -1 -1 diff --git a/pcbnew/drc.cpp b/pcbnew/drc.cpp index 47ffea5638..5f2f813e78 100644 --- a/pcbnew/drc.cpp +++ b/pcbnew/drc.cpp @@ -12,10 +12,15 @@ #include "protos.h" +#include "drc_stuff.h" + + + /* variables locales */ class WinEDA_DrcFrame; WinEDA_DrcFrame* DrcFrame; + /* saving drc options */ static bool s_Pad2PadTestOpt = true; static bool s_UnconnectedTestOpt = true; @@ -50,15 +55,42 @@ static int Tst_Ligne( int x1, int y1, int x2, int y2 ); static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, TRACK* pt_ref, BOARD_ITEM* pt_item, int errnumber ); -static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, +static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, D_PAD* pad1, D_PAD* pad2 ); /*******************************************/ -/* function relatives to the DRC control */ +/* DRC functions */ /*******************************************/ #include "dialog_drc.cpp" + +const wxString& DRC_ITEM::GetErrorText() const +{ + static const wxString error1( wxT("Items Too Close:") ); + + switch( m_ErrorCode ) + { + default: + case DRCE_: return error1; + } +} + + +wxString DRC_ITEM::ShowCoord( const wxPoint& aPos ) +{ + wxString temp; + wxString ret; + + ret << wxT("@(") << valeur_param( aPos.x, temp ); + ret << wxT(",") << valeur_param( aPos.y, temp ); + ret << wxT(")"); + + return ret; +} + + + /***************************************************************/ void WinEDA_DrcFrame::ListUnconnectedPads( wxCommandEvent& event ) /***************************************************************/ @@ -75,10 +107,10 @@ void WinEDA_DrcFrame::ListUnconnectedPads( wxCommandEvent& event ) WinEDA_DrawPanel* panel = m_Parent->DrawPanel; int ii; wxString msg; - float convert = 0.0001; + double convert = 0.0001; msg = _( "Look for active routes\n" ); - m_logWindow->AppendText( msg ); +// m_logWindow->AppendText( msg ); if( s_RptFile ) fprintf( s_RptFile, "%s", CONV_TO_UTF8( msg ) ); @@ -87,36 +119,38 @@ void WinEDA_DrcFrame::ListUnconnectedPads( wxCommandEvent& event ) { if( (Ratsnest->status & CH_ACTIF) == 0 ) continue; - + m_UnconnectedCount++; if( m_UnconnectedCount == 1 ) - m_logWindow->AppendText( _( "Unconnected found:\n" ) ); - + { +// m_logWindow->AppendText( _( "Unconnected found:\n" ) ); + } + D_PAD* pad = Ratsnest->pad_start; pad->Draw( panel, m_DC, wxPoint( 0, 0 ), draw_mode ); - + wxString pad_name = pad->ReturnStringPadName(); wxString module_name = ( (MODULE*) (pad->m_Parent) )->m_Reference->m_Text; - + msg.Printf( _( "%d > Pad %s (%s) @ %.4f,%.4f and " ), m_UnconnectedCount, - pad_name.GetData(), module_name.GetData(), + pad_name.GetData(), module_name.GetData(), pad->m_Pos.x * convert, pad->m_Pos.y * convert ); - - m_logWindow->AppendText( msg ); + +// m_logWindow->AppendText( msg ); if( s_RptFile ) fprintf( s_RptFile, "%s", CONV_TO_UTF8( msg ) ); pad = Ratsnest->pad_end; pad->Draw( panel, m_DC, wxPoint( 0, 0 ), draw_mode ); - + pad_name = pad->ReturnStringPadName(); module_name = ( (MODULE*) (pad->m_Parent) )->m_Reference->m_Text; - + msg.Printf( _( "Pad %s (%s) @ %.4f,%.4f\n" ), - pad_name.GetData(), module_name.GetData(), + pad_name.GetData(), module_name.GetData(), pad->m_Pos.x * convert, pad->m_Pos.y * convert ); - - m_logWindow->AppendText( msg ); + +// m_logWindow->AppendText( msg ); if( s_RptFile ) fprintf( s_RptFile, "%s", CONV_TO_UTF8( msg ) ); } @@ -125,8 +159,8 @@ void WinEDA_DrcFrame::ListUnconnectedPads( wxCommandEvent& event ) msg.Printf( _( "Active routes: %d\n" ), m_UnconnectedCount ); else msg = _( "OK! (No active routes)\n" ); - - m_logWindow->AppendText( msg ); + +// m_logWindow->AppendText( msg ); if( s_RptFile ) fprintf( s_RptFile, "%s", CONV_TO_UTF8( msg ) ); } @@ -144,10 +178,10 @@ void WinEDA_DrcFrame::TestDrc( wxCommandEvent& event ) if( m_CreateRptCtrl->IsChecked() ) // Create a file rpt { s_RptFilename = m_RptFilenameCtrl->GetValue(); - + if( s_RptFilename.IsEmpty() ) OnButtonBrowseRptFileClick( event ); - + if( !s_RptFilename.IsEmpty() ) s_RptFile = wxFopen( s_RptFilename, wxT( "w" ) ); else @@ -164,30 +198,30 @@ void WinEDA_DrcFrame::TestDrc( wxCommandEvent& event ) s_Pad2PadTestOpt = m_Pad2PadTestCtrl->IsChecked(); s_UnconnectedTestOpt = m_UnconnectedTestCtrl->IsChecked(); - + s_ZonesTestOpt = m_ZonesTestCtrl->IsChecked(); - + AbortDrc = FALSE; - m_logWindow->Clear(); +// m_logWindow->Clear(); g_DesignSettings.m_TrackClearence = ReturnValueFromTextCtrl( *m_SetClearance, m_Parent->m_InternalUnits ); - + /* Test DRC errors (clearance errors, bad connections .. */ - errors = m_Parent->Test_DRC( m_DC, m_Pad2PadTestCtrl->IsChecked( - ), m_ZonesTestCtrl->IsChecked() ); - + errors = m_Parent->Test_DRC( m_DC, m_Pad2PadTestCtrl->IsChecked(), + m_ZonesTestCtrl->IsChecked() ); + /* Search for active routes (unconnected pads) */ if( m_UnconnectedTestCtrl->IsChecked() ) ListUnconnectedPads( event ); else m_UnconnectedCount = 0; - + if( errors ) msg.Printf( _( "** End Drc: %d errors **\n" ), errors ); else if( m_UnconnectedCount == 0 ) msg = _( "** End Drc: No Error **\n" ); - - m_logWindow->AppendText( msg ); + +// m_logWindow->AppendText( msg ); if( s_RptFile ) fprintf( s_RptFile, "%s", CONV_TO_UTF8( msg ) ); @@ -195,7 +229,7 @@ void WinEDA_DrcFrame::TestDrc( wxCommandEvent& event ) if( s_RptFile ) { msg.Printf( _( "Report file <%s> created\n" ), s_RptFilename.GetData() ); - m_logWindow->AppendText( msg ); +// m_logWindow->AppendText( msg ); fclose( s_RptFile ); s_RptFile = NULL; } @@ -228,7 +262,8 @@ void WinEDA_PcbFrame::Install_Test_DRC_Frame( wxDC* DC ) { AbortDrc = FALSE; DrcFrame = new WinEDA_DrcFrame( this, DC ); - DrcFrame->ShowModal(); DrcFrame->Destroy(); + DrcFrame->ShowModal(); + DrcFrame->Destroy(); DrcFrame = NULL; } @@ -274,15 +309,17 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone ) Line.Printf( wxT( "%d" ), m_Pcb->m_NbPads ); Affiche_1_Parametre( this, PRINT_NB_PAD_POS, wxT( "NbPad" ), Line, RED ); Affiche_1_Parametre( this, PRINT_PAD_ERR_POS, wxT( "Pad Err" ), wxT( "0" ), LIGHTRED ); - + if( DrcFrame ) - DrcFrame->m_logWindow->AppendText( _( "Tst Pad to Pad\n" ) ); - + { +// DrcFrame->m_logWindow->AppendText( _( "Tst Pad to Pad\n" ) ); + } + LISTE_PAD* pad_list_start = CreateSortedPadListByXCoord( m_Pcb ); LISTE_PAD* pad_list_limit = &pad_list_start[m_Pcb->m_NbPads]; int max_size = 0; LISTE_PAD* pad_list; - + /* Compute the max size of the pads ( used to stop the test) */ for( pad_list = pad_list_start; pad_list < pad_list_limit; pad_list++ ) { @@ -326,16 +363,15 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone ) Affiche_1_Parametre( this, PRINT_TRACK_ERR_POS, _( "Track Err" ), wxT( "0" ), LIGHTRED ); pt_segm = m_Pcb->m_Track; - if( DrcFrame ) - DrcFrame->m_logWindow->AppendText( _( "Tst Tracks\n" ) ); - +// if( DrcFrame ) DrcFrame->m_logWindow->AppendText( _( "Tst Tracks\n" ) ); + for( ii = 0, old_net = -1, jj = 0; pt_segm != NULL; pt_segm = (TRACK*) pt_segm->Pnext, ii++, jj-- ) { if( pt_segm->Pnext == NULL ) break; - + if( jj == 0 ) { jj = 10; @@ -399,25 +435,24 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone ) Affiche_1_Parametre( this, PRINT_NB_ZONESEGM_POS, _( "SegmNb" ), Line, RED ); Affiche_1_Parametre( this, PRINT_ZONE_ERR_POS, _( "Zone Err" ), wxT( "0" ), LIGHTRED ); - if( DrcFrame ) - DrcFrame->m_logWindow->AppendText( _( "Tst Zones\n" ) ); +// if( DrcFrame ) DrcFrame->m_logWindow->AppendText( _( "Tst Zones\n" ) ); pt_segm = (TRACK*) m_Pcb->m_Zone; - + for( ii = 0, old_net = -1, jj = 0; pt_segm != NULL; pt_segm = (TRACK*) pt_segm->Pnext, ii++, jj-- ) { if( pt_segm->Pnext == NULL ) break; - + if( jj == 0 ) { jj = 100; wxYield(); if( AbortDrc ) { - AbortDrc = FALSE; + AbortDrc = FALSE; break; } /* Print stats */ @@ -430,17 +465,17 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone ) jj = 1; wxString msg; EQUIPOT* equipot = m_Pcb->FindNet( pt_segm->GetNet() ); - + if( equipot ) msg = equipot->m_Netname + wxT( " " ); else msg = wxT( "" ); - + Affiche_1_Parametre( this, 0, _( "Netname" ), msg, YELLOW ); old_net = pt_segm->GetNet(); } g_HightLigth_NetCode = pt_segm->GetNet(); - + /* Test drc with other zone segments, and pads */ flag_err_Drc = Drc( this, DC, pt_segm, (TRACK*) pt_segm->Pnext, 1 ); if( flag_err_Drc == BAD_DRC ) @@ -467,12 +502,12 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone ) } /* Test drc with track segments */ - int tmp = m_Pcb->m_NbPads; + int tmp = m_Pcb->m_NbPads; m_Pcb->m_NbPads = 0; // Pads already tested: disable pad test flag_err_Drc = Drc( this, DC, pt_segm, m_Pcb->m_Track, 1 ); - + m_Pcb->m_NbPads = tmp; - + if( flag_err_Drc == BAD_DRC ) { Marqueur = current_marqueur; @@ -488,7 +523,7 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone ) PtStruct = m_Pcb->m_Drawings; if( PtStruct ) PtStruct->Pback = Marqueur; - + m_Pcb->m_Drawings = Marqueur; GRSetDrawMode( DC, GR_OR ); @@ -529,12 +564,12 @@ int Drc( WinEDA_BasePcbFrame* frame, wxDC* DC, // l'origine du segment de reference wxPoint shape_pos; - org_X = pt_segment->m_Start.x; + org_X = pt_segment->m_Start.x; org_Y = pt_segment->m_Start.y; - + finx = dx = pt_segment->m_End.x - org_X; finy = dy = pt_segment->m_End.y - org_Y; - + MaskLayer = pt_segment->ReturnMaskLayer(); net_code_ref = pt_segment->GetNet(); @@ -545,7 +580,7 @@ int Drc( WinEDA_BasePcbFrame* frame, wxDC* DC, { /* Compute the segment angle in 0,1 degrees */ segm_angle = ArcTangente( dy, dx ); - + /* Compute the segment lenght: we build an equivalent rotated segment, this segment is horizontal, therefore dx = lenght */ RotatePoint( &dx, &dy, segm_angle ); /* dx = lenght, dy = 0 */ @@ -573,7 +608,7 @@ int Drc( WinEDA_BasePcbFrame* frame, wxDC* DC, * a pseudo pad is used, with a shape and a size like the hole */ if( pt_pad->m_Drill.x == 0 ) continue; - + D_PAD pseudo_pad( (MODULE*) NULL ); pseudo_pad.m_Size = pt_pad->m_Drill; @@ -696,13 +731,13 @@ int Drc( WinEDA_BasePcbFrame* frame, wxDC* DC, * in the new axis : the new X axis is the reference segment * We must translate and rotate the segment to test */ - x0 = pttrack->m_Start.x - org_X; + x0 = pttrack->m_Start.x - org_X; y0 = pttrack->m_Start.y - org_Y; - - xf = pttrack->m_End.x - org_X; + + xf = pttrack->m_End.x - org_X; yf = pttrack->m_End.y - org_Y; - RotatePoint( &x0, &y0, segm_angle ); + RotatePoint( &x0, &y0, segm_angle ); RotatePoint( &xf, &yf, segm_angle ); if( pttrack->Type() == TYPEVIA ) @@ -724,7 +759,7 @@ int Drc( WinEDA_BasePcbFrame* frame, wxDC* DC, { if( abs( y0 ) >= w_dist ) continue; - + if( x0 > xf ) EXCHG( x0, xf ); /* pour que x0 <= xf */ @@ -860,18 +895,18 @@ int Drc( WinEDA_BasePcbFrame* frame, wxDC* DC, { // Test the starting and the ending point int angle, rx0, ry0, rxf, ryf; - x0 = pttrack->m_Start.x; + x0 = pttrack->m_Start.x; y0 = pttrack->m_Start.y; - - xf = pttrack->m_End.x; + + xf = pttrack->m_End.x; yf = pttrack->m_End.y; - - dx = xf - x0; + + dx = xf - x0; dy = yf - y0; - + /* Compute the segment orientation (angle) en 0,1 degre */ angle = ArcTangente( dy, dx ); - + /* Compute the segment lenght: dx = longueur */ RotatePoint( &dx, &dy, angle ); @@ -944,7 +979,7 @@ static bool Test_Pad_to_Pads_Drc( WinEDA_BasePcbFrame* frame, MaskLayer = pad_ref->m_Masque_Layer & ALL_CU_LAYERS; int x_limite = max_size + g_DesignSettings.m_TrackClearence + pad_ref->m_Rayon + pad_ref->m_Pos.x; - + for( ; pad_list < end_buffer; pad_list++ ) { pad = *pad_list; @@ -972,7 +1007,7 @@ static bool Test_Pad_to_Pads_Drc( WinEDA_BasePcbFrame* frame, if( Pad_to_Pad_Isol( pad_ref, pad, g_DesignSettings.m_TrackClearence ) == OK_DRC ) continue; - + else /* here we have a drc error! */ { ErrorsDRC_Count++; @@ -1057,13 +1092,13 @@ static int Pad_to_Pad_Isol( D_PAD* pad_ref, D_PAD* pad, const int dist_min ) // Test DRC: diag = BAD_DRC; - - rel_pos.x = ABS( rel_pos.x ); + + rel_pos.x = ABS( rel_pos.x ); rel_pos.y = ABS( rel_pos.y ); - + if( ( rel_pos.x - ( (size.x + pad_ref->m_Size.x) / 2 ) ) >= dist_min ) diag = OK_DRC; - + if( ( rel_pos.y - ( (size.y + pad_ref->m_Size.y) / 2 ) ) >= dist_min ) diag = OK_DRC; } @@ -1117,7 +1152,7 @@ static int TestClearanceSegmToPad( const D_PAD* pad_to_test, int w_segm, int dis /* * Routine adaptee de la "distance()" (LOCATE.CPP) * teste la distance du pad au segment de droite en cours - * + * * retourne: * 0 si distance >= dist_min * 1 si distance < dist_min @@ -1125,7 +1160,7 @@ static int TestClearanceSegmToPad( const D_PAD* pad_to_test, int w_segm, int dis * pad_to_test = pointeur sur le pad a tester * w_segm = demi largeur du segment a tester * dist_min = marge a respecter - * + * * en variables globales * segm_long = longueur du segment en test * segm_angle = angle d'inclinaison du segment; @@ -1158,14 +1193,14 @@ static int TestClearanceSegmToPad( const D_PAD* pad_to_test, int w_segm, int dis ycliplo = spot_cY - seuil - p_dimy; xcliphi = spot_cX + seuil + p_dimx; ycliphi = spot_cY + seuil + p_dimy; - - x0 = y0 = 0; - - xf = finx; + + x0 = y0 = 0; + + xf = finx; yf = finy; - + orient = pad_to_test->m_Orient; - + RotatePoint( &x0, &y0, spot_cX, spot_cY, -orient ); RotatePoint( &xf, &yf, spot_cX, spot_cY, -orient ); @@ -1173,7 +1208,7 @@ static int TestClearanceSegmToPad( const D_PAD* pad_to_test, int w_segm, int dis if( bflag == OK_DRC ) return OK_DRC; - + /* Erreur DRC : analyse fine de la forme de la pastille */ switch( pad_to_test->m_PadShape ) @@ -1209,7 +1244,7 @@ static int TestClearanceSegmToPad( const D_PAD* pad_to_test, int w_segm, int dis y0 = spot_cY + deltay; RotatePoint( &x0, &y0, spot_cX, spot_cY, orient ); RotatePoint( &x0, &y0, segm_angle ); - + bflag = TestMarginToCircle( x0, y0, p_dimx + seuil, segm_long ); if( bflag == BAD_DRC ) return BAD_DRC; @@ -1218,7 +1253,7 @@ static int TestClearanceSegmToPad( const D_PAD* pad_to_test, int w_segm, int dis y0 = spot_cY - deltay; RotatePoint( &x0, &y0, spot_cX, spot_cY, orient ); RotatePoint( &x0, &y0, segm_angle ); - + bflag = TestMarginToCircle( x0, y0, p_dimx + seuil, segm_long ); if( bflag == BAD_DRC ) return BAD_DRC; @@ -1359,30 +1394,30 @@ static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, netname1 = equipot->m_Netname; else netname1 = wxT( "" ); - + netname2 = wxT( "" ); if( pt_ref->Type() == TYPEVIA ) tracktype = wxT( "Via" ); - + else if( pt_ref->Type() == TYPEZONE ) tracktype = wxT( "Zone" ); - + else tracktype = wxT( "Track" ); - + if( pt_item->Type() == TYPEPAD ) { D_PAD* pad = (D_PAD*) pt_item; equipot = Pcb->FindNet( pad->GetNet() ); if( equipot ) netname2 = equipot->m_Netname; - + erc_pos = pad->m_Pos; wxString pad_name = pad->ReturnStringPadName(); - + wxString module_name = ( (MODULE*) (pad->m_Parent) )->m_Reference->m_Text; - + msg.Printf( _( "%d Drc Err %d %s (net %s) and PAD %s (%s) net %s @ %d,%d\n" ), ErrorsDRC_Count, errnumber, tracktype.GetData(), netname1.GetData(), @@ -1390,7 +1425,7 @@ static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, netname2.GetData(), erc_pos.x, erc_pos.y ); } - + else /* erreur sur segment de piste */ { pt_segm = (TRACK*) pt_item; @@ -1413,7 +1448,7 @@ static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, < hypot( (double) (erc_pos.x - pt_ref->m_End.x), (double) (erc_pos.y - pt_ref->m_End.y) ) ) { - EXCHG( erc_pos_f.x, erc_pos.x ); + EXCHG( erc_pos_f.x, erc_pos.x ); EXCHG( erc_pos_f.y, erc_pos.y ); } msg.Printf( _( "%d Err type %d: %s (net %s) and track (net %s) @ %d,%d\n" ), @@ -1424,16 +1459,18 @@ static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, } if( DrcFrame ) - DrcFrame->m_logWindow->AppendText( msg ); + { +// DrcFrame->m_logWindow->AppendText( msg ); + } else panel->m_Parent->Affiche_Message( msg ); - + if( s_RptFile ) fprintf( s_RptFile, "%s", CONV_TO_UTF8( msg ) ); if( current_marqueur == NULL ) current_marqueur = new MARQUEUR( Pcb ); - + current_marqueur->m_Pos = wxPoint( erc_pos.x, erc_pos.y ); current_marqueur->m_Color = WHITE; current_marqueur->m_Diag = msg; @@ -1460,14 +1497,14 @@ static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, wxString pad_name2 = pad2->ReturnStringPadName(); wxString module_name2 = ( (MODULE*) (pad2->m_Parent) )->m_Reference->m_Text; wxString netname1, netname2; - + EQUIPOT* equipot = Pcb->FindNet( pad1->GetNet() ); if( equipot ) netname1 = equipot->m_Netname; else netname1 = wxT( "" ); - + equipot = Pcb->FindNet( pad2->GetNet() ); if( equipot ) netname2 = equipot->m_Netname; @@ -1475,21 +1512,23 @@ static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, netname2 = wxT( "" ); msg.Printf( _( "%d Drc Err: PAD %s (%s) net %s @ %d,%d and PAD %s (%s) net %s @ %d,%d\n" ), - ErrorsDRC_Count, + ErrorsDRC_Count, pad_name1.GetData(), module_name1.GetData(), netname1.GetData(), pad1->m_Pos.x, pad1->m_Pos.y, pad_name2.GetData(), module_name2.GetData(), netname2.GetData(), pad2->m_Pos.x, pad2->m_Pos.y ); - + if( DrcFrame ) - DrcFrame->m_logWindow->AppendText( msg ); + { +// DrcFrame->m_logWindow->AppendText( msg ); + } else panel->m_Parent->Affiche_Message( msg ); - + if( s_RptFile ) fprintf( s_RptFile, "%s", CONV_TO_UTF8( msg ) ); if( current_marqueur == NULL ) current_marqueur = new MARQUEUR( Pcb ); - + current_marqueur->m_Pos = pad1->m_Pos; current_marqueur->m_Color = WHITE; current_marqueur->m_Diag = msg; @@ -1502,16 +1541,15 @@ static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, /**********************************************/ /* Routine utilisee pour tester si une piste est en contact avec une autre piste. - * + * * Cette routine controle si la ligne (x1,y1 x2,y2) a une partie s'inscrivant * dans le cadre (xcliplo,ycliplo xcliphi,ycliphi) (variables globales, * locales a ce fichier) - * + * * Retourne OK_DRC si aucune partie commune * Retourne BAD_DRC si partie commune */ -#define us unsigned int -static inline int USCALE( us arg, us num, us den ) +static inline int USCALE( unsigned arg, unsigned num, unsigned den ) { int ii; @@ -1527,96 +1565,95 @@ static int Tst_Ligne( int x1, int y1, int x2, int y2 ) { int temp; - do { - if( x1 > x2 ) - { - EXCHG( x1, x2 ); EXCHG( y1, y2 ); - } - if( (x2 < xcliplo) || (x1 > xcliphi) ) + if( x1 > x2 ) + { + EXCHG( x1, x2 ); + EXCHG( y1, y2 ); + } + if( (x2 < xcliplo) || (x1 > xcliphi) ) + { + WHEN_OUTSIDE; + } + if( y1 < y2 ) + { + if( (y2 < ycliplo) || (y1 > ycliphi) ) { WHEN_OUTSIDE; } - if( y1 < y2 ) + if( y1 < ycliplo ) { - if( (y2 < ycliplo) || (y1 > ycliphi) ) + temp = USCALE( (x2 - x1), (ycliplo - y1), (y2 - y1) ); + if( (x1 += temp) > xcliphi ) { WHEN_OUTSIDE; } - if( y1 < ycliplo ) - { - temp = USCALE( (x2 - x1), (ycliplo - y1), (y2 - y1) ); - if( (x1 += temp) > xcliphi ) - { - WHEN_OUTSIDE; - } - y1 = ycliplo; - WHEN_INSIDE; - } - if( y2 > ycliphi ) - { - temp = USCALE( (x2 - x1), (y2 - ycliphi), (y2 - y1) ); - if( (x2 -= temp) < xcliplo ) - { - WHEN_OUTSIDE; - } - y2 = ycliphi; - WHEN_INSIDE; - } - if( x1 < xcliplo ) - { - temp = USCALE( (y2 - y1), (xcliplo - x1), (x2 - x1) ); - y1 += temp; x1 = xcliplo; - WHEN_INSIDE; - } - if( x2 > xcliphi ) - { - temp = USCALE( (y2 - y1), (x2 - xcliphi), (x2 - x1) ); - y2 -= temp; x2 = xcliphi; - WHEN_INSIDE; - } + y1 = ycliplo; + WHEN_INSIDE; } - else + if( y2 > ycliphi ) { - if( (y1 < ycliplo) || (y2 > ycliphi) ) + temp = USCALE( (x2 - x1), (y2 - ycliphi), (y2 - y1) ); + if( (x2 -= temp) < xcliplo ) { WHEN_OUTSIDE; } - if( y1 > ycliphi ) - { - temp = USCALE( (x2 - x1), (y1 - ycliphi), (y1 - y2) ); - if( (x1 += temp) > xcliphi ) - { - WHEN_OUTSIDE; - } - y1 = ycliphi; - WHEN_INSIDE; - } - if( y2 < ycliplo ) - { - temp = USCALE( (x2 - x1), (ycliplo - y2), (y1 - y2) ); - if( (x2 -= temp) < xcliplo ) - { - WHEN_OUTSIDE; - } - y2 = ycliplo; - WHEN_INSIDE; - } - if( x1 < xcliplo ) - { - temp = USCALE( (y1 - y2), (xcliplo - x1), (x2 - x1) ); - y1 -= temp; - x1 = xcliplo; - WHEN_INSIDE; - } - if( x2 > xcliphi ) - { - temp = USCALE( (y1 - y2), (x2 - xcliphi), (x2 - x1) ); - y2 += temp; - x2 = xcliphi; - WHEN_INSIDE; - } + y2 = ycliphi; + WHEN_INSIDE; } - } while( 0 ); + if( x1 < xcliplo ) + { + temp = USCALE( (y2 - y1), (xcliplo - x1), (x2 - x1) ); + y1 += temp; x1 = xcliplo; + WHEN_INSIDE; + } + if( x2 > xcliphi ) + { + temp = USCALE( (y2 - y1), (x2 - xcliphi), (x2 - x1) ); + y2 -= temp; x2 = xcliphi; + WHEN_INSIDE; + } + } + else + { + if( (y1 < ycliplo) || (y2 > ycliphi) ) + { + WHEN_OUTSIDE; + } + if( y1 > ycliphi ) + { + temp = USCALE( (x2 - x1), (y1 - ycliphi), (y1 - y2) ); + if( (x1 += temp) > xcliphi ) + { + WHEN_OUTSIDE; + } + y1 = ycliphi; + WHEN_INSIDE; + } + if( y2 < ycliplo ) + { + temp = USCALE( (x2 - x1), (ycliplo - y2), (y1 - y2) ); + if( (x2 -= temp) < xcliplo ) + { + WHEN_OUTSIDE; + } + y2 = ycliplo; + WHEN_INSIDE; + } + if( x1 < xcliplo ) + { + temp = USCALE( (y1 - y2), (xcliplo - x1), (x2 - x1) ); + y1 -= temp; + x1 = xcliplo; + WHEN_INSIDE; + } + if( x2 > xcliphi ) + { + temp = USCALE( (y1 - y2), (x2 - xcliphi), (x2 - x1) ); + y2 += temp; + x2 = xcliphi; + WHEN_INSIDE; + } + } if( ( (x2 + x1)/2 <= xcliphi ) && ( (x2 + x1)/2 >= xcliplo ) \ && ( (y2 + y1)/2 <= ycliphi ) && ( (y2 + y1)/2 >= ycliplo ) ) @@ -1626,3 +1663,4 @@ static int Tst_Ligne( int x1, int y1, int x2, int y2 ) else return OK_DRC; } + diff --git a/pcbnew/drc_stuff.h b/pcbnew/drc_stuff.h new file mode 100644 index 0000000000..8da122ef8a --- /dev/null +++ b/pcbnew/drc_stuff.h @@ -0,0 +1,214 @@ +/* + * This program source code file is part of KICAD, a free EDA CAD application. + * + * Copyright (C) 2007 Dick Hollenbeck, dick@softplc.com + * Copyright (C) 2007 Kicad Developers, see change_log.txt for contributors. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you may find one here: + * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html + * or you may search the http://www.gnu.org website for the version 2 license, + * or you may write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef _DRC_STUFF_H +#define _DRC_STUFF_H + + +#include "fctsys.h" + + +/// DRC error codes: +#define DRCE_ 1 + + + +/** + * Class DRC_ITEM + * is a holder for a DRC error item. It is generated when two objects are + * too close. There are holders for information on two items. The + * information held is the board coordinate and the MenuText for each item. + * Also held is the type of error by number and the location of the MARQUEUR. + * A function is provided to translate that number into text. + */ +class DRC_ITEM +{ + +protected: + int m_ErrorCode; ///< the error code's numeric value + wxPoint m_MarkerPos; ///< position of the MARKER + wxString m_AText; ///< text for the first BOARD_ITEM + wxString m_BText; ///< text for the second BOARD_ITEM + wxPoint m_APos; ///< the location of the first BOARD_ITEM + wxPoint m_BPos; ///< the location of the first BOARD_ITEM + + +public: + + DRC_ITEM( int aErrorCode, const wxString& aText, const wxString& bText, + const wxPoint& aPos, const wxPoint& bPos ) + { + m_ErrorCode = aErrorCode; + m_AText = aText; + m_BText = bText; + m_APos = aPos; + m_BPos = bPos; + } + + + /** + * Function ShowHtml + * translates this object into a fragment of HTML suitable for the + * wxWidget's wxHtmlListBox class. + * @return wxString - the html text. + */ + wxString ShowHtml() const + { + wxString ret; + + ret.Printf( wxT("%s
  • %s: %s
  • %s: %s
"), + GetErrorText().GetData(), + ShowCoord( m_APos ).GetData(), m_AText.GetData(), + ShowCoord( m_BPos ).GetData(), m_BText.GetData() ); + + return ret; + } + + + /** + * Function ShowText + * translates this object into a text string suitable for saving + * to disk in a report. Change this as needed to format the report. + * @return wxString - the simple non-html text. + */ + wxString ShowText() const + { + wxString ret; + + ret.Printf( wxT("%s\n %s: %s\n %s: %s\n"), + GetErrorText().GetData(), + ShowCoord( m_APos ).GetData(), m_AText.GetData(), + ShowCoord( m_BPos ).GetData(), m_BText.GetData() ); + + return ret; + } + + + /** + * Function GetErrorText + * returns the string form of a drc error code. + */ + const wxString& GetErrorText() const; + + + /** + * Function ShowCoord + * formats a coordinate or position to text. + * @param aPos The position to format + * @return wxString - The formated string + */ + static wxString ShowCoord( const wxPoint& aPos ); + +}; + + +class WinEDA_DrawPanel; +class MARQUEUR; + +typedef std::vector DRC_LIST; + + + +/** + * Class DRC_TESTER + * performs all the DRC tests, and can optionally generate a DRC test report + * to a disk file. This class is given access to the windows and the BOARD + * that it needs via its constructor or access functions. + */ +class DRC_TESTER +{ +protected: + bool doPad2PadTest; + bool doUnconnectedTest; + bool doZonesTest; + bool doCreateRptFile; + + FILE* rptFile; + + wxString rptFilename; + + int errorCount; + + MARQUEUR* currentMarker; + + bool abortDrc; + bool drcInProgress; + int spot_cX; + int spot_cY; + int finx; + int finy; // coord relatives de l'extremite du segm de reference + + int segmAngle; // angle d'inclinaison du segment de reference en 0,1 degre + int segmLong; // longueur du segment de reference + + int xcliplo; + int ycliplo; + int xcliphi; + int ycliphi; // coord de la surface de securite du segment a comparer + + DRC_LIST drcList; + + WinEDA_DrawPanel* drawPanel; + +public: + DRC_TESTER() + { + doPad2PadTest = true; + doUnconnectedTest = true; + doZonesTest = false; + doCreateRptFile = false; + } + + + /** + * Function SetTests + * sets all the test flags and may be called before running the tests. + * @param aPad2PadTest Tells whether to test pad to pad distances. + * @param aUnconnectedTest Tells whether to list unconnected pads. + * @param aZonesTest Tells whether to test zones. + * @param aRptFilename If non-Empty, is the name of the file to + * save the report to. If Empty, means save no report. + */ + void SetTests( bool aPad2PadTest, bool aUnconnectedTest, bool aZonesTest, const wxString& aRptFilename ) + { + doPad2PadTest = aPad2PadTest; + doUnconnectedTest = aUnconnectedTest; + doZonesTest = aZonesTest; + + rptFilename = aRptFilename; + if( rptFilename.IsEmpty() ) + doCreateRptFile = false; + else + doCreateRptFile = true; + } + + + +}; + + + +#endif // _DRC_STUFF_H + +//EOF