Keep Footprint Checker info between runs.
This commit is contained in:
parent
28f7221cc3
commit
eac3d33266
|
@ -34,18 +34,29 @@
|
||||||
#include <tools/footprint_editor_control.h>
|
#include <tools/footprint_editor_control.h>
|
||||||
|
|
||||||
|
|
||||||
|
static FOOTPRINT* g_lastFootprint = nullptr;
|
||||||
|
static bool g_lastChecksRun = false;
|
||||||
|
|
||||||
|
|
||||||
DIALOG_FOOTPRINT_CHECKER::DIALOG_FOOTPRINT_CHECKER( FOOTPRINT_EDIT_FRAME* aParent ) :
|
DIALOG_FOOTPRINT_CHECKER::DIALOG_FOOTPRINT_CHECKER( FOOTPRINT_EDIT_FRAME* aParent ) :
|
||||||
DIALOG_FOOTPRINT_CHECKER_BASE( aParent ),
|
DIALOG_FOOTPRINT_CHECKER_BASE( aParent ),
|
||||||
m_frame( aParent ),
|
m_frame( aParent ),
|
||||||
m_checksRun( false ),
|
m_checksRun( false ),
|
||||||
m_markersProvider( nullptr ),
|
|
||||||
m_centerMarkerOnIdle( nullptr ),
|
m_centerMarkerOnIdle( nullptr ),
|
||||||
m_severities( RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING )
|
m_severities( RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING )
|
||||||
{
|
{
|
||||||
|
m_markersProvider = new DRC_ITEMS_PROVIDER( m_frame->GetBoard(), MARKER_BASE::MARKER_DRC );
|
||||||
m_markersTreeModel = new RC_TREE_MODEL( m_frame, m_markersDataView );
|
m_markersTreeModel = new RC_TREE_MODEL( m_frame, m_markersDataView );
|
||||||
m_markersDataView->AssociateModel( m_markersTreeModel );
|
m_markersDataView->AssociateModel( m_markersTreeModel );
|
||||||
|
|
||||||
m_markersTreeModel->SetSeverities( -1 );
|
m_markersTreeModel->SetSeverities( -1 );
|
||||||
|
m_markersTreeModel->SetProvider( m_markersProvider );
|
||||||
|
|
||||||
|
if( m_frame->GetBoard()->GetFirstFootprint() == g_lastFootprint )
|
||||||
|
{
|
||||||
|
m_checksRun = g_lastChecksRun;
|
||||||
|
updateDisplayedCounts();
|
||||||
|
}
|
||||||
|
|
||||||
SetupStandardButtons( { { wxID_OK, _( "Run Checks" ) },
|
SetupStandardButtons( { { wxID_OK, _( "Run Checks" ) },
|
||||||
{ wxID_CANCEL, _( "Close" ) } } );
|
{ wxID_CANCEL, _( "Close" ) } } );
|
||||||
|
@ -58,6 +69,11 @@ DIALOG_FOOTPRINT_CHECKER::DIALOG_FOOTPRINT_CHECKER( FOOTPRINT_EDIT_FRAME* aParen
|
||||||
|
|
||||||
DIALOG_FOOTPRINT_CHECKER::~DIALOG_FOOTPRINT_CHECKER()
|
DIALOG_FOOTPRINT_CHECKER::~DIALOG_FOOTPRINT_CHECKER()
|
||||||
{
|
{
|
||||||
|
m_frame->FocusOnItem( nullptr );
|
||||||
|
|
||||||
|
g_lastFootprint = m_frame->GetBoard()->GetFirstFootprint();
|
||||||
|
g_lastChecksRun = m_checksRun;
|
||||||
|
|
||||||
m_markersTreeModel->DecRef();
|
m_markersTreeModel->DecRef();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,6 +190,9 @@ void DIALOG_FOOTPRINT_CHECKER::runChecks()
|
||||||
|
|
||||||
void DIALOG_FOOTPRINT_CHECKER::SetMarkersProvider( RC_ITEMS_PROVIDER* aProvider )
|
void DIALOG_FOOTPRINT_CHECKER::SetMarkersProvider( RC_ITEMS_PROVIDER* aProvider )
|
||||||
{
|
{
|
||||||
|
// TreeModel owns the provider, not us
|
||||||
|
// delete m_markersProvider;
|
||||||
|
|
||||||
m_markersProvider = aProvider;
|
m_markersProvider = aProvider;
|
||||||
m_markersTreeModel->SetProvider( aProvider );
|
m_markersTreeModel->SetProvider( aProvider );
|
||||||
updateDisplayedCounts();
|
updateDisplayedCounts();
|
||||||
|
|
|
@ -29,8 +29,9 @@
|
||||||
#include <fp_lib_table.h>
|
#include <fp_lib_table.h>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <kiway_express.h>
|
#include <kiway_express.h>
|
||||||
#include <pcbnew_id.h>
|
#include <pcb_marker.h>
|
||||||
#include <ratsnest/ratsnest_data.h>
|
#include <pad.h>
|
||||||
|
#include <zone.h>
|
||||||
#include <settings/color_settings.h>
|
#include <settings/color_settings.h>
|
||||||
#include <tool/tool_manager.h>
|
#include <tool/tool_manager.h>
|
||||||
#include <tools/pcb_actions.h>
|
#include <tools/pcb_actions.h>
|
||||||
|
@ -285,6 +286,7 @@ void FOOTPRINT_EDIT_FRAME::SetActiveLayer( PCB_LAYER_ID aLayer )
|
||||||
GetCanvas()->Refresh();
|
GetCanvas()->Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool FOOTPRINT_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl )
|
bool FOOTPRINT_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, int aCtl )
|
||||||
{
|
{
|
||||||
if( !Clear_Pcb( true ) )
|
if( !Clear_Pcb( true ) )
|
||||||
|
@ -354,6 +356,6 @@ void FOOTPRINT_EDIT_FRAME::KiwayMailIn( KIWAY_EXPRESS& mail )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue