KiCad PCB EDA Suite
Loading...
Searching...
No Matches
easyedapro_parser.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 Alex Shvartzkop <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef EASYEDAPRO_PARSER_H_
22#define EASYEDAPRO_PARSER_H_
23
24#include <cstdint>
25#include <cstring>
26#include <memory>
27#include <vector>
28#include <map>
29#include <optional>
30
31#include <wx/string.h>
32
33#include <json_common.h>
34#include <math/vector2d.h>
35
36
37namespace EASYEDAPRO
38{
39
40static const bool IMPORT_POURED = true;
41static const bool IMPORT_POURED_ECOP = false;
42
43enum class SYMBOL_TYPE
44{
45 NORMAL = 2,
47 NETPORT = 19,
49 SHORT = 22,
50};
51
53{
54 NORMAL = 4,
55};
56
58{
59 wxString id;
60 wxString parentId;
61 wxString key;
62 wxString value;
63 bool keyVisible = false;
64 bool valVisible = false;
65 std::optional<VECTOR2D> position;
66 double rotation = 0;
67 wxString fontStyle;
68};
69
71{
72 wxString id;
73 int layer = 0;
74 wxString parentId;
75 int textOrigin = 0;
77 wxString key;
78 wxString value;
79 bool keyVisible = false;
80 bool valVisible = false;
81 wxString fontName;
82 double height = 0;
83 double strokeWidth = 0;
84 double rotation = 0;
85 int inverted = 0;
86};
87
89{
90 wxString id;
91 wxString name;
92
94 double rotation = 0;
95 bool mirror = false;
96
97 nlohmann::json customProps;
98
99 int unk1 = 0;
100 int unk2 = 0;
101};
102
104{
105 wxString id;
106 std::vector<std::vector<double>> geometry;
107 wxString lineStyle;
108
109 int unk1 = 0;
110};
111
113{
114 wxString id;
115
117 double length = 0;
118 double rotation = 0;
119 bool inverted = false;
120};
121
129
131{
132 int id = 0;
133 wxString name;
134 wxString uuid;
135};
136
138{
139 wxString name;
140 std::vector<PRJ_SHEET> sheets;
141};
142
144{
145 wxString schematic;
146 wxString pcb;
147};
148
150{
151 wxString source;
152 wxString desc;
153 nlohmann::json tags;
154 nlohmann::json custom_tags;
155 wxString title;
156 wxString version;
158};
159
161{
162 wxString source;
163 wxString desc;
164 nlohmann::json tags;
165 nlohmann::json custom_tags;
166 wxString title;
167 wxString version;
169};
170
172{
173 wxString source;
174 wxString description;
175 nlohmann::json tags;
176 nlohmann::json custom_tags;
177 wxString title;
178 wxString version;
179 std::map<wxString, wxString> attributes;
180};
181
182struct BLOB
183{
184 wxString objectId;
185 wxString url;
186};
187
188struct POURED
189{
190 wxString pouredId;
191 wxString parentId;
192 int unki = 0;
193 bool isPoly = false;
194 nlohmann::json polyData;
195};
196
197void from_json( const nlohmann::json& j, EASYEDAPRO::SCH_ATTR& d );
198void from_json( const nlohmann::json& j, EASYEDAPRO::PCB_ATTR& d );
199void from_json( const nlohmann::json& j, EASYEDAPRO::SCH_COMPONENT& d );
200void from_json( const nlohmann::json& j, EASYEDAPRO::SCH_WIRE& d );
201void from_json( const nlohmann::json& j, EASYEDAPRO::SYM_PIN& d );
202void from_json( const nlohmann::json& j, EASYEDAPRO::SYM_HEAD& d );
203void from_json( const nlohmann::json& j, EASYEDAPRO::PRJ_SHEET& d );
204void from_json( const nlohmann::json& j, EASYEDAPRO::PRJ_SCHEMATIC& d );
205void from_json( const nlohmann::json& j, EASYEDAPRO::PRJ_BOARD& d );
206void from_json( const nlohmann::json& j, EASYEDAPRO::PRJ_SYMBOL& d );
207void from_json( const nlohmann::json& j, EASYEDAPRO::PRJ_FOOTPRINT& d );
208void from_json( const nlohmann::json& j, EASYEDAPRO::PRJ_DEVICE& d );
209void from_json( const nlohmann::json& j, EASYEDAPRO::BLOB& d );
210void from_json( const nlohmann::json& j, EASYEDAPRO::POURED& d );
211
212} // namespace EASYEDAPRO
213
214
215#endif // EASYEDAPRO_PARSER_H_
static const bool IMPORT_POURED_ECOP
static const bool IMPORT_POURED
void from_json(const nlohmann::json &j, EASYEDAPRO::SCH_ATTR &d)
nlohmann::json polyData
std::map< wxString, wxString > attributes
std::vector< PRJ_SHEET > sheets
std::optional< VECTOR2D > position
std::vector< std::vector< double > > geometry
VECTOR2< double > VECTOR2D
Definition vector2d.h:682