28using namespace std::placeholders;
58 &aNetlist, aFilename, wxEmptyString ) );
60 if( !netlistReader.get() )
62 msg.Printf(
_(
"Cannot open netlist file '%s'." ), aFilename );
68 netlistReader->LoadNetlist();
73 msg.Printf(
_(
"Error loading netlist.\n%s" ), ioe.
What().GetData() );
99 if( netNamesCfg == 2 || netNamesCfg == 3 )
102 else if(
dynamic_cast<PAD*
>( aItem ) )
104 if( netNamesCfg == 1 || netNamesCfg == 3 )
112 text->ClearRenderCache();
113 text->ClearBoundingBoxCache();
128 if( !newFootprints.empty() )
130 for(
FOOTPRINT* footprint : newFootprints )
133 *aRunDragCommand =
true;
150 if( aNetlist.
IsEmpty() ||
Prj().PcbFootprintLibs()->IsEmpty() )
155 for(
unsigned ii = 0; ii < aNetlist.
GetCount(); ii++ )
162 msg.Printf(
_(
"No footprint defined for symbol %s." ),
176 path.push_back( uuid );
185 bool footprintMisMatch = fpOnBoard && fpOnBoard->
GetFPID() != component->
GetFPID();
189 msg.Printf(
_(
"Footprint of %s changed: board footprint '%s', netlist footprint '%s'." ),
199 footprintMisMatch =
false;
201 if( fpOnBoard && !footprintMisMatch )
204 if( component->
GetFPID() != lastFPID )
212 msg.Printf(
_(
"%s footprint ID '%s' is not valid." ),
225 lastFPID = component->
GetFPID();
229 msg.Printf(
_(
"%s footprint '%s' not found in any libraries in the footprint "
Update the BOARD with a new netlist.
std::vector< FOOTPRINT * > GetAddedFootprints() const
Information pertinent to a Pcbnew printed circuit board.
FOOTPRINT * FindFootprintByPath(const KIID_PATH &aPath) const
Search for a FOOTPRINT within this board with the given path.
FOOTPRINT * FindFootprintByReference(const wxString &aReference) const
Search for a FOOTPRINT within this board with the given reference designator.
Store all of the related footprint information found in a netlist.
const KIID_PATH & GetPath() const
const wxString & GetReference() const
void SetFootprint(FOOTPRINT *aFootprint)
const std::vector< KIID > & GetKIIDs() const
const LIB_ID & GetFPID() const
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Clear the message panel and populates it with the contents of aList.
virtual void Refresh(bool aEraseBackground=true, const wxRect *aRect=nullptr) override
A base class for most all the KiCad significant classes used in schematics and boards.
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual const wxString What() const
A composite of Problem() and Where()
An abstract base class for deriving all objects that can be added to a VIEW.
void UpdateAllItemsConditionally(int aUpdateFlags, std::function< bool(VIEW_ITEM *)> aCondition)
Update items in the view according to the given flags and condition.
A logical library item identifier and consists of various portions much like a URI.
const UTF8 & GetLibItemName() const
static NETLIST_READER * GetNetlistReader(NETLIST *aNetlist, const wxString &aNetlistFileName, const wxString &aCompFootprintFileName=wxEmptyString)
Attempt to determine the net list file type of aNetlistFileName and return the appropriate NETLIST_RE...
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
bool GetReplaceFootprints() const
unsigned GetCount() const
COMPONENT * GetComponent(unsigned aIndex)
Return the COMPONENT at aIndex.
bool IsFindByTimeStamp() const
DISPLAY_OPTIONS m_Display
static TOOL_ACTION selectionClear
Clear the current selection.
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
PCBNEW_SETTINGS * GetPcbNewSettings() const
FOOTPRINT * loadFootprint(const LIB_ID &aFootprintId)
Attempts to load aFootprintId from the footprint library table.
PCB_DRAW_PANEL_GAL * GetCanvas() const override
Return a pointer to GAL-based canvas of given EDA draw frame.
void Compile_Ratsnest(bool aDisplayStatus)
Create the entire board ratsnest.
virtual KIGFX::PCB_VIEW * GetView() const override
Return a pointer to the #VIEW instance used in the panel.
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.
void OnNetlistChanged(BOARD_NETLIST_UPDATER &aUpdater, bool *aRunDragCommand)
Called after netlist is updated.
void LoadFootprints(NETLIST &aNetlist, REPORTER &aReporter)
Load the footprints for each #SCH_COMPONENT in aNetlist from the list of libraries.
A pure virtual class used to derive REPORTER objects from.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
std::string::size_type size() const
void DisplayErrorMessage(wxWindow *aParent, const wxString &aText, const wxString &aExtraInfo)
Display an error message with aMessage.
This file is part of the common library.
@ REPAINT
Item needs to be redrawn.
@ GEOMETRY
Position or shape has changed.
Class that computes missing connections on a PCB.