2011-10-15 13:25:57 +00:00
|
|
|
/*
|
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
|
|
|
*
|
2017-07-26 10:03:24 +00:00
|
|
|
* Copyright (C) 2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
2017-10-06 18:07:43 +00:00
|
|
|
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@gmail.com>
|
2023-01-04 20:39:50 +00:00
|
|
|
* Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
2011-10-15 13:25:57 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2011-09-30 18:15:37 +00:00
|
|
|
/**
|
|
|
|
* @file sch_sheet_path.h
|
2021-01-26 15:23:37 +00:00
|
|
|
* Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
|
2011-09-30 18:15:37 +00:00
|
|
|
*/
|
2009-01-04 18:52:57 +00:00
|
|
|
|
|
|
|
#ifndef CLASS_DRAWSHEET_PATH_H
|
|
|
|
#define CLASS_DRAWSHEET_PATH_H
|
|
|
|
|
2016-05-28 16:46:29 +00:00
|
|
|
#include <map>
|
2022-07-19 15:00:35 +00:00
|
|
|
#include <optional>
|
2016-05-28 16:46:29 +00:00
|
|
|
|
2021-06-09 16:28:03 +00:00
|
|
|
#include <kiid.h>
|
2022-07-19 15:00:35 +00:00
|
|
|
#include <wx/string.h>
|
2011-12-01 16:49:28 +00:00
|
|
|
|
2020-04-26 20:53:29 +00:00
|
|
|
/**
|
2021-01-26 15:23:37 +00:00
|
|
|
* A simple container for schematic symbol instance information.
|
2020-04-26 20:53:29 +00:00
|
|
|
*/
|
2023-01-04 20:39:50 +00:00
|
|
|
struct SCH_SYMBOL_INSTANCE
|
2020-04-26 20:53:29 +00:00
|
|
|
{
|
|
|
|
KIID_PATH m_Path;
|
2020-08-29 13:41:47 +00:00
|
|
|
|
|
|
|
// Things that can be annotated:
|
2020-04-26 20:53:29 +00:00
|
|
|
wxString m_Reference;
|
2022-03-25 19:51:05 +00:00
|
|
|
int m_Unit = 1;
|
2020-08-29 13:41:47 +00:00
|
|
|
|
2022-11-25 14:25:39 +00:00
|
|
|
// Do not use. This is left over from the dubious decision to instantiate symbol value
|
|
|
|
// and footprint fields.
|
2020-08-29 13:41:47 +00:00
|
|
|
wxString m_Value;
|
|
|
|
wxString m_Footprint;
|
2022-10-01 12:44:21 +00:00
|
|
|
|
|
|
|
// The project name associated with this instance.
|
|
|
|
wxString m_ProjectName;
|
2020-04-26 20:53:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-10-18 20:30:37 +00:00
|
|
|
/**
|
2021-01-26 15:23:37 +00:00
|
|
|
* A simple container for sheet instance information.
|
2020-10-18 20:30:37 +00:00
|
|
|
*/
|
|
|
|
struct SCH_SHEET_INSTANCE
|
|
|
|
{
|
|
|
|
KIID_PATH m_Path;
|
|
|
|
|
|
|
|
wxString m_PageNumber;
|
2022-11-22 19:35:27 +00:00
|
|
|
|
|
|
|
// The project name associated with this instance.
|
|
|
|
wxString m_ProjectName;
|
2020-10-18 20:30:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Complex hierarchies
|
|
|
|
*
|
2020-11-15 17:03:27 +00:00
|
|
|
* A hierarchical schematic uses sheets (hierarchical sheets) included in a given sheet.
|
|
|
|
* Each sheet corresponds to a schematic drawing handled by a SCH_SCREEN structure. A
|
Fix source comment/doc typos (follow-up)
Found via `codespell -q 3 -S *.po,./thirdparty -L aactual,acount,aline,alocation,alog,anormal,anumber,aother,apoints,aparent,aray,dout,einstance,modul,ot,overide,serie,te,,tesselate,tesselator,tht`
2021-07-03 22:37:31 +00:00
|
|
|
* SCH_SCREEN structure contains drawings, and have a filename to write its data. Also a
|
2020-11-15 17:03:27 +00:00
|
|
|
* SCH_SCREEN displays a sheet number and the name of the sheet.
|
2009-11-03 13:26:31 +00:00
|
|
|
*
|
2020-11-15 17:03:27 +00:00
|
|
|
* In simple (and flat) hierarchies a sheet is linked to a SCH_SCREEN, and a SCH_SCREEN is
|
|
|
|
* used by the single hierarchical sheet.
|
2009-01-06 20:09:32 +00:00
|
|
|
*
|
2020-11-15 17:03:27 +00:00
|
|
|
* In complex hierarchies the same SCH_SCREEN (and its data) is shared by more than one sheet.
|
|
|
|
* Therefore subsheets (like subsheets in a SCH_SCREEN shared by many sheets) can also be
|
|
|
|
* shared. So the same SCH_SCREEN must handle different symbol references and unit selections
|
|
|
|
* depending on which sheet is currently selected, and how a given subsheet is selected. Two
|
|
|
|
* sheets share the same SCH_SCREEN (the same drawings) if they have the same filename.
|
2009-01-06 20:09:32 +00:00
|
|
|
*
|
2020-11-15 17:03:27 +00:00
|
|
|
* In KiCad each symbol and sheet receives (when created) a uuid. So each sheet has 2 id: its
|
|
|
|
* uuid (which cannot change) and its name (that can be edited and therefore is not reliable
|
|
|
|
* for strong identification).
|
|
|
|
* A given sheet in a hierarchy is fully labeled by its path (or sheet path) that is the list
|
|
|
|
* of uuids found to access it through the hierarchy. The root sheet is /. All other sheets
|
|
|
|
* have a path like /1234ABCD or /4567FEDC/AA2233DD/. This path can be displayed as human
|
|
|
|
* readable sheet name like: / or /sheet1/include_sheet/ or /sheet2/include_sheet/
|
2009-01-06 20:09:32 +00:00
|
|
|
*
|
|
|
|
* So to know for a given SCH_SCREEN (a given schematic drawings) we must:
|
2009-11-03 13:26:31 +00:00
|
|
|
* 1) Handle all references possibilities.
|
|
|
|
* 2) When acceded by a given selected sheet, display (update) the
|
|
|
|
* corresponding references and sheet path
|
2009-01-06 20:09:32 +00:00
|
|
|
*
|
2020-11-15 17:03:27 +00:00
|
|
|
* The class SCH_SHEET_PATH handles paths used to access a sheet. The class SCH_SHEET_LIST
|
|
|
|
* allows one to handle the full (or partial) list of sheets and their paths in a complex
|
|
|
|
* hierarchy. The class EDA_ScreenList allows one to handle the list of SCH_SCREEN. It is
|
|
|
|
* useful to clear or save data, but is not suitable to handle the full complex hierarchy
|
|
|
|
* possibilities (usable in flat and simple hierarchies).
|
2009-01-06 20:09:32 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2021-06-06 14:41:02 +00:00
|
|
|
class EDA_ITEM;
|
2019-03-11 21:32:05 +00:00
|
|
|
class SCH_SHEET;
|
2010-11-10 15:30:12 +00:00
|
|
|
class SCH_SCREEN;
|
2016-02-15 20:14:48 +00:00
|
|
|
class SCH_MARKER;
|
2010-11-10 15:30:12 +00:00
|
|
|
class SCH_ITEM;
|
2021-06-10 14:10:55 +00:00
|
|
|
class SCH_SYMBOL;
|
2016-02-15 20:16:54 +00:00
|
|
|
class SCH_REFERENCE_LIST;
|
2017-10-06 18:07:43 +00:00
|
|
|
|
2010-03-16 18:22:59 +00:00
|
|
|
|
2016-02-15 20:16:54 +00:00
|
|
|
/**
|
2020-10-18 20:30:37 +00:00
|
|
|
* Container to map reference designators for multi-unit parts.
|
2016-02-15 20:16:54 +00:00
|
|
|
*/
|
|
|
|
typedef std::map<wxString, SCH_REFERENCE_LIST> SCH_MULTI_UNIT_REFERENCE_MAP;
|
|
|
|
|
2010-07-30 21:41:55 +00:00
|
|
|
/**
|
2020-10-18 20:30:37 +00:00
|
|
|
* Handle access to a stack of flattened #SCH_SHEET objects by way of a path for
|
2016-02-27 19:35:45 +00:00
|
|
|
* creating a flattened schematic hierarchy.
|
|
|
|
*
|
|
|
|
* The #SCH_SHEET objects are stored in a list from first (usually the root sheet) to a
|
|
|
|
* given sheet in last position. The _last_ sheet is usually the sheet we want to select
|
|
|
|
* or reach (which is what the function Last() returns). Others sheets constitute the
|
|
|
|
* "path" from the first to the last sheet.
|
2009-01-07 17:33:18 +00:00
|
|
|
*/
|
2019-04-09 03:27:04 +00:00
|
|
|
class SCH_SHEET_PATH
|
2009-01-04 18:52:57 +00:00
|
|
|
{
|
2011-01-23 21:22:42 +00:00
|
|
|
public:
|
2010-03-16 18:22:59 +00:00
|
|
|
SCH_SHEET_PATH();
|
|
|
|
|
2020-07-08 21:42:05 +00:00
|
|
|
SCH_SHEET_PATH( const SCH_SHEET_PATH& aOther );
|
|
|
|
|
|
|
|
SCH_SHEET_PATH& operator=( const SCH_SHEET_PATH& aOther );
|
|
|
|
|
2022-04-08 16:05:27 +00:00
|
|
|
SCH_SHEET_PATH operator+( const SCH_SHEET_PATH& aOther );
|
|
|
|
|
2021-01-19 03:40:58 +00:00
|
|
|
~SCH_SHEET_PATH() = default;
|
|
|
|
|
2019-04-09 03:27:04 +00:00
|
|
|
/// Forwarded method from std::vector
|
|
|
|
SCH_SHEET* at( size_t aIndex ) const { return m_sheets.at( aIndex ); }
|
|
|
|
|
|
|
|
/// Forwarded method from std::vector
|
|
|
|
void clear()
|
|
|
|
{
|
|
|
|
m_sheets.clear();
|
|
|
|
Rehash();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Forwarded method from std::vector
|
|
|
|
bool empty() const { return m_sheets.empty(); }
|
|
|
|
|
|
|
|
/// Forwarded method from std::vector
|
|
|
|
void pop_back()
|
|
|
|
{
|
|
|
|
m_sheets.pop_back();
|
|
|
|
Rehash();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Forwarded method from std::vector
|
|
|
|
void push_back( SCH_SHEET* aSheet )
|
|
|
|
{
|
|
|
|
m_sheets.push_back( aSheet );
|
|
|
|
Rehash();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Forwarded method from std::vector
|
|
|
|
size_t size() const { return m_sheets.size(); }
|
|
|
|
|
2022-11-22 19:35:27 +00:00
|
|
|
std::vector<SCH_SHEET*>::iterator erase( std::vector<SCH_SHEET*>::const_iterator aPosition )
|
|
|
|
{
|
|
|
|
return m_sheets.erase( aPosition );
|
|
|
|
}
|
|
|
|
|
2019-04-09 03:27:04 +00:00
|
|
|
void Rehash();
|
|
|
|
|
|
|
|
size_t GetCurrentHash() const { return m_current_hash; }
|
|
|
|
|
2020-10-26 17:01:20 +00:00
|
|
|
/**
|
|
|
|
* Set the sheet instance virtual page number.
|
|
|
|
*
|
|
|
|
* Virtual page numbers are incremental integers set automatically when the sheet path
|
|
|
|
* hierarchy is created (@see #SCH_SHEET_LIST::BuildSheetList). The virtual page
|
|
|
|
* numbering is ordered by the X and Y position of the sheet in a schematic which
|
|
|
|
* mimics the page numbering code prior to the addition of actual user definable page
|
|
|
|
* numbers. Virtual page numbers should only be use when annotating schematics.
|
|
|
|
*/
|
|
|
|
void SetVirtualPageNumber( int aPageNumber ) { m_virtualPageNumber = aPageNumber; }
|
|
|
|
|
|
|
|
int GetVirtualPageNumber() const { return m_virtualPageNumber; }
|
|
|
|
|
2021-12-06 12:47:18 +00:00
|
|
|
/**
|
|
|
|
* Set the sheet instance user definable page number.
|
|
|
|
*
|
|
|
|
* @note User definable page numbers can be any string devoid of white space characters.
|
|
|
|
*/
|
|
|
|
void SetPageNumber( const wxString& aPageNumber );
|
|
|
|
|
|
|
|
wxString GetPageNumber() const;
|
|
|
|
|
2016-03-06 21:22:01 +00:00
|
|
|
const SCH_SHEET* GetSheet( unsigned aIndex ) const
|
2015-06-07 20:31:55 +00:00
|
|
|
{
|
2021-05-27 20:01:36 +00:00
|
|
|
SCH_SHEET* retv = nullptr;
|
2016-03-06 21:22:01 +00:00
|
|
|
|
2016-02-27 19:35:45 +00:00
|
|
|
if( aIndex < size() )
|
2016-03-06 21:22:01 +00:00
|
|
|
retv = at( aIndex );
|
|
|
|
|
2020-12-20 18:59:07 +00:00
|
|
|
return retv;
|
2016-03-06 21:22:01 +00:00
|
|
|
}
|
2015-06-07 20:31:55 +00:00
|
|
|
|
2021-12-08 18:36:23 +00:00
|
|
|
bool IsFullPath() const;
|
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2021-03-25 21:13:01 +00:00
|
|
|
* Compare if this is the same sheet path as \a aSheetPathToTest.
|
2020-10-18 20:30:37 +00:00
|
|
|
*
|
2021-03-25 21:13:01 +00:00
|
|
|
* @param aSheetPathToTest is the sheet path to compare.
|
2015-12-14 21:20:54 +00:00
|
|
|
* @return 1 if this sheet path has more sheets than aSheetPathToTest,
|
|
|
|
* -1 if this sheet path has fewer sheets than aSheetPathToTest,
|
2015-08-31 11:13:26 +00:00
|
|
|
* or 0 if same
|
2009-01-06 20:09:32 +00:00
|
|
|
*/
|
2011-03-28 18:23:01 +00:00
|
|
|
int Cmp( const SCH_SHEET_PATH& aSheetPathToTest ) const;
|
2009-01-07 17:33:18 +00:00
|
|
|
|
2024-06-06 10:40:24 +00:00
|
|
|
void CachePageNumber() const { m_cached_page_number = GetPageNumber(); }
|
|
|
|
wxString GetCachedPageNumber() const { return m_cached_page_number; }
|
|
|
|
|
2021-04-11 15:24:11 +00:00
|
|
|
/**
|
2022-04-08 16:05:27 +00:00
|
|
|
* Compare sheets by their page number. If the actual page number is equal, use virtual page
|
|
|
|
* numbers to compare.
|
2021-04-11 15:24:11 +00:00
|
|
|
*
|
|
|
|
* @return -1 if aSheetPathToTest is greater than this (should appear later in the sort order)
|
|
|
|
* 0 if aSheetPathToTest is equal to this
|
|
|
|
* 1 if aSheetPathToTest is less than this (should appear earlier in the sort order)
|
|
|
|
*/
|
2022-01-02 23:20:01 +00:00
|
|
|
int ComparePageNum( const SCH_SHEET_PATH& aSheetPathToTest ) const;
|
2021-04-11 15:24:11 +00:00
|
|
|
|
2021-05-01 22:56:37 +00:00
|
|
|
/**
|
|
|
|
* Check if this path is contained inside aSheetPathToTest.
|
|
|
|
*
|
|
|
|
* @param aSheetPathToTest is the sheet path to compare against.
|
|
|
|
* @return true if this path is contained inside or equal to aSheetPathToTest.
|
|
|
|
*/
|
|
|
|
bool IsContainedWithin( const SCH_SHEET_PATH& aSheetPathToTest ) const;
|
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2020-10-18 20:30:37 +00:00
|
|
|
* Return a pointer to the last #SCH_SHEET of the list.
|
|
|
|
*
|
|
|
|
* One can see the others sheet as the "path" to reach this last sheet.
|
2009-01-07 17:33:18 +00:00
|
|
|
*/
|
2014-04-30 19:16:22 +00:00
|
|
|
SCH_SHEET* Last() const;
|
2009-01-07 17:33:18 +00:00
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2020-10-18 20:30:37 +00:00
|
|
|
* @return the #SCH_SCREEN relative to the last sheet in list.
|
2009-01-07 17:33:18 +00:00
|
|
|
*/
|
2019-06-25 23:39:58 +00:00
|
|
|
SCH_SCREEN* LastScreen();
|
2009-01-07 17:33:18 +00:00
|
|
|
|
2009-01-06 20:09:32 +00:00
|
|
|
|
2021-01-26 15:23:37 +00:00
|
|
|
///< @copydoc SCH_SHEET_PATH::LastScreen()
|
2019-06-25 23:39:58 +00:00
|
|
|
SCH_SCREEN* LastScreen() const;
|
2010-03-16 18:22:59 +00:00
|
|
|
|
2024-06-02 21:26:49 +00:00
|
|
|
bool GetExcludedFromSim() const;
|
|
|
|
bool GetExcludedFromBOM() const;
|
|
|
|
bool GetExcludedFromBoard() const;
|
|
|
|
bool GetDNP() const;
|
|
|
|
|
2022-12-23 22:02:59 +00:00
|
|
|
/**
|
|
|
|
* Fetch a SCH_ITEM by ID.
|
|
|
|
*/
|
|
|
|
SCH_ITEM* GetItem( const KIID& aID ) const;
|
|
|
|
|
2010-11-12 15:17:10 +00:00
|
|
|
/**
|
2020-10-18 20:30:37 +00:00
|
|
|
* Return the path of time stamps which do not changes even when editing sheet parameters.
|
|
|
|
*
|
|
|
|
* A path is something like / (root) or /34005677 or /34005677/00AE4523.
|
2009-01-04 18:52:57 +00:00
|
|
|
*/
|
2020-02-22 21:39:59 +00:00
|
|
|
wxString PathAsString() const;
|
|
|
|
|
|
|
|
/**
|
2020-10-18 20:30:37 +00:00
|
|
|
* Get the sheet path as an #KIID_PATH.
|
|
|
|
*
|
|
|
|
* @note This #KIID_PATH includes the root sheet UUID prefixed to the path.
|
2020-02-22 21:39:59 +00:00
|
|
|
*/
|
|
|
|
KIID_PATH Path() const;
|
2009-01-04 18:52:57 +00:00
|
|
|
|
2020-10-18 20:30:37 +00:00
|
|
|
/**
|
2021-01-26 15:23:37 +00:00
|
|
|
* Return the sheet path in a human readable form made from the sheet names.
|
2020-10-18 20:30:37 +00:00
|
|
|
*
|
2021-06-09 19:32:58 +00:00
|
|
|
* The "normal" path instead uses the #KIID objects in the path that do not change
|
2020-10-18 20:30:37 +00:00
|
|
|
* even when editing sheet parameters.
|
2009-01-04 18:52:57 +00:00
|
|
|
*/
|
2022-12-12 11:00:18 +00:00
|
|
|
wxString PathHumanReadable( bool aUseShortRootName = true,
|
|
|
|
bool aStripTrailingSeparator = false ) const;
|
2019-06-23 17:37:21 +00:00
|
|
|
|
2016-02-15 20:17:51 +00:00
|
|
|
/**
|
2020-10-18 20:30:37 +00:00
|
|
|
* Update all the symbol references for this sheet path.
|
|
|
|
*
|
|
|
|
* Mandatory in complex hierarchies because sheets may use the same screen (basic schematic)
|
|
|
|
* more than once but with different references and units according to the displayed sheet.
|
2016-02-15 20:17:51 +00:00
|
|
|
*/
|
2022-01-25 22:33:37 +00:00
|
|
|
void UpdateAllScreenReferences() const;
|
2016-02-15 20:17:51 +00:00
|
|
|
|
2021-04-27 21:00:48 +00:00
|
|
|
/**
|
|
|
|
* Append a #SCH_REFERENCE object to \a aReferences based on \a aSymbol
|
|
|
|
*
|
|
|
|
* @param aReferences List of references to populate.
|
|
|
|
* @param aSymbol A symbol to add to aReferences
|
|
|
|
* @param aIncludePowerSymbols set to false to only get normal symbols.
|
2024-06-12 17:27:17 +00:00
|
|
|
* @param aForceIncludeOrphanSymbols set to true to include symbols having no symbol found
|
|
|
|
* in lib. The normal option is false, and set to true
|
|
|
|
* only to build the full list of symbols.
|
2021-04-27 21:00:48 +00:00
|
|
|
*/
|
2021-06-10 14:10:55 +00:00
|
|
|
void AppendSymbol( SCH_REFERENCE_LIST& aReferences, SCH_SYMBOL* aSymbol,
|
2024-06-12 17:27:17 +00:00
|
|
|
bool aIncludePowerSymbols = true,
|
|
|
|
bool aForceIncludeOrphanSymbols = false ) const;
|
2021-04-27 21:00:48 +00:00
|
|
|
|
2016-02-15 20:16:54 +00:00
|
|
|
/**
|
2021-03-19 20:27:30 +00:00
|
|
|
* Adds #SCH_REFERENCE object to \a aReferences for each symbol in the sheet.
|
2017-10-06 18:07:43 +00:00
|
|
|
*
|
2016-02-15 20:16:54 +00:00
|
|
|
* @param aReferences List of references to populate.
|
2021-03-25 21:13:01 +00:00
|
|
|
* @param aIncludePowerSymbols set to false to only get normal symbols.
|
2024-06-12 17:27:17 +00:00
|
|
|
* @param aForceIncludeOrphanSymbols set to true to include symbols having no symbol found
|
|
|
|
* in lib. The normal option is false, and set to true
|
|
|
|
* only to build the full list of symbols.
|
2016-02-15 20:16:54 +00:00
|
|
|
*/
|
2024-06-12 17:27:17 +00:00
|
|
|
void GetSymbols( SCH_REFERENCE_LIST& aReferences, bool aIncludePowerSymbols = true,
|
|
|
|
bool aForceIncludeOrphanSymbols = false ) const;
|
2016-02-15 20:16:54 +00:00
|
|
|
|
2021-04-27 21:00:48 +00:00
|
|
|
/**
|
|
|
|
* Append a #SCH_REFERENCE_LIST object to \a aRefList based on \a aSymbol,
|
|
|
|
* storing same-reference set of multi-unit parts together.
|
|
|
|
*
|
|
|
|
* The map key for each element will be the reference designator.
|
|
|
|
*
|
|
|
|
* @param aRefList Map of reference designators to reference lists
|
|
|
|
* @param aSymbol A symbol to add to aRefList
|
|
|
|
* @param aIncludePowerSymbols Set to false to only get normal symbols.
|
|
|
|
*/
|
2021-06-10 14:10:55 +00:00
|
|
|
void AppendMultiUnitSymbol( SCH_MULTI_UNIT_REFERENCE_MAP& aRefList, SCH_SYMBOL* aSymbol,
|
2021-04-27 21:00:48 +00:00
|
|
|
bool aIncludePowerSymbols = true ) const;
|
|
|
|
|
2016-02-15 20:14:48 +00:00
|
|
|
/**
|
2020-10-18 20:30:37 +00:00
|
|
|
* Add a #SCH_REFERENCE_LIST object to \a aRefList for each same-reference set of
|
|
|
|
* multi-unit parts in the sheet.
|
|
|
|
*
|
|
|
|
* The map key for each element will be the reference designator.
|
2017-10-06 18:07:43 +00:00
|
|
|
*
|
2016-02-15 20:14:48 +00:00
|
|
|
* @param aRefList Map of reference designators to reference lists
|
2021-03-25 21:13:01 +00:00
|
|
|
* @param aIncludePowerSymbols Set to false to only get normal symbols.
|
2016-02-15 20:14:48 +00:00
|
|
|
*/
|
2021-03-19 20:27:30 +00:00
|
|
|
void GetMultiUnitSymbols( SCH_MULTI_UNIT_REFERENCE_MAP &aRefList,
|
|
|
|
bool aIncludePowerSymbols = true ) const;
|
2016-02-15 20:14:48 +00:00
|
|
|
|
2016-02-15 20:12:42 +00:00
|
|
|
/**
|
2020-10-18 20:30:37 +00:00
|
|
|
* Test the SCH_SHEET_PATH file names to check adding the sheet stored in the file
|
2016-02-15 20:12:42 +00:00
|
|
|
* \a aSrcFileName to the sheet stored in file \a aDestFileName will cause a sheet
|
|
|
|
* path recursion.
|
|
|
|
*
|
|
|
|
* @param aSrcFileName is the source file name of the sheet add to \a aDestFileName.
|
|
|
|
* @param aDestFileName is the file name of the destination sheet for \a aSrcFileName.
|
|
|
|
* @return true if \a aFileName will cause recursion in the sheet path. Otherwise false.
|
|
|
|
*/
|
2020-02-29 04:03:04 +00:00
|
|
|
bool TestForRecursion( const wxString& aSrcFileName, const wxString& aDestFileName );
|
2016-02-15 20:12:42 +00:00
|
|
|
|
2021-05-27 20:01:36 +00:00
|
|
|
/**
|
Fix source comment/doc typos (follow-up)
Found via `codespell -q 3 -S *.po,./thirdparty -L aactual,acount,aline,alocation,alog,anormal,anumber,aother,apoints,aparent,aray,dout,einstance,modul,ot,overide,serie,te,,tesselate,tesselator,tht`
2021-07-03 22:37:31 +00:00
|
|
|
* Make the sheet file name relative to its parent sheet.
|
2021-05-27 20:01:36 +00:00
|
|
|
*
|
|
|
|
* This should only be called when changing the parent sheet path such performing a save
|
|
|
|
* as or a new schematic without a project in stand alone mode. The sheet file name is
|
|
|
|
* only made relative if the current file name is relative. Absolute sheet file name paths
|
|
|
|
* are a user choice so do not change them.
|
|
|
|
*
|
|
|
|
* Sheet file name paths are set according to the following criteria:
|
|
|
|
* - If the sheet file name path is in the same as the parent sheet file name path, set
|
|
|
|
* the sheet file name to just the file name and extension with no path.
|
|
|
|
* - If the sheet file name path can be made relative to the parent sheet file name path,
|
|
|
|
* set the sheet file name using the relative path.
|
|
|
|
* - If the sheet file name path cannot be converted to a relative path, then fall back to
|
|
|
|
* the absolute file name path.
|
|
|
|
*/
|
|
|
|
void MakeFilePathRelativeToParentSheet();
|
|
|
|
|
2022-10-01 12:44:21 +00:00
|
|
|
/**
|
|
|
|
* Attempt to add new symbol instances for all symbols in this sheet path prefixed
|
|
|
|
* with \a aPrefixSheetPath.
|
|
|
|
*
|
|
|
|
* The new symbol instance data will be assigned by the following criteria:
|
|
|
|
* - If the instance data can be found for this sheet path, use the instance data.
|
|
|
|
* - If the instance data cannot be found for this sheet path and the instance data cache
|
|
|
|
* for the symbol is not empty, use the first instance data in the cache.
|
|
|
|
* - If the cache is empty and the library symbol link is valid, set the instance data
|
|
|
|
* from the library symbol.
|
|
|
|
* - If all else fails, set the reference to "U?", the unit to 1, and everything else to
|
|
|
|
* an empty string.
|
2024-04-19 18:33:22 +00:00
|
|
|
*
|
|
|
|
* @param aPrefixSheetPath is the sheet path to prefix to this sheet path for the new symbol
|
|
|
|
* instance.
|
|
|
|
* @param aProjectName is the name of the project for the new symbol instance data.
|
2022-10-01 12:44:21 +00:00
|
|
|
*/
|
2024-04-19 18:33:22 +00:00
|
|
|
void AddNewSymbolInstances( const SCH_SHEET_PATH& aPrefixSheetPath,
|
|
|
|
const wxString& aProjectName );
|
2022-10-01 12:44:21 +00:00
|
|
|
|
|
|
|
void RemoveSymbolInstances( const SCH_SHEET_PATH& aPrefixSheetPath );
|
|
|
|
|
2010-08-03 02:13:33 +00:00
|
|
|
bool operator==( const SCH_SHEET_PATH& d1 ) const;
|
2009-01-04 18:52:57 +00:00
|
|
|
|
2011-01-30 22:22:38 +00:00
|
|
|
bool operator!=( const SCH_SHEET_PATH& d1 ) const { return !( *this == d1 ) ; }
|
2019-04-09 03:27:04 +00:00
|
|
|
|
|
|
|
bool operator<( const SCH_SHEET_PATH& d1 ) const { return m_sheets < d1.m_sheets; }
|
|
|
|
|
2020-07-08 21:42:05 +00:00
|
|
|
private:
|
|
|
|
void initFromOther( const SCH_SHEET_PATH& aOther );
|
2021-03-25 21:13:01 +00:00
|
|
|
|
|
|
|
protected:
|
2024-06-06 10:40:24 +00:00
|
|
|
std::vector<SCH_SHEET*> m_sheets;
|
2021-03-25 21:13:01 +00:00
|
|
|
|
2024-06-06 10:40:24 +00:00
|
|
|
size_t m_current_hash;
|
|
|
|
mutable wxString m_cached_page_number;
|
2021-03-25 21:13:01 +00:00
|
|
|
|
|
|
|
int m_virtualPageNumber; /// Page numbers are maintained by the sheet load order.
|
|
|
|
|
|
|
|
std::map<std::pair<wxString, wxString>, bool> m_recursion_test_cache;
|
2009-01-04 18:52:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2019-03-11 21:32:05 +00:00
|
|
|
namespace std
|
|
|
|
{
|
|
|
|
template<> struct hash<SCH_SHEET_PATH>
|
|
|
|
{
|
|
|
|
size_t operator()( const SCH_SHEET_PATH& path ) const;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-08-03 09:10:23 +00:00
|
|
|
struct SHEET_PATH_HASH
|
|
|
|
{
|
2023-05-19 01:34:30 +00:00
|
|
|
size_t operator()( const SCH_SHEET_PATH& path ) const
|
2022-08-03 09:10:23 +00:00
|
|
|
{
|
|
|
|
return path.GetCurrentHash();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2022-03-11 21:37:03 +00:00
|
|
|
struct SHEET_PATH_CMP
|
|
|
|
{
|
|
|
|
bool operator()( const SCH_SHEET_PATH& lhs, const SCH_SHEET_PATH& rhs ) const
|
|
|
|
{
|
|
|
|
return lhs.GetCurrentHash() < rhs.GetCurrentHash();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-03-11 21:32:05 +00:00
|
|
|
|
2010-07-30 21:41:55 +00:00
|
|
|
/**
|
2020-10-18 20:30:37 +00:00
|
|
|
* A container for handling #SCH_SHEET_PATH objects in a flattened hierarchy.
|
2016-03-06 21:22:01 +00:00
|
|
|
*
|
|
|
|
* #SCH_SHEET objects are not unique, there can be many sheets with the same filename and
|
|
|
|
* that share the same #SCH_SCREEN reference. Each The schematic file (#SCH_SCREEN) may
|
2021-03-19 20:27:30 +00:00
|
|
|
* be shared between these sheets and symbol references are specific to a sheet path.
|
|
|
|
* When a sheet is entered, symbol references and sheet page number are updated.
|
2009-01-06 20:09:32 +00:00
|
|
|
*/
|
2024-06-03 10:11:04 +00:00
|
|
|
class SCH_SHEET_LIST : public std::vector<SCH_SHEET_PATH>
|
2009-01-04 18:52:57 +00:00
|
|
|
{
|
|
|
|
public:
|
2010-07-30 21:41:55 +00:00
|
|
|
/**
|
2020-10-18 20:30:37 +00:00
|
|
|
* Construct a flattened list of SCH_SHEET_PATH objects from \a aSheet.
|
2010-03-16 18:22:59 +00:00
|
|
|
*
|
2016-03-06 21:22:01 +00:00
|
|
|
* If aSheet == NULL, then this is an empty hierarchy which the user can populate.
|
2010-03-16 18:22:59 +00:00
|
|
|
*/
|
2024-06-06 16:58:48 +00:00
|
|
|
SCH_SHEET_LIST( SCH_SHEET* aSheet = nullptr );
|
2010-03-16 18:22:59 +00:00
|
|
|
|
2016-03-06 21:22:01 +00:00
|
|
|
~SCH_SHEET_LIST() {}
|
2009-01-04 18:52:57 +00:00
|
|
|
|
2016-02-15 20:21:18 +00:00
|
|
|
/**
|
2020-10-18 20:30:37 +00:00
|
|
|
* Check the entire hierarchy for any modifications.
|
|
|
|
*
|
2017-07-20 18:23:21 +00:00
|
|
|
* @return True if the hierarchy is modified otherwise false.
|
2016-02-15 20:21:18 +00:00
|
|
|
*/
|
2021-03-06 09:27:41 +00:00
|
|
|
bool IsModified() const;
|
2016-02-15 20:21:18 +00:00
|
|
|
|
|
|
|
void ClearModifyStatus();
|
|
|
|
|
2020-03-16 11:05:01 +00:00
|
|
|
/**
|
|
|
|
* Fetch a SCH_ITEM by ID. Also returns the sheet the item was found on in \a aPathOut.
|
|
|
|
*/
|
2021-03-06 09:27:41 +00:00
|
|
|
SCH_ITEM* GetItem( const KIID& aID, SCH_SHEET_PATH* aPathOut = nullptr ) const;
|
2020-03-16 11:05:01 +00:00
|
|
|
|
2020-04-24 13:36:10 +00:00
|
|
|
/**
|
|
|
|
* Fill an item cache for temporary use when many items need to be fetched.
|
|
|
|
*/
|
2020-04-24 22:22:11 +00:00
|
|
|
void FillItemMap( std::map<KIID, EDA_ITEM*>& aMap );
|
2020-04-24 13:36:10 +00:00
|
|
|
|
2016-02-15 20:18:32 +00:00
|
|
|
/**
|
2020-10-18 20:30:37 +00:00
|
|
|
* Silently annotate the not yet annotated power symbols of the entire hierarchy of the
|
|
|
|
* sheet path list.
|
|
|
|
*
|
2017-07-20 18:23:21 +00:00
|
|
|
* It is called before creating a netlist, to annotate power symbols, without prompting
|
|
|
|
* the user about not annotated or duplicate for these symbols, if only these symbols
|
|
|
|
* need annotation ( a very frequent case ).
|
2016-02-15 20:18:32 +00:00
|
|
|
*/
|
2017-10-06 18:07:43 +00:00
|
|
|
void AnnotatePowerSymbols();
|
2016-02-15 20:18:32 +00:00
|
|
|
|
2016-02-15 20:16:54 +00:00
|
|
|
/**
|
2021-03-19 20:27:30 +00:00
|
|
|
* Add a #SCH_REFERENCE object to \a aReferences for each symbol in the list of sheets.
|
2017-10-06 18:07:43 +00:00
|
|
|
*
|
2016-02-15 20:16:54 +00:00
|
|
|
* @param aReferences List of references to populate.
|
2021-03-19 20:27:30 +00:00
|
|
|
* @param aIncludePowerSymbols Set to false to only get normal symbols.
|
2024-06-12 17:27:17 +00:00
|
|
|
* @param aForceIncludeOrphanSymbols Set to true to include symbols having no symbol found
|
|
|
|
* in lib. The normal option is false, and set to true
|
|
|
|
* only to build the full list of symbols.
|
2016-02-15 20:16:54 +00:00
|
|
|
*/
|
2024-06-12 17:27:17 +00:00
|
|
|
void GetSymbols( SCH_REFERENCE_LIST& aReferences, bool aIncludePowerSymbols = true,
|
|
|
|
bool aForceIncludeOrphanSymbols = false ) const;
|
2016-02-15 20:16:54 +00:00
|
|
|
|
2021-05-01 22:56:37 +00:00
|
|
|
/**
|
|
|
|
* Add a #SCH_REFERENCE object to \a aReferences for each symbol in the list of sheets that are
|
|
|
|
* contained within \a aSheetPath as well as recursively downwards inside aSheetPath.
|
|
|
|
*
|
|
|
|
* @param aReferences List of references to populate.
|
|
|
|
* @param aSheetPath Path to return symbols from
|
|
|
|
* @param aIncludePowerSymbols Set to false to only get normal symbols.
|
2024-06-12 17:27:17 +00:00
|
|
|
* @param aForceIncludeOrphanSymbols Set to true to include symbols having no symbol found
|
|
|
|
* in lib. The normal option is false, and set to true
|
|
|
|
* only to build the full list of symbols.
|
2021-05-01 22:56:37 +00:00
|
|
|
*/
|
|
|
|
void GetSymbolsWithinPath( SCH_REFERENCE_LIST& aReferences, const SCH_SHEET_PATH& aSheetPath,
|
2024-06-12 17:27:17 +00:00
|
|
|
bool aIncludePowerSymbols = true,
|
|
|
|
bool aForceIncludeOrphanSymbols = false ) const;
|
2021-05-01 22:56:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add a #SCH_SHEET_PATH object to \a aSheets for each sheet in the list that are
|
|
|
|
* contained within \a aSheetPath as well as recursively downwards inside aSheetPath.
|
|
|
|
*
|
|
|
|
* @param aReferences List of sheets to populate.
|
|
|
|
* @param aSheetPath Path to return sheets from
|
|
|
|
*/
|
2024-06-03 10:11:04 +00:00
|
|
|
void GetSheetsWithinPath( std::vector<SCH_SHEET_PATH>& aSheets,
|
|
|
|
const SCH_SHEET_PATH& aSheetPath ) const;
|
2021-05-01 22:56:37 +00:00
|
|
|
|
2022-07-19 15:00:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Finds a SCH_SHEET_PATH that matches the provided KIID_PATH.
|
|
|
|
*
|
|
|
|
* @param aPath The KIID_PATH to search for.
|
|
|
|
*/
|
2022-12-25 16:04:45 +00:00
|
|
|
std::optional<SCH_SHEET_PATH> GetSheetPathByKIIDPath( const KIID_PATH& aPath,
|
|
|
|
bool aIncludeLastSheet = true ) const;
|
2022-07-19 15:00:35 +00:00
|
|
|
|
|
|
|
|
2016-02-15 20:14:48 +00:00
|
|
|
/**
|
2020-10-18 20:30:37 +00:00
|
|
|
* Add a #SCH_REFERENCE_LIST object to \a aRefList for each same-reference set of
|
2016-02-15 20:14:48 +00:00
|
|
|
* multi-unit parts in the list of sheets. The map key for each element will be the
|
|
|
|
* reference designator.
|
2017-10-06 18:07:43 +00:00
|
|
|
*
|
2016-02-15 20:14:48 +00:00
|
|
|
* @param aRefList Map of reference designators to reference lists
|
2021-03-19 20:27:30 +00:00
|
|
|
* @param aIncludePowerSymbols Set to false to only get normal symbols.
|
2016-02-15 20:14:48 +00:00
|
|
|
*/
|
2020-11-15 16:08:31 +00:00
|
|
|
void GetMultiUnitSymbols( SCH_MULTI_UNIT_REFERENCE_MAP &aRefList,
|
|
|
|
bool aIncludePowerSymbols = true ) const;
|
2016-02-15 20:14:48 +00:00
|
|
|
|
2016-02-15 20:12:42 +00:00
|
|
|
/**
|
2020-10-18 20:30:37 +00:00
|
|
|
* Test every #SCH_SHEET_PATH in this #SCH_SHEET_LIST to verify if adding the sheets stored
|
2016-02-15 20:12:42 +00:00
|
|
|
* in \a aSrcSheetHierarchy to the sheet stored in \a aDestFileName will cause recursion.
|
|
|
|
*
|
|
|
|
* @param aSrcSheetHierarchy is the SCH_SHEET_LIST of the source sheet add to \a aDestFileName.
|
|
|
|
* @param aDestFileName is the file name of the destination sheet for \a aSrcFileName.
|
|
|
|
* @return true if \a aFileName will cause recursion in the sheet path. Otherwise false.
|
|
|
|
*/
|
|
|
|
bool TestForRecursion( const SCH_SHEET_LIST& aSrcSheetHierarchy,
|
2020-02-29 04:03:04 +00:00
|
|
|
const wxString& aDestFileName );
|
2016-02-15 20:12:42 +00:00
|
|
|
|
2022-07-20 15:39:15 +00:00
|
|
|
/**
|
|
|
|
* Return a pointer to the first #SCH_SHEET_PATH object (not necessarily the only one)
|
|
|
|
* matching the provided path. Returns nullptr if not found.
|
|
|
|
*/
|
|
|
|
SCH_SHEET_PATH* FindSheetForPath( const SCH_SHEET_PATH* aPath );
|
|
|
|
|
2019-05-19 21:04:04 +00:00
|
|
|
/**
|
2023-08-27 18:02:12 +00:00
|
|
|
* Return the first #SCH_SHEET_PATH object (not necessarily the only one) using a particular
|
|
|
|
* screen.
|
2019-05-19 21:04:04 +00:00
|
|
|
*/
|
2023-08-27 18:02:12 +00:00
|
|
|
SCH_SHEET_PATH FindSheetForScreen( const SCH_SCREEN* aScreen );
|
2019-05-19 21:04:04 +00:00
|
|
|
|
2021-05-01 22:56:37 +00:00
|
|
|
/**
|
|
|
|
* Return a #SCH_SHEET_LIST with a copy of all the #SCH_SHEET_PATH using a particular screen.
|
|
|
|
*/
|
|
|
|
SCH_SHEET_LIST FindAllSheetsForScreen( const SCH_SCREEN* aScreen ) const;
|
|
|
|
|
2010-07-30 21:41:55 +00:00
|
|
|
/**
|
2020-10-18 20:30:37 +00:00
|
|
|
* Build the list of sheets and their sheet path from \a aSheet.
|
|
|
|
*
|
2011-11-10 15:55:05 +00:00
|
|
|
* If \a aSheet is the root sheet, the full sheet path and sheet list are built.
|
2021-01-26 15:23:37 +00:00
|
|
|
*
|
2024-06-06 16:58:48 +00:00
|
|
|
* The list will be ordered as per #SCH_SCREEN::BuildSheetList which results in sheets being ordered
|
2020-11-29 18:30:58 +00:00
|
|
|
* in the legacy way of using the X and Y positions of the sheets.
|
2021-01-26 15:23:37 +00:00
|
|
|
*
|
2020-11-29 18:30:58 +00:00
|
|
|
* @see #SortByPageNumbers to sort by page numbers
|
2010-07-30 21:41:55 +00:00
|
|
|
*
|
2011-11-10 15:55:05 +00:00
|
|
|
* @param aSheet is the starting sheet from which the list is built, or NULL
|
|
|
|
* indicating that g_RootSheet should be used.
|
|
|
|
* @throw std::bad_alloc if the memory for the sheet path list could not be allocated.
|
2009-01-06 20:09:32 +00:00
|
|
|
*/
|
2020-10-05 12:24:21 +00:00
|
|
|
void BuildSheetList( SCH_SHEET* aSheet, bool aCheckIntegrity );
|
2021-01-26 15:23:37 +00:00
|
|
|
|
2020-11-29 18:30:58 +00:00
|
|
|
/**
|
2021-03-25 21:13:01 +00:00
|
|
|
* Sort the list of sheets by page number. This should be called after #BuildSheetList
|
2021-01-26 15:23:37 +00:00
|
|
|
*
|
2021-04-11 15:24:11 +00:00
|
|
|
* If page numbers happen to be equal, then it compares the sheet names to ensure deterministic
|
|
|
|
* ordering.
|
|
|
|
*
|
2020-11-29 18:30:58 +00:00
|
|
|
* @param aUpdateVirtualPageNums If true, updates the virtual page numbers to match the new
|
|
|
|
* ordering
|
|
|
|
*/
|
|
|
|
void SortByPageNumbers( bool aUpdateVirtualPageNums = true );
|
2020-03-13 09:53:44 +00:00
|
|
|
|
2021-03-06 09:27:41 +00:00
|
|
|
bool NameExists( const wxString& aSheetName ) const;
|
2020-04-26 20:53:29 +00:00
|
|
|
|
2021-03-22 20:55:44 +00:00
|
|
|
bool PageNumberExists( const wxString& aPageNumber ) const;
|
|
|
|
|
2023-09-03 13:17:51 +00:00
|
|
|
/**
|
|
|
|
* Truncates the list by removing sheet's with page numbers not in the given list
|
|
|
|
*
|
|
|
|
* @param aPageInclusions List of Page Numbers (non-virtual) to keep
|
|
|
|
*/
|
|
|
|
void TrimToPageNumbers( const std::vector<wxString>& aPageInclusions );
|
|
|
|
|
2020-04-26 20:53:29 +00:00
|
|
|
/**
|
|
|
|
* Update all of the symbol instance information using \a aSymbolInstances.
|
2020-05-13 02:00:37 +00:00
|
|
|
* WARNING: Do not call this on anything other than the full hierarchy.
|
2020-04-26 20:53:29 +00:00
|
|
|
* @param aSymbolInstances is the symbol path information loaded from the root schematic.
|
|
|
|
*/
|
2023-01-04 20:39:50 +00:00
|
|
|
void UpdateSymbolInstanceData( const std::vector<SCH_SYMBOL_INSTANCE>& aSymbolInstances );
|
2020-04-26 20:53:29 +00:00
|
|
|
|
2020-10-18 20:30:37 +00:00
|
|
|
/**
|
|
|
|
* Update all of the sheet instance information using \a aSheetInstances.
|
|
|
|
*
|
|
|
|
* @warning Do not call this on anything other than the full hierarchy.
|
|
|
|
*
|
|
|
|
* @param aSymbolInstances is the symbol path information loaded from the root schematic.
|
|
|
|
*/
|
2022-12-06 14:00:11 +00:00
|
|
|
void UpdateSheetInstanceData( const std::vector<SCH_SHEET_INSTANCE>& aSheetInstances );
|
2020-10-18 20:30:37 +00:00
|
|
|
|
2020-04-26 20:53:29 +00:00
|
|
|
std::vector<KIID_PATH> GetPaths() const;
|
|
|
|
|
2021-12-08 18:36:23 +00:00
|
|
|
/**
|
|
|
|
* Fetch the instance information for all of the sheets in the hiearchy.
|
|
|
|
*
|
|
|
|
* @return all of the sheet instance data for the hierarchy.
|
|
|
|
*/
|
2021-04-12 19:08:02 +00:00
|
|
|
std::vector<SCH_SHEET_INSTANCE> GetSheetInstances() const;
|
|
|
|
|
2020-10-18 20:30:37 +00:00
|
|
|
/**
|
|
|
|
* Check all of the sheet instance for empty page numbers.
|
|
|
|
*
|
|
|
|
* @note This should only return true when loading a legacy schematic or an s-expression
|
|
|
|
* schematic before version 20201005.
|
|
|
|
*
|
|
|
|
* @return true if all sheet instance page numbers are not defined. Otherwise false.
|
|
|
|
*/
|
|
|
|
bool AllSheetPageNumbersEmpty() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set initial sheet page numbers.
|
|
|
|
*
|
2021-03-25 21:13:01 +00:00
|
|
|
* The number scheme is base on the old pseudo sheet numbering algorithm prior to
|
2021-01-26 15:23:37 +00:00
|
|
|
* the implementation of user definable sheet page numbers.
|
2020-10-18 20:30:37 +00:00
|
|
|
*/
|
|
|
|
void SetInitialPageNumbers();
|
2021-03-25 21:13:01 +00:00
|
|
|
|
2022-10-01 12:44:21 +00:00
|
|
|
/**
|
|
|
|
* Attempt to add new symbol instances for all symbols in this list of sheet paths prefixed
|
|
|
|
* with \a aPrefixSheetPath.
|
|
|
|
*
|
|
|
|
* @param aPrefixSheetPath is the sheet path to append the new symbol instances to.
|
2024-04-19 18:33:22 +00:00
|
|
|
* @param aProjectName is the name of the project for the new symbol instance data.
|
2022-10-01 12:44:21 +00:00
|
|
|
*/
|
2024-04-19 18:33:22 +00:00
|
|
|
void AddNewSymbolInstances( const SCH_SHEET_PATH& aPrefixSheetPath,
|
|
|
|
const wxString& aProjectName );
|
2022-10-01 12:44:21 +00:00
|
|
|
|
|
|
|
void AddNewSheetInstances( const SCH_SHEET_PATH& aPrefixSheetPath,
|
|
|
|
int aLastVirtualPageNumber );
|
|
|
|
|
|
|
|
int GetLastVirtualPageNumber() const;
|
|
|
|
|
|
|
|
void RemoveSymbolInstances( const SCH_SHEET_PATH& aPrefixSheetPath );
|
|
|
|
|
2023-08-25 12:51:59 +00:00
|
|
|
bool HasPath( const KIID_PATH& aPath ) const;
|
|
|
|
|
2024-01-21 16:53:05 +00:00
|
|
|
bool ContainsSheet( const SCH_SHEET* aSheet ) const;
|
|
|
|
|
2021-03-25 21:13:01 +00:00
|
|
|
private:
|
|
|
|
SCH_SHEET_PATH m_currentSheetPath;
|
2009-01-04 18:52:57 +00:00
|
|
|
};
|
|
|
|
|
2010-07-30 21:41:55 +00:00
|
|
|
#endif // CLASS_DRAWSHEET_PATH_H
|