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() )
66 d.
id = j.at( 1 ).get<wxString>();
67 d.
parentId = j.at( 3 ).get<wxString>();
70 if( j.at( 5 ).is_number() && j.at( 6 ).is_number() )
73 d.
key = j.at( 7 ).get<wxString>();
75 if( j.at( 8 ).is_string() )
76 d.
value = j.at( 8 ).get<wxString>();
77 else if( j.at( 8 ).is_number_integer() )
78 d.
value << ( j.at( 8 ).get<
int>() );
80 if( j.at( 9 ).is_number() )
82 else if( j.at( 9 ).is_boolean() )
85 if( j.at( 10 ).is_number() )
87 else if( j.at( 10 ).is_boolean() )
90 if( j.at( 11 ).is_string() )
91 d.
fontName = j.at( 11 ).get<wxString>();
93 if( j.at( 12 ).is_number() )
96 if( j.at( 13 ).is_number() )
99 if( j.at( 16 ).is_number() )
102 if( j.at( 17 ).is_number() )
105 if( j.at( 18 ).is_number() )
112 d.
id = j.at( 1 ).get<wxString>();
113 d.
name = j.at( 2 ).get<wxString>();
115 if( j.at( 3 ).is_number() && j.at( 4 ).is_number() )
118 if( j.at( 5 ).is_number() )
121 if( j.at( 6 ).is_number() )
122 d.
mirror = j.at( 6 ).get<
int>();
124 if( j.at( 6 ).is_number() )
127 if( j.at( 7 ).is_object() )
130 if( j.at( 8 ).is_number() )
137 d.
id = j.at( 1 ).get<wxString>();
140 if( j.at( 3 ).is_string() )
147 d.
id = j.at( 1 ).get<wxString>();
149 if( j.at( 4 ).is_number() && j.at( 5 ).is_number() )
152 if( j.at( 6 ).is_number() )
155 if( j.at( 7 ).is_number() )
158 if( j.at( 9 ).is_number() )
159 d.
inverted = j.at( 9 ).get<
int>() == 2;
164 if( !j.at( 1 ).is_object() )
167 nlohmann::json
config = j.at( 1 );
179 d.
name = j.value(
"name",
"" );
180 d.
uuid = j.value(
"uuid",
"" );
181 d.
id = j.value(
"id", 0 );
186 d.
name = j.value(
"name",
"" );
187 d.
sheets = j.value(
"sheets", std::vector<PRJ_SHEET>{} );
192 d.
schematic = j.value(
"schematic",
"" );
193 d.
pcb = j.value(
"pcb",
"" );
198 if( j.at(
"source" ).is_string() )
199 d.
source = j.at(
"source" ).get<wxString>();
201 if( j.contains(
"desc" ) )
202 d.
desc = j.at(
"desc" ).get<wxString>();
203 else if( j.contains(
"description" ) )
204 d.
desc = j.at(
"description" ).get<wxString>();
206 if( j.contains(
"display_title" ) )
207 d.
title = j.at(
"display_title" ).get<wxString>();
208 else if( j.contains(
"title" ) )
209 d.
title = j.at(
"title" ).get<wxString>();
211 if( j.at(
"version" ).is_string() )
212 d.
version = j.at(
"version" ).get<wxString>();
214 if( j.at(
"type" ).is_number() )
215 d.
type = j.at(
"type" );
217 if( j.at(
"tags" ).is_object() )
218 d.
tags = j.at(
"tags" );
220 if( j.find(
"custom_tags" ) != j.end() && j.at(
"custom_tags" ).is_object() )
226 if( j.at(
"source" ).is_string() )
227 d.
source = j.at(
"source" ).get<wxString>();
229 if( j.contains(
"desc" ) )
230 d.
desc = j.at(
"desc" ).get<wxString>();
231 else if( j.contains(
"description" ) )
232 d.
desc = j.at(
"description" ).get<wxString>();
234 if( j.contains(
"display_title" ) )
235 d.
title = j.at(
"display_title" ).get<wxString>();
236 else if( j.contains(
"title" ) )
237 d.
title = j.at(
"title" ).get<wxString>();
239 if( j.at(
"version" ).is_string() )
240 d.
version = j.at(
"version" ).get<wxString>();
242 if( j.at(
"type" ).is_number() )
243 d.
type = j.at(
"type" );
245 if( j.at(
"tags" ).is_object() )
246 d.
tags = j.at(
"tags" );
248 if( j.find(
"custom_tags" ) != j.end() && j.at(
"custom_tags" ).is_object() )
254 if( j.at(
"source" ).is_string() )
255 d.
source = j.at(
"source" ).get<wxString>();
257 if( j.contains(
"desc" ) )
259 else if( j.contains(
"description" ) )
260 d.
description = j.at(
"description" ).get<wxString>();
262 if( j.contains(
"display_title" ) )
263 d.
title = j.at(
"display_title" ).get<wxString>();
264 else if( j.contains(
"title" ) )
265 d.
title = j.at(
"title" ).get<wxString>();
267 if( j.at(
"version" ).is_string() )
268 d.
version = j.at(
"version" ).get<wxString>();
270 if( j.at(
"tags" ).is_object() )
271 d.
tags = j.at(
"tags" );
273 if( j.find(
"custom_tags" ) != j.end() && j.at(
"custom_tags" ).is_object() )
276 if( j.at(
"attributes" ).is_object() )
282 d.
objectId = j.at( 1 ).get<wxString>();
283 d.
url = j.at( 3 ).get<wxString>();
288 d.
pouredId = j.at( 1 ).get<wxString>();
289 d.
parentId = j.at( 2 ).get<wxString>();
290 d.
unki = j.at( 3 ).get<
int>();
291 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