Pcbnew: read netlist dialog: remove the .cmp file option. Use only the netlist to know the footprint associated to a component.
This commit is contained in:
parent
e952302e43
commit
0027bb14c5
|
@ -109,8 +109,6 @@ protected:
|
|||
PARAM_CFG_ARRAY m_configSettings; ///< List of Pcbnew configuration settings.
|
||||
|
||||
wxString m_lastNetListRead; ///< Last net list read with relative path.
|
||||
bool m_useCmpFileForFpNames; ///< is true, use the .cmp file from CvPcb, else use the netlist
|
||||
// to know the footprint name of components.
|
||||
|
||||
// The Tool Framework initalization
|
||||
void setupTools();
|
||||
|
@ -417,26 +415,6 @@ public:
|
|||
*/
|
||||
void SetLastNetListRead( const wxString& aNetListFile );
|
||||
|
||||
/**
|
||||
* @return true if the .cmp file created by CvPcb should be used to know the
|
||||
* footprint associated to components, false to use the netlist file only
|
||||
*/
|
||||
bool GetUseCmpFileForFpNames() { return m_useCmpFileForFpNames; }
|
||||
|
||||
/**
|
||||
* Set the default option to use or not the .cmp file craeted by CvPcb
|
||||
* should be used to know the footprints associated to components when
|
||||
* reading a netlist
|
||||
* When the .cmp netlist is not used, footprint names are read from the netlist.
|
||||
* This imply the user has filled the footprint fields in schematic
|
||||
* @param aUseCmpfile = true to use the .cmp file,
|
||||
* false to use the netlist file only
|
||||
*/
|
||||
void SetUseCmpFileForFpNames( bool aUseCmpfile)
|
||||
{
|
||||
m_useCmpFileForFpNames = aUseCmpfile;
|
||||
}
|
||||
|
||||
///> @copydoc EDA_DRAW_FRAME::GetHotKeyDescription()
|
||||
EDA_HOTKEY* GetHotKeyDescription( int aCommand ) const;
|
||||
|
||||
|
|
|
@ -75,14 +75,7 @@ void PCB_EDIT_FRAME::InstallNetlistFrame( wxDC* DC )
|
|||
// Project settings are saved in the corresponding <board name>.pro file
|
||||
bool configChanged = lastNetlistName != GetLastNetListRead();
|
||||
|
||||
if( dlg.UseCmpFileForFpNames() != GetUseCmpFileForFpNames() )
|
||||
{
|
||||
SetUseCmpFileForFpNames( dlg.UseCmpFileForFpNames() );
|
||||
configChanged = true;
|
||||
}
|
||||
|
||||
if( configChanged
|
||||
&& !GetBoard()->GetFileName().IsEmpty()
|
||||
if( configChanged && !GetBoard()->GetFileName().IsEmpty()
|
||||
&& IsOK( NULL, _( "The project configuration has changed. Do you want to save it?" ) ) )
|
||||
{
|
||||
wxFileName fn = Prj().AbsolutePath( GetBoard()->GetFileName() );
|
||||
|
@ -108,7 +101,6 @@ DIALOG_NETLIST::DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxDC * aDC,
|
|||
bool tmp = m_config->Read( NETLIST_DELETESINGLEPADNETS_KEY, 0l );
|
||||
m_rbSingleNets->SetSelection( tmp == 0 ? 0 : 1);
|
||||
m_NetlistFilenameCtrl->SetValue( aNetlistFullFilename );
|
||||
m_cmpNameSourceOpt->SetSelection( m_parent->GetUseCmpFileForFpNames() ? 1 : 0 );
|
||||
m_checkBoxSilentMode->SetValue( m_silentMode );
|
||||
m_checkBoxFullMessages->SetValue( m_reportAll );
|
||||
|
||||
|
@ -158,14 +150,6 @@ void DIALOG_NETLIST::OnReadNetlistFileClick( wxCommandEvent& event )
|
|||
{
|
||||
wxString msg;
|
||||
wxString netlistFileName = m_NetlistFilenameCtrl->GetValue();
|
||||
wxString cmpFileName;
|
||||
|
||||
if( UseCmpFileForFpNames() )
|
||||
{
|
||||
wxFileName fn = m_NetlistFilenameCtrl->GetValue();
|
||||
fn.SetExt( ComponentFileExtension );
|
||||
cmpFileName = fn.GetFullPath();
|
||||
}
|
||||
|
||||
// Give the user a chance to bail out when making changes from a netlist.
|
||||
if( !m_checkDryRun->GetValue() && !m_silentMode
|
||||
|
@ -180,23 +164,17 @@ void DIALOG_NETLIST::OnReadNetlistFileClick( wxCommandEvent& event )
|
|||
msg.Printf( _( "Reading netlist file \"%s\".\n" ), GetChars( netlistFileName ) );
|
||||
m_MessageWindow->AppendText( msg );
|
||||
|
||||
if( !cmpFileName.IsEmpty() )
|
||||
{
|
||||
msg.Printf( _( "Using component footprint link file \"%s\".\n" ), GetChars( cmpFileName ) );
|
||||
m_MessageWindow->AppendText( msg );
|
||||
}
|
||||
|
||||
if( m_Select_By_Timestamp->GetSelection() == 1 )
|
||||
{
|
||||
msg.Printf( _( "Using time stamps to select footprints in file \"%s\".\n" ),
|
||||
GetChars( cmpFileName ) );
|
||||
m_MessageWindow->AppendText( msg );
|
||||
}
|
||||
msg = _( "Using time stamps to match components and footprints.\n" );
|
||||
else
|
||||
msg = _( "Using references to match components and footprints.\n" );
|
||||
|
||||
m_MessageWindow->AppendText( msg );
|
||||
|
||||
WX_TEXT_CTRL_REPORTER reporter( m_MessageWindow );
|
||||
reporter.SetReportAll( m_reportAll );
|
||||
|
||||
m_parent->ReadPcbNetlist( netlistFileName, cmpFileName, &reporter,
|
||||
m_parent->ReadPcbNetlist( netlistFileName, wxEmptyString, &reporter,
|
||||
m_ChangeExistingFootprintCtrl->GetSelection() == 1,
|
||||
m_DeleteBadTracks->GetSelection() == 1,
|
||||
m_RemoveExtraFootprintsCtrl->GetSelection() == 1,
|
||||
|
@ -219,16 +197,8 @@ void DIALOG_NETLIST::OnTestFootprintsClick( wxCommandEvent& event )
|
|||
wxArrayString missing;
|
||||
std::vector <MODULE*> notInNetlist;
|
||||
wxString netlistFilename = m_NetlistFilenameCtrl->GetValue();
|
||||
wxString cmpFilename;
|
||||
|
||||
if( UseCmpFileForFpNames() )
|
||||
{
|
||||
wxFileName fn = m_NetlistFilenameCtrl->GetValue();
|
||||
fn.SetExt( ComponentFileExtension );
|
||||
cmpFilename = fn.GetFullPath();
|
||||
}
|
||||
|
||||
if( !verifyFootprints( netlistFilename, cmpFilename, duplicate, missing, notInNetlist ) )
|
||||
if( !verifyFootprints( netlistFilename, wxEmptyString, duplicate, missing, notInNetlist ) )
|
||||
return;
|
||||
|
||||
#define ERR_CNT_MAX 100 // Max number of errors to output in dialog
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2012 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 1992-2015 KiCad Developers, see change_log.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -49,14 +49,6 @@ public:
|
|||
DIALOG_NETLIST( PCB_EDIT_FRAME* aParent, wxDC* aDC, const wxString & aNetlistFullFilename );
|
||||
~DIALOG_NETLIST();
|
||||
|
||||
// return true if the user choice is to use the .cmp file
|
||||
// created by CvPcb to know footprint names associated to components
|
||||
// and false to use the netlist only
|
||||
bool UseCmpFileForFpNames()
|
||||
{
|
||||
return m_cmpNameSourceOpt->GetSelection() == 1;
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Function verifyFootprints
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 6 2014)
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -36,14 +36,6 @@ DIALOG_NETLIST_FBP::DIALOG_NETLIST_FBP( wxWindow* parent, wxWindowID id, const w
|
|||
|
||||
bmodulesOptSizer->Add( m_Select_By_Timestamp, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxString m_cmpNameSourceOptChoices[] = { _("From netlist"), _("From separate .cmp file") };
|
||||
int m_cmpNameSourceOptNChoices = sizeof( m_cmpNameSourceOptChoices ) / sizeof( wxString );
|
||||
m_cmpNameSourceOpt = new wxRadioBox( this, wxID_ANY, _("Footprint Name Source"), wxDefaultPosition, wxDefaultSize, m_cmpNameSourceOptNChoices, m_cmpNameSourceOptChoices, 1, wxRA_SPECIFY_COLS );
|
||||
m_cmpNameSourceOpt->SetSelection( 0 );
|
||||
m_cmpNameSourceOpt->SetToolTip( _("Source of footprints names for component:\n- the netlist (if you have filled the footprint field of each component in schematic)\n- the .cmp file created by CvPcb") );
|
||||
|
||||
bmodulesOptSizer->Add( m_cmpNameSourceOpt, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
|
||||
|
||||
wxString m_ChangeExistingFootprintCtrlChoices[] = { _("Keep"), _("Change") };
|
||||
int m_ChangeExistingFootprintCtrlNChoices = sizeof( m_ChangeExistingFootprintCtrlChoices ) / sizeof( wxString );
|
||||
m_ChangeExistingFootprintCtrl = new wxRadioBox( this, wxID_ANY, _("Exchange Footprint"), wxDefaultPosition, wxDefaultSize, m_ChangeExistingFootprintCtrlNChoices, m_ChangeExistingFootprintCtrlChoices, 1, wxRA_SPECIFY_COLS );
|
||||
|
|
|
@ -219,96 +219,6 @@
|
|||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
<property name="proportion">0</property>
|
||||
<object class="wxRadioBox" expanded="1">
|
||||
<property name="BottomDockable">1</property>
|
||||
<property name="LeftDockable">1</property>
|
||||
<property name="RightDockable">1</property>
|
||||
<property name="TopDockable">1</property>
|
||||
<property name="aui_layer"></property>
|
||||
<property name="aui_name"></property>
|
||||
<property name="aui_position"></property>
|
||||
<property name="aui_row"></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="choices">"From netlist" "From separate .cmp file"</property>
|
||||
<property name="close_button">1</property>
|
||||
<property name="context_help"></property>
|
||||
<property name="context_menu">1</property>
|
||||
<property name="default_pane">0</property>
|
||||
<property name="dock">Dock</property>
|
||||
<property name="dock_fixed">0</property>
|
||||
<property name="docking">Left</property>
|
||||
<property name="enabled">1</property>
|
||||
<property name="fg"></property>
|
||||
<property name="floatable">1</property>
|
||||
<property name="font"></property>
|
||||
<property name="gripper">0</property>
|
||||
<property name="hidden">0</property>
|
||||
<property name="id">wxID_ANY</property>
|
||||
<property name="label">Footprint Name Source</property>
|
||||
<property name="majorDimension">1</property>
|
||||
<property name="max_size"></property>
|
||||
<property name="maximize_button">0</property>
|
||||
<property name="maximum_size"></property>
|
||||
<property name="min_size"></property>
|
||||
<property name="minimize_button">0</property>
|
||||
<property name="minimum_size"></property>
|
||||
<property name="moveable">1</property>
|
||||
<property name="name">m_cmpNameSourceOpt</property>
|
||||
<property name="pane_border">1</property>
|
||||
<property name="pane_position"></property>
|
||||
<property name="pane_size"></property>
|
||||
<property name="permission">protected</property>
|
||||
<property name="pin_button">1</property>
|
||||
<property name="pos"></property>
|
||||
<property name="resize">Resizable</property>
|
||||
<property name="selection">0</property>
|
||||
<property name="show">1</property>
|
||||
<property name="size"></property>
|
||||
<property name="style">wxRA_SPECIFY_COLS</property>
|
||||
<property name="subclass"></property>
|
||||
<property name="toolbar_pane">0</property>
|
||||
<property name="tooltip">Source of footprints names for component:
- the netlist (if you have filled the footprint field of each component in schematic)
- the .cmp file created by CvPcb</property>
|
||||
<property name="validator_data_type"></property>
|
||||
<property name="validator_style">wxFILTER_NONE</property>
|
||||
<property name="validator_type">wxDefaultValidator</property>
|
||||
<property name="validator_variable"></property>
|
||||
<property name="window_extra_style"></property>
|
||||
<property name="window_name"></property>
|
||||
<property name="window_style"></property>
|
||||
<event name="OnChar"></event>
|
||||
<event name="OnEnterWindow"></event>
|
||||
<event name="OnEraseBackground"></event>
|
||||
<event name="OnKeyDown"></event>
|
||||
<event name="OnKeyUp"></event>
|
||||
<event name="OnKillFocus"></event>
|
||||
<event name="OnLeaveWindow"></event>
|
||||
<event name="OnLeftDClick"></event>
|
||||
<event name="OnLeftDown"></event>
|
||||
<event name="OnLeftUp"></event>
|
||||
<event name="OnMiddleDClick"></event>
|
||||
<event name="OnMiddleDown"></event>
|
||||
<event name="OnMiddleUp"></event>
|
||||
<event name="OnMotion"></event>
|
||||
<event name="OnMouseEvents"></event>
|
||||
<event name="OnMouseWheel"></event>
|
||||
<event name="OnPaint"></event>
|
||||
<event name="OnRadioBox"></event>
|
||||
<event name="OnRightDClick"></event>
|
||||
<event name="OnRightDown"></event>
|
||||
<event name="OnRightUp"></event>
|
||||
<event name="OnSetFocus"></event>
|
||||
<event name="OnSize"></event>
|
||||
<event name="OnUpdateUI"></event>
|
||||
</object>
|
||||
</object>
|
||||
<object class="sizeritem" expanded="1">
|
||||
<property name="border">5</property>
|
||||
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jun 6 2014)
|
||||
// C++ code generated with wxFormBuilder (version Jun 5 2014)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
|
@ -47,7 +47,6 @@ class DIALOG_NETLIST_FBP : public DIALOG_SHIM
|
|||
};
|
||||
|
||||
wxRadioBox* m_Select_By_Timestamp;
|
||||
wxRadioBox* m_cmpNameSourceOpt;
|
||||
wxRadioBox* m_ChangeExistingFootprintCtrl;
|
||||
wxRadioBox* m_DeleteBadTracks;
|
||||
wxRadioBox* m_RemoveExtraFootprintsCtrl;
|
||||
|
|
|
@ -244,7 +244,7 @@ void PCB_EDIT_FRAME::loadFootprints( NETLIST& aNetlist, REPORTER* aReporter )
|
|||
{
|
||||
if( aReporter )
|
||||
{
|
||||
msg.Printf( _( "* Warning: component '%s' has footprint '%s' and should be '%s'\n" ),
|
||||
msg.Printf( _( "* Warning: component '%s': board footprint '%s', netlist footprint '%s'\n" ),
|
||||
GetChars( component->GetReference() ),
|
||||
GetChars( fpOnBoard->GetFPID().Format() ),
|
||||
GetChars( component->GetFPID().Format() ) );
|
||||
|
|
|
@ -320,7 +320,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
m_hasAutoSave = true;
|
||||
m_RecordingMacros = -1;
|
||||
m_microWaveToolBar = NULL;
|
||||
m_useCmpFileForFpNames = true;
|
||||
|
||||
m_rotationAngle = 900;
|
||||
|
||||
|
|
|
@ -319,7 +319,6 @@ PARAM_CFG_ARRAY PCB_EDIT_FRAME::GetProjectFileParameters()
|
|||
|
||||
pca.push_back( new PARAM_CFG_FILENAME( wxT( "LastNetListRead" ), &m_lastNetListRead ) );
|
||||
|
||||
pca.push_back( new PARAM_CFG_BOOL( wxT( "UseCmpFile" ), &m_useCmpFileForFpNames, true ) );
|
||||
GetBoard()->GetDesignSettings().AppendConfigs( &pca );
|
||||
|
||||
return pca;
|
||||
|
|
Loading…
Reference in New Issue