43#define SCALING_FACTOR schIUScale.mmToIU( 0.15 )
80 std::shared_ptr<ERC_ITEM>
erc = std::static_pointer_cast<ERC_ITEM>(
m_rcItem );
81 wxString sheetSpecificPath, mainItemPath, auxItemPath;
83 if(
erc->IsSheetSpecific() )
84 sheetSpecificPath =
erc->GetSpecificSheetPath().Path().AsString();
86 if(
erc->MainItemHasSheetPath() )
87 mainItemPath =
erc->GetMainItemSheetPath().Path().AsString();
89 if(
erc->AuxItemHasSheetPath() )
90 auxItemPath =
erc->GetAuxItemSheetPath().Path().AsString();
92 return wxString::Format( wxT(
"%s|%d|%d|%s|%s|%s|%s|%s" ),
m_rcItem->GetSettingsKey(),
m_Pos.
x,
94 m_rcItem->GetAuxItemID().AsString(), sheetSpecificPath, mainItemPath,
101 wxArrayString props = wxSplit( data,
'|' );
102 VECTOR2I markerPos( (
int) strtol( props[1].c_str(),
nullptr, 10 ),
103 (
int) strtol( props[2].c_str(),
nullptr, 10 ) );
110 ercItem->SetItems(
KIID( props[3] ),
KIID( props[4] ) );
112 bool isLegacyMarker =
true;
118 if( props.size() == 8 )
120 isLegacyMarker =
false;
124 if( !props[5].IsEmpty() )
126 KIID_PATH sheetSpecificKiidPath( props[5] );
127 std::optional<SCH_SHEET_PATH> sheetSpecificPath =
129 if( sheetSpecificPath.has_value() )
130 ercItem->SetSheetSpecificPath( sheetSpecificPath.value() );
133 if( !props[6].IsEmpty() )
136 std::optional<SCH_SHEET_PATH> mainItemPath =
138 if( mainItemPath.has_value() )
140 if( props[7].IsEmpty() )
142 ercItem->SetItemsSheetPaths( mainItemPath.value() );
147 std::optional<SCH_SHEET_PATH> auxItemPath =
150 if( auxItemPath.has_value() )
151 ercItem->SetItemsSheetPaths( mainItemPath.value(), auxItemPath.value() );
166void SCH_MARKER::Show(
int nestLevel, std::ostream& os )
const
169 NestedSpace( nestLevel, os ) <<
'<' <<
GetClass().Lower().mb_str() <<
GetPos() <<
"/>\n";
177 wxCHECK_RET(
Schematic(),
"No SCHEMATIC set for SCH_MARKER!" );
180 std::shared_ptr<ERC_ITEM> ercItem = std::static_pointer_cast<ERC_ITEM>(
GetRCItem() );
182 if( ercItem->IsSheetSpecific()
183 && ( ercItem->GetSpecificSheetPath() !=
Schematic()->CurrentSheet() ) )
200 case SEVERITY::RPT_SEVERITY_ERROR: aLayers[0] =
LAYER_ERC_ERR;
break;
201 case SEVERITY::RPT_SEVERITY_WARNING: aLayers[0] =
LAYER_ERC_WARN;
break;
263 aList.emplace_back(
_(
"Electrical Rule Check Error" ),
m_rcItem->GetErrorMessage() );
BITMAPS
A list of all bitmap identifiers.
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.
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
static std::shared_ptr< ERC_ITEM > Create(int aErrorCode)
Constructs an ERC_ITEM for the given error code.
SEVERITY GetSeverity(int aErrorCode) const
A color representation with 4 components: red, green, blue, alpha.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
void PrintMarker(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset)
Print the shape is the polygon defined in m_Corners (array of VECTOR2Is).
bool HitTestMarker(const VECTOR2I &aHitPosition, int aAccuracy) const
Test if the given VECTOR2I is within the bounds of this object.
std::shared_ptr< RC_ITEM > GetRCItem() const
const VECTOR2I & GetPos() const
VECTOR2I m_Pos
position of the marker
std::shared_ptr< RC_ITEM > m_rcItem
BOX2I GetBoundingBoxMarker() const
Return the orthogonal, bounding box of this object for display purposes.
Holds all the data relating to one schematic.
SCH_SHEET_LIST GetSheets() const override
Builds and returns an updated schematic hierarchy TODO: can this be cached?
ERC_SETTINGS & ErcSettings() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
SCHEMATIC * Schematic() const
Searches the item hierarchy to find a SCHEMATIC.
SEVERITY GetSeverity() 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)
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxDat) const override
Compare DRC marker main and auxiliary text against search string.
wxString Serialize() const
wxString GetClass() const override
Return the class name.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void SetIsLegacyMarker(bool isLegacyMarker=true)
Sets this marker as a legacy artifact.
EDA_ITEM * Clone() const override
Create a duplicate of this item with linked list members set to NULL.
SCH_LAYER_ID GetColorLayer() const
void MirrorVertically(int aCenter) override
Mirror item vertically about aCenter.
void Print(const RENDER_SETTINGS *aSettings, const VECTOR2I &aOffset) override
Print a schematic item.
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
void Rotate(const VECTOR2I &aCenter) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
void SwapData(SCH_ITEM *aItem) override
Swap the internal data structures aItem with the schematic item.
void MirrorHorizontally(int aCenter) override
Mirror item horizontally about aCenter.
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.
KIGFX::COLOR4D getColor() const override
BOX2I const GetBoundingBox() const override
Return the orthogonal bounding box of this object for display purposes.
static SCH_MARKER * Deserialize(SCHEMATIC *schematic, const wxString &data)
SCH_MARKER(std::shared_ptr< ERC_ITEM > aItem, const VECTOR2I &aPos)
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
std::optional< SCH_SHEET_PATH > GetSheetPathByKIIDPath(const KIID_PATH &aPath, bool aIncludeLastSheet=true) const
Finds a SCH_SHEET_PATH that matches the provided KIID_PATH.
SCH_LAYER_ID
Eeschema drawing layers.
@ LAYER_SELECTION_SHADOWS
Message panel definition file.
#define SCALING_FACTOR
Factor to convert the maker unit shape to internal units:
KIWAY Kiway & Pgm(), KFCTL_STANDALONE
The global Program "get" accessor.
Functions to provide common constants and other functions to assist in making a consistent UI.