EasyEDA Pro: don't fail on attributes for dimensions.

This commit is contained in:
Alex Shvartzkop 2023-09-29 12:17:30 +03:00
parent e34d95bb45
commit 3b28ba83c6
2 changed files with 8 additions and 1 deletions

View File

@ -68,7 +68,11 @@ void EASYEDAPRO::from_json( const nlohmann::json& j, EASYEDAPRO::PCB_ATTR& d )
d.position = VECTOR2D( j.at( 5 ), j.at( 6 ) ); d.position = VECTOR2D( j.at( 5 ), j.at( 6 ) );
d.key = j.at( 7 ).get<wxString>(); d.key = j.at( 7 ).get<wxString>();
d.value = j.at( 8 ).get<wxString>();
if( j.at( 8 ).is_string() )
d.value = j.at( 8 ).get<wxString>();
else if( j.at( 8 ).is_number_integer() )
d.value << ( j.at( 8 ).get<int>() );
if( j.at( 9 ).is_number() ) if( j.at( 9 ).is_number() )
d.keyVisible = j.at( 9 ).get<int>(); d.keyVisible = j.at( 9 ).get<int>();

View File

@ -1542,6 +1542,9 @@ void PCB_EASYEDAPRO_PARSER::ParseBoard(
} }
} }
if( deviceId.empty() )
continue;
nlohmann::json compAttrs = aProject.at( "devices" ).at( deviceId ).at( "attributes" ); nlohmann::json compAttrs = aProject.at( "devices" ).at( deviceId ).at( "attributes" );
wxString fpId; wxString fpId;