42#include <wx/filedlg.h>
61 wxString& aNetlistFullFilename )
64 m_netlistPath( aNetlistFullFilename ),
65 m_initialized( false ),
66 m_runDragCommand( false )
84 { wxID_CANCEL,
_(
"Close" ) },
85 { wxID_APPLY,
_(
"Update PCB" ) } } );
102 catch(
const std::runtime_error& e )
104 wxFAIL_MSG( e.what() );
126 wxString dirPath = wxFileName(
Prj().GetProjectFullName() ).GetPath();
130 if( !filename.IsEmpty() )
132 wxFileName fn = filename;
133 dirPath = fn.GetPath();
134 filename = fn.GetFullName();
137 wxFileDialog FilesDialog(
this,
_(
"Import Netlist" ), dirPath, filename,
139 wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST );
141 if( FilesDialog.ShowModal() != wxID_OK )
162 wxMessageBox(
_(
"Please choose a valid netlist file." ) );
166 if( !fn.FileExists() )
168 wxMessageBox(
_(
"The netlist file does not exist." ) );
194 if( fn.FileExists() )
229 wxFileName fn = netlistFileName;
231 if( !fn.IsOk() || !fn.FileExists() )
240 msg.Printf(
_(
"Reading netlist file '%s'.\n" ), netlistFileName );
244 msg =
_(
"Using reference designators to match symbols and footprints.\n" );
246 msg =
_(
"Using tstamps (unique IDs) to match symbols and footprints.\n" );
wxBitmapBundle KiBitmapBundle(BITMAPS aBitmap)
Update the BOARD with a new netlist.
void SetReporter(REPORTER *aReporter)
Enable dry run mode (just report, no changes to PCB).
bool UpdateNetlist(NETLIST &aNetlist)
Update the board's components according to the new netlist.
void SetIsDryRun(bool aEnabled)
void SetDeleteUnusedFootprints(bool aEnabled)
void SetOverrideLocks(bool aOverride)
void SetReplaceFootprints(bool aEnabled)
void SetLookupByTimestamp(bool aEnabled)
Class DIALOG_IMPORT_NETLIST_BASE.
wxCheckBox * m_cbDeleteExtraFootprints
wxCheckBox * m_cbUpdateFootprints
wxTextCtrl * m_NetlistFilenameCtrl
STD_BITMAP_BUTTON * m_browseButton
wxRadioBox * m_matchByTimestamp
wxCheckBox * m_cbOverrideLocks
wxButton * m_sdbSizerCancel
WX_HTML_REPORT_PANEL * m_MessageWindow
wxCheckBox * m_cbDeleteShortingTracks
void onFilenameChanged(bool aLoadNetlist)
void onUpdatePCB(wxCommandEvent &event) override
PCB_EDIT_FRAME * m_parent
void loadNetlist(bool aDryRun)
static bool m_matchByUUID
void onImportNetlist(wxCommandEvent &event) override
void OnFilenameKillFocus(wxFocusEvent &event) override
void OnOptionChanged(wxCommandEvent &event) override
void OnMatchChanged(wxCommandEvent &event) override
void onBrowseNetlistFiles(wxCommandEvent &event) override
DIALOG_IMPORT_NETLIST(PCB_EDIT_FRAME *aParent, wxString &aNetlistFullFilename)
void SetupStandardButtons(std::map< int, wxString > aLabels={})
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
KIGFX::VIEW_CONTROLS * GetViewControls() const
Return a pointer to the #VIEW_CONTROLS instance used in the panel.
An interface for classes handling user events controlling the view behavior such as zooming,...
virtual VECTOR2D GetMousePosition(bool aWorldCoordinates=true) const =0
Return the current mouse pointer position.
virtual void SetCursorPosition(const VECTOR2D &aPosition, bool aWarpView=true, bool aTriggeredByArrows=false, long aArrowCommand=0)=0
Move cursor to the requested position expressed in world coordinates.
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
DIALOG_NETLIST m_NetlistDialog
static TOOL_ACTION move
move or drag an item
PCBNEW_SETTINGS * GetPcbNewSettings() const
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
The main frame for Pcbnew.
void SetLastPath(LAST_PATH_TYPE aType, const wxString &aLastPath)
Set the path of the last file successfully read.
bool ReadNetlistFromFile(const wxString &aFilename, NETLIST &aNetlist, REPORTER &aReporter)
Read a netlist from a file into a NETLIST object.
wxString GetLastPath(LAST_PATH_TYPE aType)
Get the last path for a particular type.
void OnNetlistChanged(BOARD_NETLIST_UPDATER &aUpdater, bool *aRunDragCommand)
Called after netlist is updated.
void InstallNetlistFrame()
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & ReportHead(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Places the report at the beginning of the list for objects that support ordering.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
void Clear()
return the number of messages matching the given severity mask.
void SetLazyUpdate(bool aLazyUpdate)
Forces updating the HTML page, after the report is built in lazy mode If aSort = true,...
void SetLabel(const wxString &aLabel) override
Sets the lazy update.
int GetVisibleSeverities() const
void SetFileName(const wxString &aReportFileName)
void SetVisibleSeverities(int aSeverities)
void Flush(bool aSort=false)
Set the visible severity filter.
This file is part of the common library.
static wxString NetlistFileWildcard()
bool delete_extra_footprints
bool delete_shorting_tracks
Definition of file extensions used in Kicad.