From d1dd446e4ef652b1d574f434de3ca172cdfc1485 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 8 Aug 2025 22:31:09 +0100 Subject: [PATCH] Remove more old open-coded dialog state saving. (State saving is now handled uniformly in DIALOG_SHIM.) --- .../dialog_cleanup_tracks_and_vias.cpp | 109 +++------- .../dialogs/dialog_cleanup_tracks_and_vias.h | 11 +- .../dialogs/dialog_gen_footprint_position.cpp | 142 +++--------- .../dialogs/dialog_gen_footprint_position.h | 25 +-- ...ialog_gen_footprint_position_file_base.cpp | 4 +- ...ialog_gen_footprint_position_file_base.fbp | 6 +- pcbnew/dialogs/dialog_gendrill.cpp | 105 +++------ pcbnew/dialogs/dialog_gendrill.h | 2 - pcbnew/dialogs/dialog_gendrill_base.cpp | 2 +- pcbnew/dialogs/dialog_gendrill_base.fbp | 2 +- pcbnew/dialogs/dialog_import_netlist.cpp | 47 +--- pcbnew/dialogs/dialog_import_netlist.h | 10 +- pcbnew/dialogs/dialog_import_netlist_base.cpp | 4 +- pcbnew/dialogs/dialog_import_netlist_base.fbp | 104 ++++----- pcbnew/dialogs/dialog_import_netlist_base.h | 2 +- pcbnew/dialogs/dialog_update_pcb.cpp | 18 -- pcbnew/dialogs/dialog_update_pcb.h | 6 +- pcbnew/import_gfx/dialog_import_graphics.cpp | 63 ------ pcbnew/import_gfx/dialog_import_graphics.h | 20 +- .../dialog_import_graphics_base.cpp | 9 +- .../dialog_import_graphics_base.fbp | 204 +++++++++--------- .../import_gfx/dialog_import_graphics_base.h | 3 +- pcbnew/pcbnew_settings.cpp | 144 ------------- pcbnew/pcbnew_settings.h | 75 ------- 24 files changed, 292 insertions(+), 825 deletions(-) diff --git a/pcbnew/dialogs/dialog_cleanup_tracks_and_vias.cpp b/pcbnew/dialogs/dialog_cleanup_tracks_and_vias.cpp index 89b5773a8b..1c6d8aa3f6 100644 --- a/pcbnew/dialogs/dialog_cleanup_tracks_and_vias.cpp +++ b/pcbnew/dialogs/dialog_cleanup_tracks_and_vias.cpp @@ -44,18 +44,25 @@ DIALOG_CLEANUP_TRACKS_AND_VIAS::DIALOG_CLEANUP_TRACKS_AND_VIAS( PCB_EDIT_FRAME* { m_reporter = new WX_TEXT_CTRL_REPORTER( m_tcReport ); - if( PCBNEW_SETTINGS* cfg = m_parentFrame->GetPcbNewSettings() ) - { - m_cbRefillZones->SetValue( cfg->m_Cleanup.cleanup_refill_zones ); - m_cleanViasOpt->SetValue( cfg->m_Cleanup.cleanup_vias ); - m_mergeSegmOpt->SetValue( cfg->m_Cleanup.merge_segments ); - m_deleteUnconnectedOpt->SetValue( cfg->m_Cleanup.cleanup_unconnected ); - m_cleanShortCircuitOpt->SetValue( cfg->m_Cleanup.cleanup_short_circuits ); - m_deleteTracksInPadsOpt->SetValue( cfg->m_Cleanup.cleanup_tracks_in_pad ); - m_deleteDanglingViasOpt->SetValue( cfg->m_Cleanup.delete_dangling_vias ); - } + // Populate the net filter list with net names + m_netFilter->SetNetInfo( &m_brd->GetNetInfo() ); - buildFilterLists(); + // Populate the netclass filter list with netclass names + wxArrayString netclassNames; + std::shared_ptr& settings = m_brd->GetDesignSettings().m_NetSettings; + + netclassNames.push_back( settings->GetDefaultNetclass()->GetName() ); + + for( const auto& [name, netclass] : settings->GetNetclasses() ) + netclassNames.push_back( name ); + + m_netclassFilter->Set( netclassNames ); + + // Populate the layer filter list + m_layerFilter->SetBoardFrame( m_parentFrame ); + m_layerFilter->SetLayersHotkeys( false ); + m_layerFilter->SetNotAllowedLayerSet( LSET::AllNonCuMask() ); + m_layerFilter->Resync(); m_changesTreeModel = new RC_TREE_MODEL( m_parentFrame, m_changesDataView ); m_changesDataView->AssociateModel( m_changesTreeModel ); @@ -74,50 +81,10 @@ DIALOG_CLEANUP_TRACKS_AND_VIAS::DIALOG_CLEANUP_TRACKS_AND_VIAS( PCB_EDIT_FRAME* DIALOG_CLEANUP_TRACKS_AND_VIAS::~DIALOG_CLEANUP_TRACKS_AND_VIAS() { - if( PCBNEW_SETTINGS* cfg = m_parentFrame->GetPcbNewSettings() ) - { - cfg->m_Cleanup.cleanup_refill_zones = m_cbRefillZones->GetValue(); - cfg->m_Cleanup.cleanup_vias = m_cleanViasOpt->GetValue(); - cfg->m_Cleanup.merge_segments = m_mergeSegmOpt->GetValue(); - cfg->m_Cleanup.cleanup_unconnected = m_deleteUnconnectedOpt->GetValue(); - cfg->m_Cleanup.cleanup_short_circuits = m_cleanShortCircuitOpt->GetValue(); - cfg->m_Cleanup.cleanup_tracks_in_pad = m_deleteTracksInPadsOpt->GetValue(); - cfg->m_Cleanup.delete_dangling_vias = m_deleteDanglingViasOpt->GetValue(); - } - m_changesTreeModel->DecRef(); } -void DIALOG_CLEANUP_TRACKS_AND_VIAS::buildFilterLists() -{ - // Populate the net filter list with net names - m_netFilter->SetNetInfo( &m_brd->GetNetInfo() ); - - if( !m_brd->GetHighLightNetCodes().empty() ) - m_netFilter->SetSelectedNetcode( *m_brd->GetHighLightNetCodes().begin() ); - - // Populate the netclass filter list with netclass names - wxArrayString netclassNames; - std::shared_ptr& settings = m_brd->GetDesignSettings().m_NetSettings; - - netclassNames.push_back( settings->GetDefaultNetclass()->GetName() ); - - for( const auto& [name, netclass] : settings->GetNetclasses() ) - netclassNames.push_back( name ); - - m_netclassFilter->Set( netclassNames ); - m_netclassFilter->SetStringSelection( m_brd->GetDesignSettings().GetCurrentNetClassName() ); - - // Populate the layer filter list - m_layerFilter->SetBoardFrame( m_parentFrame ); - m_layerFilter->SetLayersHotkeys( false ); - m_layerFilter->SetNotAllowedLayerSet( LSET::AllNonCuMask() ); - m_layerFilter->Resync(); - m_layerFilter->SetLayerSelection( m_parentFrame->GetActiveLayer() ); -} - - void DIALOG_CLEANUP_TRACKS_AND_VIAS::setupOKButtonLabel() { if( m_firstRun ) @@ -155,6 +122,11 @@ void DIALOG_CLEANUP_TRACKS_AND_VIAS::OnLayerFilterSelect( wxCommandEvent& aEvent bool DIALOG_CLEANUP_TRACKS_AND_VIAS::TransferDataToWindow() { + if( !m_brd->GetHighLightNetCodes().empty() ) + m_netFilter->SetSelectedNetcode( *m_brd->GetHighLightNetCodes().begin() ); + + m_netclassFilter->SetStringSelection( m_brd->GetDesignSettings().GetCurrentNetClassName() ); + m_layerFilter->SetLayerSelection( m_parentFrame->GetActiveLayer() ); return true; } @@ -178,29 +150,10 @@ void DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup( bool aDryRun ) BOARD_COMMIT commit( m_parentFrame ); TRACKS_CLEANER cleaner( m_brd, commit ); - struct FILTER_STATE - { - bool selectedOnly; - int netCodeOnly; - wxString netClassOnly; - int layerOnly; - }; - - FILTER_STATE filter_state = { - .selectedOnly = m_selectedItemsFilter->GetValue(), - .netCodeOnly = m_netFilterOpt->GetValue() ? m_netFilter->GetSelectedNetcode() : -1, - .netClassOnly = m_netclassFilterOpt->GetValue() - ? m_netclassFilter->GetStringSelection() - : wxString(), - .layerOnly = m_layerFilterOpt->GetValue() - ? m_layerFilter->GetLayerSelection() - : UNDEFINED_LAYER - }; - cleaner.SetFilter( - [&, filter_state]( BOARD_CONNECTED_ITEM* aItem ) -> bool + [&]( BOARD_CONNECTED_ITEM* aItem ) -> bool { - if( filter_state.selectedOnly ) + if( m_selectedItemsFilter->GetValue() ) { if( !aItem->IsSelected() ) { @@ -214,23 +167,23 @@ void DIALOG_CLEANUP_TRACKS_AND_VIAS::doCleanup( bool aDryRun ) } } - if( filter_state.netCodeOnly >= 0 ) + if( m_netFilterOpt->GetValue() ) { - if( aItem->GetNetCode() != filter_state.netCodeOnly ) + if( aItem->GetNetCode() != m_netFilter->GetSelectedNetcode() ) return true; } - if( !filter_state.netClassOnly.IsEmpty() ) + if( m_netclassFilterOpt->GetValue() ) { NETCLASS* netclass = aItem->GetEffectiveNetClass(); - if( !netclass->ContainsNetclassWithName( filter_state.netClassOnly ) ) + if( !netclass->ContainsNetclassWithName( m_netclassFilter->GetStringSelection() ) ) return true; } - if( filter_state.layerOnly != UNDEFINED_LAYER ) + if( m_layerFilterOpt->GetValue() ) { - if( aItem->GetLayer() != filter_state.layerOnly ) + if( aItem->GetLayer() != m_layerFilter->GetLayerSelection() ) return true; } diff --git a/pcbnew/dialogs/dialog_cleanup_tracks_and_vias.h b/pcbnew/dialogs/dialog_cleanup_tracks_and_vias.h index 7b61cb2527..2dc26db815 100644 --- a/pcbnew/dialogs/dialog_cleanup_tracks_and_vias.h +++ b/pcbnew/dialogs/dialog_cleanup_tracks_and_vias.h @@ -22,8 +22,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef DIALOG_CLEANUP_TRACKS_AND_VIAS_H_ -#define DIALOG_CLEANUP_TRACKS_AND_VIAS_H_ +#pragma once #include #include @@ -41,7 +40,6 @@ public: private: void doCleanup( bool aDryRun ); - void buildFilterLists(); void setupOKButtonLabel(); void OnCheckBox( wxCommandEvent& aEvent ) override; @@ -54,13 +52,12 @@ private: bool TransferDataToWindow() override; bool TransferDataFromWindow() override; +private: PCB_EDIT_FRAME* m_parentFrame; BOARD* m_brd; RC_TREE_MODEL* m_changesTreeModel; bool m_firstRun; - std::vector > m_items; - WX_TEXT_CTRL_REPORTER* m_reporter; + std::vector> m_items; + WX_TEXT_CTRL_REPORTER* m_reporter; }; - -#endif // DIALOG_CLEANUP_TRACKS_AND_VIAS_H_ diff --git a/pcbnew/dialogs/dialog_gen_footprint_position.cpp b/pcbnew/dialogs/dialog_gen_footprint_position.cpp index dbaac7796f..525b971b3b 100644 --- a/pcbnew/dialogs/dialog_gen_footprint_position.cpp +++ b/pcbnew/dialogs/dialog_gen_footprint_position.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -52,12 +51,20 @@ DIALOG_GEN_FOOTPRINT_POSITION::DIALOG_GEN_FOOTPRINT_POSITION( PCB_EDIT_FRAME* aE m_job( nullptr ) { m_messagesPanel->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) ); + m_messagesPanel->MsgPanelSetMinSize( wxSize( -1, 160 ) ); m_reporter = &m_messagesPanel->Reporter(); - initDialog(); + + m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) ); + + m_outputDirectoryName->SetValue( m_editFrame->Prj().GetProjectFile().m_PcbLastPath[LAST_PATH_POS_FILES] ); SetupStandardButtons( { { wxID_OK, _( "Generate Position File" ) }, { wxID_CANCEL, _( "Close" ) } } ); + // DIALOG_SHIM needs a unique hash_key because classname will be the same for both job and + // non-job versions (which have different sizes). + m_hash_key = TO_UTF8( GetTitle() ); + GetSizer()->SetSizeHints( this ); Centre(); } @@ -71,72 +78,33 @@ DIALOG_GEN_FOOTPRINT_POSITION::DIALOG_GEN_FOOTPRINT_POSITION( JOB_EXPORT_PCB_POS m_editFrame( aEditFrame ), m_job( aJob ) { + SetTitle( m_job->GetSettingsDialogTitle() ); + + m_browseButton->Hide(); + m_units = m_job->m_units == JOB_EXPORT_PCB_POS::UNITS::INCH ? EDA_UNITS::INCH : EDA_UNITS::MM; + m_staticTextDir->SetLabel( _( "Output file:" ) ); + m_outputDirectoryName->SetValue( m_job->GetConfiguredOutputPath() ); + + m_unitsCtrl->SetSelection( static_cast( m_job->m_units ) ); + m_singleFile->SetValue( m_job->m_singleFile ); + m_formatCtrl->SetSelection( static_cast( m_job->m_format ) ); + m_cbIncludeBoardEdge->SetValue( m_job->m_gerberBoardEdge ); + m_useDrillPlaceOrigin->SetValue( m_job->m_useDrillPlaceFileOrigin ); + m_onlySMD->SetValue( m_job->m_smdOnly ); + m_negateXcb->SetValue( m_job->m_negateBottomX ); + m_excludeTH->SetValue( m_job->m_excludeFootprintsWithTh ); + m_excludeDNP->SetValue( m_job->m_excludeDNP ); + m_messagesPanel->Hide(); - initDialog(); SetupStandardButtons(); - GetSizer()->SetSizeHints( this ); - Centre(); -} - - -void DIALOG_GEN_FOOTPRINT_POSITION::initDialog() -{ - if( !m_job ) - { - m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) ); - - PROJECT_FILE& projectFile = m_editFrame->Prj().GetProjectFile(); - - if( PCBNEW_SETTINGS* cfg = m_editFrame->GetPcbNewSettings() ) - { - m_units = cfg->m_PlaceFile.units == 0 ? EDA_UNITS::INCH : EDA_UNITS::MM; - - // Output directory - m_outputDirectoryName->SetValue( projectFile.m_PcbLastPath[LAST_PATH_POS_FILES] ); - - // Update Options - m_unitsCtrl->SetSelection( cfg->m_PlaceFile.units ); - m_singleFile->SetValue( cfg->m_PlaceFile.file_options == 1 ); - m_formatCtrl->SetSelection( cfg->m_PlaceFile.file_format ); - m_cbIncludeBoardEdge->SetValue( cfg->m_PlaceFile.include_board_edge ); - m_useDrillPlaceOrigin->SetValue( cfg->m_PlaceFile.use_aux_origin ); - m_onlySMD->SetValue( cfg->m_PlaceFile.only_SMD ); - m_negateXcb->SetValue( cfg->m_PlaceFile.negate_xcoord ); - m_excludeTH->SetValue( cfg->m_PlaceFile.exclude_TH ); - } - - // Update sizes and sizers: - m_messagesPanel->MsgPanelSetMinSize( wxSize( -1, 160 ) ); - } - else - { - SetTitle( m_job->GetSettingsDialogTitle() ); - - m_browseButton->Hide(); - m_units = m_job->m_units == JOB_EXPORT_PCB_POS::UNITS::INCH ? EDA_UNITS::INCH : EDA_UNITS::MM; - m_staticTextDir->SetLabel( _( "Output file:" ) ); - m_outputDirectoryName->SetValue( m_job->GetConfiguredOutputPath() ); - - m_unitsCtrl->SetSelection( static_cast( m_job->m_units ) ); - m_singleFile->SetValue( m_job->m_singleFile ); - m_formatCtrl->SetSelection( static_cast( m_job->m_format ) ); - m_cbIncludeBoardEdge->SetValue( m_job->m_gerberBoardEdge ); - m_useDrillPlaceOrigin->SetValue( m_job->m_useDrillPlaceFileOrigin ); - m_onlySMD->SetValue( m_job->m_smdOnly ); - m_negateXcb->SetValue( m_job->m_negateBottomX ); - m_excludeTH->SetValue( m_job->m_excludeFootprintsWithTh ); - m_excludeDNP->SetValue( m_job->m_excludeDNP ); - - m_messagesPanel->Hide(); - } - // DIALOG_SHIM needs a unique hash_key because classname will be the same for both job and // non-job versions (which have different sizes). m_hash_key = TO_UTF8( GetTitle() ); GetSizer()->SetSizeHints( this ); + Centre(); } @@ -194,36 +162,6 @@ void DIALOG_GEN_FOOTPRINT_POSITION::onUpdateUIExcludeTH( wxUpdateUIEvent& event } -bool DIALOG_GEN_FOOTPRINT_POSITION::UnitsMM() -{ - return m_unitsCtrl->GetSelection() == 1; -} - - -bool DIALOG_GEN_FOOTPRINT_POSITION::OneFileOnly() -{ - return m_singleFile->GetValue(); -} - - -bool DIALOG_GEN_FOOTPRINT_POSITION::OnlySMD() -{ - return m_onlySMD->GetValue(); -} - - -bool DIALOG_GEN_FOOTPRINT_POSITION::ExcludeAllTH() -{ - return m_excludeTH->GetValue(); -} - - -bool DIALOG_GEN_FOOTPRINT_POSITION::ExcludeDNP() -{ - return m_excludeDNP->GetValue(); -} - - void DIALOG_GEN_FOOTPRINT_POSITION::onUpdateUIincludeBoardEdge( wxUpdateUIEvent& event ) { m_cbIncludeBoardEdge->Enable( m_formatCtrl->GetSelection() == 2 ); @@ -252,8 +190,7 @@ void DIALOG_GEN_FOOTPRINT_POSITION::onOutputDirectoryBrowseClicked( wxCommandEve if( !dirName.MakeRelativeTo( boardFilePath ) ) { - wxMessageBox( _( "Cannot make path relative (target volume different from board " - "file volume)!" ), + wxMessageBox( _( "Cannot make path relative (target volume different from board file volume)!" ), _( "Plot Output Directory" ), wxOK | wxICON_ERROR ); } } @@ -268,24 +205,11 @@ void DIALOG_GEN_FOOTPRINT_POSITION::onGenerate( wxCommandEvent& event ) { m_units = m_unitsCtrl->GetSelection() == 0 ? EDA_UNITS::INCH : EDA_UNITS::MM; - wxString dirStr = m_outputDirectoryName->GetValue(); + m_outputDirectory = m_outputDirectoryName->GetValue(); // Keep unix directory format convention in cfg files - dirStr.Replace( wxT( "\\" ), wxT( "/" ) ); + m_outputDirectory.Replace( wxT( "\\" ), wxT( "/" ) ); - m_editFrame->Prj().GetProjectFile().m_PcbLastPath[LAST_PATH_POS_FILES] = dirStr; - - if( PCBNEW_SETTINGS* cfg = m_editFrame->GetPcbNewSettings() ) - { - cfg->m_PlaceFile.output_directory = dirStr; - cfg->m_PlaceFile.units = m_units == EDA_UNITS::INCH ? 0 : 1; - cfg->m_PlaceFile.file_options = m_singleFile->GetValue() ? 1 : 0; - cfg->m_PlaceFile.file_format = m_formatCtrl->GetSelection(); - cfg->m_PlaceFile.include_board_edge = m_cbIncludeBoardEdge->GetValue(); - cfg->m_PlaceFile.exclude_TH = m_excludeTH->GetValue(); - cfg->m_PlaceFile.only_SMD = m_onlySMD->GetValue(); - cfg->m_PlaceFile.use_aux_origin = m_useDrillPlaceOrigin->GetValue(); - cfg->m_PlaceFile.negate_xcoord = m_negateXcb->GetValue(); - } + m_editFrame->Prj().GetProjectFile().m_PcbLastPath[LAST_PATH_POS_FILES] = m_outputDirectory; if( m_formatCtrl->GetSelection() == 2 ) CreateGerberFiles(); @@ -328,7 +252,7 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateGerberFiles() return m_editFrame->GetBoard()->ResolveTextVar( token, 0 ); }; - wxString path = m_editFrame->GetPcbNewSettings()->m_PlaceFile.output_directory; + wxString path = m_outputDirectory; path = ExpandTextVars( path, &textResolver ); path = ExpandEnvVarSubstitutions( path, nullptr ); @@ -437,7 +361,7 @@ bool DIALOG_GEN_FOOTPRINT_POSITION::CreateAsciiFiles() return m_editFrame->GetBoard()->ResolveTextVar( token, 0 ); }; - wxString path = m_editFrame->GetPcbNewSettings()->m_PlaceFile.output_directory; + wxString path = m_outputDirectory; path = ExpandTextVars( path, &textResolver ); path = ExpandEnvVarSubstitutions( path, nullptr ); diff --git a/pcbnew/dialogs/dialog_gen_footprint_position.h b/pcbnew/dialogs/dialog_gen_footprint_position.h index df10c73ba7..68696276ac 100644 --- a/pcbnew/dialogs/dialog_gen_footprint_position.h +++ b/pcbnew/dialogs/dialog_gen_footprint_position.h @@ -41,20 +41,14 @@ public: wxWindow* aParent ); private: - void initDialog(); void onOutputDirectoryBrowseClicked( wxCommandEvent& event ) override; void onGenerate( wxCommandEvent& event ) override; void onUpdateUIUnits( wxUpdateUIEvent& event ) override; - void onUpdateUIFileOpt( wxUpdateUIEvent& event ) override; - void onUpdateUIOnlySMD( wxUpdateUIEvent& event ) override; - void onUpdateUInegXcoord( wxUpdateUIEvent& event ) override; - void onUpdateUIExcludeTH( wxUpdateUIEvent& event ) override; - void onUpdateUIincludeBoardEdge( wxUpdateUIEvent& event ) override; /** @@ -68,18 +62,15 @@ private: bool CreateGerberFiles(); // accessors to options: - bool UnitsMM(); - - bool OneFileOnly(); - - bool OnlySMD(); - - bool ExcludeAllTH(); - - bool ExcludeDNP(); + bool UnitsMM() { return m_unitsCtrl->GetSelection() == 1; } + bool OneFileOnly() { return m_singleFile->GetValue(); } + bool OnlySMD() { return m_onlySMD->GetValue(); } + bool ExcludeAllTH() { return m_excludeTH->GetValue(); } + bool ExcludeDNP() { return m_excludeDNP->GetValue(); } private: - PCB_EDIT_FRAME* m_editFrame; - REPORTER* m_reporter; + PCB_EDIT_FRAME* m_editFrame; + REPORTER* m_reporter; JOB_EXPORT_PCB_POS* m_job; + wxString m_outputDirectory; }; \ No newline at end of file diff --git a/pcbnew/dialogs/dialog_gen_footprint_position_file_base.cpp b/pcbnew/dialogs/dialog_gen_footprint_position_file_base.cpp index 3b0564df73..236f3d4657 100644 --- a/pcbnew/dialogs/dialog_gen_footprint_position_file_base.cpp +++ b/pcbnew/dialogs/dialog_gen_footprint_position_file_base.cpp @@ -69,7 +69,7 @@ DIALOG_GEN_FOOTPRINT_POSITION_BASE::DIALOG_GEN_FOOTPRINT_POSITION_BASE( wxWindow wxString m_unitsCtrlChoices[] = { _("Inches"), _("Millimeters") }; int m_unitsCtrlNChoices = sizeof( m_unitsCtrlChoices ) / sizeof( wxString ); m_unitsCtrl = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_unitsCtrlNChoices, m_unitsCtrlChoices, 0 ); - m_unitsCtrl->SetSelection( 0 ); + m_unitsCtrl->SetSelection( 1 ); fgSizer1->Add( m_unitsCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); @@ -103,12 +103,14 @@ DIALOG_GEN_FOOTPRINT_POSITION_BASE::DIALOG_GEN_FOOTPRINT_POSITION_BASE( wxWindow bSizerLower->Add( m_cbIncludeBoardEdge, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_useDrillPlaceOrigin = new wxCheckBox( this, wxID_ANY, _("Use drill/place file origin"), wxDefaultPosition, wxDefaultSize, 0 ); + m_useDrillPlaceOrigin->SetValue(true); bSizerLower->Add( m_useDrillPlaceOrigin, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_negateXcb = new wxCheckBox( this, wxID_ANY, _("Use negative X coordinates for footprints on bottom layer"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerLower->Add( m_negateXcb, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_singleFile = new wxCheckBox( this, wxID_ANY, _("Generate single file with both front and back positions"), wxDefaultPosition, wxDefaultSize, 0 ); + m_singleFile->SetValue(true); bSizerLower->Add( m_singleFile, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); diff --git a/pcbnew/dialogs/dialog_gen_footprint_position_file_base.fbp b/pcbnew/dialogs/dialog_gen_footprint_position_file_base.fbp index a431b4300d..4d5c209b5e 100644 --- a/pcbnew/dialogs/dialog_gen_footprint_position_file_base.fbp +++ b/pcbnew/dialogs/dialog_gen_footprint_position_file_base.fbp @@ -552,7 +552,7 @@ 1 Resizable - 0 + 1 1 @@ -885,7 +885,7 @@ 1 0 - 0 + 1 1 1 @@ -1016,7 +1016,7 @@ 1 0 - 0 + 1 1 1 diff --git a/pcbnew/dialogs/dialog_gendrill.cpp b/pcbnew/dialogs/dialog_gendrill.cpp index 82bdf4f535..410063004e 100644 --- a/pcbnew/dialogs/dialog_gendrill.cpp +++ b/pcbnew/dialogs/dialog_gendrill.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -44,10 +43,9 @@ #include #include -// list of allowed precision for EXCELLON files, for integer format: -// Due to difference between inches and mm, -// there are 2 precision values, one for inches and one for metric -// Note: for decimla format, the precision is not used +// List of allowed precision for EXCELLON files, for integer format. Due to difference between inches and mm, +// there are 2 precision values, one for inches and one for metric. +// Note: for decimal format, the precision is not used. static DRILL_PRECISION precisionListForInches( 2, 4 ); static DRILL_PRECISION precisionListForMetric( 3, 3 ); @@ -65,31 +63,32 @@ int BOARD_EDITOR_CONTROL::GenerateDrillFiles( const TOOL_EVENT& aEvent ) DIALOG_GENDRILL::DIALOG_GENDRILL( PCB_EDIT_FRAME* aPcbEditFrame, wxWindow* aParent ) : - DIALOG_GENDRILL_BASE( aParent ) + DIALOG_GENDRILL_BASE( aParent ), + m_pcbEditFrame( aPcbEditFrame ), + m_board( aPcbEditFrame->GetBoard() ), + m_plotOpts( aPcbEditFrame->GetPlotSettings() ), + m_job( nullptr ) { - m_pcbEditFrame = aPcbEditFrame; - m_board = m_pcbEditFrame->GetBoard(); - m_job = nullptr; - m_plotOpts = m_pcbEditFrame->GetPlotSettings(); - m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) ); SetupStandardButtons( { { wxID_OK, _( "Generate" ) }, { wxID_CANCEL, _( "Close" ) } } ); - initDialog(); + // DIALOG_SHIM needs a unique hash_key because classname will be the same for both job and + // non-job versions (which have different sizes). + m_hash_key = TO_UTF8( GetTitle() ); + finishDialogSettings(); } DIALOG_GENDRILL::DIALOG_GENDRILL( PCB_EDIT_FRAME* aPcbEditFrame, JOB_EXPORT_PCB_DRILL* aJob, wxWindow* aParent ) : - DIALOG_GENDRILL_BASE( aParent ) + DIALOG_GENDRILL_BASE( aParent ), + m_pcbEditFrame( aPcbEditFrame ), + m_board( m_pcbEditFrame->GetBoard() ), + m_job( aJob ) { - m_pcbEditFrame = aPcbEditFrame; - m_board = m_pcbEditFrame->GetBoard(); - m_job = aJob; - m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) ); // hide ui elements that dont belong for job config @@ -99,7 +98,12 @@ DIALOG_GENDRILL::DIALOG_GENDRILL( PCB_EDIT_FRAME* aPcbEditFrame, JOB_EXPORT_PCB_ SetupStandardButtons(); - initDialog(); + SetTitle( m_job->GetSettingsDialogTitle() ); + + // DIALOG_SHIM needs a unique hash_key because classname will be the same for both job and + // non-job versions (which have different sizes). + m_hash_key = TO_UTF8( GetTitle() ); + finishDialogSettings(); } @@ -138,29 +142,6 @@ bool DIALOG_GENDRILL::TransferDataToWindow() { if( !m_job ) { - if( PCBNEW_SETTINGS* cfg = m_pcbEditFrame->GetPcbNewSettings() ) - { - m_Check_Merge_PTH_NPTH->SetValue( cfg->m_GenDrill.merge_pth_npth ); - m_Check_Minimal->SetValue( cfg->m_GenDrill.minimal_header ); - m_Check_Mirror->SetValue( cfg->m_GenDrill.mirror ); - m_units->SetSelection( cfg->m_GenDrill.unit_drill_is_inch ? 1 : 0 ); - m_altDrillMode->SetValue( !cfg->m_GenDrill.use_route_for_oval_holes ); - m_rbExcellon->SetValue( cfg->m_GenDrill.drill_file_type == 0 ); - m_rbGerberX2->SetValue( cfg->m_GenDrill.drill_file_type == 1 ); - m_cbGenerateMap->SetValue( cfg->m_GenDrill.generate_map ); - m_generateTentingLayers->SetValue( cfg->m_GenDrill.generate_tenting ); - - int zerosFormat = cfg->m_GenDrill.zeros_format; - - if( zerosFormat >= 0 && zerosFormat < (int) m_zeros->GetCount() ) - m_zeros->SetSelection( zerosFormat ); - - int mapFileType = cfg->m_GenDrill.map_file_type; - - if( mapFileType >= 0 && mapFileType < (int) m_choiceDrillMap->GetCount() ) - m_choiceDrillMap->SetSelection( mapFileType ); - } - updatePrecisionOptions(); m_origin->SetSelection( m_plotOpts.GetUseAuxOrigin() ? 1 : 0 ); @@ -196,17 +177,6 @@ bool DIALOG_GENDRILL::TransferDataToWindow() } -void DIALOG_GENDRILL::initDialog() -{ - if( m_job ) - SetTitle( m_job->GetSettingsDialogTitle() ); - - // DIALOG_SHIM needs a unique hash_key because classname will be the same for both job and - // non-job versions (which have different sizes). - m_hash_key = TO_UTF8( GetTitle() ); -} - - void DIALOG_GENDRILL::onFileFormatSelection( wxCommandEvent& event ) { bool enbl_Excellon = m_rbExcellon->GetValue(); @@ -248,20 +218,6 @@ void DIALOG_GENDRILL::updateConfig() m_board->SetPlotOptions( m_plotOpts ); m_pcbEditFrame->OnModify(); } - - if( PCBNEW_SETTINGS* cfg = m_pcbEditFrame->GetPcbNewSettings() ) - { - cfg->m_GenDrill.merge_pth_npth = m_Check_Merge_PTH_NPTH->IsChecked(); - cfg->m_GenDrill.minimal_header = m_Check_Minimal->IsChecked(); - cfg->m_GenDrill.mirror = m_Check_Mirror->IsChecked(); - cfg->m_GenDrill.unit_drill_is_inch = ( m_units->GetSelection() == 0 ) ? false : true; - cfg->m_GenDrill.use_route_for_oval_holes = !m_altDrillMode->GetValue(); - cfg->m_GenDrill.drill_file_type = m_rbExcellon->GetValue() ? 0 : 1; - cfg->m_GenDrill.map_file_type = m_choiceDrillMap->GetSelection(); - cfg->m_GenDrill.zeros_format = m_zeros->GetSelection(); - cfg->m_GenDrill.generate_map = m_cbGenerateMap->IsChecked(); - cfg->m_GenDrill.generate_tenting = m_generateTentingLayers->IsChecked(); - } } @@ -320,8 +276,7 @@ void DIALOG_GENDRILL::onOutputDirectoryBrowseClicked( wxCommandEvent& event ) wxString msg; msg.Printf( _( "Do you want to use a path relative to\n'%s'?" ), defaultPath ); - wxMessageDialog dialog( this, msg, _( "Plot Output Directory" ), - wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT ); + wxMessageDialog dialog( this, msg, _( "Plot Output Directory" ), wxYES_NO | wxICON_QUESTION | wxYES_DEFAULT ); if( dialog.ShowModal() == wxID_YES ) { @@ -460,16 +415,8 @@ void DIALOG_GENDRILL::onGenReportFile( wxCommandEvent& event ) success = gerberWriter.GenDrillReportFile( dlg.GetPath() ); } - wxString msg; - - if( ! success ) - { - msg.Printf( _( "Failed to create file '%s'." ), dlg.GetPath() ); - m_messagesBox->AppendText( msg ); - } + if( !success ) + m_messagesBox->AppendText( wxString::Format( _( "Failed to create file '%s'." ), dlg.GetPath() ) ); else - { - msg.Printf( _( "Report file '%s' created." ), dlg.GetPath() ); - m_messagesBox->AppendText( msg ); - } + m_messagesBox->AppendText( wxString::Format( _( "Report file '%s' created." ), dlg.GetPath() ) ); } diff --git a/pcbnew/dialogs/dialog_gendrill.h b/pcbnew/dialogs/dialog_gendrill.h index 44099c75ab..1cabd65aea 100644 --- a/pcbnew/dialogs/dialog_gendrill.h +++ b/pcbnew/dialogs/dialog_gendrill.h @@ -44,8 +44,6 @@ public: bool TransferDataToWindow() override; private: - void initDialog(); - // event functions void onSelDrillUnitsSelected( wxCommandEvent& event ) override; void onSelZerosFmtSelected( wxCommandEvent& event ) override; diff --git a/pcbnew/dialogs/dialog_gendrill_base.cpp b/pcbnew/dialogs/dialog_gendrill_base.cpp index fd120dd5a1..9edf3d1110 100644 --- a/pcbnew/dialogs/dialog_gendrill_base.cpp +++ b/pcbnew/dialogs/dialog_gendrill_base.cpp @@ -110,7 +110,7 @@ DIALOG_GENDRILL_BASE::DIALOG_GENDRILL_BASE( wxWindow* parent, wxWindowID id, con wxString m_choiceDrillMapChoices[] = { _("Postscript"), _("Gerber X2"), _("DXF"), _("SVG"), _("PDF") }; int m_choiceDrillMapNChoices = sizeof( m_choiceDrillMapChoices ) / sizeof( wxString ); m_choiceDrillMap = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceDrillMapNChoices, m_choiceDrillMapChoices, 0 ); - m_choiceDrillMap->SetSelection( 4 ); + m_choiceDrillMap->SetSelection( 1 ); bSizer9->Add( m_choiceDrillMap, 1, wxALL, 5 ); diff --git a/pcbnew/dialogs/dialog_gendrill_base.fbp b/pcbnew/dialogs/dialog_gendrill_base.fbp index e9aa5783c8..75699a90e6 100644 --- a/pcbnew/dialogs/dialog_gendrill_base.fbp +++ b/pcbnew/dialogs/dialog_gendrill_base.fbp @@ -1062,7 +1062,7 @@ 1 Resizable - 4 + 1 1 diff --git a/pcbnew/dialogs/dialog_import_netlist.cpp b/pcbnew/dialogs/dialog_import_netlist.cpp index 0b59c5af03..c2d67e7090 100644 --- a/pcbnew/dialogs/dialog_import_netlist.cpp +++ b/pcbnew/dialogs/dialog_import_netlist.cpp @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -54,31 +53,17 @@ void PCB_EDIT_FRAME::InstallNetlistFrame() SetLastPath( LAST_PATH_NETLIST, netlistName ); } -bool DIALOG_IMPORT_NETLIST::m_matchByUUID = false; - -DIALOG_IMPORT_NETLIST::DIALOG_IMPORT_NETLIST( PCB_EDIT_FRAME* aParent, - wxString& aNetlistFullFilename ) - : DIALOG_IMPORT_NETLIST_BASE( aParent ), - m_parent( aParent ), - m_netlistPath( aNetlistFullFilename ), - m_initialized( false ), - m_runDragCommand( false ) +DIALOG_IMPORT_NETLIST::DIALOG_IMPORT_NETLIST( PCB_EDIT_FRAME* aParent, wxString& aNetlistFullFilename ) : + DIALOG_IMPORT_NETLIST_BASE( aParent ), + m_parent( aParent ), + m_netlistPath( aNetlistFullFilename ), + m_initialized( false ), + m_runDragCommand( false ) { m_NetlistFilenameCtrl->SetValue( m_netlistPath ); m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) ); - if( PCBNEW_SETTINGS* cfg = m_parent->GetPcbNewSettings() ) - { - m_cbUpdateFootprints->SetValue( cfg->m_NetlistDialog.update_footprints ); - m_cbTransferGroups->SetValue( cfg->m_NetlistDialog.transfer_groups ); - m_cbDeleteShortingTracks->SetValue( cfg->m_NetlistDialog.delete_shorting_tracks ); - m_cbDeleteExtraFootprints->SetValue( cfg->m_NetlistDialog.delete_extra_footprints ); - m_MessageWindow->SetVisibleSeverities( cfg->m_NetlistDialog.report_filter ); - } - - m_matchByTimestamp->SetSelection( m_matchByUUID ? 0 : 1 ); - m_MessageWindow->SetLabel( _("Changes to Be Applied") ); m_MessageWindow->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) ); @@ -93,17 +78,6 @@ DIALOG_IMPORT_NETLIST::DIALOG_IMPORT_NETLIST( PCB_EDIT_FRAME* aParent, DIALOG_IMPORT_NETLIST::~DIALOG_IMPORT_NETLIST() { - m_matchByUUID = m_matchByTimestamp->GetSelection() == 0; - - if( PCBNEW_SETTINGS* cfg = m_parent->GetPcbNewSettings() ) - { - cfg->m_NetlistDialog.report_filter = m_MessageWindow->GetVisibleSeverities(); - cfg->m_NetlistDialog.update_footprints = m_cbUpdateFootprints->GetValue(); - cfg->m_NetlistDialog.transfer_groups = m_cbTransferGroups->GetValue(); - cfg->m_NetlistDialog.delete_shorting_tracks = m_cbDeleteShortingTracks->GetValue(); - cfg->m_NetlistDialog.delete_extra_footprints = m_cbDeleteExtraFootprints->GetValue(); - } - if( m_runDragCommand ) { KIGFX::VIEW_CONTROLS* controls = m_parent->GetCanvas()->GetViewControls(); @@ -116,7 +90,6 @@ DIALOG_IMPORT_NETLIST::~DIALOG_IMPORT_NETLIST() void DIALOG_IMPORT_NETLIST::onBrowseNetlistFiles( wxCommandEvent& event ) { wxString dirPath = wxFileName( Prj().GetProjectFullName() ).GetPath(); - wxString filename = m_parent->GetLastPath( LAST_PATH_NETLIST ); if( !filename.IsEmpty() ) @@ -126,8 +99,7 @@ void DIALOG_IMPORT_NETLIST::onBrowseNetlistFiles( wxCommandEvent& event ) filename = fn.GetFullName(); } - wxFileDialog FilesDialog( this, _( "Import Netlist" ), dirPath, filename, - FILEEXT::NetlistFileWildcard(), + wxFileDialog FilesDialog( this, _( "Import Netlist" ), dirPath, filename, FILEEXT::NetlistFileWildcard(), wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST ); if( FilesDialog.ShowModal() != wxID_OK ) @@ -240,11 +212,10 @@ void DIALOG_IMPORT_NETLIST::loadNetlist( bool aDryRun ) reporter.ReportHead( msg, RPT_SEVERITY_INFO ); m_MessageWindow->SetLazyUpdate( true ); // Use lazy update to speed the creation of the report // (the window is not updated for each message) - m_matchByUUID = m_matchByTimestamp->GetSelection() == 0; NETLIST netlist; - netlist.SetFindByTimeStamp( m_matchByUUID ); + netlist.SetFindByTimeStamp( m_matchByTimestamp->GetSelection() == 0 ); netlist.SetReplaceFootprints( m_cbUpdateFootprints->GetValue() ); if( !m_parent->ReadNetlistFromFile( netlistFileName, netlist, reporter ) ) @@ -253,7 +224,7 @@ void DIALOG_IMPORT_NETLIST::loadNetlist( bool aDryRun ) BOARD_NETLIST_UPDATER updater( m_parent, m_parent->GetBoard() ); updater.SetReporter ( &reporter ); updater.SetIsDryRun( aDryRun ); - updater.SetLookupByTimestamp( m_matchByUUID ); + updater.SetLookupByTimestamp( m_matchByTimestamp->GetSelection() == 0 ); updater.SetDeleteUnusedFootprints( m_cbDeleteExtraFootprints->GetValue()); updater.SetReplaceFootprints( m_cbUpdateFootprints->GetValue() ); updater.SetTransferGroups( m_cbTransferGroups->GetValue() ); diff --git a/pcbnew/dialogs/dialog_import_netlist.h b/pcbnew/dialogs/dialog_import_netlist.h index 629c2df417..3ae0b2d19d 100644 --- a/pcbnew/dialogs/dialog_import_netlist.h +++ b/pcbnew/dialogs/dialog_import_netlist.h @@ -21,8 +21,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef DIALOG_IMPORT_NETLIST_H -#define DIALOG_IMPORT_NETLIST_H +#pragma once #include @@ -50,15 +49,10 @@ private: void OnMatchChanged( wxCommandEvent& event ) override; void OnOptionChanged( wxCommandEvent& event ) override; +private: PCB_EDIT_FRAME* m_parent; wxString& m_netlistPath; bool m_initialized; bool m_runDragCommand; - static bool m_matchByUUID; // True to use UUID as link between symbol and footprint - // False to use reference designator as link - // between symbol and footprint - }; - -#endif // DIALOG_IMPORT_NETLIST_H diff --git a/pcbnew/dialogs/dialog_import_netlist_base.cpp b/pcbnew/dialogs/dialog_import_netlist_base.cpp index 4c6aa4d9fc..3ae48fb2ca 100644 --- a/pcbnew/dialogs/dialog_import_netlist_base.cpp +++ b/pcbnew/dialogs/dialog_import_netlist_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf-dirty) +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -54,9 +54,11 @@ DIALOG_IMPORT_NETLIST_BASE::DIALOG_IMPORT_NETLIST_BASE( wxWindow* parent, wxWind sbSizer1->Add( m_cbDeleteExtraFootprints, 0, wxBOTTOM, 5 ); m_cbUpdateFootprints = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Replace footprints with those specified in netlist"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbUpdateFootprints->SetValue(true); sbSizer1->Add( m_cbUpdateFootprints, 0, wxBOTTOM, 5 ); m_cbTransferGroups = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Group footprints based on symbol group"), wxDefaultPosition, wxDefaultSize, 0 ); + m_cbTransferGroups->SetValue(true); sbSizer1->Add( m_cbTransferGroups, 0, wxBOTTOM, 5 ); m_cbOverrideLocks = new wxCheckBox( sbSizer1->GetStaticBox(), wxID_ANY, _("Delete/replace footprints even if locked"), wxDefaultPosition, wxDefaultSize, 0 ); diff --git a/pcbnew/dialogs/dialog_import_netlist_base.fbp b/pcbnew/dialogs/dialog_import_netlist_base.fbp index ab70a5d527..48156d5839 100644 --- a/pcbnew/dialogs/dialog_import_netlist_base.fbp +++ b/pcbnew/dialogs/dialog_import_netlist_base.fbp @@ -1,34 +1,36 @@ - + - C++ - 1 - source_name - 0 - 0 + + 1 + connect + none + + + 0 + 1 res UTF-8 - connect dialog_import_netlist_base 1000 - none - - 1 + 1 + UI dialog_netlist_base - . - + 0 + source_name + 1 + 0 + source_name + + + 1 1 - 1 - 1 - 1 - UI - 0 - 1 0 + 0 0 wxAUI_MGR_DEFAULT @@ -80,10 +82,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -142,10 +144,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -169,7 +171,7 @@ 0 - + 0 0 -1,-1 @@ -208,10 +210,10 @@ 1 1 1 - + 0 - - + 0 + 0 0 @@ -294,10 +296,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -374,10 +376,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -440,16 +442,16 @@ 1 1 1 - + 0 - - + 0 + 0 1 0 - 0 + 1 1 1 @@ -506,16 +508,16 @@ 1 1 1 - + 0 - - + 0 + 0 1 0 - 0 + 1 1 1 @@ -572,10 +574,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -638,10 +640,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -717,10 +719,10 @@ 1 1 1 - + 0 - - + 0 + 0 diff --git a/pcbnew/dialogs/dialog_import_netlist_base.h b/pcbnew/dialogs/dialog_import_netlist_base.h index cf26931bbb..8bd97c80c0 100644 --- a/pcbnew/dialogs/dialog_import_netlist_base.h +++ b/pcbnew/dialogs/dialog_import_netlist_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf-dirty) +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! diff --git a/pcbnew/dialogs/dialog_update_pcb.cpp b/pcbnew/dialogs/dialog_update_pcb.cpp index 7fb1020d0f..e3a8fb3f25 100644 --- a/pcbnew/dialogs/dialog_update_pcb.cpp +++ b/pcbnew/dialogs/dialog_update_pcb.cpp @@ -41,15 +41,6 @@ DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB( PCB_EDIT_FRAME* aParent, NETLIST* aNetlist m_netlist( aNetlist ), m_initialized( false ) { - if( PCBNEW_SETTINGS* cfg = m_frame->GetPcbNewSettings() ) - { - m_cbRelinkFootprints->SetValue( cfg->m_NetlistDialog.associate_by_ref_sch ); - m_cbUpdateFootprints->SetValue( cfg->m_NetlistDialog.update_footprints ); - m_cbTransferGroups->SetValue( cfg->m_NetlistDialog.transfer_groups ); - m_cbDeleteExtraFootprints->SetValue( cfg->m_NetlistDialog.delete_extra_footprints ); - m_messagePanel->SetVisibleSeverities( cfg->m_NetlistDialog.report_filter ); - } - m_messagePanel->SetLabel( _("Changes to Be Applied") ); m_messagePanel->SetFileName( Prj().GetProjectPath() + wxT( "report.txt" ) ); m_messagePanel->SetLazyUpdate( true ); @@ -70,15 +61,6 @@ DIALOG_UPDATE_PCB::DIALOG_UPDATE_PCB( PCB_EDIT_FRAME* aParent, NETLIST* aNetlist DIALOG_UPDATE_PCB::~DIALOG_UPDATE_PCB() { - if( PCBNEW_SETTINGS* cfg = m_frame->GetPcbNewSettings() ) - { - cfg->m_NetlistDialog.associate_by_ref_sch = m_cbRelinkFootprints->GetValue(); - cfg->m_NetlistDialog.update_footprints = m_cbUpdateFootprints->GetValue(); - cfg->m_NetlistDialog.transfer_groups = m_cbTransferGroups->GetValue(); - cfg->m_NetlistDialog.delete_extra_footprints = m_cbDeleteExtraFootprints->GetValue(); - cfg->m_NetlistDialog.report_filter = m_messagePanel->GetVisibleSeverities(); - } - if( m_runDragCommand ) { KIGFX::VIEW_CONTROLS* controls = m_frame->GetCanvas()->GetViewControls(); diff --git a/pcbnew/dialogs/dialog_update_pcb.h b/pcbnew/dialogs/dialog_update_pcb.h index 17c8d421ba..9920ec4dea 100644 --- a/pcbnew/dialogs/dialog_update_pcb.h +++ b/pcbnew/dialogs/dialog_update_pcb.h @@ -21,8 +21,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef _DIALOG_UPDATE_PCB_H_ -#define _DIALOG_UPDATE_PCB_H_ +#pragma once #include @@ -41,10 +40,9 @@ private: void OnOptionChanged( wxCommandEvent& event ) override; void OnUpdateClick( wxCommandEvent& event ) override; +private: PCB_EDIT_FRAME* m_frame; NETLIST* m_netlist; bool m_initialized; bool m_runDragCommand; }; - -#endif diff --git a/pcbnew/import_gfx/dialog_import_graphics.cpp b/pcbnew/import_gfx/dialog_import_graphics.cpp index 299d6121cd..f318c55fd0 100644 --- a/pcbnew/import_gfx/dialog_import_graphics.cpp +++ b/pcbnew/import_gfx/dialog_import_graphics.cpp @@ -40,14 +40,6 @@ #include -// Static members of DIALOG_IMPORT_GRAPHICS, to remember the user's choices during the session -bool DIALOG_IMPORT_GRAPHICS::s_useDlgLayerSelection = true; -bool DIALOG_IMPORT_GRAPHICS::s_placementInteractive = true; -bool DIALOG_IMPORT_GRAPHICS::s_shouldGroupItems = true; -bool DIALOG_IMPORT_GRAPHICS::s_fixDiscontinuities = true; -int DIALOG_IMPORT_GRAPHICS::s_toleranceValue = pcbIUScale.mmToIU( 1.0 ); -double DIALOG_IMPORT_GRAPHICS::s_importScale = 1.0; // Do not change the imported items size - const std::map dxfUnitsMap = { { DXF_IMPORT_UNITS::INCH, _( "Inches" ) }, @@ -74,30 +66,6 @@ DIALOG_IMPORT_GRAPHICS::DIALOG_IMPORT_GRAPHICS( PCB_BASE_FRAME* aParent ) : m_importer = std::make_unique( aParent->GetModel() ); m_gfxImportMgr = std::make_unique(); - if( PCBNEW_SETTINGS* cfg = m_parent->GetPcbNewSettings() ) - { - s_shouldGroupItems = cfg->m_ImportGraphics.group_items; - s_fixDiscontinuities = cfg->m_ImportGraphics.fix_discontinuities; - s_toleranceValue = cfg->m_ImportGraphics.tolerance * pcbIUScale.IU_PER_MM; - s_useDlgLayerSelection = cfg->m_ImportGraphics.use_dlg_layer_selection; - s_placementInteractive = cfg->m_ImportGraphics.interactive_placement; - - m_xOrigin.SetValue( cfg->m_ImportGraphics.origin_x * pcbIUScale.IU_PER_MM ); - m_yOrigin.SetValue( cfg->m_ImportGraphics.origin_y * pcbIUScale.IU_PER_MM ); - m_defaultLineWidth.SetValue( cfg->m_ImportGraphics.dxf_line_width * pcbIUScale.IU_PER_MM ); - m_textCtrlFileName->SetValue( cfg->m_ImportGraphics.last_file ); - } - - m_cbGroupItems->SetValue( s_shouldGroupItems ); - m_setLayerCheckbox->SetValue( s_useDlgLayerSelection ); - - m_importScaleCtrl->SetValue( wxString::Format( wxT( "%f" ), s_importScale ) ); - - m_placeAtCheckbox->SetValue( !s_placementInteractive ); - - m_tolerance.SetValue( s_toleranceValue ); - m_rbFixDiscontinuities->SetValue( s_fixDiscontinuities ); - // Configure the layers list selector m_SelLayerBox->SetLayersHotkeys( false ); // Do not display hotkeys m_SelLayerBox->SetBoardFrame( m_parent ); @@ -106,14 +74,6 @@ DIALOG_IMPORT_GRAPHICS::DIALOG_IMPORT_GRAPHICS( PCB_BASE_FRAME* aParent ) : for( const std::pair& unitEntry : dxfUnitsMap ) m_dxfUnitsChoice->Append( unitEntry.second ); - if( PCBNEW_SETTINGS* cfg = m_parent->GetPcbNewSettings() ) - { - if( m_SelLayerBox->SetLayerSelection( cfg->m_ImportGraphics.layer ) < 0 ) - m_SelLayerBox->SetLayerSelection( Dwgs_User ); - - m_dxfUnitsChoice->SetSelection( cfg->m_ImportGraphics.dxf_units ); - } - m_browseButton->SetBitmap( KiBitmapBundle( BITMAPS::small_folder ) ); wxCommandEvent dummy; @@ -134,29 +94,6 @@ DIALOG_IMPORT_GRAPHICS::DIALOG_IMPORT_GRAPHICS( PCB_BASE_FRAME* aParent ) : DIALOG_IMPORT_GRAPHICS::~DIALOG_IMPORT_GRAPHICS() { - s_placementInteractive = !m_placeAtCheckbox->GetValue(); - s_fixDiscontinuities = m_rbFixDiscontinuities->GetValue(); - s_toleranceValue = m_tolerance.GetIntValue(); - s_shouldGroupItems = m_cbGroupItems->IsChecked(); - s_useDlgLayerSelection = m_setLayerCheckbox->IsChecked(); - - if( PCBNEW_SETTINGS* cfg = m_parent->GetPcbNewSettings() ) - { - cfg->m_ImportGraphics.layer = m_SelLayerBox->GetLayerSelection(); - cfg->m_ImportGraphics.use_dlg_layer_selection = s_useDlgLayerSelection; - cfg->m_ImportGraphics.interactive_placement = s_placementInteractive; - cfg->m_ImportGraphics.last_file = m_textCtrlFileName->GetValue(); - cfg->m_ImportGraphics.dxf_line_width = pcbIUScale.IUTomm( m_defaultLineWidth.GetIntValue() ); - cfg->m_ImportGraphics.origin_x = pcbIUScale.IUTomm( m_xOrigin.GetIntValue() ); - cfg->m_ImportGraphics.origin_y = pcbIUScale.IUTomm( m_yOrigin.GetIntValue() ); - cfg->m_ImportGraphics.dxf_units = m_dxfUnitsChoice->GetSelection(); - cfg->m_ImportGraphics.group_items = s_shouldGroupItems; - cfg->m_ImportGraphics.fix_discontinuities = s_fixDiscontinuities; - cfg->m_ImportGraphics.tolerance = pcbIUScale.IUTomm( s_toleranceValue ); - } - - s_importScale = EDA_UNIT_UTILS::UI::DoubleValueFromString( m_importScaleCtrl->GetValue() ); - m_textCtrlFileName->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_IMPORT_GRAPHICS::onFilename ), nullptr, this ); diff --git a/pcbnew/import_gfx/dialog_import_graphics.h b/pcbnew/import_gfx/dialog_import_graphics.h index 771f968e3d..78325a8175 100644 --- a/pcbnew/import_gfx/dialog_import_graphics.h +++ b/pcbnew/import_gfx/dialog_import_graphics.h @@ -22,8 +22,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ -#ifndef DIALOG_IMPORT_GRAPHICS_H -#define DIALOG_IMPORT_GRAPHICS_H +#pragma once #include #include @@ -43,10 +42,7 @@ public: /** * @return a list of items imported from a vector graphics file. */ - std::list>& GetImportedItems() - { - return m_importer->GetItems(); - } + std::list>& GetImportedItems() { return m_importer->GetItems(); } /** * @return true if the placement is interactive, i.e. all imported @@ -63,7 +59,7 @@ public: /** * @return tolerance to connect the shapes. */ - int GetTolerance() { return m_tolerance.GetValue(); } + int GetTolerance() { return m_tolerance.GetIntValue(); } /** * @return true if imported items must be placed in a new PCB_GROUP. @@ -87,14 +83,4 @@ private: UNIT_BINDER m_yOrigin; UNIT_BINDER m_defaultLineWidth; UNIT_BINDER m_tolerance; - - static bool s_useDlgLayerSelection; - static bool s_shouldGroupItems; - static bool s_placementInteractive; - static bool s_fixDiscontinuities; - static int s_toleranceValue; - static double s_importScale; // a scale factor to change the size of imported - // items m_importScale =1.0 means keep original size }; - -#endif // DIALOG_IMPORT_GRAPHICS_H diff --git a/pcbnew/import_gfx/dialog_import_graphics_base.cpp b/pcbnew/import_gfx/dialog_import_graphics_base.cpp index 367bcd7f3a..26a0f201a1 100644 --- a/pcbnew/import_gfx/dialog_import_graphics_base.cpp +++ b/pcbnew/import_gfx/dialog_import_graphics_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf) +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -50,7 +50,7 @@ DIALOG_IMPORT_GRAPHICS_BASE::DIALOG_IMPORT_GRAPHICS_BASE( wxWindow* parent, wxWi m_importScaleLabel->Wrap( -1 ); fgSizer3->Add( m_importScaleLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - m_importScaleCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 120,-1 ), 0 ); + m_importScaleCtrl = new wxTextCtrl( this, wxID_ANY, _("1.0"), wxDefaultPosition, wxSize( 120,-1 ), 0 ); fgSizer3->Add( m_importScaleCtrl, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -62,7 +62,7 @@ DIALOG_IMPORT_GRAPHICS_BASE::DIALOG_IMPORT_GRAPHICS_BASE( wxWindow* parent, wxWi fgSizer3->Add( m_lineWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - m_lineWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_lineWidthCtrl = new wxTextCtrl( this, wxID_ANY, _("0.2"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer3->Add( m_lineWidthCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); m_lineWidthUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -171,6 +171,7 @@ DIALOG_IMPORT_GRAPHICS_BASE::DIALOG_IMPORT_GRAPHICS_BASE( wxWindow* parent, wxWi bSizer11 = new wxBoxSizer( wxHORIZONTAL ); m_rbFixDiscontinuities = new wxCheckBox( this, wxID_ANY, _("Fix discontinuities"), wxDefaultPosition, wxDefaultSize, 0 ); + m_rbFixDiscontinuities->SetValue(true); m_rbFixDiscontinuities->SetToolTip( _("Trim/extend open shapes or add segments to make vertices of shapes coincide") ); bSizer11->Add( m_rbFixDiscontinuities, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -179,7 +180,7 @@ DIALOG_IMPORT_GRAPHICS_BASE::DIALOG_IMPORT_GRAPHICS_BASE( wxWindow* parent, wxWi m_toleranceLabel->Wrap( -1 ); bSizer11->Add( m_toleranceLabel, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 30 ); - m_toleranceCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_toleranceCtrl = new wxTextCtrl( this, wxID_ANY, _("1"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); bSizer11->Add( m_toleranceCtrl, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); m_toleranceUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 ); diff --git a/pcbnew/import_gfx/dialog_import_graphics_base.fbp b/pcbnew/import_gfx/dialog_import_graphics_base.fbp index a392ca8a6f..91651bdf30 100644 --- a/pcbnew/import_gfx/dialog_import_graphics_base.fbp +++ b/pcbnew/import_gfx/dialog_import_graphics_base.fbp @@ -1,34 +1,36 @@ - + - C++ - 1 - source_name - 0 - 0 + + 1 + connect + none + + + 0 + 0 res UTF-8 - connect dialog_import_graphics_base 1000 - none - - 1 + 1 + UI dialog_import_graphics_base - . - + 0 + source_name + 1 + 0 + source_name + + + 1 1 - 1 - 1 - 1 - UI - 0 - 0 0 + 0 0 wxAUI_MGR_DEFAULT @@ -81,10 +83,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -143,10 +145,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -170,7 +172,7 @@ 0 - + 0 0 300,-1 @@ -208,10 +210,10 @@ 1 1 1 - + 0 - - + 0 + 0 0 @@ -301,10 +303,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -363,10 +365,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -390,7 +392,7 @@ 0 - + 0 0 @@ -413,7 +415,7 @@ wxFILTER_NONE wxDefaultValidator - + 1.0 @@ -438,10 +440,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -500,10 +502,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -527,7 +529,7 @@ 0 - + 0 0 @@ -550,7 +552,7 @@ wxFILTER_NONE wxDefaultValidator - + 0.2 @@ -565,10 +567,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -627,10 +629,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -689,10 +691,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -766,10 +768,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -843,10 +845,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -911,10 +913,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -976,10 +978,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -1044,10 +1046,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -1109,10 +1111,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -1177,10 +1179,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -1242,10 +1244,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -1310,10 +1312,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -1387,10 +1389,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -1454,10 +1456,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -1522,16 +1524,16 @@ 1 1 1 - + 0 - - + 0 + 0 1 0 - 0 + 1 1 1 @@ -1587,10 +1589,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -1649,10 +1651,10 @@ 1 1 1 - + 0 - - + 0 + 0 @@ -1676,7 +1678,7 @@ 0 - + 0 0 @@ -1699,7 +1701,7 @@ wxFILTER_NONE wxDefaultValidator - + 1 @@ -1714,10 +1716,10 @@ 1 1 1 - + 0 - - + 0 + 0 diff --git a/pcbnew/import_gfx/dialog_import_graphics_base.h b/pcbnew/import_gfx/dialog_import_graphics_base.h index 6887b99f12..4277493639 100644 --- a/pcbnew/import_gfx/dialog_import_graphics_base.h +++ b/pcbnew/import_gfx/dialog_import_graphics_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf) +// C++ code generated with wxFormBuilder (version 4.2.1-0-g80c4cb6) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -37,7 +37,6 @@ class STD_BITMAP_BUTTON; /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////// /// Class DIALOG_IMPORT_GRAPHICS_BASE /////////////////////////////////////////////////////////////////////////////// diff --git a/pcbnew/pcbnew_settings.cpp b/pcbnew/pcbnew_settings.cpp index 5f48925d8d..3e8e8d3550 100644 --- a/pcbnew/pcbnew_settings.cpp +++ b/pcbnew/pcbnew_settings.cpp @@ -50,16 +50,11 @@ const int pcbnewSchemaVersion = 5; PCBNEW_SETTINGS::PCBNEW_SETTINGS() : PCB_VIEWERS_SETTINGS_BASE( "pcbnew", pcbnewSchemaVersion ), m_AuiPanels(), - m_Cleanup(), m_ExportIdf(), m_ExportStep(), m_ExportODBPP(), m_ExportVrml(), m_FootprintWizardList(), - m_GenDrill(), - m_ImportGraphics(), - m_NetlistDialog(), - m_PlaceFile(), m_Plot(), m_FootprintChooser(), m_Zones(), @@ -296,57 +291,6 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() m_params.emplace_back( new PARAM( "pcb_display.show_page_borders", &m_ShowPageLimits, true ) ); - m_params.emplace_back( new PARAM( "cleanup.cleanup_refill_zones", - &m_Cleanup.cleanup_refill_zones, true ) ); - - m_params.emplace_back( new PARAM( "cleanup.cleanup_vias", - &m_Cleanup.cleanup_vias, true ) ); - - m_params.emplace_back( new PARAM( "cleanup.delete_dangling_vias", - &m_Cleanup.delete_dangling_vias, true ) ); - - m_params.emplace_back( new PARAM( "cleanup.merge_segments", - &m_Cleanup.merge_segments, true ) ); - - m_params.emplace_back( new PARAM( "cleanup.cleanup_unconnected", - &m_Cleanup.cleanup_unconnected, true ) ); - - m_params.emplace_back( new PARAM( "cleanup.cleanup_short_circuits", - &m_Cleanup.cleanup_short_circuits, true ) ); - - m_params.emplace_back( new PARAM( "cleanup.cleanup_tracks_in_pad", - &m_Cleanup.cleanup_tracks_in_pad, false ) ); - - m_params.emplace_back( new PARAM( "gen_drill.merge_pth_npth", - &m_GenDrill.merge_pth_npth, false ) ); - - m_params.emplace_back( new PARAM( "gen_drill.minimal_header", - &m_GenDrill.minimal_header, false ) ); - - m_params.emplace_back( new PARAM( "gen_drill.mirror", - &m_GenDrill.mirror, false ) ); - - m_params.emplace_back( new PARAM( "gen_drill.unit_drill_is_inch", - &m_GenDrill.unit_drill_is_inch, false ) ); - - m_params.emplace_back( new PARAM( "gen_drill.use_route_for_oval_holes", - &m_GenDrill.use_route_for_oval_holes, true ) ); - - m_params.emplace_back( new PARAM( "gen_drill.drill_file_type", - &m_GenDrill.drill_file_type, 0 ) ); - - m_params.emplace_back( new PARAM( "gen_drill.map_file_type", - &m_GenDrill.map_file_type, 1 ) ); - - m_params.emplace_back( new PARAM( "gen_drill.zeros_format", - &m_GenDrill.zeros_format, 0, 0, 3 ) ); - - m_params.emplace_back( new PARAM( "gen_drill.generate_map", - &m_GenDrill.generate_map, false ) ); - - m_params.emplace_back( new PARAM( "gen_drill.generate_tenting", - &m_GenDrill.generate_tenting, false ) ); - m_params.emplace_back( new PARAM( "export_2581.units", &m_Export2581.units, 0 ) ); @@ -440,94 +384,6 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS() m_params.emplace_back( new PARAM( "zones.net_sort_mode", &m_Zones.net_sort_mode, -1 ) ); - m_params.emplace_back( new PARAM( "import_graphics.layer", - &m_ImportGraphics.layer, Dwgs_User ) ); - - m_params.emplace_back( new PARAM( "import_graphics.use_dlg_layer_selection", - &m_ImportGraphics.use_dlg_layer_selection, true ) ); - - m_params.emplace_back( new PARAM( "import_graphics.interactive_placement", - &m_ImportGraphics.interactive_placement, true ) ); - - m_params.emplace_back( new PARAM( "import_graphics.group_items", - &m_ImportGraphics.group_items, true ) ); - - m_params.emplace_back( new PARAM( "import_graphics.fix_discontinuities", - &m_ImportGraphics.fix_discontinuities, true ) ); - - m_params.emplace_back( new PARAM( "import_graphics.tolerance", - &m_ImportGraphics.tolerance, 1.0, 0.0, 10.0 ) ); - - m_params.emplace_back( new PARAM( "import_graphics.line_width_units", - &m_ImportGraphics.dxf_line_width_units, 0 ) ); - - m_params.emplace_back( new PARAM( "import_graphics.line_width", - &m_ImportGraphics.dxf_line_width, 0.2 ) ); - - m_params.emplace_back( new PARAM( "import_graphics.origin_units", - &m_ImportGraphics.origin_units, 0 ) ); - - m_params.emplace_back( new PARAM( "import_graphics.origin_x", - &m_ImportGraphics.origin_x, 0 ) ); - - m_params.emplace_back( new PARAM( "import_graphics.origin_y", - &m_ImportGraphics.origin_y, 0 ) ); - - m_params.emplace_back( new PARAM( "import_graphics.dxf_units", - &m_ImportGraphics.dxf_units, 0 ) ); - - m_params.emplace_back( new PARAM( "netlist.report_filter", - &m_NetlistDialog.report_filter, -1 ) ); - - m_params.emplace_back( new PARAM( "netlist.update_footprints", - &m_NetlistDialog.update_footprints, true ) ); - - m_params.emplace_back( new PARAM( "netlist.transfer_groups", - &m_NetlistDialog.transfer_groups, true ) ); - - m_params.emplace_back( new PARAM( "netlist.delete_shorting_tracks", - &m_NetlistDialog.delete_shorting_tracks, false ) ); - - m_params.emplace_back( new PARAM( "netlist.delete_extra_footprints", - &m_NetlistDialog.delete_extra_footprints, false ) ); - - m_params.emplace_back( new PARAM( "netlist.associate_by_ref_sch", - &m_NetlistDialog.associate_by_ref_sch, false ) ); - - /* - * place_file.output_directory is only used at run-time; actual data is in project file - * - * m_params.emplace_back( new PARAM( "place_file.output_directory", - * &m_PlaceFile.output_directory, wxEmptyString ) ); - */ - - m_params.emplace_back( new PARAM( "place_file.units", - &m_PlaceFile.units, 1 ) ); - - m_params.emplace_back( new PARAM( "place_file.file_options", - &m_PlaceFile.file_options, 0 ) ); - - m_params.emplace_back( new PARAM( "place_file.file_format", - &m_PlaceFile.file_format, 0 ) ); - - m_params.emplace_back( new PARAM( "place_file.excludeTH", - &m_PlaceFile.exclude_TH, false ) ); - - m_params.emplace_back( new PARAM( "place_file.onlySMD", - &m_PlaceFile.only_SMD, false ) ); - - m_params.emplace_back( new PARAM( "place_file.include_board_edge", - &m_PlaceFile.include_board_edge, false ) ); - - m_params.emplace_back( new PARAM( "place_file.use_place_file_origin", - &m_PlaceFile.use_aux_origin, true ) ); - - m_params.emplace_back( new PARAM( "place_file.negate_xcoord", - &m_PlaceFile.negate_xcoord, false ) ); - - m_params.emplace_back( new PARAM( "plot.all_layers_on_one_page", - &m_Plot.all_layers_on_one_page, 1 ) ); - m_params.emplace_back( new PARAM( "plot.edgecut_on_all_layers", &m_Plot.edgecut_on_all_layers, true ) ); diff --git a/pcbnew/pcbnew_settings.h b/pcbnew/pcbnew_settings.h index 4ac32d6171..3b5745131c 100644 --- a/pcbnew/pcbnew_settings.h +++ b/pcbnew/pcbnew_settings.h @@ -163,17 +163,6 @@ public: int design_blocks_panel_float_height; }; - struct DIALOG_CLEANUP - { - bool cleanup_refill_zones; - bool cleanup_vias; - bool delete_dangling_vias; - bool cleanup_tracks_in_pad; - bool cleanup_unconnected; - bool cleanup_short_circuits; - bool merge_segments; - }; - struct DIALOG_EXPORT_IDF { bool auto_adjust; @@ -236,60 +225,6 @@ public: int height; }; - struct DIALOG_GENERATE_DRILL - { - bool merge_pth_npth; - bool minimal_header; - bool mirror; - bool unit_drill_is_inch; - bool use_route_for_oval_holes; - int drill_file_type; - int map_file_type; - int zeros_format; - bool generate_map; - bool generate_tenting; - }; - - struct DIALOG_IMPORT_GRAPHICS - { - int layer; - bool use_dlg_layer_selection; - bool interactive_placement; - bool group_items; - bool fix_discontinuities; - double tolerance; - wxString last_file; - double dxf_line_width; - int dxf_line_width_units; - int origin_units; - double origin_x; - double origin_y; - int dxf_units; - }; - - struct DIALOG_NETLIST - { - int report_filter; - bool update_footprints; - bool transfer_groups; - bool delete_shorting_tracks; - bool delete_extra_footprints; - bool associate_by_ref_sch; - }; - - struct DIALOG_PLACE_FILE - { - wxString output_directory; // only used at run-time; actual data in project settings - int units; - int file_options; - int file_format; - bool include_board_edge; - bool exclude_TH; - bool only_SMD; - bool use_aux_origin; - bool negate_xcoord; - }; - struct DIALOG_PLOT { int all_layers_on_one_page; @@ -362,8 +297,6 @@ public: AUI_PANELS m_AuiPanels; - DIALOG_CLEANUP m_Cleanup; - DIALOG_EXPORT_IDF m_ExportIdf; DIALOG_EXPORT_STEP m_ExportStep; @@ -378,14 +311,6 @@ public: DIALOG_FOOTPRINT_WIZARD_LIST m_FootprintWizardList; - DIALOG_GENERATE_DRILL m_GenDrill; - - DIALOG_IMPORT_GRAPHICS m_ImportGraphics; - - DIALOG_NETLIST m_NetlistDialog; - - DIALOG_PLACE_FILE m_PlaceFile; - DIALOG_PLOT m_Plot; FOOTPRINT_CHOOSER m_FootprintChooser;