KiCad PCB EDA Suite
Loading...
Searching...
No Matches
rc_json_schema.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2023 KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef RC_JSON_SCHEMA_H
21#define RC_JSON_SCHEMA_H
22
23#include <nlohmann/json.hpp>
24#include <wx/string.h>
25#include <vector>
26
33namespace RC_JSON
34{
36{
37 double x;
38 double y;
39};
41
43{
44 wxString uuid;
45 wxString description;
47};
48
50
52{
53 wxString type;
54 wxString description;
55 wxString severity;
56 std::vector<AFFECTED_ITEM> items;
57};
58
59NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE( VIOLATION, type, description, severity, items )
60
62{
63 wxString source;
64 wxString date;
65 wxString kicad_version;
66 wxString type;
68};
69
71{
72 DRC_REPORT() { type = wxS( "drc" ); }
73
74 std::vector<VIOLATION> violations;
75 std::vector<VIOLATION> unconnected_items;
76 std::vector<VIOLATION> schematic_parity;
77};
78
79NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE( DRC_REPORT, source, date, kicad_version, violations,
80 unconnected_items, schematic_parity, coordinate_units )
81
82struct ERC_SHEET
83{
84 wxString uuid_path;
85 wxString path;
86 std::vector<VIOLATION> violations;
87};
88
89NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE( ERC_SHEET, uuid_path, path, violations )
90
92{
93 ERC_REPORT() { type = wxS( "erc" ); }
94
95 std::vector<ERC_SHEET> sheets;
96};
97
98NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE( ERC_REPORT, source, date, kicad_version, sheets,
99 coordinate_units )
100
101} // namespace RC_JSON
102
103#endif
Contains the json serialization structs for DRC and ERC reports If you are trying to change the outpu...
Definition: rc_item.h:40
NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(DRC_REPORT, source, date, kicad_version, violations, unconnected_items, schematic_parity, coordinate_units) struct ERC_SHEET
std::vector< VIOLATION > unconnected_items
std::vector< VIOLATION > violations
std::vector< VIOLATION > schematic_parity
std::vector< ERC_SHEET > sheets
std::vector< AFFECTED_ITEM > items