31 using namespace std::placeholders;
49 #include <wx/msgdlg.h> 52 extern void SpreadFootprints( std::vector<FOOTPRINT*>* aFootprints, wxPoint aSpreadAreaPosition );
63 &aNetlist, aFilename, wxEmptyString ) );
65 if( !netlistReader.get() )
67 msg.Printf(
_(
"Cannot open netlist file '%s'." ), aFilename );
68 wxMessageBox( msg,
_(
"Netlist Load Error." ), wxOK | wxICON_ERROR,
this );
73 netlistReader->LoadNetlist();
74 LoadFootprints( aNetlist, aReporter );
78 msg.Printf(
_(
"Error loading netlist.\n%s" ), ioe.
What().GetData() );
79 wxMessageBox( msg,
_(
"Netlist Load Error" ), wxOK | wxICON_ERROR );
91 std::string dummyPayload;
100 for(
auto track : board->
Tracks() )
101 GetCanvas()->GetView()->Update( track );
106 wxPoint areaPosition = (wxPoint) GetCanvas()->GetViewControls()->GetCursorPosition();
114 if( !newFootprints.empty() )
116 for(
FOOTPRINT* footprint : newFootprints )
119 *aRunDragCommand =
true;
129 Compile_Ratsnest(
true );
131 GetCanvas()->Refresh();
148 for(
unsigned ii = 0; ii < aNetlist.
GetCount(); ii++ )
155 msg.Printf(
_(
"No footprint defined for symbol %s." ),
169 path.push_back( uuid );
171 if( ( fpOnBoard = m_pcb->FindFootprintByPath(
path ) ) )
176 fpOnBoard = m_pcb->FindFootprintByReference( component->
GetReference() );
178 bool footprintMisMatch = fpOnBoard && fpOnBoard->
GetFPID() != component->
GetFPID();
182 msg.Printf(
_(
"Footprint of %s changed: board footprint '%s', netlist footprint '%s'." ),
192 footprintMisMatch =
false;
194 if( fpOnBoard && !footprintMisMatch )
197 if( component->
GetFPID() != lastFPID )
205 msg.Printf(
_(
"%s footprint ID '%s' is not valid." ),
218 lastFPID = component->
GetFPID();
222 msg.Printf(
_(
"%s footprint '%s' not found in any libraries in the footprint " 238 const_cast<KIID&>( footprint->
m_Uuid ) =
KIID();
static TOOL_ACTION selectionClear
Clear the current selection.
const EDA_RECT GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
const UTF8 & GetLibItemName() const
Update the BOARD with a new netlist.
bool IsFindByTimeStamp() const
void LoadFootprints(NETLIST &aNetlist, REPORTER &aReporter)
Load the footprints for each #SCH_COMPONENT in aNetlist from the list of libraries.
Class that computes missing connections on a PCB.
bool ReadNetlistFromFile(const wxString &aFilename, NETLIST &aNetlist, REPORTER &aReporter)
Read a netlist from a file into a NETLIST object.
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...
unsigned GetCount() const
virtual void ExpressMail(FRAME_T aDestination, MAIL_T aCommand, std::string &aPayload, wxWindow *aSource=nullptr)
Send aPayload to aDestination from aSource.
A pure virtual class used to derive REPORTER objects from.
A logical library item identifier and consists of various portions much like a URI.
void OnNetlistChanged(BOARD_NETLIST_UPDATER &aUpdater, bool *aRunDragCommand)
Called after netlist is updated.
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
void SetFootprint(FOOTPRINT *aFootprint)
void SpreadFootprints(std::vector< FOOTPRINT * > *aFootprints, wxPoint aSpreadAreaPosition)
Footprints (after loaded by reading a netlist for instance) are moved to be in a small free area (out...
const LIB_ID & GetFPID() const
void SetReferencePoint(const VECTOR2I &aP)
FOOTPRINT * loadFootprint(const LIB_ID &aFootprintId)
Attempts to load aFootprintId from the footprint library table.
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
virtual const wxString What() const
A composite of Problem() and Where()
const wxString & GetReference() const
std::vector< FOOTPRINT * > GetAddedFootprints() const
Store all of the related footprint information found in a netlist.
virtual FP_LIB_TABLE * PcbFootprintLibs(KIWAY &aKiway)
Return the table of footprint libraries.
COMPONENT * GetComponent(unsigned aIndex)
Return the COMPONENT at aIndex.
Information pertinent to a Pcbnew printed circuit board.
bool GetReplaceFootprints() const
static TOOL_ACTION selectItem
Select an item (specified as the event parameter).
Handle the component boundary box.
std::string::size_type size() const
const KIID_PATH & GetPath() const
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
bool IsEmpty(bool aIncludeFallback=true)
Return true if the table is empty.
const std::vector< KIID > & GetKIIDs() const