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();
119 return wxString::Format( wxT(
"%s|%d|%d|%s|%s|%s|%s|%s" ),
123 parent->m_Uuid.AsString(),
124 text_item->GetText(),
131 return wxString::Format( wxT(
"%s|%d|%d|%s|%s|%s|%s|%s" ),
132 m_rcItem->GetSettingsKey(),
135 m_rcItem->GetMainItemID().AsString(),
136 m_rcItem->GetAuxItemID().AsString(),
144 const wxString& data )
146 wxArrayString props = wxSplit( data,
'|' );
147 VECTOR2I markerPos( (
int) strtol( props[1].c_str(),
nullptr, 10 ),
148 (
int) strtol( props[2].c_str(),
nullptr, 10 ) );
163 if( !props[4].IsEmpty() )
174 if( text_item->GetText() == props[4] )
191 if( text_item->GetText() == props[4] )
198 ercItem->SetItems( uuid );
204 ercItem->SetItems(
KIID( props[3] ) );
209 ercItem->SetItems(
KIID( props[3] ),
KIID( props[4] ) );
212 bool isLegacyMarker =
true;
218 if( props.size() == 8 )
220 isLegacyMarker =
false;
222 if( !props[5].IsEmpty() )
224 KIID_PATH sheetSpecificKiidPath( props[5] );
225 std::optional<SCH_SHEET_PATH> sheetSpecificPath =
227 if( sheetSpecificPath.has_value() )
228 ercItem->SetSheetSpecificPath( sheetSpecificPath.value() );
231 if( !props[6].IsEmpty() )
234 std::optional<SCH_SHEET_PATH> mainItemPath =
236 if( mainItemPath.has_value() )
238 if( props[7].IsEmpty() )
240 ercItem->SetItemsSheetPaths( mainItemPath.value() );
245 std::optional<SCH_SHEET_PATH> auxItemPath =
248 if( auxItemPath.has_value() )
249 ercItem->SetItemsSheetPaths( mainItemPath.value(), auxItemPath.value() );
264void SCH_MARKER::Show(
int nestLevel, std::ostream& os )
const
267 NestedSpace( nestLevel, os ) <<
'<' <<
GetClass().Lower().mb_str() <<
GetPos() <<
"/>\n";
275 wxCHECK2_MSG(
Schematic(),
return {},
"No SCHEMATIC set for SCH_MARKER!" );
278 std::shared_ptr<ERC_ITEM> ercItem = std::static_pointer_cast<ERC_ITEM>(
GetRCItem() );
280 if( ercItem->IsSheetSpecific()
281 && ( ercItem->GetSpecificSheetPath() !=
Schematic()->CurrentSheet() ) )
286 std::vector<int> layers( 2 );
297 case SEVERITY::RPT_SEVERITY_ERROR: layers[0] =
LAYER_ERC_ERR;
break;
298 case SEVERITY::RPT_SEVERITY_WARNING: layers[0] =
LAYER_ERC_WARN;
break;
342 const VECTOR2I& aOffset,
bool aForceNoFill,
bool aDimmed )
362 aList.emplace_back(
_(
"Type" ),
_(
"Marker" ) );
363 aList.emplace_back(
_(
"Violation" ),
m_rcItem->GetErrorMessage() );
368 aList.emplace_back(
_(
"Severity" ),
_(
"Ignore" ) );
371 aList.emplace_back(
_(
"Severity" ),
_(
"Warning" ) );
374 aList.emplace_back(
_(
"Severity" ),
_(
"Error" ) );
382 aList.emplace_back(
_(
"Drawing Sheet" ), wxEmptyString );
403 aList.emplace_back( mainText, auxText );
407 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
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.
std::vector< int > ViewGetLayers() const override
Return the layers the item is drawn on (which may be more than its "home" layer)
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.
@ ERCE_UNRESOLVED_VARIABLE
A text variable could not be resolved.
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.