20#ifndef KICAD_SCHEMATIC_H
21#define KICAD_SCHEMATIC_H
85 return wxT(
"SCHEMATIC" );
184 std::shared_ptr<BUS_ALIAS>
GetBusAlias(
const wxString& aLabel )
const;
255 wxString
GetOperatingPoint(
const wxString& aNetName,
int aPrecision,
const wxString& aRange );
345 void Show(
int nestLevel, std::ostream& os )
const override {}
351 template <
typename Func,
typename... Args>
355 ( l->*aFunc )( std::forward<Args>( args )... );
Calculate the connectivity of a schematic and generates netlists.
The base frame for deriving all KiCad main window classes.
A base class for most all the KiCad significant classes used in schematics and boards.
Container for ERC settings.
Container for project specific data.
virtual void SetCurrentSheet(const SCH_SHEET_PATH &aPath)=0
virtual wxString GetFileName() const =0
virtual CONNECTION_GRAPH * ConnectionGraph() const =0
virtual SCH_SHEET_PATH & CurrentSheet() const =0
virtual SCH_SHEET_LIST BuildSheetListSortedByPageNumbers() const =0
virtual PROJECT & Prj() const =0
virtual ~SCHEMATIC_IFACE()
virtual SCH_SHEET_LIST Hierarchy() const =0
virtual void OnSchItemsRemoved(SCHEMATIC &aSch, std::vector< SCH_ITEM * > &aSchItem)
virtual ~SCHEMATIC_LISTENER()
virtual void OnSchItemsChanged(SCHEMATIC &aSch, std::vector< SCH_ITEM * > &aSchItem)
virtual void OnSchSheetChanged(SCHEMATIC &aSch)
virtual void OnSchItemsAdded(SCHEMATIC &aSch, std::vector< SCH_ITEM * > &aSchItem)
These are loaded from Eeschema settings but then overwritten by the project settings.
Holds all the data relating to one schematic.
void Reset()
Initialize this schematic to a blank one, unloading anything existing.
std::set< const SCH_SCREEN * > GetSchematicsSharedByMultipleProjects() const
Return a list of schematic files in the current project that contain instance data for multiple proje...
void SetLegacySymbolInstanceData()
Update the symbol value and footprint instance data for legacy designs.
void OnItemsAdded(std::vector< SCH_ITEM * > &aNewItems)
Must be used if Add() is used using a BULK_x ADD_MODE to generate a change event for listeners.
CONNECTION_GRAPH * m_connectionGraph
Holds and calculates connectivity information of this schematic.
virtual wxString GetClass() const override
Return the class name.
void SetOperatingPoint(const wxString &aSignal, double aValue)
Set operating points from a .op simulation.
SCH_SHEET_LIST m_hierarchy
Cache of the entire schematic hierarchy sorted by sheet page number.
SCH_SHEET_PATH & CurrentSheet() const override
void ResolveERCExclusionsPostUpdate()
Update markers to match recorded exclusions.
void RemoveListener(SCHEMATIC_LISTENER *aListener)
Remove the specified listener.
bool IsComplexHierarchy() const
Test if the schematic is a complex hierarchy.
void OnSchSheetChanged()
Notify the schematic and its listeners that the current sheet has been changed.
SCH_SHEET_PATH * m_currentSheet
The sheet path of the sheet currently being edited or displayed.
wxString GetOperatingPoint(const wxString &aNetName, int aPrecision, const wxString &aRange)
void OnItemsRemoved(std::vector< SCH_ITEM * > &aRemovedItems)
Must be used if Remove() is used using a BULK_x REMOVE_MODE to generate a change event for listeners.
std::shared_ptr< BUS_ALIAS > GetBusAlias(const wxString &aLabel) const
Return a pointer to a bus alias object for the given label, or null if one doesn't exist.
std::vector< SCH_MARKER * > ResolveERCExclusions()
wxString GetFileName() const override
Helper to retrieve the filename from the root sheet screen.
void EmbedFonts() override
Embed fonts in the schematic.
SCHEMATIC_SETTINGS & Settings() const
void ClearOperatingPoints()
Clear operating points from a .op simulation.
CONNECTION_GRAPH * ConnectionGraph() const override
wxString ConvertKIIDsToRefs(const wxString &aSource) const
void RecordERCExclusions()
Scan existing markers and record data from any that are Excluded.
std::map< wxString, std::set< int > > & GetPageRefsMap()
SCH_SHEET_LIST BuildUnorderedSheetList() const
void SetCurrentSheet(const SCH_SHEET_PATH &aPath) override
void FixupJunctions()
Add junctions to this schematic where required.
std::map< wxString, std::set< int > > m_labelToPageRefsMap
Holds a map of labels to the page sequence (virtual page number) that they appear on.
SCH_SHEET_LIST Hierarchy() const override
Return the full schematic flattened hierarchical sheet list.
SCH_ITEM * GetItem(const KIID &aID, SCH_SHEET_PATH *aPathOut=nullptr) const
wxString ConvertRefsToKIIDs(const wxString &aSource) const
void SetRoot(SCH_SHEET *aRootSheet)
Initialize the schematic with a new root sheet.
void SetProject(PROJECT *aPrj)
void AddListener(SCHEMATIC_LISTENER *aListener)
Add a listener to the schematic to receive calls whenever something on the schematic has been modifie...
std::map< int, wxString > GetVirtualPageToSheetPagesMap() const
EMBEDDED_FILES * GetEmbeddedFiles() override
SCH_SCREEN * RootScreen() const
Helper to retrieve the screen of the root sheet.
bool ResolveTextVar(const SCH_SHEET_PATH *aSheetPath, wxString *token, int aDepth) const
std::set< wxString > GetNetClassAssignmentCandidates()
Return the set of netname candidates for netclass assignment.
void RecomputeIntersheetRefs(const std::function< void(SCH_GLOBALLABEL *)> &aItemCallback)
Update the schematic's page reference map for all global labels, and refresh the labels so that they ...
void InvokeListeners(Func &&aFunc, Args &&... args)
bool IsValid() const
A simple test if the schematic is loaded, not a complete one.
static bool m_IsSchematicExists
True if a SCHEMATIC exists, false if not.
void RemoveAllListeners()
Remove all listeners.
const std::map< wxString, wxString > * GetProperties()
void GetContextualTextVars(wxArrayString *aVars) const
std::map< int, wxString > GetVirtualPageToSheetNamesMap() const
SCH_SHEET_LIST BuildSheetListSortedByPageNumbers() const override
wxString GetUniqueFilenameForCurrentSheet()
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
std::vector< SCHEMATIC_LISTENER * > m_listeners
Currently installed listeners.
PROJECT & Prj() const override
Return a reference to the project this schematic is part of.
bool ResolveCrossReference(wxString *token, int aDepth) const
Resolves text vars that refer to other items.
std::map< wxString, double > m_operatingPoints
Simulation operating points for text variable substitution.
std::map< wxString, wxString > m_properties
Properties for text variable substitution (and perhaps other uses in future).
ERC_SETTINGS & ErcSettings() const
void OnItemsChanged(std::vector< SCH_ITEM * > &aItems)
Notify the schematic and its listeners that an item on the schematic has been modified in some way.
SCH_SHEET * m_rootSheet
The top-level sheet in this schematic hierarchy (or potentially the only one)
Schematic editor (Eeschema) main window.
Base class for any item which can be embedded within the SCHEMATIC container class,...
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
SCH_ITEM * GetItem(const KIID &aID, SCH_SHEET_PATH *aPathOut=nullptr) const
Fetch a SCH_ITEM by ID.
void SortByPageNumbers(bool aUpdateVirtualPageNums=true)
Sort the list of sheets by page number.
void BuildSheetList(SCH_SHEET *aSheet, bool aCheckIntegrity)
Build the list of sheets and their sheet path from aSheet.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.