Save severities settings in the DRC dialog.
Fixes https://gitlab.com/kicad/code/kicad/issues/3978
This commit is contained in:
parent
12088f240d
commit
0894674869
|
@ -94,27 +94,12 @@ DIALOG_DRC_CONTROL::~DIALOG_DRC_CONTROL()
|
||||||
settings->m_DrcDialog.refill_zones = m_cbRefillZones->GetValue();
|
settings->m_DrcDialog.refill_zones = m_cbRefillZones->GetValue();
|
||||||
settings->m_DrcDialog.test_track_to_zone = m_cbReportAllTrackErrors->GetValue();
|
settings->m_DrcDialog.test_track_to_zone = m_cbReportAllTrackErrors->GetValue();
|
||||||
settings->m_DrcDialog.test_footprints = m_cbTestFootprints->GetValue();
|
settings->m_DrcDialog.test_footprints = m_cbTestFootprints->GetValue();
|
||||||
|
settings->m_DrcDialog.severities = m_severities;
|
||||||
|
|
||||||
m_markerTreeModel->DecRef();
|
m_markerTreeModel->DecRef();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_DRC_CONTROL::SetSettings( int aSeverities )
|
|
||||||
{
|
|
||||||
m_severities = aSeverities;
|
|
||||||
|
|
||||||
m_markerTreeModel->SetSeverities( m_severities );
|
|
||||||
m_unconnectedTreeModel->SetSeverities( m_severities );
|
|
||||||
m_footprintWarningsTreeModel->SetSeverities( m_severities );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_DRC_CONTROL::GetSettings( int* aSeverities )
|
|
||||||
{
|
|
||||||
*aSeverities = m_severities;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void DIALOG_DRC_CONTROL::OnActivateDlg( wxActivateEvent& aEvent )
|
void DIALOG_DRC_CONTROL::OnActivateDlg( wxActivateEvent& aEvent )
|
||||||
{
|
{
|
||||||
if( m_currentBoard != m_brdEditor->GetBoard() )
|
if( m_currentBoard != m_brdEditor->GetBoard() )
|
||||||
|
@ -162,6 +147,7 @@ void DIALOG_DRC_CONTROL::initValues()
|
||||||
m_cbRefillZones->SetValue( cfg->m_DrcDialog.refill_zones );
|
m_cbRefillZones->SetValue( cfg->m_DrcDialog.refill_zones );
|
||||||
m_cbReportAllTrackErrors->SetValue( cfg->m_DrcDialog.test_track_to_zone );
|
m_cbReportAllTrackErrors->SetValue( cfg->m_DrcDialog.test_track_to_zone );
|
||||||
m_cbTestFootprints->SetValue( cfg->m_DrcDialog.test_footprints );
|
m_cbTestFootprints->SetValue( cfg->m_DrcDialog.test_footprints );
|
||||||
|
m_severities = cfg->m_DrcDialog.severities;
|
||||||
|
|
||||||
Layout(); // adding the units above expanded Clearance text, now resize.
|
Layout(); // adding the units above expanded Clearance text, now resize.
|
||||||
|
|
||||||
|
|
|
@ -54,9 +54,6 @@ public:
|
||||||
DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
|
DIALOG_DRC_CONTROL( DRC* aTester, PCB_EDIT_FRAME* aEditorFrame, wxWindow* aParent );
|
||||||
~DIALOG_DRC_CONTROL();
|
~DIALOG_DRC_CONTROL();
|
||||||
|
|
||||||
void SetSettings( int aSeverities );
|
|
||||||
void GetSettings( int* aSeverities );
|
|
||||||
|
|
||||||
void SetMarkersProvider( DRC_ITEMS_PROVIDER* aProvider );
|
void SetMarkersProvider( DRC_ITEMS_PROVIDER* aProvider );
|
||||||
void SetUnconnectedProvider( DRC_ITEMS_PROVIDER* aProvider );
|
void SetUnconnectedProvider( DRC_ITEMS_PROVIDER* aProvider );
|
||||||
void SetFootprintsProvider( DRC_ITEMS_PROVIDER* aProvider );
|
void SetFootprintsProvider( DRC_ITEMS_PROVIDER* aProvider );
|
||||||
|
|
|
@ -74,8 +74,6 @@ DRC::DRC() :
|
||||||
m_drcRun = false;
|
m_drcRun = false;
|
||||||
m_footprintsTested = false;
|
m_footprintsTested = false;
|
||||||
|
|
||||||
m_severities = RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING;
|
|
||||||
|
|
||||||
m_segmAngle = 0;
|
m_segmAngle = 0;
|
||||||
m_segmLength = 0;
|
m_segmLength = 0;
|
||||||
|
|
||||||
|
@ -132,8 +130,6 @@ void DRC::ShowDRCDialog( wxWindow* aParent )
|
||||||
m_drcDialog = new DIALOG_DRC_CONTROL( this, m_pcbEditorFrame, aParent );
|
m_drcDialog = new DIALOG_DRC_CONTROL( this, m_pcbEditorFrame, aParent );
|
||||||
updatePointers();
|
updatePointers();
|
||||||
|
|
||||||
m_drcDialog->SetSettings( m_severities );
|
|
||||||
|
|
||||||
if( show_dlg_modal )
|
if( show_dlg_modal )
|
||||||
m_drcDialog->ShowModal();
|
m_drcDialog->ShowModal();
|
||||||
else
|
else
|
||||||
|
@ -166,8 +162,6 @@ void DRC::DestroyDRCDialog( int aReason )
|
||||||
{
|
{
|
||||||
if( m_drcDialog )
|
if( m_drcDialog )
|
||||||
{
|
{
|
||||||
m_drcDialog->GetSettings( &m_severities );
|
|
||||||
|
|
||||||
m_drcDialog->Destroy();
|
m_drcDialog->Destroy();
|
||||||
m_drcDialog = nullptr;
|
m_drcDialog = nullptr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,6 @@ private:
|
||||||
bool m_refillZones; // refill zones if requested (by user).
|
bool m_refillZones; // refill zones if requested (by user).
|
||||||
bool m_reportAllTrackErrors; // Report all tracks errors (or only 4 first errors)
|
bool m_reportAllTrackErrors; // Report all tracks errors (or only 4 first errors)
|
||||||
bool m_testFootprints; // Test footprints against schematic
|
bool m_testFootprints; // Test footprints against schematic
|
||||||
int m_severities; // Severities of DRC violations to display
|
|
||||||
|
|
||||||
/* In DRC functions, many calculations are using coordinates relative
|
/* In DRC functions, many calculations are using coordinates relative
|
||||||
* to the position of the segment under test (segm to segm DRC, segm to pad DRC
|
* to the position of the segment under test (segm to segm DRC, segm to pad DRC
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include <wx/config.h>
|
#include <wx/config.h>
|
||||||
#include <wx/tokenzr.h>
|
#include <wx/tokenzr.h>
|
||||||
#include <zones.h>
|
#include <zones.h>
|
||||||
|
#include <widgets/ui_common.h>
|
||||||
|
|
||||||
#include "../3d-viewer/3d_viewer/3d_viewer_settings.h"
|
#include "../3d-viewer/3d_viewer/3d_viewer_settings.h"
|
||||||
|
|
||||||
|
@ -177,6 +178,9 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() : APP_SETTINGS_BASE( "pcbnew", pcbnewSchemaVe
|
||||||
m_params.emplace_back( new PARAM<bool>( "drc_dialog.test_footprints",
|
m_params.emplace_back( new PARAM<bool>( "drc_dialog.test_footprints",
|
||||||
&m_DrcDialog.test_footprints, false ) );
|
&m_DrcDialog.test_footprints, false ) );
|
||||||
|
|
||||||
|
m_params.emplace_back( new PARAM<int>( "drc_dialog.severities",
|
||||||
|
&m_DrcDialog.severities, RPT_SEVERITY_ERROR | RPT_SEVERITY_WARNING ) );
|
||||||
|
|
||||||
m_params.emplace_back( new PARAM<bool>( "gen_drill.merge_pth_npth",
|
m_params.emplace_back( new PARAM<bool>( "gen_drill.merge_pth_npth",
|
||||||
&m_GenDrill.merge_pth_npth, false ) );
|
&m_GenDrill.merge_pth_npth, false ) );
|
||||||
|
|
||||||
|
|
|
@ -64,6 +64,7 @@ public:
|
||||||
bool refill_zones;
|
bool refill_zones;
|
||||||
bool test_track_to_zone;
|
bool test_track_to_zone;
|
||||||
bool test_footprints;
|
bool test_footprints;
|
||||||
|
int severities;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DIALOG_EXPORT_IDF
|
struct DIALOG_EXPORT_IDF
|
||||||
|
|
Loading…
Reference in New Issue