42#define SCALING_FACTOR schIUScale.mmToIU( 0.15 )
93 std::shared_ptr<ERC_ITEM>
erc = std::static_pointer_cast<ERC_ITEM>(
m_rcItem );
94 wxString sheetSpecificPath, mainItemPath, auxItemPath;
96 if(
erc->IsSheetSpecific() )
97 sheetSpecificPath =
erc->GetSpecificSheetPath().Path().AsString();
99 if(
erc->MainItemHasSheetPath() )
100 mainItemPath =
erc->GetMainItemSheetPath().Path().AsString();
102 if(
erc->AuxItemHasSheetPath() )
103 auxItemPath =
erc->GetAuxItemSheetPath().Path().AsString();
105 return wxString::Format( wxT(
"%s|%d|%d|%s|%s|%s|%s|%s" ),
m_rcItem->GetSettingsKey(),
m_Pos.
x,
107 m_rcItem->GetAuxItemID().AsString(), sheetSpecificPath, mainItemPath,
114 wxArrayString props = wxSplit( data,
'|' );
115 VECTOR2I markerPos( (
int) strtol( props[1].c_str(),
nullptr, 10 ),
116 (
int) strtol( props[2].c_str(),
nullptr, 10 ) );
123 ercItem->SetItems(
KIID( props[3] ),
KIID( props[4] ) );
125 bool isLegacyMarker =
true;
131 if( props.size() == 8 )
133 isLegacyMarker =
false;
137 if( !props[5].IsEmpty() )
139 KIID_PATH sheetSpecificKiidPath( props[5] );
140 std::optional<SCH_SHEET_PATH> sheetSpecificPath =
142 if( sheetSpecificPath.has_value() )
143 ercItem->SetSheetSpecificPath( sheetSpecificPath.value() );
146 if( !props[6].IsEmpty() )
149 std::optional<SCH_SHEET_PATH> mainItemPath =
151 if( mainItemPath.has_value() )
153 if( props[7].IsEmpty() )
155 ercItem->SetItemsSheetPaths( mainItemPath.value() );
160 std::optional<SCH_SHEET_PATH> auxItemPath =
163 if( auxItemPath.has_value() )
164 ercItem->SetItemsSheetPaths( mainItemPath.value(), auxItemPath.value() );
179void SCH_MARKER::Show(
int nestLevel, std::ostream& os )
const
182 NestedSpace( nestLevel, os ) <<
'<' <<
GetClass().Lower().mb_str() <<
GetPos() <<
"/>\n";
190 wxCHECK_RET(
Schematic(),
"No SCHEMATIC set for SCH_MARKER!" );
193 std::shared_ptr<ERC_ITEM> ercItem = std::static_pointer_cast<ERC_ITEM>(
GetRCItem() );
195 if( ercItem->IsSheetSpecific()
196 && ( ercItem->GetSpecificSheetPath() !=
Schematic()->CurrentSheet() ) )
213 case SEVERITY::RPT_SEVERITY_ERROR: aLayers[0] =
LAYER_ERC_ERR;
break;
214 case SEVERITY::RPT_SEVERITY_WARNING: aLayers[0] =
LAYER_ERC_WARN;
break;
257 const VECTOR2I& aOffset,
bool aForceNoFill,
bool aDimmed )
277 aList.emplace_back(
_(
"Type" ),
_(
"Marker" ) );
278 aList.emplace_back(
_(
"Violation" ),
m_rcItem->GetErrorMessage() );
283 aList.emplace_back(
_(
"Severity" ),
_(
"Ignore" ) );
286 aList.emplace_back(
_(
"Severity" ),
_(
"Warning" ) );
289 aList.emplace_back(
_(
"Severity" ),
_(
"Error" ) );
297 aList.emplace_back(
_(
"Drawing Sheet" ), wxEmptyString );
318 aList.emplace_back( mainText, auxText );
322 aList.emplace_back(
_(
"Excluded" ),
m_comment );
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.
virtual EDA_ITEM * GetItem(const KIID &aId) const
Fetch an item by KIID.
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.
virtual wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider) const
Return a user-visible description string of this item.
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.
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
enum MARKER_T GetMarkerType() const
BOX2I GetBoundingBoxMarker() const
Return the orthogonal, bounding box of this object for display purposes.
virtual SETTINGS_MANAGER & GetSettingsManager() const
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.
void SwapFlags(SCH_ITEM *aItem)
Swap the non-temp and non-edit flags.
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)
static SCH_MARKER * DeserializeFromString(SCHEMATIC *schematic, const wxString &data)
bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxDat) const override
Compare DRC marker main and auxiliary text against search string.
wxString GetClass() const override
Return the class name.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
void Print(const SCH_RENDER_SETTINGS *aSettings, int aUnit, int aBodyStyle, const VECTOR2I &aOffset, bool aForceNoFill, bool aDimmed) override
Print an item.
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.
wxString SerializeToString() const
bool HitTest(const VECTOR2I &aPosition, int aAccuracy=0) const override
Test if aPosition is inside or on the boundary of this item.
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.
SCH_MARKER(std::shared_ptr< ERC_ITEM > aItem, const VECTOR2I &aPos)
void Rotate(const VECTOR2I &aCenter, bool aRotateCCW) override
Rotate the item around aCenter 90 degrees in the clockwise direction.
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.
COLOR_SETTINGS * GetColorSettings(const wxString &aName="user")
Retrieves a color settings object that applications can read colors from.
SCH_LAYER_ID
Eeschema drawing layers.
@ LAYER_SELECTION_SHADOWS
Message panel definition file.
PGM_BASE & Pgm()
The global Program "get" accessor.
#define SCALING_FACTOR
Factor to convert the maker unit shape to internal units:
Functions to provide common constants and other functions to assist in making a consistent UI.