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();
118 return wxString::Format( wxT(
"%s|%d|%d|%s|%s|%s|%s|%s" ),
122 parent->m_Uuid.AsString(),
123 text_item->GetText(),
130 return wxString::Format( wxT(
"%s|%d|%d|%s|%s|%s|%s|%s" ),
134 sch_item->m_Uuid.AsString(),
143 return wxString::Format( wxT(
"%s|%d|%d|%s|%s|%s|%s|%s" ),
144 m_rcItem->GetSettingsKey(),
147 m_rcItem->GetMainItemID().AsString(),
148 m_rcItem->GetAuxItemID().AsString(),
157 const wxString& data )
159 wxArrayString props = wxSplit( data,
'|' );
160 VECTOR2I markerPos( (
int) strtol( props[1].c_str(),
nullptr, 10 ),
161 (
int) strtol( props[2].c_str(),
nullptr, 10 ) );
175 if( !props[4].IsEmpty() )
186 if( text_item->GetText() == props[4] )
203 if( text_item->GetText() == props[4] )
210 ercItem->SetItems( uuid );
216 ercItem->SetItems(
KIID( props[3] ) );
221 ercItem->SetItems(
KIID( props[3] ),
KIID( props[4] ) );
224 bool isLegacyMarker =
true;
230 if( props.size() == 8 )
232 isLegacyMarker =
false;
234 if( !props[5].IsEmpty() )
236 KIID_PATH sheetSpecificKiidPath( props[5] );
237 std::optional<SCH_SHEET_PATH> sheetSpecificPath =
239 if( sheetSpecificPath.has_value() )
240 ercItem->SetSheetSpecificPath( sheetSpecificPath.value() );
243 if( !props[6].IsEmpty() )
246 std::optional<SCH_SHEET_PATH> mainItemPath =
248 if( mainItemPath.has_value() )
250 if( props[7].IsEmpty() )
252 ercItem->SetItemsSheetPaths( mainItemPath.value() );
257 std::optional<SCH_SHEET_PATH> auxItemPath =
260 if( auxItemPath.has_value() )
261 ercItem->SetItemsSheetPaths( mainItemPath.value(), auxItemPath.value() );
276void SCH_MARKER::Show(
int nestLevel, std::ostream& os )
const
279 NestedSpace( nestLevel, os ) <<
'<' <<
GetClass().Lower().mb_str() <<
GetPos() <<
"/>\n";
287 wxCHECK_RET(
Schematic(),
"No SCHEMATIC set for SCH_MARKER!" );
290 std::shared_ptr<ERC_ITEM> ercItem = std::static_pointer_cast<ERC_ITEM>(
GetRCItem() );
292 if( ercItem->IsSheetSpecific()
293 && ( ercItem->GetSpecificSheetPath() !=
Schematic()->CurrentSheet() ) )
310 case SEVERITY::RPT_SEVERITY_ERROR: aLayers[0] =
LAYER_ERC_ERR;
break;
311 case SEVERITY::RPT_SEVERITY_WARNING: aLayers[0] =
LAYER_ERC_WARN;
break;
354 const VECTOR2I& aOffset,
bool aForceNoFill,
bool aDimmed )
374 aList.emplace_back(
_(
"Type" ),
_(
"Marker" ) );
375 aList.emplace_back(
_(
"Violation" ),
m_rcItem->GetErrorMessage() );
380 aList.emplace_back(
_(
"Severity" ),
_(
"Ignore" ) );
383 aList.emplace_back(
_(
"Severity" ),
_(
"Warning" ) );
386 aList.emplace_back(
_(
"Severity" ),
_(
"Error" ) );
394 aList.emplace_back(
_(
"Drawing Sheet" ), wxEmptyString );
415 aList.emplace_back( mainText, auxText );
419 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 wxString GetItemDescription(UNITS_PROVIDER *aUnitsProvider, bool aFull) const
Return a user-visible description string of this item.
KICAD_T Type() const
Returns the type of object.
virtual bool Matches(const EDA_SEARCH_DATA &aSearchData, void *aAuxData) const
Compare the item against the search criteria in aSearchData.
EDA_ITEM * GetParent() const
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
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
SCH_ITEM * GetItem(const KIID &aID, SCH_SHEET_PATH *aPathOut=nullptr) const
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.
virtual void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction)
void SwapFlags(SCH_ITEM *aItem)
Swap the non-temp and non-edit flags.
bool IsType(const std::vector< KICAD_T > &aScanTypes) const override
Check whether the item is one of the listed types.
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 GetClass() const override
Return the class name.
BITMAPS GetMenuImage() const override
Return a pointer to an image to be used in menus.
static SCH_MARKER * DeserializeFromString(const SCH_SHEET_LIST &aSheetList, const wxString &data)
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.
SCH_ITEM * GetItem(const KIID &aID, SCH_SHEET_PATH *aPathOut=nullptr) const
Fetch a SCH_ITEM by ID.
void RunOnChildren(const std::function< void(SCH_ITEM *)> &aFunction) override
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.