KiCad PCB EDA Suite
Loading...
Searching...
No Matches
easyeda_parser_structs.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 (C) 2023 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, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25#ifndef EASYEDA_PARSER_STRUCTS_H_
26#define EASYEDA_PARSER_STRUCTS_H_
27
28#include <cstdint>
29#include <cstring>
30#include <memory>
31#include <vector>
32#include <map>
33#include <optional>
34
35#include <wx/string.h>
36#include <wx/arrstr.h>
37
38#include <nlohmann/json.hpp>
39
40namespace EASYEDA
41{
42
43enum class DOC_TYPE
44{
45 UNKNOWN = 0,
46
48 SYMBOL = 2,
49 PCB = 3,
50 PCB_COMPONENT = 4,
52 PCB_MODULE = 14,
53};
54
55struct HEAD
56{
58
59 wxString editorVersion;
60 wxString title;
61 wxString description;
62
63 double x = 0;
64 double y = 0;
65
66 std::optional<std::map<wxString, wxString>> c_para;
67};
68
70{
71 std::optional<DOC_TYPE> docType; // May be here or in head
73
74 // BBox
75 // colors
76 wxString canvas;
77 wxString title;
78 wxArrayString shape;
79 std::optional<nlohmann::json> dataStr;
80};
81
82struct C_PARA
83{
84 wxString package;
85 wxString pre;
86 wxString Contributor;
87 wxString link;
88 wxString Model_3D;
89};
90
92{
93 std::optional<std::map<wxString, wxString>> c_para;
94 std::vector<wxString> layers;
95 std::optional<wxString> uuid;
96 std::optional<std::map<wxString, nlohmann::json>> DRCRULE;
97};
98
100{
101 std::optional<std::map<wxString, wxString>> c_para;
102};
103
105{
106 std::optional<std::vector<DOCUMENT>> schematics;
107};
108
109void from_json( const nlohmann::json& j, EASYEDA::DOC_TYPE& d );
110void from_json( const nlohmann::json& j, EASYEDA::HEAD& d );
111void from_json( const nlohmann::json& j, EASYEDA::DOCUMENT& d );
112void from_json( const nlohmann::json& j, EASYEDA::C_PARA& d );
113void from_json( const nlohmann::json& j, EASYEDA::DOCUMENT_PCB& d );
114void from_json( const nlohmann::json& j, EASYEDA::DOCUMENT_SYM& d );
115void from_json( const nlohmann::json& j, EASYEDA::DOCUMENT_SCHEMATICS& d );
116
118{
119 UNKNOWN = -1,
120
121 CIRCLE = 0,
122 ARROW = 1,
123 BAR = 2,
124 WAVE = 3,
125 POWER_GROUND = 4,
126 SIGNAL_GROUND = 5,
127 EARTH = 6,
128 GOST_ARROW = 7,
130 GOST_EARTH = 9,
131 GOST_BAR = 10
132};
133
134} // namespace EASYEDA
135
136
137#endif // EASYEDA_PARSER_STRUCTS_H_
Represent basic circle geometry with utility geometry functions.
Definition: circle.h:33
A base class for LIB_SYMBOL and SCH_SYMBOL.
Definition: symbol.h:34
void from_json(const nlohmann::json &j, EASYEDA::DOC_TYPE &d)
std::optional< std::map< wxString, nlohmann::json > > DRCRULE
std::optional< std::map< wxString, wxString > > c_para
std::vector< wxString > layers
std::optional< wxString > uuid
std::optional< std::vector< DOCUMENT > > schematics
std::optional< std::map< wxString, wxString > > c_para
std::optional< nlohmann::json > dataStr
std::optional< DOC_TYPE > docType
std::optional< std::map< wxString, wxString > > c_para