37 d.
id = j.at( 1 ).get<wxString>();
38 d.
parentId = j.at( 2 ).get<wxString>();
39 d.
key = j.at( 3 ).get<wxString>();
41 if( j.at( 4 ).is_string() )
42 d.
value = j.at( 4 ).get<wxString>();
44 if( j.at( 5 ).is_number() )
46 else if( j.at( 5 ).is_boolean() )
49 if( j.at( 6 ).is_number() )
51 else if( j.at( 6 ).is_boolean() )
54 if( j.at( 7 ).is_number() && j.at( 8 ).is_number() )
57 if( j.at( 9 ).is_number() )
60 if( j.at( 10 ).is_string() )
67 d.
id = j.at( 1 ).get<wxString>();
68 d.
parentId = j.at( 3 ).get<wxString>();
71 if( j.at( 5 ).is_number() && j.at( 6 ).is_number() )
74 d.
key = j.at( 7 ).get<wxString>();
76 if( j.at( 8 ).is_string() )
77 d.
value = j.at( 8 ).get<wxString>();
78 else if( j.at( 8 ).is_number_integer() )
79 d.
value << ( j.at( 8 ).get<
int>() );
81 if( j.at( 9 ).is_number() )
83 else if( j.at( 9 ).is_boolean() )
86 if( j.at( 10 ).is_number() )
88 else if( j.at( 10 ).is_boolean() )
91 if( j.at( 11 ).is_string() )
92 d.
fontName = j.at( 11 ).get<wxString>();
94 if( j.at( 12 ).is_number() )
97 if( j.at( 13 ).is_number() )
100 if( j.at( 16 ).is_number() )
103 if( j.at( 17 ).is_number() )
106 if( j.at( 18 ).is_number() )
113 d.
id = j.at( 1 ).get<wxString>();
114 d.
name = j.at( 2 ).get<wxString>();
116 if( j.at( 3 ).is_number() && j.at( 4 ).is_number() )
119 if( j.at( 5 ).is_number() )
122 if( j.at( 6 ).is_number() )
123 d.
mirror = j.at( 6 ).get<
int>();
125 if( j.at( 6 ).is_number() )
128 if( j.at( 7 ).is_object() )
131 if( j.at( 8 ).is_number() )
138 d.
id = j.at( 1 ).get<wxString>();
141 if( j.at( 3 ).is_string() )
148 d.
id = j.at( 1 ).get<wxString>();
150 if( j.at( 4 ).is_number() && j.at( 5 ).is_number() )
153 if( j.at( 6 ).is_number() )
156 if( j.at( 7 ).is_number() )
159 if( j.at( 9 ).is_number() )
160 d.
inverted = j.at( 9 ).get<
int>() == 2;
166 if( !j.at( 1 ).is_object() )
169 nlohmann::json
config = j.at( 1 );
182 d.
name = j.value(
"name",
"" );
183 d.
uuid = j.value(
"uuid",
"" );
184 d.
id = j.value(
"id", 0 );
190 d.
name = j.value(
"name",
"" );
191 d.
sheets = j.value(
"sheets", std::vector<PRJ_SHEET>{} );
197 d.
schematic = j.value(
"schematic",
"" );
198 d.
pcb = j.value(
"pcb",
"" );
204 if( j.at(
"source" ).is_string() )
205 d.
source = j.at(
"source" ).get<wxString>();
207 if( j.contains(
"desc" ) )
208 d.
desc = j.at(
"desc" ).get<wxString>();
209 else if( j.contains(
"description" ) )
210 d.
desc = j.at(
"description" ).get<wxString>();
212 if( j.contains(
"display_title" ) )
213 d.
title = j.at(
"display_title" ).get<wxString>();
214 else if( j.contains(
"title" ) )
215 d.
title = j.at(
"title" ).get<wxString>();
217 if( j.at(
"version" ).is_string() )
218 d.
version = j.at(
"version" ).get<wxString>();
220 if( j.at(
"type" ).is_number() )
221 d.
type = j.at(
"type" );
223 if( j.at(
"tags" ).is_object() )
224 d.
tags = j.at(
"tags" );
226 if( j.find(
"custom_tags" ) != j.end() && j.at(
"custom_tags" ).is_object() )
233 if( j.at(
"source" ).is_string() )
234 d.
source = j.at(
"source" ).get<wxString>();
236 if( j.contains(
"desc" ) )
237 d.
desc = j.at(
"desc" ).get<wxString>();
238 else if( j.contains(
"description" ) )
239 d.
desc = j.at(
"description" ).get<wxString>();
241 if( j.contains(
"display_title" ) )
242 d.
title = j.at(
"display_title" ).get<wxString>();
243 else if( j.contains(
"title" ) )
244 d.
title = j.at(
"title" ).get<wxString>();
246 if( j.at(
"version" ).is_string() )
247 d.
version = j.at(
"version" ).get<wxString>();
249 if( j.at(
"type" ).is_number() )
250 d.
type = j.at(
"type" );
252 if( j.at(
"tags" ).is_object() )
253 d.
tags = j.at(
"tags" );
255 if( j.find(
"custom_tags" ) != j.end() && j.at(
"custom_tags" ).is_object() )
262 if( j.at(
"source" ).is_string() )
263 d.
source = j.at(
"source" ).get<wxString>();
265 if( j.contains(
"desc" ) )
267 else if( j.contains(
"description" ) )
268 d.
description = j.at(
"description" ).get<wxString>();
270 if( j.contains(
"display_title" ) )
271 d.
title = j.at(
"display_title" ).get<wxString>();
272 else if( j.contains(
"title" ) )
273 d.
title = j.at(
"title" ).get<wxString>();
275 if( j.at(
"version" ).is_string() )
276 d.
version = j.at(
"version" ).get<wxString>();
278 if( j.at(
"tags" ).is_object() )
279 d.
tags = j.at(
"tags" );
281 if( j.find(
"custom_tags" ) != j.end() && j.at(
"custom_tags" ).is_object() )
284 if( j.at(
"attributes" ).is_object() )
291 d.
objectId = j.at( 1 ).get<wxString>();
292 d.
url = j.at( 3 ).get<wxString>();
298 d.
pouredId = j.at( 1 ).get<wxString>();
299 d.
parentId = j.at( 2 ).get<wxString>();
300 d.
unki = j.at( 3 ).get<
int>();
301 d.
isPoly = j.at( 4 ).get<
bool>();
std::map< wxString, wxString > AnyMapToStringMap(const std::map< wxString, nlohmann::json > &aInput)
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