Remove more old open-coded dialog state saving.

(State saving is now handled uniformly in DIALOG_SHIM.)
This commit is contained in:
Jeff Young 2025-08-08 22:31:09 +01:00
parent 9fcee70827
commit d1dd446e4e
24 changed files with 292 additions and 825 deletions

View File

@ -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<NET_SETTINGS>& 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<NET_SETTINGS>& 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;
}

View File

@ -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 <dialog_cleanup_tracks_and_vias_base.h>
#include <cleanup_item.h>
@ -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<std::shared_ptr<CLEANUP_ITEM> > m_items;
WX_TEXT_CTRL_REPORTER* m_reporter;
std::vector<std::shared_ptr<CLEANUP_ITEM>> m_items;
WX_TEXT_CTRL_REPORTER* m_reporter;
};
#endif // DIALOG_CLEANUP_TRACKS_AND_VIAS_H_

View File

@ -29,7 +29,6 @@
#include <dialog_gen_footprint_position.h>
#include <confirm.h>
#include <pcb_edit_frame.h>
#include <pcbnew_settings.h>
#include <project/project_file.h>
#include <bitmaps.h>
#include <reporter.h>
@ -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<int>( m_job->m_units ) );
m_singleFile->SetValue( m_job->m_singleFile );
m_formatCtrl->SetSelection( static_cast<int>( 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<int>( m_job->m_units ) );
m_singleFile->SetValue( m_job->m_singleFile );
m_formatCtrl->SetSelection( static_cast<int>( 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 );

View File

@ -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;
};

View File

@ -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 );

View File

@ -552,7 +552,7 @@
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">0</property>
<property name="selection">1</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
@ -885,7 +885,7 @@
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="checked">1</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
@ -1016,7 +1016,7 @@
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="checked">1</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>

View File

@ -26,7 +26,6 @@
#include <core/arraydim.h>
#include <widgets/std_bitmap_button.h>
#include <pcb_edit_frame.h>
#include <pcbnew_settings.h>
#include <pcbplot.h>
#include <gendrill_Excellon_writer.h>
#include <gendrill_gerber_writer.h>
@ -44,10 +43,9 @@
#include <wx/filedlg.h>
#include <jobs/job_export_pcb_drill.h>
// 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() ) );
}

View File

@ -44,8 +44,6 @@ public:
bool TransferDataToWindow() override;
private:
void initDialog();
// event functions
void onSelDrillUnitsSelected( wxCommandEvent& event ) override;
void onSelZerosFmtSelected( wxCommandEvent& event ) override;

View File

@ -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 );

View File

@ -1062,7 +1062,7 @@
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="selection">4</property>
<property name="selection">1</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>

View File

@ -23,7 +23,6 @@
#include <project.h>
#include <kiface_base.h>
#include <confirm.h>
#include <pcb_edit_frame.h>
#include <pcbnew_settings.h>
#include <reporter.h>
@ -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() );

View File

@ -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 <dialog_import_netlist_base.h>
@ -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

View File

@ -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 );

View File

@ -1,34 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="17"/>
<FileVersion major="1" minor="18"/>
<object class="Project" expanded="true">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="cpp_class_decoration"></property>
<property name="cpp_disconnect_events">1</property>
<property name="cpp_event_generation">connect</property>
<property name="cpp_help_provider">none</property>
<property name="cpp_namespace"></property>
<property name="cpp_precompiled_header"></property>
<property name="cpp_use_array_enum">0</property>
<property name="cpp_use_enum">1</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_import_netlist_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="lua_skip_events">1</property>
<property name="lua_ui_table">UI</property>
<property name="name">dialog_netlist_base</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="php_disconnect_events">0</property>
<property name="php_disconnect_mode">source_name</property>
<property name="php_skip_events">1</property>
<property name="python_disconnect_events">0</property>
<property name="python_disconnect_mode">source_name</property>
<property name="python_image_path_wrapper_function_name"></property>
<property name="python_indent_with_spaces"></property>
<property name="python_skip_events">1</property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">1</property>
<property name="use_microsoft_bom">0</property>
<property name="use_native_eol">0</property>
<object class="Dialog" expanded="true">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
@ -80,10 +82,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -142,10 +144,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -169,7 +171,7 @@
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">-1,-1</property>
@ -208,10 +210,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
@ -294,10 +296,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -374,10 +376,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -440,16 +442,16 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="checked">1</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
@ -506,16 +508,16 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="checked">1</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
@ -572,10 +574,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -638,10 +640,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -717,10 +719,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>

View File

@ -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!

View File

@ -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();

View File

@ -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 <dialog_update_pcb_base.h>
@ -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

View File

@ -40,14 +40,6 @@
#include <memory>
// 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<DXF_IMPORT_UNITS, wxString> 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<GRAPHICS_IMPORTER_PCBNEW>( aParent->GetModel() );
m_gfxImportMgr = std::make_unique<GRAPHICS_IMPORT_MGR>();
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<const DXF_IMPORT_UNITS, wxString>& 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 );

View File

@ -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 <widgets/unit_binder.h>
#include <pcb_edit_frame.h>
@ -43,10 +42,7 @@ public:
/**
* @return a list of items imported from a vector graphics file.
*/
std::list<std::unique_ptr<EDA_ITEM>>& GetImportedItems()
{
return m_importer->GetItems();
}
std::list<std::unique_ptr<EDA_ITEM>>& 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

View File

@ -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 );

View File

@ -1,34 +1,36 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="17"/>
<FileVersion major="1" minor="18"/>
<object class="Project" expanded="true">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="cpp_class_decoration"></property>
<property name="cpp_disconnect_events">1</property>
<property name="cpp_event_generation">connect</property>
<property name="cpp_help_provider">none</property>
<property name="cpp_namespace"></property>
<property name="cpp_precompiled_header"></property>
<property name="cpp_use_array_enum">0</property>
<property name="cpp_use_enum">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">dialog_import_graphics_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="image_path_wrapper_function_name"></property>
<property name="indent_with_spaces"></property>
<property name="internationalize">1</property>
<property name="lua_skip_events">1</property>
<property name="lua_ui_table">UI</property>
<property name="name">dialog_import_graphics_base</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="php_disconnect_events">0</property>
<property name="php_disconnect_mode">source_name</property>
<property name="php_skip_events">1</property>
<property name="python_disconnect_events">0</property>
<property name="python_disconnect_mode">source_name</property>
<property name="python_image_path_wrapper_function_name"></property>
<property name="python_indent_with_spaces"></property>
<property name="python_skip_events">1</property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_array_enum">0</property>
<property name="use_enum">0</property>
<property name="use_microsoft_bom">0</property>
<property name="use_native_eol">0</property>
<object class="Dialog" expanded="true">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
@ -81,10 +83,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -143,10 +145,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -170,7 +172,7 @@
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size">300,-1</property>
@ -208,10 +210,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="auth_needed">0</property>
<property name="best_size"></property>
<property name="bg"></property>
@ -301,10 +303,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -363,10 +365,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -390,7 +392,7 @@
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
@ -413,7 +415,7 @@
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="value">1.0</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -438,10 +440,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -500,10 +502,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -527,7 +529,7 @@
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
@ -550,7 +552,7 @@
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="value">0.2</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -565,10 +567,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -627,10 +629,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -689,10 +691,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -766,10 +768,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -843,10 +845,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -911,10 +913,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -976,10 +978,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1044,10 +1046,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1109,10 +1111,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1177,10 +1179,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1242,10 +1244,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1310,10 +1312,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1387,10 +1389,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1454,10 +1456,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1522,16 +1524,16 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="checked">1</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
@ -1587,10 +1589,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1649,10 +1651,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
@ -1676,7 +1678,7 @@
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="maxlength"></property>
<property name="maxlength">0</property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
@ -1699,7 +1701,7 @@
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="value"></property>
<property name="value">1</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
@ -1714,10 +1716,10 @@
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_layer">0</property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="aui_position">0</property>
<property name="aui_row">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>

View File

@ -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
///////////////////////////////////////////////////////////////////////////////

View File

@ -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<bool>( "pcb_display.show_page_borders",
&m_ShowPageLimits, true ) );
m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_refill_zones",
&m_Cleanup.cleanup_refill_zones, true ) );
m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_vias",
&m_Cleanup.cleanup_vias, true ) );
m_params.emplace_back( new PARAM<bool>( "cleanup.delete_dangling_vias",
&m_Cleanup.delete_dangling_vias, true ) );
m_params.emplace_back( new PARAM<bool>( "cleanup.merge_segments",
&m_Cleanup.merge_segments, true ) );
m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_unconnected",
&m_Cleanup.cleanup_unconnected, true ) );
m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_short_circuits",
&m_Cleanup.cleanup_short_circuits, true ) );
m_params.emplace_back( new PARAM<bool>( "cleanup.cleanup_tracks_in_pad",
&m_Cleanup.cleanup_tracks_in_pad, false ) );
m_params.emplace_back( new PARAM<bool>( "gen_drill.merge_pth_npth",
&m_GenDrill.merge_pth_npth, false ) );
m_params.emplace_back( new PARAM<bool>( "gen_drill.minimal_header",
&m_GenDrill.minimal_header, false ) );
m_params.emplace_back( new PARAM<bool>( "gen_drill.mirror",
&m_GenDrill.mirror, false ) );
m_params.emplace_back( new PARAM<bool>( "gen_drill.unit_drill_is_inch",
&m_GenDrill.unit_drill_is_inch, false ) );
m_params.emplace_back( new PARAM<bool>( "gen_drill.use_route_for_oval_holes",
&m_GenDrill.use_route_for_oval_holes, true ) );
m_params.emplace_back( new PARAM<int>( "gen_drill.drill_file_type",
&m_GenDrill.drill_file_type, 0 ) );
m_params.emplace_back( new PARAM<int>( "gen_drill.map_file_type",
&m_GenDrill.map_file_type, 1 ) );
m_params.emplace_back( new PARAM<int>( "gen_drill.zeros_format",
&m_GenDrill.zeros_format, 0, 0, 3 ) );
m_params.emplace_back( new PARAM<bool>( "gen_drill.generate_map",
&m_GenDrill.generate_map, false ) );
m_params.emplace_back( new PARAM<bool>( "gen_drill.generate_tenting",
&m_GenDrill.generate_tenting, false ) );
m_params.emplace_back( new PARAM<int>( "export_2581.units",
&m_Export2581.units, 0 ) );
@ -440,94 +384,6 @@ PCBNEW_SETTINGS::PCBNEW_SETTINGS()
m_params.emplace_back( new PARAM<int>( "zones.net_sort_mode",
&m_Zones.net_sort_mode, -1 ) );
m_params.emplace_back( new PARAM<int>( "import_graphics.layer",
&m_ImportGraphics.layer, Dwgs_User ) );
m_params.emplace_back( new PARAM<bool>( "import_graphics.use_dlg_layer_selection",
&m_ImportGraphics.use_dlg_layer_selection, true ) );
m_params.emplace_back( new PARAM<bool>( "import_graphics.interactive_placement",
&m_ImportGraphics.interactive_placement, true ) );
m_params.emplace_back( new PARAM<bool>( "import_graphics.group_items",
&m_ImportGraphics.group_items, true ) );
m_params.emplace_back( new PARAM<bool>( "import_graphics.fix_discontinuities",
&m_ImportGraphics.fix_discontinuities, true ) );
m_params.emplace_back( new PARAM<double>( "import_graphics.tolerance",
&m_ImportGraphics.tolerance, 1.0, 0.0, 10.0 ) );
m_params.emplace_back( new PARAM<int>( "import_graphics.line_width_units",
&m_ImportGraphics.dxf_line_width_units, 0 ) );
m_params.emplace_back( new PARAM<double>( "import_graphics.line_width",
&m_ImportGraphics.dxf_line_width, 0.2 ) );
m_params.emplace_back( new PARAM<int>( "import_graphics.origin_units",
&m_ImportGraphics.origin_units, 0 ) );
m_params.emplace_back( new PARAM<double>( "import_graphics.origin_x",
&m_ImportGraphics.origin_x, 0 ) );
m_params.emplace_back( new PARAM<double>( "import_graphics.origin_y",
&m_ImportGraphics.origin_y, 0 ) );
m_params.emplace_back( new PARAM<int>( "import_graphics.dxf_units",
&m_ImportGraphics.dxf_units, 0 ) );
m_params.emplace_back( new PARAM<int>( "netlist.report_filter",
&m_NetlistDialog.report_filter, -1 ) );
m_params.emplace_back( new PARAM<bool>( "netlist.update_footprints",
&m_NetlistDialog.update_footprints, true ) );
m_params.emplace_back( new PARAM<bool>( "netlist.transfer_groups",
&m_NetlistDialog.transfer_groups, true ) );
m_params.emplace_back( new PARAM<bool>( "netlist.delete_shorting_tracks",
&m_NetlistDialog.delete_shorting_tracks, false ) );
m_params.emplace_back( new PARAM<bool>( "netlist.delete_extra_footprints",
&m_NetlistDialog.delete_extra_footprints, false ) );
m_params.emplace_back( new PARAM<bool>( "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<wxString>( "place_file.output_directory",
* &m_PlaceFile.output_directory, wxEmptyString ) );
*/
m_params.emplace_back( new PARAM<int>( "place_file.units",
&m_PlaceFile.units, 1 ) );
m_params.emplace_back( new PARAM<int>( "place_file.file_options",
&m_PlaceFile.file_options, 0 ) );
m_params.emplace_back( new PARAM<int>( "place_file.file_format",
&m_PlaceFile.file_format, 0 ) );
m_params.emplace_back( new PARAM<bool>( "place_file.excludeTH",
&m_PlaceFile.exclude_TH, false ) );
m_params.emplace_back( new PARAM<bool>( "place_file.onlySMD",
&m_PlaceFile.only_SMD, false ) );
m_params.emplace_back( new PARAM<bool>( "place_file.include_board_edge",
&m_PlaceFile.include_board_edge, false ) );
m_params.emplace_back( new PARAM<bool>( "place_file.use_place_file_origin",
&m_PlaceFile.use_aux_origin, true ) );
m_params.emplace_back( new PARAM<bool>( "place_file.negate_xcoord",
&m_PlaceFile.negate_xcoord, false ) );
m_params.emplace_back( new PARAM<int>( "plot.all_layers_on_one_page",
&m_Plot.all_layers_on_one_page, 1 ) );
m_params.emplace_back( new PARAM<bool>( "plot.edgecut_on_all_layers",
&m_Plot.edgecut_on_all_layers, true ) );

View File

@ -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;