36 d.
id = j.at( 1 ).get<wxString>();
37 d.
parentId = j.at( 2 ).get<wxString>();
38 d.
key = j.at( 3 ).get<wxString>();
40 if( j.at( 4 ).is_string() )
41 d.
value = j.at( 4 ).get<wxString>();
43 if( j.at( 5 ).is_number() )
45 else if( j.at( 5 ).is_boolean() )
48 if( j.at( 6 ).is_number() )
50 else if( j.at( 6 ).is_boolean() )
53 if( j.at( 7 ).is_number() && j.at( 8 ).is_number() )
56 if( j.at( 9 ).is_number() )
59 if( j.at( 10 ).is_string() )
65 d.
id = j.at( 1 ).get<wxString>();
66 d.
parentId = j.at( 3 ).get<wxString>();
69 if( j.at( 5 ).is_number() && j.at( 6 ).is_number() )
72 d.
key = j.at( 7 ).get<wxString>();
74 if( j.at( 8 ).is_string() )
75 d.
value = j.at( 8 ).get<wxString>();
76 else if( j.at( 8 ).is_number_integer() )
77 d.
value << ( j.at( 8 ).get<
int>() );
79 if( j.at( 9 ).is_number() )
81 else if( j.at( 9 ).is_boolean() )
84 if( j.at( 10 ).is_number() )
86 else if( j.at( 10 ).is_boolean() )
89 if( j.at( 11 ).is_string() )
90 d.
fontName = j.at( 11 ).get<wxString>();
92 if( j.at( 12 ).is_number() )
95 if( j.at( 13 ).is_number() )
98 if( j.at( 16 ).is_number() )
101 if( j.at( 17 ).is_number() )
104 if( j.at( 18 ).is_number() )
111 d.
id = j.at( 1 ).get<wxString>();
112 d.
name = j.at( 2 ).get<wxString>();
114 if( j.at( 3 ).is_number() && j.at( 4 ).is_number() )
117 if( j.at( 5 ).is_number() )
120 if( j.at( 6 ).is_number() )
121 d.
mirror = j.at( 6 ).get<
int>();
123 if( j.at( 6 ).is_number() )
126 if( j.at( 7 ).is_object() )
129 if( j.at( 8 ).is_number() )
136 d.
id = j.at( 1 ).get<wxString>();
139 if( j.at( 3 ).is_string() )
146 d.
id = j.at( 1 ).get<wxString>();
148 if( j.at( 4 ).is_number() && j.at( 5 ).is_number() )
151 if( j.at( 6 ).is_number() )
154 if( j.at( 7 ).is_number() )
157 if( j.at( 9 ).is_number() )
158 d.
inverted = j.at( 9 ).get<
int>() == 2;
163 if( !j.at( 1 ).is_object() )
166 nlohmann::json
config = j.at( 1 );
178 d.
name = j.value(
"name",
"" );
179 d.
uuid = j.value(
"uuid",
"" );
180 d.
id = j.value(
"id", 0 );
185 d.
name = j.value(
"name",
"" );
186 d.
sheets = j.value(
"sheets", std::vector<PRJ_SHEET>{} );
191 d.
schematic = j.value(
"schematic",
"" );
192 d.
pcb = j.value(
"pcb",
"" );
197 if( j.at(
"source" ).is_string() )
198 d.
source = j.at(
"source" ).get<wxString>();
200 if( j.contains(
"desc" ) )
201 d.
desc = j.at(
"desc" ).get<wxString>();
202 else if( j.contains(
"description" ) )
203 d.
desc = j.at(
"description" ).get<wxString>();
205 if( j.contains(
"display_title" ) )
206 d.
title = j.at(
"display_title" ).get<wxString>();
207 else if( j.contains(
"title" ) )
208 d.
title = j.at(
"title" ).get<wxString>();
210 if( j.at(
"version" ).is_string() )
211 d.
version = j.at(
"version" ).get<wxString>();
213 if( j.at(
"type" ).is_number() )
214 d.
type = j.at(
"type" );
216 if( j.at(
"tags" ).is_object() )
217 d.
tags = j.at(
"tags" );
219 if( j.find(
"custom_tags" ) != j.end() && j.at(
"custom_tags" ).is_object() )
225 if( j.at(
"source" ).is_string() )
226 d.
source = j.at(
"source" ).get<wxString>();
228 if( j.contains(
"desc" ) )
229 d.
desc = j.at(
"desc" ).get<wxString>();
230 else if( j.contains(
"description" ) )
231 d.
desc = j.at(
"description" ).get<wxString>();
233 if( j.contains(
"display_title" ) )
234 d.
title = j.at(
"display_title" ).get<wxString>();
235 else if( j.contains(
"title" ) )
236 d.
title = j.at(
"title" ).get<wxString>();
238 if( j.at(
"version" ).is_string() )
239 d.
version = j.at(
"version" ).get<wxString>();
241 if( j.at(
"type" ).is_number() )
242 d.
type = j.at(
"type" );
244 if( j.at(
"tags" ).is_object() )
245 d.
tags = j.at(
"tags" );
247 if( j.find(
"custom_tags" ) != j.end() && j.at(
"custom_tags" ).is_object() )
253 if( j.at(
"source" ).is_string() )
254 d.
source = j.at(
"source" ).get<wxString>();
256 if( j.contains(
"desc" ) )
258 else if( j.contains(
"description" ) )
259 d.
description = j.at(
"description" ).get<wxString>();
261 if( j.contains(
"display_title" ) )
262 d.
title = j.at(
"display_title" ).get<wxString>();
263 else if( j.contains(
"title" ) )
264 d.
title = j.at(
"title" ).get<wxString>();
266 if( j.at(
"version" ).is_string() )
267 d.
version = j.at(
"version" ).get<wxString>();
269 if( j.at(
"tags" ).is_object() )
270 d.
tags = j.at(
"tags" );
272 if( j.find(
"custom_tags" ) != j.end() && j.at(
"custom_tags" ).is_object() )
275 if( j.at(
"attributes" ).is_object() )
281 d.
objectId = j.at( 1 ).get<wxString>();
282 d.
url = j.at( 3 ).get<wxString>();
287 d.
pouredId = j.at( 1 ).get<wxString>();
288 d.
parentId = j.at( 2 ).get<wxString>();
289 d.
unki = j.at( 3 ).get<
int>();
290 d.
isPoly = j.at( 4 ).get<
bool>();
void from_json(const nlohmann::json &j, EASYEDAPRO::SCH_ATTR &d)
nlohmann::json custom_tags
std::map< wxString, wxString > attributes
std::vector< PRJ_SHEET > sheets
nlohmann::json custom_tags
std::optional< VECTOR2D > position
nlohmann::json customProps
std::vector< std::vector< double > > geometry