Commit 15b70020 authored by dickelbeck's avatar dickelbeck

drc work

parent 4002c6f4
...@@ -39,6 +39,12 @@ ...@@ -39,6 +39,12 @@
////@end XPM images ////@end XPM images
/**
* Class DRC_LIST_MARKERS
* is an implementation of the interface named DRC_ITEM_LIST which uses
* a BOARD instance to fulfill the interface. No ownership is taken of the
* BOARD.
*/
class DRC_LIST_MARKERS : public DRC_ITEM_LIST class DRC_LIST_MARKERS : public DRC_ITEM_LIST
{ {
BOARD* m_board; BOARD* m_board;
...@@ -55,7 +61,7 @@ public: ...@@ -55,7 +61,7 @@ public:
*/ */
//-----<Interface DRC_ITEM_LIST >--------------------------------------- //-----<Interface DRC_ITEM_LIST>---------------------------------------
void DeleteAllItems() void DeleteAllItems()
{ {
...@@ -86,13 +92,11 @@ public: ...@@ -86,13 +92,11 @@ public:
return m_board->GetMARKERCount(); return m_board->GetMARKERCount();
} }
//-----</Interface DRC_ITEM_LIST >-------------------------------------- //-----</Interface DRC_ITEM_LIST>--------------------------------------
}; };
/** /**
* Class DRCLISTBOX * Class DRCLISTBOX
* is used to display a DRC_ITEM_LIST. * is used to display a DRC_ITEM_LIST.
...@@ -120,7 +124,7 @@ public: ...@@ -120,7 +124,7 @@ public:
/** /**
* Function SetList * Function SetList
* sets the DRC_LIST for this listbox. Ownership of the DRC_ITEM_LIST is * sets the DRC_ITEM_LIST for this listbox. Ownership of the DRC_ITEM_LIST is
* transfered to this DRCLISTBOX. * transfered to this DRCLISTBOX.
* @param aList The DRC_ITEM_LIST* containing the DRC_ITEMs which will be * @param aList The DRC_ITEM_LIST* containing the DRC_ITEMs which will be
* displayed in the wxHtmlListBox * displayed in the wxHtmlListBox
...@@ -139,7 +143,7 @@ public: ...@@ -139,7 +143,7 @@ public:
* Function OnGetItem * Function OnGetItem
* returns the html text associated with the DRC_ITEM given by index 'n'. * returns the html text associated with the DRC_ITEM given by index 'n'.
* @param n An index into the list. * @param n An index into the list.
* @return wxString - the simply html text to show in the listbox. * @return wxString - the simple html text to show in the listbox.
*/ */
wxString OnGetItem( size_t n ) const wxString OnGetItem( size_t n ) const
{ {
...@@ -157,7 +161,7 @@ public: ...@@ -157,7 +161,7 @@ public:
* Function OnGetItem * Function OnGetItem
* returns the html text associated with the given index 'n'. * returns the html text associated with the given index 'n'.
* @param n An index into the list. * @param n An index into the list.
* @return wxString - the simply html text to show in the listbox. * @return wxString - the simple html text to show in the listbox.
*/ */
wxString OnGetItemMarkup( size_t n ) const wxString OnGetItemMarkup( size_t n ) const
{ {
...@@ -463,7 +467,6 @@ void DrcDialog::CreateControls() ...@@ -463,7 +467,6 @@ void DrcDialog::CreateControls()
m_UnconnectedListBox->Connect(ID_UNCONNECTED_LIST, wxEVT_RIGHT_UP, wxMouseEventHandler(DrcDialog::OnRightUpUnconnected), NULL, this); m_UnconnectedListBox->Connect(ID_UNCONNECTED_LIST, wxEVT_RIGHT_UP, wxMouseEventHandler(DrcDialog::OnRightUpUnconnected), NULL, this);
////@end DrcDialog content construction ////@end DrcDialog content construction
// @todo this is expanding the Clearance text, so we need to recalc sizers.
AddUnitSymbol(*m_ClearenceTitle); AddUnitSymbol(*m_ClearenceTitle);
Layout(); // adding the units above expanded Clearance text, now resize. Layout(); // adding the units above expanded Clearance text, now resize.
...@@ -535,12 +538,12 @@ void DrcDialog::OnStartdrcClick( wxCommandEvent& event ) ...@@ -535,12 +538,12 @@ void DrcDialog::OnStartdrcClick( wxCommandEvent& event )
m_ZonesTestCtrl->IsChecked(), m_ZonesTestCtrl->IsChecked(),
reportName, m_CreateRptCtrl->IsChecked() ); reportName, m_CreateRptCtrl->IsChecked() );
DelDRCMarkers();
m_Parent->Erase_Marqueurs();
m_Parent->ReDrawPanel();
SetCursor( wxCursor( wxCURSOR_WAIT ) ); SetCursor( wxCursor( wxCURSOR_WAIT ) );
wxYield(); // process the cursor change event and the redraw.
// run all the tests, with no UI at this time. // run all the tests, with no UI at this time.
m_tester->RunTests(); m_tester->RunTests();
...@@ -557,24 +560,20 @@ void DrcDialog::OnStartdrcClick( wxCommandEvent& event ) ...@@ -557,24 +560,20 @@ void DrcDialog::OnStartdrcClick( wxCommandEvent& event )
//msg.Printf( _( "Report file <%s> created\n" ), s_RptFilename.GetData() ); //msg.Printf( _( "Report file <%s> created\n" ), s_RptFilename.GetData() );
} }
SetCursor( wxCursor( wxCURSOR_WATCH ) ); SetCursor( wxCursor( wxCURSOR_ARROW ) );
// @todo set the list counts in the DRCLISTITEMS here.
m_Parent->ReDrawPanel(); RedrawDrawPanel();
// printf("done with tests\n");
} }
/*! /*!
* wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ERASE_DRC_MARKERS * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ERASE_DRC_MARKERS
*/ */
void DrcDialog::OnDeleteAllClick( wxCommandEvent& event ) void DrcDialog::OnDeleteAllClick( wxCommandEvent& event )
{ {
m_ClearanceListBox->DeleteAllItems(); DelDRCMarkers();
m_UnconnectedListBox->DeleteAllItems(); RedrawDrawPanel();
m_Parent->ReDrawPanel();
} }
...@@ -607,10 +606,11 @@ void DrcDialog::OnListUnconnectedClick( wxCommandEvent& event ) ...@@ -607,10 +606,11 @@ void DrcDialog::OnListUnconnectedClick( wxCommandEvent& event )
m_ZonesTestCtrl->IsChecked(), m_ZonesTestCtrl->IsChecked(),
reportName, m_CreateRptCtrl->IsChecked() ); reportName, m_CreateRptCtrl->IsChecked() );
DelDRCMarkers();
DelDRCMarkers();
SetCursor( wxCursor( wxCURSOR_WAIT ) ); SetCursor( wxCursor( wxCURSOR_WAIT ) );
wxYield();
// run all the tests, with no UI at this time. // run all the tests, with no UI at this time.
m_tester->ListUnconnectedPads(); m_tester->ListUnconnectedPads();
...@@ -628,11 +628,11 @@ void DrcDialog::OnListUnconnectedClick( wxCommandEvent& event ) ...@@ -628,11 +628,11 @@ void DrcDialog::OnListUnconnectedClick( wxCommandEvent& event )
//msg.Printf( _( "Report file <%s> created\n" ), s_RptFilename.GetData() ); //msg.Printf( _( "Report file <%s> created\n" ), s_RptFilename.GetData() );
} }
SetCursor( wxCursor( wxCURSOR_WATCH ) ); SetCursor( wxCursor( wxCURSOR_ARROW ) );
// @todo set the list counts in the DRCLISTITEMS here. // @todo set the list counts in the DRCLISTITEMS here.
m_Parent->ReDrawPanel(); RedrawDrawPanel();
} }
/*! /*!
...@@ -826,14 +826,18 @@ void DrcDialog::OnUnconnectedSelectionEvent( wxCommandEvent& event ) ...@@ -826,14 +826,18 @@ void DrcDialog::OnUnconnectedSelectionEvent( wxCommandEvent& event )
} }
void DrcDialog::RedrawDrawPanel()
{
m_Parent->DrawPanel->Refresh();
}
/*********************************************************/ /*********************************************************/
void DrcDialog::DelDRCMarkers() void DrcDialog::DelDRCMarkers()
/*********************************************************/ /*********************************************************/
{ {
m_Parent->Erase_Marqueurs(); m_ClearanceListBox->DeleteAllItems();
m_Parent->ReDrawPanel(); m_UnconnectedListBox->DeleteAllItems();
} }
......
...@@ -160,7 +160,9 @@ public: ...@@ -160,7 +160,9 @@ public:
static bool ShowToolTips(); static bool ShowToolTips();
void DelDRCMarkers(); void DelDRCMarkers();
void RedrawDrawPanel();
////@begin DrcDialog member variables ////@begin DrcDialog member variables
wxBoxSizer* m_MainSizer; wxBoxSizer* m_MainSizer;
wxBoxSizer* m_CommandSizer; wxBoxSizer* m_CommandSizer;
...@@ -181,6 +183,7 @@ public: ...@@ -181,6 +183,7 @@ public:
////@end DrcDialog member variables ////@end DrcDialog member variables
DRC* m_tester; DRC* m_tester;
WinEDA_PcbFrame* m_Parent; WinEDA_PcbFrame* m_Parent;
int m_UnconnectedCount; int m_UnconnectedCount;
......
...@@ -92,6 +92,7 @@ DRC::DRC( WinEDA_PcbFrame* aPcbWindow ) ...@@ -92,6 +92,7 @@ DRC::DRC( WinEDA_PcbFrame* aPcbWindow )
m_mainWindow = aPcbWindow; m_mainWindow = aPcbWindow;
m_drawPanel = aPcbWindow->DrawPanel; m_drawPanel = aPcbWindow->DrawPanel;
m_pcb = aPcbWindow->m_Pcb; m_pcb = aPcbWindow->m_Pcb;
m_ui = 0;
// establish initial values for everything: // establish initial values for everything:
m_doPad2PadTest = true; m_doPad2PadTest = true;
......
...@@ -250,11 +250,6 @@ public: ...@@ -250,11 +250,6 @@ public:
/** /**
* Class DRC * Class DRC
* is the Design Rule Checker, and performs all the DRC tests. The output of * is the Design Rule Checker, and performs all the DRC tests. The output of
......
...@@ -410,7 +410,7 @@ void WinEDA_DrawFrame::ReDrawPanel() ...@@ -410,7 +410,7 @@ void WinEDA_DrawFrame::ReDrawPanel()
{ {
if( DrawPanel == NULL ) if( DrawPanel == NULL )
return; return;
wxClientDC dc( DrawPanel ); wxClientDC dc( DrawPanel );
DrawPanel->PrepareGraphicContext( &dc ); DrawPanel->PrepareGraphicContext( &dc );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment