Save footprint errors in the DRC log

Fixes https://gitlab.com/kicad/code/kicad/issues/3754
This commit is contained in:
brian piccioni 2020-01-15 10:26:13 -05:00 committed by Ian McInerney
parent fe15511d38
commit c7db77e664
1 changed files with 63 additions and 56 deletions

View File

@ -23,19 +23,19 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <base_units.h>
#include <bitmaps.h>
#include <collectors.h>
#include <confirm.h>
#include <dialog_drc.h>
#include <fctsys.h>
#include <kiface_i.h>
#include <confirm.h>
#include <wildcards_and_files_ext.h>
#include <bitmaps.h>
#include <pgm_base.h>
#include <dialog_drc.h>
#include <pcb_edit_frame.h>
#include <base_units.h>
#include <view/view.h>
#include <collectors.h>
#include <pgm_base.h>
#include <tool/tool_manager.h>
#include <tools/pcb_actions.h>
#include <view/view.h>
#include <wildcards_and_files_ext.h>
/* class DIALOG_DRC_CONTROL: a dialog to set DRC parameters (clearance, min cooper size)
* and run DRC tests
@ -47,9 +47,9 @@
#define DrcTestFootprintsKey wxT( "DrcTestFootprints" )
DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* aEditorFrame,
wxWindow* aParent ) :
DIALOG_DRC_CONTROL_BASE( aParent ),
DIALOG_DRC_CONTROL::DIALOG_DRC_CONTROL(
DRC* aTester, PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent )
: DIALOG_DRC_CONTROL_BASE( aParent ),
m_trackMinWidth( aEditorFrame, m_TrackMinWidthTitle, m_SetTrackMinWidthCtrl,
m_TrackMinWidthUnit, true ),
m_viaMinSize( aEditorFrame, m_ViaMinTitle, m_SetViaMinSizeCtrl, m_ViaMinUnit, true ),
@ -141,7 +141,7 @@ void DIALOG_DRC_CONTROL::InitValues()
}
void DIALOG_DRC_CONTROL::SetDRCParameters( )
void DIALOG_DRC_CONTROL::SetDRCParameters()
{
m_BrdSettings.m_TrackMinWidth = m_trackMinWidth.GetValue();
m_BrdSettings.m_ViasMinSize = m_viaMinSize.GetValue();
@ -201,7 +201,7 @@ void DIALOG_DRC_CONTROL::OnStartdrcClick( wxCommandEvent& event )
// run all the tests, with no UI at this time.
m_Messages->Clear();
wxSafeYield(); // Allows time slice to refresh the Messages
m_tester->RunTests(m_Messages);
m_tester->RunTests( m_Messages );
m_Notebook->ChangeSelection( 0 ); // display the "Problems/Markers" tab
// Generate the report
@ -269,7 +269,7 @@ void DIALOG_DRC_CONTROL::OnReportCheckBoxClicked( wxCommandEvent& event )
}
void DIALOG_DRC_CONTROL::OnReportFilenameEdited( wxCommandEvent &event )
void DIALOG_DRC_CONTROL::OnReportFilenameEdited( wxCommandEvent& event )
{
m_CreateRptCtrl->SetValue( event.GetString().Length() );
}
@ -347,7 +347,7 @@ int DIALOG_DRC_CONTROL::rightUpClicSelection( DRCLISTBOX* aListBox, wxMouseEvent
// Check if user right-clicked on a different item, and select the right clicked item
int selection = aListBox->HitTest( event.GetPosition() );
if( selection >= (int)aListBox->GetItemCount() ) // Should not happen.
if( selection >= (int) aListBox->GetItemCount() ) // Should not happen.
selection = wxNOT_FOUND;
#endif
if( selection == wxNOT_FOUND )
@ -571,8 +571,7 @@ bool DIALOG_DRC_CONTROL::writeReport( const wxString& aFullFileName )
int count;
EDA_UNITS units = GetUserUnits();
fprintf( fp, "** Drc report for %s **\n",
TO_UTF8( m_brdEditor->GetBoard()->GetFileName() ) );
fprintf( fp, "** Drc report for %s **\n", TO_UTF8( m_brdEditor->GetBoard()->GetFileName() ) );
wxDateTime now = wxDateTime::Now();
@ -582,16 +581,24 @@ bool DIALOG_DRC_CONTROL::writeReport( const wxString& aFullFileName )
fprintf( fp, "\n** Found %d DRC errors **\n", count );
for( int i = 0; i<count; ++i )
for( int i = 0; i < count; ++i )
fprintf( fp, "%s", TO_UTF8( m_ClearanceListBox->GetItem( i )->ShowReport( units ) ) );
count = m_UnconnectedListBox->GetItemCount();
fprintf( fp, "\n** Found %d unconnected pads **\n", count );
for( int i = 0; i<count; ++i )
for( int i = 0; i < count; ++i )
fprintf( fp, "%s", TO_UTF8( m_UnconnectedListBox->GetItem( i )->ShowReport( units ) ) );
count = m_FootprintsListBox->GetItemCount();
fprintf( fp, "\n** Found %d Footprint errors **\n", count );
for( int i = 0; i < count; ++i )
fprintf( fp, "%s", TO_UTF8( m_FootprintsListBox->GetItem( i )->ShowReport( units ) ) );
fprintf( fp, "\n** End of Report **\n" );
fclose( fp );