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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 }
112 [&]() -> nlohmann::json
114 nlohmann::json ret = {};
118 wxString
name = item.GetSettingsKey();
119 int code = item.GetErrorCode();
129 [&](
const nlohmann::json& aJson )
131 if( !aJson.is_object() )
136 int code = item.GetErrorCode();
137 wxString name = item.GetSettingsKey();
139 std::string key( name.ToUTF8() );
141 if( aJson.contains( key ) )
142 m_ERCSeverities[code] = SeverityFromString( aJson[key] );
148 [&]() -> nlohmann::json
150 nlohmann::json js = nlohmann::json::array();
153 js.push_back( entry );
157 [&](
const nlohmann::json& aObj )
161 if( !aObj.is_array() )
164 for(
const nlohmann::json& entry : aObj )
175 [&]() -> nlohmann::json
177 nlohmann::json ret = nlohmann::json::array();
181 nlohmann::json inner = nlohmann::json::array();
186 ret.push_back( inner );
191 [&](
const nlohmann::json& aJson )
198 if( i > aJson.size() - 1 )
201 nlohmann::json inner = aJson[i];
208 if( inner[j].is_number_integer() )
210 int val = inner[j].get<
int>();
212 if( val >= 0 && val <=
static_cast<int>( PIN_ERROR::UNCONNECTED ) )
257 wxS(
"Missing severity from map in ERC_SETTINGS!" ) );
279 std::set<SCH_SCREEN*> seenScreens;
281 for(
unsigned i = 0; i < sheetList.size(); i++ )
283 bool firstTime = seenScreens.count( sheetList[i].LastScreen() ) == 0;
286 seenScreens.insert( sheetList[i].LastScreen() );
295 std::shared_ptr<const ERC_ITEM> ercItem =
296 std::static_pointer_cast<const ERC_ITEM>( marker->
GetRCItem() );
299 if( ercItem->IsSheetSpecific() )
301 if( ercItem->GetSpecificSheetPath() != sheetList[i] )
306 if( !firstTime && !ercItem->IsSheetSpecific() )
358 if( ( markerSeverity & aSeverity ) > 0 )
370 return marker ? std::static_pointer_cast<ERC_ITEM>( marker->
GetRCItem() ) :
nullptr;
static std::vector< std::reference_wrapper< RC_ITEM > > GetItemsWithSeverities()
Container for ERC settings.
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 TYPEMARKER 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 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,...
Container class that holds multiple SCH_SCREEN objects in a hierarchy.
void DeleteMarker(SCH_MARKER *aMarker)
Delete a specific marker.
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
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_LABELS
2 labels are equal for case insensitive comparisons.
@ ERCE_ENDPOINT_OFF_GRID
Pin or wire-end off grid.
@ ERCE_BUS_ENTRY_CONFLICT
A wire connected to a bus doesn't match the bus.
@ ERCE_GLOBLABEL
A global label is unique.
@ ERCE_NOCONNECT_NOT_CONNECTED
A no connect symbol is not connected to anything.
@ ERCE_SIMULATION_MODEL
An error was found in the simulation model.
@ 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
Library symbol changed from current symbol in schematic or the library symbol link no longer valid.
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)