52#define SHEET_NAME_CANONICAL "Sheetname"
53#define SHEET_FILE_CANONICAL "Sheetfile"
54#define USER_FIELD_CANONICAL "Field%d"
82 m_excludedFromSim( false ),
83 m_excludedFromBOM( false ),
84 m_excludedFromBoard( false ),
138 m_pins.back()->SetParent(
this );
142 field.SetParent(
this );
207 wxCHECK_MSG(
Schematic(),
false,
"Can't call IsRootSheet without setting a schematic" );
216 [&](
const wxString& aVar )
219 aVars->push_back( aVar );
223 add(
m_fields[i].GetCanonicalName().Upper() );
230 if( sheetPath.
size() >= 2 )
242 add( wxT(
"SHEETPATH" ) );
243 add( wxT(
"EXCLUDE_FROM_BOM" ) );
244 add( wxT(
"EXCLUDE_FROM_BOARD" ) );
245 add( wxT(
"EXCLUDE_FROM_SIM" ) );
247 add( wxT(
"ERC_ERROR <message_text>" ) );
248 add( wxT(
"ERC_WARNING <message_text>" ) );
256 wxCHECK( aPath,
false );
263 if( token->Contains(
':' ) )
271 if( token->IsSameAs(
m_fields[i].GetCanonicalName().Upper() ) )
273 *token =
m_fields[i].GetShownText( aPath,
false, aDepth + 1 );
280 if( token->IsSameAs(
m_fields[i].GetName() ) )
282 *token =
m_fields[i].GetShownText( aPath,
false, aDepth + 1 );
296 if( token->IsSameAs( wxT(
"#" ) ) )
301 else if( token->IsSameAs( wxT(
"##" ) ) )
303 *token = wxString::Format( wxT(
"%d" ), (
int) schematic->
Hierarchy().size() );
306 else if( token->IsSameAs( wxT(
"SHEETPATH" ) ) )
311 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_BOM" ) ) )
313 *token = wxEmptyString;
316 *token =
_(
"Excluded from BOM" );
320 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_BOARD" ) ) )
322 *token = wxEmptyString;
325 *token =
_(
"Excluded from board" );
329 else if( token->IsSameAs( wxT(
"EXCLUDE_FROM_SIM" ) ) )
331 *token = wxEmptyString;
334 *token =
_(
"Excluded from simulation" );
338 else if( token->IsSameAs( wxT(
"DNP" ) ) )
340 *token = wxEmptyString;
342 if( aPath->
GetDNP() || this->GetDNP() )
350 if( aPath->
size() >= 2 )
355 if(
path.Last()->ResolveTextVar( &
path, token, aDepth + 1 ) )
373 wxString::Format( wxT(
"SCH_SHEET object cannot swap data with %s object." ),
386 sheetPin->SetParent(
this );
392 field.SetParent(
this );
417 return a.GetId() < b.GetId();
431 wxASSERT( aSheetPin !=
nullptr );
435 m_pins.push_back( aSheetPin );
442 wxASSERT( aSheetPin !=
nullptr );
447 if( *i == aSheetPin )
461 if(
pin->GetText().Cmp( aName ) == 0 )
473 if( sheetPin->GetPosition() == aPosition )
488 switch(
pin->GetSide() )
490 case SHEET_SIDE::LEFT: leftRight++;
break;
491 case SHEET_SIDE::RIGHT: leftRight++;
break;
492 case SHEET_SIDE::TOP: topBottom++;
break;
493 case SHEET_SIDE::BOTTOM: topBottom++;
break;
498 return topBottom > 0 && leftRight == 0;
518 if( HLabel ==
nullptr )
530 int base = aVal / gridSize;
531 int excess = abs( aVal % gridSize );
535 return ( base + 1 ) * gridSize;
537 else if( excess > 0 )
539 return ( base ) * gridSize;
543 return ( base - 1 ) * gridSize;
553 for(
size_t i = 0; i <
m_pins.size(); i++ )
557 if( edge == SHEET_SIDE::TOP || edge == SHEET_SIDE::BOTTOM )
561 pinsLeft = std::min( pinsLeft, pinRect.
GetLeft() );
562 pinsRight = std::max( pinsRight, pinRect.
GetRight() );
571 if( pinsLeft >= pinsRight )
574 pinMinWidth = pinsRight -
m_pos.
x;
587 for(
size_t i = 0; i <
m_pins.size(); i++ )
591 if( edge == SHEET_SIDE::RIGHT || edge == SHEET_SIDE::LEFT )
595 pinsTop = std::min( pinsTop, pinRect.
GetTop() );
596 pinsBottom = std::max( pinsBottom, pinRect.
GetBottom() );
605 if( pinsTop >= pinsBottom )
608 pinMinHeight = pinsBottom -
m_pos.
y;
618 std::vector<SCH_SHEET_PIN*> pins =
m_pins;
646 if(
pin->HitTest( aPosition ) )
670 int margin = borderMargin +
KiROUND( std::max( textSize.
x, textSize.
y ) * 0.5 );
688 margin = borderMargin +
KiROUND( std::max( textSize.
x, textSize.
y ) * 0.4 );
732 end.
x = std::max(
m_size.
x, textLength );
750 bbox.
Merge( field.GetBoundingBox() );
806 if( screen && screen->
GetFileName().Cmp( aFilename ) == 0 )
862 aList.emplace_back(
_(
"Sheet Name" ),
868 path.push_back(
this );
870 aList.emplace_back(
_(
"Hierarchical Path" ),
path.PathHumanReadable(
false,
true ) );
874 aList.emplace_back(
_(
"File Name" ),
881 msgs.Add(
_(
"Simulation" ) );
884 msgs.Add(
_(
"BOM" ) );
887 msgs.Add(
_(
"Board" ) );
890 msgs.Add(
_(
"DNP" ) );
892 msg = wxJoin( msgs,
'|' );
893 msg.Replace(
'|', wxS(
", " ) );
896 aList.emplace_back(
_(
"Exclude from" ), msg );
913 m_pos += aMoveVector;
916 pin->Move( aMoveVector );
919 field.Move( aMoveVector );
945 sheetPin->Rotate( aCenter, aRotateCCW );
959 field.SetTextPos( pos );
974 sheetPin->MirrorVertically( aCenter );
980 field.SetTextPos( pos );
994 sheetPin->MirrorHorizontally( aCenter );
1000 field.SetTextPos( pos );
1026 sheetPin->ConstrainOnEdge( sheetPin->GetPosition(),
false );
1043 pin->SetNumber(
id );
1055 while( !sheetPath.
empty() && sheetPath.
Last() !=
this )
1058 if( sheetPath.
empty() )
1074 wxT(
"Invalid item in schematic sheet pin list. Bad programmer!" ) );
1076 sheetPin->GetEndPoints( aItemList );
1082 std::vector<DANGLING_END_ITEM>& aItemListByPos,
1085 bool changed =
false;
1088 changed |= sheetPin->UpdateDanglingState( aItemListByType, aItemListByPos );
1104 wxCHECK( sheet,
false );
1118 for(
size_t i = 0; i <
m_pins.size(); i++ )
1130 std::vector<VECTOR2I> retval;
1133 retval.push_back( sheetPin->GetPosition() );
1140 const std::vector<KICAD_T>& aScanTypes )
1142 for(
KICAD_T scanType : aScanTypes )
1147 if( INSPECT_RESULT::QUIT == aInspector(
this,
nullptr ) )
1148 return INSPECT_RESULT::QUIT;
1156 if( INSPECT_RESULT::QUIT == aInspector( &field,
this ) )
1157 return INSPECT_RESULT::QUIT;
1166 if( INSPECT_RESULT::QUIT == aInspector( sheetPin,
this ) )
1167 return INSPECT_RESULT::QUIT;
1172 return INSPECT_RESULT::CONTINUE;
1179 aFunction( &field );
1188 return wxString::Format(
_(
"Hierarchical Sheet %s" ),
1196 return BITMAPS::add_hierarchical_subsheet;
1224 int aUnit,
int aBodyStyle,
const VECTOR2I& aOffset,
bool aDimmed )
1239 if( aBackground && backgroundColor.
a > 0.0 )
1241 aPlotter->
SetColor( backgroundColor );
1260 std::vector<wxString> properties;
1266 properties.emplace_back( wxString::Format( wxT(
"!%s = %s" ), field.GetName(),
1267 field.GetShownText(
false ) ) );
1275 sheetPin->Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
1279 field.Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
1288 std::max( bbox.
GetY() - pins.
GetY(),
1292 margins.
x = std::max( margins.
x * 0.6, margins.
y * 0.3 );
1293 margins.
y = std::max( margins.
y * 0.6, margins.
x * 0.3 );
1302 strokeWidth,
FILLED,
nullptr );
1308 const VECTOR2I& aOffset,
bool aForceNoFill,
bool aDimmed )
1323 background = COLOR4D::UNSPECIFIED;
1325 if( background.
a > 0.0 )
1331 field.Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
1334 sheetPin->Print( aSettings, aUnit, aBodyStyle, aOffset, aForceNoFill, aDimmed );
1344 margins.
x = std::max( margins.
x * 0.6, margins.
y * 0.3 );
1345 margins.
y = std::max( margins.
y * 0.6, margins.
x * 0.3 );
1362 wxCHECK_MSG(
Type() == aItem.
Type(), *
this,
1363 wxT(
"Cannot assign object type " ) + aItem.
GetClass() + wxT(
" to type " ) +
1366 if( &aItem !=
this )
1379 m_pins.back()->SetParent(
this );
1395 auto sheet =
static_cast<const SCH_SHEET*
>( &aItem );
1410 for(
unsigned ii = 0; ii <
m_instances.size(); ii++ )
1416 " page %s, from project %s.",
1445 if( instance.m_Path == aPath )
1451 (
GetName().IsEmpty() ) ? wxString( wxT(
"root" ) ) :
GetName() );
1464 bool aTestFromEnd )
const
1470 if( instance.m_Path == aSheetPath )
1472 aInstance = instance;
1476 else if( instance.m_Path.EndsWith( aSheetPath ) )
1478 aInstance = instance;
1491 if( instance.m_Path.size() == 0 )
1503 if( instance.m_Path.size() == 0 )
1517 wxString pageNumber;
1521 if( instance.m_Path == aPath )
1523 pageNumber = instance.m_PageNumber;
1536 if( instance.m_Path == aPath )
1538 instance.m_PageNumber = aPageNumber;
1548 if( &aOther ==
this )
1555 std::vector<SCH_SHEET_INSTANCE> instances =
GetInstances();
1556 std::vector<SCH_SHEET_INSTANCE> otherInstances = aOther.
GetInstances();
1562 std::sort( instances.begin(), instances.end(),
1565 if( aLhs.m_Path > aRhs.m_Path )
1570 std::sort( otherInstances.begin(), otherInstances.end(),
1573 if( aLhs.m_Path > aRhs.m_Path )
1579 auto itThis = instances.begin();
1580 auto itOther = otherInstances.begin();
1582 while( itThis != instances.end() )
1584 if( ( itThis->m_Path == itOther->m_Path )
1585 && ( itThis->m_PageNumber != itOther->m_PageNumber ) )
1600 if( aPageNumberA == aPageNumberB )
1605 bool isIntegerPageA = aPageNumberA.ToLong( &pageA );
1606 bool isIntegerPageB = aPageNumberB.ToLong( &pageB );
1608 if( isIntegerPageA && isIntegerPageB )
1617 if( isIntegerPageA )
1619 else if( isIntegerPageB )
1623 int result =
StrNumCmp( aPageNumberA, aPageNumberB );
1626 wxCHECK( result != 0, 0 );
1628 result = result /
std::abs( result );
1671 for(
size_t i = 0; i <
GetFields().size(); ++i )
1697void SCH_SHEET::Show(
int nestLevel, std::ostream& os )
const
1702 NestedSpace( nestLevel, os ) <<
'<' << s.Lower().mb_str() <<
">" <<
" sheet_name=\""
1707 sheetPin->Show( nestLevel + 1, os );
1709 NestedSpace( nestLevel, os ) <<
"</" << s.Lower().mb_str() <<
">\n" << std::flush;
1727 PROPERTY_DISPLAY::PT_SIZE ) );
1735 const wxString groupAttributes =
_HKI(
"Attributes" );
constexpr EDA_IU_SCALE schIUScale
BITMAPS
A list of all bitmap identifiers.
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
constexpr const Vec GetEnd() const
constexpr coord_type GetY() const
constexpr size_type GetWidth() const
constexpr coord_type GetX() const
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
constexpr const Vec GetCenter() const
constexpr size_type GetHeight() const
constexpr coord_type GetLeft() const
constexpr bool Contains(const Vec &aPoint) const
constexpr const Vec & GetOrigin() const
constexpr coord_type GetRight() const
constexpr void SetEnd(coord_type x, coord_type y)
constexpr coord_type GetTop() const
constexpr bool Intersects(const BOX2< Vec > &aRect) const
constexpr coord_type GetBottom() const
Color settings are a bit different than most of the settings objects in that there can be more than o...
COLOR4D GetColor(int aLayer) const
The base class for create windows for drawing purpose.
A base class for most all the KiCad significant classes used in schematics and boards.
KICAD_T Type() const
Returns the type of object.
virtual void SetParent(EDA_ITEM *aParent)
EDA_ITEM * GetParent() const
virtual const wxString & GetText() const
Return the string associated with the text object.
static wxString GotoPageHref(const wxString &aDestination)
Generate a href to a page in the current schematic.
EE_TYPE OfType(KICAD_T aType) const
A color representation with 4 components: red, green, blue, alpha.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
wxDC * GetPrintDC() const
wxString AsString() const
virtual SETTINGS_MANAGER & GetSettingsManager() const
Base plotter engine class.
virtual void ThickSegment(const VECTOR2I &start, const VECTOR2I &end, int width, OUTLINE_MODE tracemode, void *aData)
RENDER_SETTINGS * RenderSettings()
virtual void HyperlinkBox(const BOX2I &aBox, const wxString &aDestinationURL)
Create a clickable hyperlink with a rectangular click area.
bool GetColorMode() const
virtual void HyperlinkMenu(const BOX2I &aBox, const std::vector< wxString > &aDestURLs)
Create a clickable hyperlink menu with a rectangular click area.
virtual void Rect(const VECTOR2I &p1, const VECTOR2I &p2, FILL_T fill, int width=USE_DEFAULT_LINE_WIDTH)=0
virtual void SetColor(const COLOR4D &color)=0
Container for project specific data.
Provide class metadata.Helper macro to map type hashes to names.
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
static PROPERTY_MANAGER & Instance()
PROPERTY_BASE & AddProperty(PROPERTY_BASE *aProperty, const wxString &aGroup=wxEmptyString)
Register a property.
Holds all the data relating to one schematic.
SCH_SHEET_PATH & CurrentSheet() const override
SCHEMATIC_SETTINGS & Settings() const
SCH_SHEET_LIST Hierarchy() const override
Return the full schematic flattened hierarchical sheet list.
bool ResolveTextVar(const SCH_SHEET_PATH *aSheetPath, wxString *token, int aDepth) const
void GetContextualTextVars(wxArrayString *aVars) const
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.
Schematic editor (Eeschema) main window.
Instances are attached to a symbol or sheet and provide a place for the symbol's value,...
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCH_ITEM & operator=(const SCH_ITEM &aPin)
SCH_RENDER_SETTINGS * getRenderSettings(PLOTTER *aPlotter) const
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
FIELDS_AUTOPLACED m_fieldsAutoplaced
void SwapFlags(SCH_ITEM *aItem)
Swap the non-temp and non-edit flags.
wxString GetClass() const override
Return the class name.
int GetEffectivePenWidth(const SCH_RENDER_SETTINGS *aSettings) const
void AutoAutoplaceFields(SCH_SCREEN *aScreen)
Autoplace fields only if correct to do so automatically.
bool m_OverrideItemColors
EE_RTREE & Items()
Gets the full RTree, usually for iterating.
const wxString & GetFileName() const
const TITLE_BLOCK & GetTitleBlock() const
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
bool GetExcludedFromBOM() const
bool empty() const
Forwarded method from std::vector.
wxString PathHumanReadable(bool aUseShortRootName=true, bool aStripTrailingSeparator=false) const
Return the sheet path in a human readable form made from the sheet names.
wxString GetPageNumber() const
bool GetExcludedFromSim() const
bool GetExcludedFromBoard() const
SCH_SHEET * Last() const
Return a pointer to the last SCH_SHEET of the list.
void push_back(SCH_SHEET *aSheet)
Forwarded method from std::vector.
size_t size() const
Forwarded method from std::vector.
void pop_back()
Forwarded method from std::vector.
Define a sheet pin (label) used in sheets to create hierarchical schematics.
Sheet symbol placed in a schematic, and is the entry point for a sub schematic.
void GetEndPoints(std::vector< DANGLING_END_ITEM > &aItemList) override
Add the schematic item end points to aItemList if the item has end points.
void GetContextualTextVars(wxArrayString *aVars) const
Return the list of system text vars & fields for this sheet.
bool GetExcludedFromBOM() const
void SetBorderColor(KIGFX::COLOR4D aColor)
friend class SCH_SHEET_PIN
void SetFileName(const wxString &aFilename)
bool HasConnectivityChanges(const SCH_ITEM *aItem, const SCH_SHEET_PATH *aInstance=nullptr) const override
Check if aItem has connectivity changes against this object.
wxString GetFileName() const
Return the filename corresponding to this sheet.
bool getInstance(SCH_SHEET_INSTANCE &aInstance, const KIID_PATH &aSheetPath, bool aTestFromEnd=false) const
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void RemoveInstance(const KIID_PATH &aInstancePath)
static const wxString GetDefaultFieldName(int aFieldNdx, bool aTranslated=true)
bool addInstance(const KIID_PATH &aInstance)
Add a new instance aSheetPath to the instance list.
void AddPin(SCH_SHEET_PIN *aSheetPin)
Add aSheetPin to the sheet.
bool HasRootInstance() const
Check to see if this sheet has a root sheet instance.
wxString GetClass() const override
Return the class name.
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
int GetPenWidth() const override
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
SCH_SHEET_PATH findSelf() const
Get the sheetpath of this sheet.
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const override
Compare the item against the search criteria in aSearchData.
double Similarity(const SCH_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
std::vector< SCH_FIELD > & GetFields()
KIGFX::COLOR4D m_borderColor
void renumberPins()
Renumber the sheet pins in the sheet.
void SetExcludedFromBOM(bool aExcludeFromBOM)
Set or clear the exclude from schematic bill of materials flag.
VECTOR2I GetRotationCenter() const
Rotating around the boundingBox's center can cause walking when the sheetname or filename is longer t...
SCH_SHEET_PIN * GetPin(const VECTOR2I &aPosition)
Return the sheet pin item found at aPosition in the sheet.
bool operator<(const SCH_ITEM &aItem) const override
bool GetExcludedFromBoard() const
void CleanupSheet()
Delete sheet label which do not have a corresponding hierarchical label.
void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aForceNoFill, bool aDimmed) override
Print an item.
void RemovePin(const SCH_SHEET_PIN *aSheetPin)
Remove aSheetPin from the sheet.
void SetPositionIgnoringPins(const VECTOR2I &aPosition)
bool SearchHierarchy(const wxString &aFilename, SCH_SCREEN **aScreen)
Search the existing hierarchy for an instance of screen loaded from aFileName.
bool LocatePathOfScreen(SCH_SCREEN *aScreen, SCH_SHEET_PATH *aList)
Search the existing hierarchy for an instance of screen loaded from aFileName.
std::vector< SCH_SHEET_INSTANCE > m_instances
bool HasUndefinedPins() const
Check all sheet labels against schematic for undefined hierarchical labels.
void SetPosition(const VECTOR2I &aPosition) override
void SetBackgroundColor(KIGFX::COLOR4D aColor)
int SymbolCount() const
Count our own symbols, without the power symbols.
void Plot(PLOTTER *aPlotter, bool aBackground, const SCH_PLOT_OPTS &aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aDimmed) override
Plot the item to aPlotter.
void AddInstance(const SCH_SHEET_INSTANCE &aInstance)
int GetMinWidth(bool aFromLeft) const
Return the minimum width of the sheet based on the widths of the sheet pin text.
bool operator==(const SCH_ITEM &aOther) const override
void ViewGetLayers(int aLayers[], int &aCount) const override
Return the layers the item is drawn on (which may be more than its "home" layer)
std::vector< SCH_FIELD > m_fields
KIGFX::COLOR4D m_backgroundColor
void SetName(const wxString &aName)
int CountSheets() const
Count the number of sheets found in "this" sheet including all of the subsheets.
VECTOR2I GetPosition() const override
const BOX2I GetBodyBoundingBox() const
Return a bounding box for the sheet body but not the fields.
bool HasPin(const wxString &aName) const
Checks if the sheet already has a sheet pin named aName.
static int ComparePageNum(const wxString &aPageNumberA, const wxString &aPageNumberB)
Compares page numbers of schematic sheets.
SCH_SHEET(EDA_ITEM *aParent=nullptr, const VECTOR2I &aPos=VECTOR2I(0, 0), VECTOR2I aSize=VECTOR2I(schIUScale.MilsToIU(MIN_SHEET_WIDTH), schIUScale.MilsToIU(MIN_SHEET_HEIGHT)), FIELDS_AUTOPLACED aAutoplaceFields=FIELDS_AUTOPLACED_AUTO)
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
void SetFields(const std::vector< SCH_FIELD > &aFields)
Set multiple schematic fields.
int GetScreenCount() const
Return the number of times the associated screen for the sheet is being used.
void SetScreen(SCH_SCREEN *aScreen)
Set the SCH_SCREEN associated with this sheet to aScreen.
SCH_SHEET & operator=(const SCH_ITEM &aSheet)
bool HasPageNumberChanges(const SCH_SHEET &aOther) const
Check if the instance data of this sheet has any changes compared to aOther.
const SCH_SHEET_INSTANCE & GetRootInstance() const
Return the root sheet instance data.
bool doIsConnected(const VECTOR2I &aPosition) const override
Provide the object specific test to see if it is connected to aPosition.
void AutoplaceFields(SCH_SCREEN *aScreen, bool aManual) override
const BOX2I GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
std::vector< VECTOR2I > GetConnectionPoints() const override
Add all the connection points for this item to aPoints.
KIGFX::COLOR4D GetBorderColor() const
std::vector< SCH_SHEET_PIN * > m_pins
INSPECT_RESULT Visit(INSPECTOR inspector, void *testData, const std::vector< KICAD_T > &aScanTypes) override
May be re-implemented for each derived class in order to handle all the types given by its member dat...
void SetBorderWidth(int aWidth)
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
void setPageNumber(const KIID_PATH &aInstance, const wxString &aPageNumber)
Set the page number for the sheet instance aInstance.
bool GetExcludedFromSim() const override
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
int GetMinHeight(bool aFromTop) const
Return the minimum height that the sheet can be resized based on the sheet pin positions.
wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const override
Return a user-visible description string of this item.
bool UpdateDanglingState(std::vector< DANGLING_END_ITEM > &aItemListByType, std::vector< DANGLING_END_ITEM > &aItemListByPos, const SCH_SHEET_PATH *aPath=nullptr) override
Test the schematic item to aItemList to check if it's dangling state has changed.
void Resize(const VECTOR2I &aSize)
Resize this sheet to aSize and adjust all of the labels accordingly.
void Move(const VECTOR2I &aMoveVector) override
Move the item by aMoveVector to a new position.
int GetBorderWidth() const
void SetExcludedFromBoard(bool aExcludeFromBoard)
Set or clear exclude from board netlist flag.
void GetMsgPanelInfo(EDA_DRAW_FRAME *aFrame, std::vector< MSG_PANEL_ITEM > &aList) override
Populate aList of MSG_PANEL_ITEM objects with it's internal state for display purposes.
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
bool ResolveTextVar(const SCH_SHEET_PATH *aPath, wxString *token, int aDepth=0) const
Resolve any references to system tokens supported by the sheet.
const std::vector< SCH_SHEET_INSTANCE > & GetInstances() const
bool IsVerticalOrientation() const
void SetExcludedFromSim(bool aExcludeFromSim) override
Set or clear the exclude from simulation flag.
bool GetDNP() const
Set or clear the 'Do Not Populate' flaga.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy) const override
Test if aPosition is inside or on the boundary of this item.
KIGFX::COLOR4D GetBackgroundColor() const
wxString getPageNumber(const KIID_PATH &aInstance) const
Return the sheet page number for aInstance.
SCH_FIELD * GetField(MANDATORY_FIELD_T aFieldType)
Return a mandatory field in this symbol.
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
bool TextVarResolver(wxString *aToken, const PROJECT *aProject) const
static void GetContextualTextVars(wxArrayString *aVars)
#define DEFAULT_LINE_WIDTH_MILS
The default wire width in mils. (can be changed in preference menu)
static constexpr EDA_ANGLE ANGLE_90
static constexpr EDA_ANGLE ANGLE_VERTICAL
static constexpr EDA_ANGLE ANGLE_HORIZONTAL
static constexpr EDA_ANGLE ANGLE_270
const INSPECTOR_FUNC & INSPECTOR
void GRRect(wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor)
void GRFilledSegment(wxDC *aDC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor)
void GRFilledRect(wxDC *DC, const VECTOR2I &aStart, const VECTOR2I &aEnd, int aWidth, const COLOR4D &aColor, const COLOR4D &aBgColor)
bool GetGRForceBlackPenState(void)
const wxChar *const traceSchSheetPaths
Flag to enable debug output of schematic symbol sheet path manipulation code.
@ LAYER_SELECTION_SHADOWS
constexpr void MIRROR(T &aPoint, const T &aMirrorRef)
Updates aPoint with the mirror of aPoint relative to the aMirrorRef.
Message panel definition file.
KICOMMON_API wxString EllipsizeMenuText(const wxString &aString)
Ellipsize text (at the end) to be no more than 36 characters.
KICOMMON_API wxString EllipsizeStatusText(wxWindow *aWindow, const wxString &aString)
Ellipsize text (at the end) to be no more than 1/3 of the window width.
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
PGM_BASE & Pgm()
The global Program "get" accessor.
#define USER_FIELD_CANONICAL
#define SHEET_NAME_CANONICAL
int bumpToNextGrid(const int aVal, const int aDirection)
static struct SCH_SHEET_DESC _SCH_SHEET_DESC
#define SHEET_FILE_CANONICAL
@ SHEET_MANDATORY_FIELDS
The first 2 are mandatory, and must be instantiated in SCH_SHEET.
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
SHEET_SIDE
Define the edge of the sheet that the sheet pin is positioned.
std::vector< FAB_LAYER_COLOR > dummy
int StrNumCmp(const wxString &aString1, const wxString &aString2, bool aIgnoreCase)
Compare two strings with alphanumerical content.
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
constexpr int MilsToIU(int mils) const
bool m_PDFHierarchicalLinks
A simple container for sheet instance information.
@ VALUE_FIELD
Field Value of part, i.e. "3.3K".
wxLogTrace helper definitions.
void RotatePoint(int *pX, int *pY, const EDA_ANGLE &aAngle)
Calculate the new point of coord coord pX, pY, for a rotation center 0, 0.
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
VECTOR2< int32_t > VECTOR2I