34 m_rootSheet( nullptr )
102 wxCHECK_RET( aRootSheet,
"Call to SetRoot with null SCH_SHEET!" );
148 SCH_MARKER* marker = static_cast<SCH_MARKER*>( item );
159 std::vector<SCH_MARKER*> newMarkers;
168 newMarkers.push_back( marker );
182 for(
const auto& alias : sheet.LastScreen()->GetBusAliases() )
184 if( alias->GetName() == aLabel )
195 std::vector<wxString> names;
203 names.emplace_back( pair.first.first );
214 wxString ref = token->BeforeFirst(
':', &remainder );
220 SCH_COMPONENT* refComponent = static_cast<SCH_COMPONENT*>( refItem );
230 SCH_SHEET* refSheet = static_cast<SCH_SHEET*>( refItem );
246 size_t sourceLen = aSource.length();
248 for(
size_t i = 0; i < sourceLen; ++i )
250 if( aSource[i] ==
'$' && i + 1 < sourceLen && aSource[i+1] ==
'{' )
253 bool isCrossRef =
false;
255 for( i = i + 2; i < sourceLen; ++i )
257 if( aSource[i] ==
'}' )
260 if( aSource[i] ==
':' )
263 token.append( aSource[i] );
270 wxString ref = token.BeforeFirst(
':', &remainder );
275 for(
size_t jj = 0; jj < references.
GetCount(); jj++ )
279 if( ref == refSymbol->
GetRef( &references[ jj ].GetSheetPath(), true ) )
281 wxString
test( remainder );
291 newbuf.append(
"${" + token +
"}" );
295 newbuf.append( aSource[i] );
306 size_t sourceLen = aSource.length();
308 for(
size_t i = 0; i < sourceLen; ++i )
310 if( aSource[i] ==
'$' && i + 1 < sourceLen && aSource[i+1] ==
'{' )
313 bool isCrossRef =
false;
315 for( i = i + 2; i < sourceLen; ++i )
317 if( aSource[i] ==
'}' )
320 if( aSource[i] ==
':' )
323 token.append( aSource[i] );
330 wxString ref = token.BeforeFirst(
':', &remainder );
337 SCH_COMPONENT* refComponent = static_cast<SCH_COMPONENT*>( refItem );
338 token = refComponent->
GetRef( &refSheetPath,
true ) +
":" + remainder;
342 newbuf.append(
"${" + token +
"}" );
346 newbuf.append( aSource[i] );
std::vector< SCH_MARKER * > ResolveERCExclusions()
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
const wxString & GetFileName() const
Container for project specific data.
SCH_SHEET_LIST GetSheets() const
Builds and returns an updated schematic hierarchy TODO: can this be cached?
void GetSymbols(SCH_REFERENCE_LIST &aReferences, bool aIncludePowerSymbols=true, bool aForceIncludeOrphanComponents=false) const
Add a SCH_REFERENCE object to aReferences for each component in the list of sheets.
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the component.
SCH_ITEM * GetItem(const KIID &aID, SCH_SHEET_PATH *aPathOut=nullptr)
Fetch a SCH_ITEM by ID.
SCH_SHEET_PATH * m_currentSheet
The sheet path of the sheet currently being edited or displayed.
Calculates the connectivity of a schematic and generates netlists.
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
virtual PROJECT_FILE & GetProjectFile() const
SCHEMATIC_SETTINGS & Settings() const
static PRIORITY GetDriverPriority(SCH_ITEM *aDriver)
Returns the priority (higher is more important) of a candidate driver.
bool IsValid() const
A simple test if the schematic is loaded, not a complete one.
wxString AsString() const
wxString GetFileName() const
Helper to retrieve the filename from the root sheet screen.
CONNECTION_GRAPH * m_connectionGraph
Holds and calculates connectivity information of this schematic.
SCH_SCREEN * GetScreen() const
bool LoadFromFile(const wxString &aDirectory="") override
Loads the JSON document from the parent and then calls Load()
A subgraph is a set of items that are electrically connected on a single sheet.
PROJECT_FILE is the backing store for a PROJECT, in JSON format.
std::set< wxString > m_ErcExclusions
SCH_REFERENCE_LIST is used to create a flattened list of symbols because in a complex hierarchy,...
void SetRoot(SCH_SHEET *aRootSheet)
Initializes the schematic with a new root sheet.
void SetExcluded(bool aExcluded)
std::shared_ptr< BUS_ALIAS > GetBusAlias(const wxString &aLabel) const
Returns a pointer to a bus alias object for the given label, or null if one doesn't exist.
wxString ConvertRefsToKIIDs(const wxString &aSource) const
void BuildSheetList(SCH_SHEET *aSheet, bool aCheckIntegrity)
Build the list of sheets and their sheet path from aSheet.
const NET_MAP & GetNetMap() const
bool ResolveCrossReference(wxString *token, int aDepth) const
Resolves text vars that refer to other items.
ERC_SETTINGS * m_ErcSettings
Eeschema params.
SCHEMATIC_SETTINGS * m_SchematicSettings
Container for ERC settings.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
wxString Serialize() const
void SetProject(PROJECT *aPrj)
void clear()
Forwarded method from std::vector.
SCH_SHEET * m_rootSheet
The top-level sheet in this schematic hierarchy (or potentially the only one)
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
unsigned GetCount() const
wxString ConvertKIIDsToRefs(const wxString &aSource) const
void Reset()
Initializes this schematic to a blank one, unloading anything existing.
static LIB_PART * dummy()
Used to draw a dummy shape when a LIB_PART is not found in library.
void SortByPageNumbers(bool aUpdateVirtualPageNums=true)
Sorts the list of sheets by page number.
A base class for most all the KiCad significant classes used in schematics and boards.
These settings were stored in SCH_BASE_FRAME previously.
bool ResolveTextVar(wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the sheet.
ERC_SETTINGS & ErcSettings() const
SCH_SCREEN * RootScreen() const
Helper to retreive the screen of the root sheet.
std::vector< wxString > GetNetClassAssignmentCandidates()
Returns a list of name candidates for netclass assignment.
static SCH_MARKER * Deserialize(const wxString &data)
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCH_SHEET_LIST & GetFullHierarchy() const
Return the full schematic flattened hiearchical sheet list.
KICAD_T Type() const
Returns the type of object.
const wxString GetRef(const SCH_SHEET_PATH *aSheet, bool aIncludeUnit=false) const
Return the reference for the given sheet path.