KiCad PCB EDA Suite
Loading...
Searching...
No Matches
netlist_exporter_base.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 1992-2017 jp.charras at wanadoo.fr
5 * Copyright (C) 2013-2017 SoftPLC Corporation, Dick Hollenbeck <[email protected]>
6 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
23
24#include <string_utils.h>
25
26#include <trace_helpers.h>
27#include <connection_graph.h>
28#include <kiface_services.h>
29#include <kiway.h>
30#include <lib_id.h>
31#include <sch_pin.h>
32#include <sch_reference_list.h>
33#include <sch_screen.h>
34#include <sch_symbol.h>
35#include <schematic.h>
36#include <advanced_config.h>
38#include <reporter.h>
39#include <richio.h>
40
41
43 m_exporter( aExporter )
44{
45 if( m_exporter.m_connectivityDepth == 0 )
46 m_exporter.rebuildConnectivity();
47
48 ++m_exporter.m_connectivityDepth;
49}
50
55
56bool NETLIST_EXPORTER_BASE::WriteNetlist( const wxString& aOutFileName, unsigned aNetlistOptions,
57 REPORTER& aReporter )
58{
59 try
60 {
61 CONNECTIVITY_SCOPE connectivity( *this );
62 return writeNetlist( aOutFileName, aNetlistOptions, aReporter );
63 }
64 catch( const IO_ERROR& error )
65 {
66 aReporter.Report( error.What(), RPT_SEVERITY_ERROR );
67 return false;
68 }
69 catch( const std::exception& error )
70 {
71 aReporter.Report( wxString::Format( _( "Failed to export schematic: %s" ), error.what() ),
73 return false;
74 }
75}
76
78{
79 m_exportNets.clear();
80 m_exportItemNets.clear();
81 m_schematic->RebuildConnectivity();
82 m_exportSheets = m_schematic->Hierarchy();
83
84 if( ADVANCED_CFG::GetCfg().m_ConnectivityEngine )
85 {
86 auto& facade = m_schematic->Connectivity();
87 std::map<KIID_PATH, const SCH_SHEET_PATH*> paths;
88
89 for( const SCH_SHEET_PATH& path : m_exportSheets )
90 paths.emplace( path.Path(), &path );
91
92 for( const auto& [key, row] : facade.Published().Rows() )
93 {
94 const auto& path = facade.Keys().Instance( key.inst );
95 const auto view = facade.Connection( key.item, path );
96
97 if( !view )
98 THROW_IO_ERROR( _( "Connectivity changed while preparing the netlist." ) );
99
100 const auto sheet = paths.find( path );
101
102 if( sheet == paths.end() )
103 THROW_IO_ERROR( _( "Connectivity contains an unknown sheet instance." ) );
104
105 m_exportItemNets[*sheet->second].emplace( key.item, view->Name() );
106 }
107
108 for( const SCH_CONNECTIVITY::NET_GROUP& group : facade.GetNetMap() )
109 {
110 EXPORT_NET result{ group.name, false, {} };
111
112 for( const SCH_CONNECTIVITY::NET_VIEW& net : group.instances )
113 {
114 if( !net.IsNet() )
115 continue;
116
117 const auto path = paths.find( net.Instance() );
118
119 if( path == paths.end() )
120 THROW_IO_ERROR( _( "Connectivity contains an unknown sheet instance." ) );
121
122 for( SCH_ITEM* item : net.Items() )
123 {
124 result.hasNoConnect |= item->Type() == SCH_NO_CONNECT_T;
125
126 if( item->Type() == SCH_PIN_T )
127 result.pins.emplace_back( static_cast<SCH_PIN*>( item ), *path->second );
128 }
129 }
130
131 m_exportNets.push_back( std::move( result ) );
132 }
133
134 return;
135 }
136
137 for( const SCH_SHEET_PATH& path : m_exportSheets )
138 {
139 std::unordered_map<KIID, wxString>& itemNets = m_exportItemNets[path];
140
141 auto collect =
142 [&]( SCH_ITEM* item )
143 {
144 if( SCH_CONNECTION* connection = item->Connection( &path ) )
145 itemNets.emplace( item->m_Uuid, connection->Name() );
146 };
147
148 for( SCH_ITEM* item : path.LastScreen()->Items() )
149 {
150 collect( item );
151 item->RunOnChildren( collect, RECURSE_MODE::NO_RECURSE );
152 }
153 }
154
155 for( const auto& [key, subgraphs] : m_schematic->ConnectionGraph()->GetNetMap() )
156 {
157 EXPORT_NET result{ key.Name, false, {} };
158
159 for( CONNECTION_SUBGRAPH* subgraph : subgraphs )
160 {
161 result.hasNoConnect |= subgraph->GetNoConnect()
162 && subgraph->GetNoConnect()->Type() == SCH_NO_CONNECT_T;
163 const SCH_SHEET_PATH& path = subgraph->GetSheet();
164
165 for( SCH_ITEM* item : subgraph->GetItems() )
166 {
167 if( item->Type() == SCH_PIN_T )
168 result.pins.emplace_back( static_cast<SCH_PIN*>( item ), path );
169 }
170 }
171
172 m_exportNets.push_back( std::move( result ) );
173 }
174}
175
176std::optional<wxString> NETLIST_EXPORTER_BASE::itemNetName( const SCH_ITEM& aItem,
177 const SCH_SHEET_PATH& aPath ) const
178{
179 const auto sheet = m_exportItemNets.find( aPath );
180
181 if( sheet == m_exportItemNets.end() )
182 return std::nullopt;
183
184 const auto found = sheet->second.find( aItem.m_Uuid );
185 return found == sheet->second.end() ? std::nullopt : std::optional( found->second );
186}
187
188
189// a "less than" test on two LIB_SYMBOLs (.m_name wxStrings)
190bool LIB_SYMBOL_LESS_THAN::operator()( LIB_SYMBOL* const& libsymbol1, LIB_SYMBOL* const& libsymbol2 ) const
191{
192 // Use case specific GetName() wxString compare
193 return libsymbol1->GetLibId() < libsymbol2->GetLibId();
194}
195
196
197wxString NETLIST_EXPORTER_BASE::MakeCommandLine( const wxString& aFormatString, const wxString& aNetlistFile,
198 const wxString& aFinalFile, const wxString& aProjectPath )
199{
200 // Expand format symbols in the command line:
201 // %B => base filename of selected output file, minus path and extension.
202 // %P => project directory name, without trailing '/' or '\'.
203 // %I => full filename of the input file (the intermediate net file).
204 // %O => complete filename and path (but without extension) of the user chosen output file.
205
206 wxString ret = aFormatString;
207 wxFileName in = aNetlistFile;
208 wxFileName out = aFinalFile;
209 wxString str_out = out.GetFullPath();
210
211 ret.Replace( "%P", aProjectPath, true );
212 ret.Replace( "%B", out.GetName(), true );
213 ret.Replace( "%I", in.GetFullPath(), true );
214
215#ifdef __WINDOWS__
216 // A ugly hack to run xsltproc that has a serious bug on Window since a long time:
217 // the filename given after -o option (output filename) cannot use '\' in filename
218 // so replace if by '/' if possible (I mean if the filename does not start by "\\"
219 // that is a filename on a Windows server)
220
221 if( !str_out.StartsWith( "\\\\" ) )
222 str_out.Replace( "\\", "/" );
223#endif
224
225 ret.Replace( "%O", str_out, true );
226
227 return ret;
228}
229
230
232 const EXPORT_EXCLUSION& aExcluded )
233{
234 wxCHECK( aItem, nullptr );
235
236 wxString ref;
237
238 if( aItem->Type() != SCH_SYMBOL_T )
239 return nullptr;
240
241 // found next symbol
242 SCH_SYMBOL* symbol = (SCH_SYMBOL*) aItem;
243
244 // Power symbols and other symbols which have the reference starting with "#" are not
245 // included in netlist (pseudo or virtual symbols)
246 ref = symbol->GetRef( &aSheetPath );
247
248 if( ref[0] == wxChar( '#' ) )
249 return nullptr;
250
251 // An excluded unit must not claim the reference, or the package's exported units would be dropped with it
252 if( aExcluded && aExcluded( symbol, aSheetPath ) )
253 return nullptr;
254
255 SCH_SCREEN* screen = aSheetPath.LastScreen();
256
257 wxCHECK( screen, nullptr );
258
259 auto it = screen->GetLibSymbols().find( symbol->GetSchSymbolLibraryName() );
260
261 if( it == screen->GetLibSymbols().end() )
262 return nullptr;
263
264 LIB_SYMBOL* libSymbol = it->second;
265
266 // If symbol is a "multi parts per package" type
267 if( libSymbol->GetUnitCount() > 1 )
268 {
269 // A package spanning sheets belongs to the unit on its suffix's sheet, so the footprint path matches the ref
270 if( packageOwnedElsewhere( symbol, aSheetPath, aExcluded ) )
271 return nullptr;
272
273 // test if this reference has already been processed, and if so skip
274 if( m_referencesAlreadyFound.Lookup( ref ) )
275 return nullptr;
276 }
277
278 // record the usage of this library symbol entry.
279 m_libParts.insert( libSymbol ); // rejects non-unique pointers
280
281 return symbol;
282}
283
284
286{
287 return [this]( const SCH_SYMBOL* aSymbol, const SCH_SHEET_PATH& aSheet )
288 {
289 return aSymbol->GetExcludedFromBoard( &aSheet, m_exportVariant );
290 };
291}
292
293
295 const EXPORT_EXCLUSION& aExcluded ) const
296{
297 const SCHEMATIC* schematic = aSymbol->Schematic();
298
299 if( !schematic )
300 return false;
301
302 const wxString suffix = schematic->GetPackageRefSuffix( aSymbol, aSheetPath );
303
304 if( suffix == schematic->GetRefSuffix( aSheetPath ) )
305 return false;
306
307 const wxString base = aSymbol->GetBaseRef( &aSheetPath );
308
309 for( const SCH_SHEET_PATH& path : m_exportSheets )
310 {
311 if( schematic->GetRefSuffix( path ) != suffix )
312 continue;
313
314 for( SCH_ITEM* item : path.LastScreen()->Items().OfType( SCH_SYMBOL_T ) )
315 {
316 const SCH_SYMBOL* other = static_cast<const SCH_SYMBOL*>( item );
317
318 if( other->GetLibId() == aSymbol->GetLibId() && other->GetBaseRef( &path ) == base
319 && schematic->GetPackageRefSuffix( other, path ) == suffix
320 && !( aExcluded && aExcluded( other, path ) ) )
321 {
322 return true;
323 }
324 }
325 }
326
327 return false;
328}
329
330
331std::vector<PIN_INFO> NETLIST_EXPORTER_BASE::CreatePinList( SCH_SYMBOL* aSymbol, const SCH_SHEET_PATH& aSheetPath )
332{
333 std::vector<PIN_INFO> pins;
334
335 if( !aSymbol )
336 return pins;
337
338 wxString ref( aSymbol->GetRef( &aSheetPath ) );
339
340 // Power symbols and other symbols which have the reference starting with "#" are not
341 // included in netlist (pseudo or virtual symbols)
342 if( ( ref[0] == wxChar( '#' ) ) || aSymbol->IsPower() )
343 return pins;
344
345 // if( aSymbol->m_FlagControlMulti == 1 )
346 // continue; /* yes */
347 // removed because with multiple instances of one schematic (several sheets pointing to
348 // 1 screen), this will be erroneously be toggled.
349
350 if( !aSymbol->GetLibSymbolRef() )
351 return pins;
352
353 // If symbol is a "multi parts per package" type
354 if( aSymbol->GetLibSymbolRef()->GetUnitCount() > 1 )
355 {
356 // Collect all pins for this reference designator by searching the entire design for
357 // other parts with the same reference designator.
358 findAllUnitsOfSymbol( aSymbol, aSheetPath, pins );
359 }
360
361 else // GetUnitCount() <= 1 means one part per package
362 {
363 for( const SCH_PIN* pin : aSymbol->GetPins( &aSheetPath ) )
364 {
365 if( const std::optional<wxString> netName = itemNetName( *pin, aSheetPath ) )
366 appendResolvedPins( pins, pin, aSheetPath, *netName );
367 }
368 }
369
370 // Sort pins in m_SortedSymbolPinList by pin number
371 std::sort( pins.begin(), pins.end(),
372 []( const PIN_INFO& lhs, const PIN_INFO& rhs )
373 {
374 return StrNumCmp( lhs.num, rhs.num, CMP_T::IGNORE_CASE ) < 0;
375 } );
376
377 // Remove duplicate Pins in m_SortedSymbolPinList
378 eraseDuplicatePins( pins );
379
380 // record the usage of this library symbol
381 m_libParts.insert( aSymbol->GetLibSymbolRef().get() ); // rejects non-unique pointers
382
383 return pins;
384}
385
386
387std::vector<wxString> NETLIST_EXPORTER_BASE::resolvePadNumbers( const SCH_PIN* aPin,
388 const SCH_SHEET_PATH& aSheetPath ) const
389{
390 // Shared resolution kernel for all netlist paths (issue #2282) so they cannot drift.
391 if( m_kiway )
392 {
393 if( const SCH_SYMBOL* symbol = dynamic_cast<const SCH_SYMBOL*>( aPin->GetParentSymbol() ) )
394 {
395 wxString fpText = symbol->GetFootprintFieldText( &aSheetPath, RESOLVED, m_exportVariant );
396 LIB_ID fpId;
397
398 if( !fpText.IsEmpty() && fpId.Parse( fpText, true ) < 0 )
399 {
400 const std::set<wxString>& pads = footprintPads( fpId.GetUniStringLibId() );
401
402 if( !pads.empty() )
403 {
404 SCH_PIN::PAD_RESOLUTION state = SCH_PIN::PAD_RESOLUTION::MAPPED;
405 wxString pad = aPin->GetEffectivePadNumber( aSheetPath, m_exportVariant, fpId, &pads, &state );
406
407 if( state == SCH_PIN::PAD_RESOLUTION::UNMAPPED )
408 return {};
409
411 }
412 }
413 }
414 }
415
417}
418
419
420const std::set<wxString>& NETLIST_EXPORTER_BASE::footprintPads( const wxString& aFootprintId ) const
421{
422 auto it = m_footprintPadCache.find( aFootprintId );
423
424 if( it != m_footprintPadCache.end() )
425 return it->second;
426
427 std::set<wxString>& pads = m_footprintPadCache[aFootprintId];
428
429 if( m_kiway && !aFootprintId.IsEmpty() )
430 {
431 if( KIFACE* cvpcb = m_kiway->KiFACE( KIWAY::FACE_CVPCB ) )
432 {
435
436 if( fetch )
437 fetch( aFootprintId, &m_schematic->Project(), pads );
438 }
439 }
440
441 return pads;
442}
443
444
445void NETLIST_EXPORTER_BASE::appendResolvedPins( std::vector<PIN_INFO>& aPins, const SCH_PIN* aPin,
446 const SCH_SHEET_PATH& aSheetPath, const wxString& aNetName )
447{
448 const wxString& baseName = aPin->GetShownName();
449
450 for( const wxString& padNum : resolvePadNumbers( aPin, aSheetPath ) )
451 {
452 wxString pinName = baseName.IsEmpty() ? padNum : baseName + wxT( "_" ) + padNum;
453 aPins.emplace_back( padNum, aNetName, pinName, aPin->GetNumber() );
454 }
455}
456
457
458void NETLIST_EXPORTER_BASE::eraseDuplicatePins( std::vector<PIN_INFO>& aPins )
459{
460 for( unsigned ii = 0; ii < aPins.size(); ii++ )
461 {
462 if( aPins[ii].num.empty() )
463 continue;
464
465 // Search for duplicated pins and keep only one. Duplicate pin numbers can occur
466 // for multi-unit symbols with shared pins, or for symbols with the "duplicate pin
467 // numbers are jumpers" flag. In either case, all pins with the same number should
468 // connect to the same net. When they don't (user error), we prefer user-assigned
469 // nets over auto-generated ones to preserve user intent in the netlist.
470 // Because the pin list is sorted by pin number, duplicates are consecutive.
471 unsigned idxBest = ii;
472
473 for( unsigned jj = ii + 1; jj < aPins.size(); jj++ )
474 {
475 if( aPins[jj].num.empty() )
476 continue;
477
478 if( aPins[idxBest].num != aPins[jj].num )
479 break;
480
481 // A genuine many-to-one mapping collision - two *different* symbol pins resolved to
482 // the same pad on *different* nets - must survive so it stays visible and is flagged
483 // by ERC (issue #2282). Shared multi-unit pins and jumpers carry the same source pin
484 // number, so they still collapse below as before.
485 if( aPins[idxBest].netName != aPins[jj].netName
486 && !aPins[idxBest].srcPin.IsEmpty()
487 && !aPins[jj].srcPin.IsEmpty()
488 && aPins[idxBest].srcPin != aPins[jj].srcPin )
489 {
490 continue;
491 }
492
493 // Check if jj has a better (user-assigned) net than the current best.
494 // Prefer user-assigned nets over auto-generated "unconnected-(" or "Net-(" nets.
495 bool bestIsAuto = IsAutoGeneratedNetName( aPins[idxBest].netName );
496 bool jjIsAuto = IsAutoGeneratedNetName( aPins[jj].netName );
497
498 if( bestIsAuto && !jjIsAuto )
499 {
500 // jj has a user-assigned net while best has auto-generated; switch to jj
501 aPins[idxBest].num.clear();
502 idxBest = jj;
503 }
504 else
505 {
506 aPins[jj].num.clear();
507 }
508 }
509 }
510}
511
512
514 std::vector<PIN_INFO>& aPins )
515{
516 const wxString ref = aSchSymbol->GetRef( &aSheetPath );
517
518 for( const SCH_SHEET_PATH& sheet : m_exportSheets )
519 {
520 for( SCH_ITEM* item : sheet.LastScreen()->Items().OfType( SCH_SYMBOL_T ) )
521 {
522 SCH_SYMBOL* symbol = static_cast<SCH_SYMBOL*>( item );
523
524 if( symbol->GetRef( &sheet ).CmpNoCase( ref ) != 0 )
525 continue;
526
527 for( const SCH_PIN* pin : symbol->GetPins( &sheet ) )
528 {
529 if( const std::optional<wxString> netName = itemNetName( *pin, sheet ) )
530 appendResolvedPins( aPins, pin, sheet, *netName );
531 }
532 }
533 }
534}
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
A subgraph is a set of items that are electrically connected on a single sheet.
A base class for most all the KiCad significant classes used in schematics and boards.
Definition eda_item.h:98
const KIID m_Uuid
Definition eda_item.h:599
KICAD_T Type() const
Returns the type of object.
Definition eda_item.h:110
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()
virtual const char * what() const override
std::exception interface, returned as UTF-8
@ FACE_CVPCB
Definition kiway.h:357
A logical library item identifier and consists of various portions much like a URI.
Definition lib_id.h:45
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
Definition lib_id.cpp:65
wxString GetUniStringLibId() const
Definition lib_id.h:144
Define a library symbol object.
Definition lib_symbol.h:114
const LIB_ID & GetLibId() const override
Definition lib_symbol.h:190
int GetUnitCount() const override
CONNECTIVITY_SCOPE(NETLIST_EXPORTER_BASE &aExporter)
NETLIST_EXPORTER_BASE(SCHEMATIC *aSchematic, KIWAY *aKiway)
virtual bool writeNetlist(const wxString &aOutFileName, unsigned aNetlistOptions, REPORTER &aReporter)
std::optional< wxString > itemNetName(const SCH_ITEM &aItem, const SCH_SHEET_PATH &aPath) const
const std::set< wxString > & footprintPads(const wxString &aFootprintId) const
void findAllUnitsOfSymbol(SCH_SYMBOL *aSchSymbol, const SCH_SHEET_PATH &aSheetPath, std::vector< PIN_INFO > &aPins)
Find all units for symbols with multiple symbols per package.
std::map< wxString, std::set< wxString > > m_footprintPadCache
std::set< LIB_SYMBOL *, LIB_SYMBOL_LESS_THAN > m_libParts
unique library symbols used. LIB_SYMBOL items are sorted by names
void eraseDuplicatePins(std::vector< PIN_INFO > &pins)
Erase duplicate pins.
std::vector< wxString > resolvePadNumbers(const SCH_PIN *aPin, const SCH_SHEET_PATH &aSheetPath) const
Resolve aPin to its effective pad number(s) for every netlist path (issue #2282).
std::map< SCH_SHEET_PATH, std::unordered_map< KIID, wxString > > m_exportItemNets
UNIQUE_STRINGS m_referencesAlreadyFound
Used for "multiple symbols per package" symbols to avoid processing a lib symbol more than once.
std::vector< EXPORT_NET > m_exportNets
EXPORT_EXCLUSION boardExclusion() const
bool WriteNetlist(const wxString &aOutFileName, unsigned aNetlistOptions, REPORTER &aReporter)
Write to specified output file.
wxString m_exportVariant
The schematic we're generating a netlist for.
SCH_SYMBOL * findNextSymbol(EDA_ITEM *aItem, const SCH_SHEET_PATH &aSheetPath, const EXPORT_EXCLUSION &aExcluded=nullptr)
Check if the given symbol should be processed for netlisting.
KIWAY * m_kiway
The variant of the schematic to export.
static wxString MakeCommandLine(const wxString &aFormatString, const wxString &aNetlistFile, const wxString &aFinalFile, const wxString &aProjectDirectory)
Build up a string that describes a command line for executing a child process.
void appendResolvedPins(std::vector< PIN_INFO > &aPins, const SCH_PIN *aPin, const SCH_SHEET_PATH &aSheetPath, const wxString &aNetName)
Resolve aPin to its pad number(s) and append a PIN_INFO for each (issue #2282).
bool packageOwnedElsewhere(const SCH_SYMBOL *aSymbol, const SCH_SHEET_PATH &aSheetPath, const EXPORT_EXCLUSION &aExcluded) const
std::vector< PIN_INFO > CreatePinList(SCH_SYMBOL *aSymbol, const SCH_SHEET_PATH &aSheetPath)
Find a symbol from the DrawList and builds its pin list.
A pure virtual class used to derive REPORTER objects from.
Definition reporter.h:73
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)
Report a string with a given severity.
Definition reporter.h:102
Holds all the data relating to one schematic.
Definition schematic.h:155
wxString GetPackageRefSuffix(const SCH_SYMBOL *aSymbol, const SCH_SHEET_PATH &aPath) const
Return the suffix the package of a multi-unit symbol's instance composes with.
wxString GetRefSuffix(const SCH_SHEET_PATH &aPath) const
Return the composed reference suffix of aPath as of the last RefreshHierarchy().
Each graphical item can have a SCH_CONNECTION describing its logical connection (to a bus or net).
std::vector< SCH_ITEM * > Items() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
Definition sch_item.h:170
const SYMBOL * GetParentSymbol() const
Definition sch_item.cpp:350
SCHEMATIC * Schematic() const
Search the item hierarchy to find a SCHEMATIC.
Definition sch_item.cpp:302
PAD_RESOLUTION
Outcome of pin-to-pad resolution (issue #2282).
Definition sch_pin.h:175
const wxString & GetShownName() const
Definition sch_pin.cpp:700
wxString GetEffectivePadNumber(const SCH_SHEET_PATH &aSheet, const wxString &aVariantName, const LIB_ID &aFootprintLibId, const std::set< wxString > *aFootprintPadNumbers, PAD_RESOLUTION *aState=nullptr) const
Resolve the footprint pad number this symbol pin lands on (issue #2282).
Definition sch_pin.cpp:751
const wxString & GetNumber() const
Definition sch_pin.h:144
const std::map< wxString, LIB_SYMBOL * > & GetLibSymbols() const
Fetch a list of unique LIB_SYMBOL object pointers required to properly render each SCH_SYMBOL in this...
Definition sch_screen.h:565
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
SCH_SCREEN * LastScreen()
Schematic symbol object.
Definition sch_symbol.h:76
wxString GetSchSymbolLibraryName() const
std::vector< const SCH_PIN * > GetPins(const SCH_SHEET_PATH *aSheet) const
Retrieve a list of the SCH_PINs for the given sheet path.
wxString GetBaseRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const
const LIB_ID & GetLibId() const override
Definition sch_symbol.h:166
bool GetExcludedFromBoard(const SCH_SHEET_PATH *aInstance=nullptr, const wxString &aVariantName=wxEmptyString) const override
std::unique_ptr< LIB_SYMBOL > & GetLibSymbolRef()
Definition sch_symbol.h:185
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const override
bool IsPower() const override
@ RESOLVED
Definition common.h:97
#define _(s)
@ NO_RECURSE
Definition eda_item.h:52
#define THROW_IO_ERROR(msg)
macro which captures the "call site" values of FILE_, __FUNCTION & LINE
Service::Type GetKifaceService(KIFACE *aKiface)
Look up a service exported by a KIFACE.
std::function< bool(const SCH_SYMBOL *, const SCH_SHEET_PATH &)> EXPORT_EXCLUSION
An abstract class used for the netlist exporters that Eeschema supports.
@ RPT_SEVERITY_ERROR
std::vector< wxString > ExpandStackedPinNotation(const wxString &aPinName, bool *aValid)
Expand stacked pin notation like [1,2,3], [1-4], [A1-A4], or [AA1-AA3,AB4,CD12-CD14] into individual ...
bool IsAutoGeneratedNetName(const wxString &aNetName)
Recognize the reserved prefixes used for generated pin-net names.
Implement a participant in the KIWAY alchemy.
Definition kiway.h:153
bool operator()(LIB_SYMBOL *const &libsymbol1, LIB_SYMBOL *const &libsymbol2) const
std::string path
KIBIS_PIN * pin
wxString result
Test unit parsing edge cases and error handling.
wxLogTrace helper definitions.
@ SCH_NO_CONNECT_T
Definition typeinfo.h:156
@ SCH_SYMBOL_T
Definition typeinfo.h:168
@ SCH_PIN_T
Definition typeinfo.h:149