mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-11 10:00:13 +00:00
Set an excluded property in json reports for erc/drc
This commit is contained in:
parent
b86bf19328
commit
6db6e85161
@ -165,6 +165,7 @@ void RC_ITEM::GetJsonViolation( RC_JSON::VIOLATION& aViolation, UNITS_PROVIDER*
|
||||
aViolation.severity = severity;
|
||||
aViolation.description = GetErrorMessage();
|
||||
aViolation.type = GetSettingsKey();
|
||||
aViolation.excluded = ( m_parent && m_parent->IsExcluded() );
|
||||
|
||||
EDA_ITEM* mainItem = nullptr;
|
||||
EDA_ITEM* auxItem = nullptr;
|
||||
|
@ -54,9 +54,27 @@ struct VIOLATION
|
||||
wxString description;
|
||||
wxString severity;
|
||||
std::vector<AFFECTED_ITEM> items;
|
||||
bool excluded;
|
||||
};
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE( VIOLATION, type, description, severity, items )
|
||||
inline void to_json( nlohmann::json& aJson, const VIOLATION& aViolation )
|
||||
{
|
||||
aJson["type"] = aViolation.type;
|
||||
aJson["description"] = aViolation.description;
|
||||
aJson["severity"] = aViolation.severity;
|
||||
aJson["items"] = aViolation.items;
|
||||
|
||||
if( aViolation.excluded )
|
||||
aJson["excluded"] = aViolation.excluded;
|
||||
}
|
||||
inline void from_json( const nlohmann::json& aJson, VIOLATION& aViolation )
|
||||
{
|
||||
aJson.at( "type" ).get_to( aViolation.type );
|
||||
aJson.at( "description" ).get_to( aViolation.description );
|
||||
aJson.at( "severity" ).get_to( aViolation.severity );
|
||||
aJson.at( "items" ).get_to( aViolation.items );
|
||||
aJson.at( "excluded" ).get_to( aViolation.excluded );
|
||||
}
|
||||
|
||||
struct REPORT_BASE
|
||||
{
|
||||
|
@ -78,6 +78,10 @@
|
||||
"items": {
|
||||
"$ref": "#/definitions/AffectedItem"
|
||||
}
|
||||
},
|
||||
"excluded": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -87,6 +87,10 @@
|
||||
"items": {
|
||||
"$ref": "#/definitions/AffectedItem"
|
||||
}
|
||||
},
|
||||
"excluded": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
Loading…
Reference in New Issue
Block a user