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V,
DRV,
DRV,
NOD,
DRV,
NOD,
DRV,
DRV,
DRV,
NPI },
77 {
NOD,
NOD,
NOD,
NOD,
NOD,
NOD,
NOD,
NOD,
NOD,
NOD,
NOD,
NPI },
78 {
DRV,
DRV,
DRV,
DRV,
DRV,
NOD,
DRV,
NOD,
DRV,
DRV,
DRV,
NPI },
79 {
NOD,
DRV,
NOD,
NOD,
NOD,
NOD,
NOD,
NOD,
DRV,
NOD,
NOD,
NPI },
80 {
DRV,
DRV,
DRV,
DRV,
DRV,
NOD,
DRV,
DRV,
DRV,
DRV,
DRV,
NPI },
81 {
DRV,
DRV,
DRV,
DRV,
DRV,
NOD,
DRV,
NOD,
DRV,
DRV,
DRV,
NPI },
82 {
DRV,
DRV,
DRV,
DRV,
DRV,
NOD,
DRV,
NOD,
DRV,
DRV,
DRV,
NPI },
83 {
NPI,
NPI,
NPI,
NPI,
NPI,
NPI,
NPI,
NPI,
NPI,
NPI,
NPI,
NPI }
122 [&]() -> nlohmann::json
124 nlohmann::json ret = {};
128 wxString
name = item.GetSettingsKey();
129 int code = item.GetErrorCode();
139 [&](
const nlohmann::json& aJson )
141 if( !aJson.is_object() )
146 int code = item.GetErrorCode();
147 wxString name = item.GetSettingsKey();
149 std::string key( name.ToUTF8() );
151 if( aJson.contains( key ) )
152 m_ERCSeverities[code] = SeverityFromString( aJson[key] );
158 [&]() -> nlohmann::json
160 nlohmann::json js = nlohmann::json::array();
167 [&](
const nlohmann::json& aObj )
171 if( !aObj.is_array() )
174 for(
const nlohmann::json& entry : aObj )
176 if( entry.is_array() )
178 wxString serialized = entry[0].get<wxString>();
182 else if( entry.is_string() )
191 [&]() -> nlohmann::json
193 nlohmann::json ret = nlohmann::json::array();
197 nlohmann::json inner = nlohmann::json::array();
202 ret.push_back( inner );
207 [&](
const nlohmann::json& aJson )
214 if( i > aJson.size() - 1 )
217 nlohmann::json inner = aJson[i];
224 if( inner[j].is_number_integer() )
226 int val = inner[j].get<
int>();
228 if( val >= 0 && val <=
static_cast<int>( PIN_ERROR::UNCONNECTED ) )
287 wxS(
"Missing severity from map in ERC_SETTINGS!" ) );
307 std::set<SCH_SCREEN*> seenScreens;
311 bool firstTime = seenScreens.count( sheet.LastScreen() ) == 0;
314 seenScreens.insert( sheet.LastScreen() );
323 std::shared_ptr<const ERC_ITEM> ercItem =
324 std::static_pointer_cast<const ERC_ITEM>( marker->
GetRCItem() );
327 if( ercItem->IsSheetSpecific() )
329 if( ercItem->GetSpecificSheetPath() != sheet )
334 if( !firstTime && !ercItem->IsSheetSpecific() )
386 if( ( markerSeverity & aSeverity ) > 0 )
398 return marker ? std::static_pointer_cast<ERC_ITEM>( marker->
GetRCItem() ) :
nullptr;
static std::vector< std::reference_wrapper< RC_ITEM > > GetItemsWithSeverities()
Container for ERC settings.
std::map< wxString, wxString > m_ErcExclusionComments
static PIN_ERROR m_defaultPinMap[ELECTRICAL_PINTYPES_TOTAL][ELECTRICAL_PINTYPES_TOTAL]
Default Look up table which gives the ERC error level for a pair of connected pins.
SEVERITY GetSeverity(int aErrorCode) const
ERC_SETTINGS(JSON_SETTINGS *aParent, const std::string &aPath)
void SetSeverity(int aErrorCode, SEVERITY aSeverity)
PIN_ERROR GetPinMapValue(int aFirstType, int aSecondType) const
std::map< int, SEVERITY > m_ERCSeverities
std::set< wxString > m_ErcExclusions
static int m_PinMinDrive[ELECTRICAL_PINTYPES_TOTAL][ELECTRICAL_PINTYPES_TOTAL]
Look up table which gives the minimal drive for a pair of connected pins on a net.
void SetPinMapValue(int aFirstType, int aSecondType, PIN_ERROR aValue)
PIN_ERROR m_PinMap[ELECTRICAL_PINTYPES_TOTAL][ELECTRICAL_PINTYPES_TOTAL]
std::vector< PARAM_BASE * > m_params
The list of parameters (owned by this object)
void ReleaseNestedSettings(NESTED_SETTINGS *aSettings)
Saves and frees a nested settings object, if it exists within this one.
std::shared_ptr< RC_ITEM > GetRCItem() const
enum MARKER_T GetMarkerType() const
NESTED_SETTINGS is a JSON_SETTINGS that lives inside a JSON_SETTINGS.
JSON_SETTINGS * m_parent
A pointer to the parent object to load and store from.
Like a normal param, but with custom getter and setter functions.
A holder for a rule check item, DRC in Pcbnew or ERC in Eeschema.
SCH_SHEET_LIST BuildUnorderedSheetList() const
ERC_SETTINGS & ErcSettings() const
Base class for any item which can be embedded within the SCHEMATIC container class,...
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
void DeleteMarker(SCH_MARKER *aMarker)
Delete a specific marker.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
int GetCount(int aSeverity=-1) const override
void SetSeverities(int aSeverities) override
void visitMarkers(std::function< void(SCH_MARKER *)> aVisitor) const
void DeleteItem(int aIndex, bool aDeep) override
Remove (and optionally deletes) the indexed item from the list.
std::shared_ptr< ERC_ITEM > GetERCItem(int aIndex) const
std::vector< SCH_MARKER * > m_filteredMarkers
std::shared_ptr< RC_ITEM > GetItem(int aIndex) const override
Retrieve a RC_ITEM by index.
const int ercSettingsSchemaVersion
@ ERCE_DRIVER_CONFLICT
Conflicting drivers (labels, etc) on a subgraph.
@ ERCE_SIMILAR_POWER
2 power pins are equal for case insensitive comparisons.
@ ERCE_UNCONNECTED_WIRE_ENDPOINT
A label is connected to more than one wire.
@ ERCE_SIMILAR_LABELS
2 labels are equal for case insensitive comparisons.
@ ERCE_ENDPOINT_OFF_GRID
Pin or wire-end off grid.
@ ERCE_SAME_LOCAL_GLOBAL_LABEL
2 labels are equal for case insensitive comparisons.
@ ERCE_SIMILAR_LABEL_AND_POWER
label and pin are equal for case insensitive comparisons.
@ ERCE_BUS_ENTRY_CONFLICT
A wire connected to a bus doesn't match the bus.
@ ERCE_GLOBLABEL
A global label is unique.
@ ERCE_FOOTPRINT_LINK_ISSUES
The footprint link is invalid, or points to a missing (or inactive) footprint or library.
@ ERCE_DUPLICATE_PIN_ERROR
@ ERCE_NOCONNECT_NOT_CONNECTED
A no connect symbol is not connected to anything.
@ ERCE_FOUR_WAY_JUNCTION
A four-way junction was found.
@ ERCE_SIMULATION_MODEL
An error was found in the simulation model.
@ ERCE_LIB_SYMBOL_MISMATCH
Symbol doesn't match copy in library.
@ ERCE_NOCONNECT_CONNECTED
A no connect symbol is connected to more than 1 pin.
@ ERCE_PIN_TO_PIN_WARNING
@ ERCE_MISSING_INPUT_PIN
Symbol has input pins that are not placed.
@ ERCE_MISSING_UNIT
Symbol has units that are not placed on the schematic.
@ ERCE_MISSING_BIDI_PIN
Symbol has bi-directional pins that are not placed.
@ ERCE_LIB_SYMBOL_ISSUES
Symbol not found in active libraries.
@ ERCE_FOOTPRINT_FILTERS
The assigned footprint doesn't match the footprint filters.
@ ERCE_SINGLE_GLOBAL_LABEL
A global label only exists once in the schematic.
@ ERCE_LABEL_MULTIPLE_WIRES
A label is connected to more than one wire.
PIN_ERROR
The values a pin-to-pin entry in the pin matrix can take on.
#define NPI
Types of drive on a net (used for legacy ERC)
#define ELECTRICAL_PINTYPES_TOTAL
wxString SeverityToString(const SEVERITY &aSeverity)