EasyEDA (JLCEDA) Pro: fix PCB parse error.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16544
This commit is contained in:
parent
120937b6b0
commit
4f9fbd230d
|
@ -589,7 +589,12 @@ std::unique_ptr<PAD> PCB_IO_EASYEDAPRO_PARSER::createPAD( FOOTPRINT*
|
||||||
const nlohmann::json& line )
|
const nlohmann::json& line )
|
||||||
{
|
{
|
||||||
wxString uuid = line.at( 1 );
|
wxString uuid = line.at( 1 );
|
||||||
int unk = line.at( 2 ).get<int>();
|
|
||||||
|
// if( line.at( 2 ).is_number() )
|
||||||
|
// int unk = line.at( 2 ).get<int>();
|
||||||
|
// else if( line.at( 2 ).is_string() )
|
||||||
|
// int unk = wxAtoi( line.at( 2 ).get<wxString>() );
|
||||||
|
|
||||||
wxString netname = line.at( 3 );
|
wxString netname = line.at( 3 );
|
||||||
int layer = line.at( 4 ).get<int>();
|
int layer = line.at( 4 ).get<int>();
|
||||||
PCB_LAYER_ID klayer = LayerToKi( layer );
|
PCB_LAYER_ID klayer = LayerToKi( layer );
|
||||||
|
@ -746,7 +751,12 @@ FOOTPRINT* PCB_IO_EASYEDAPRO_PARSER::ParseFootprint( const nlohmann::json&
|
||||||
|| type == wxS( "ATTR" ) )
|
|| type == wxS( "ATTR" ) )
|
||||||
{
|
{
|
||||||
wxString uuid = line.at( 1 );
|
wxString uuid = line.at( 1 );
|
||||||
int unk = line.at( 2 ).get<int>();
|
|
||||||
|
// if( line.at( 2 ).is_number() )
|
||||||
|
// int unk = line.at( 2 ).get<int>();
|
||||||
|
// else if( line.at( 2 ).is_string() )
|
||||||
|
// int unk = wxAtoi( line.at( 2 ).get<wxString>() );
|
||||||
|
|
||||||
wxString netname = line.at( 3 );
|
wxString netname = line.at( 3 );
|
||||||
int layer = line.at( 4 ).get<int>();
|
int layer = line.at( 4 ).get<int>();
|
||||||
PCB_LAYER_ID klayer = LayerToKi( layer );
|
PCB_LAYER_ID klayer = LayerToKi( layer );
|
||||||
|
@ -838,7 +848,11 @@ FOOTPRINT* PCB_IO_EASYEDAPRO_PARSER::ParseFootprint( const nlohmann::json&
|
||||||
else if( type == wxS( "REGION" ) )
|
else if( type == wxS( "REGION" ) )
|
||||||
{
|
{
|
||||||
wxString uuid = line.at( 1 );
|
wxString uuid = line.at( 1 );
|
||||||
int unk = line.at( 2 ).get<int>();
|
|
||||||
|
// if( line.at( 2 ).is_number() )
|
||||||
|
// int unk = line.at( 2 ).get<int>();
|
||||||
|
// else if( line.at( 2 ).is_string() )
|
||||||
|
// int unk = wxAtoi( line.at( 2 ).get<wxString>() );
|
||||||
|
|
||||||
int layer = line.at( 3 ).get<int>();
|
int layer = line.at( 3 ).get<int>();
|
||||||
PCB_LAYER_ID klayer = LayerToKi( layer );
|
PCB_LAYER_ID klayer = LayerToKi( layer );
|
||||||
|
@ -1012,7 +1026,12 @@ void PCB_IO_EASYEDAPRO_PARSER::ParseBoard(
|
||||||
|| type == wxS( "POLY" ) || type == wxS( "FILL" ) || type == wxS( "POUR" ) )
|
|| type == wxS( "POLY" ) || type == wxS( "FILL" ) || type == wxS( "POUR" ) )
|
||||||
{
|
{
|
||||||
wxString uuid = line.at( 1 );
|
wxString uuid = line.at( 1 );
|
||||||
int unk = line.at( 2 ).get<int>();
|
|
||||||
|
// if( line.at( 2 ).is_number() )
|
||||||
|
// int unk = line.at( 2 ).get<int>();
|
||||||
|
// else if( line.at( 2 ).is_string() )
|
||||||
|
// int unk = wxAtoi( line.at( 2 ).get<wxString>() );
|
||||||
|
|
||||||
wxString netname = line.at( 3 );
|
wxString netname = line.at( 3 );
|
||||||
|
|
||||||
if( type == wxS( "VIA" ) )
|
if( type == wxS( "VIA" ) )
|
||||||
|
@ -1304,7 +1323,11 @@ void PCB_IO_EASYEDAPRO_PARSER::ParseBoard(
|
||||||
else if( type == wxS( "REGION" ) )
|
else if( type == wxS( "REGION" ) )
|
||||||
{
|
{
|
||||||
wxString uuid = line.at( 1 );
|
wxString uuid = line.at( 1 );
|
||||||
int unk = line.at( 2 ).get<int>();
|
|
||||||
|
// if( line.at( 2 ).is_number() )
|
||||||
|
// int unk = line.at( 2 ).get<int>();
|
||||||
|
// else if( line.at( 2 ).is_string() )
|
||||||
|
// int unk = wxAtoi( line.at( 2 ).get<wxString>() );
|
||||||
|
|
||||||
int layer = line.at( 3 ).get<int>();
|
int layer = line.at( 3 ).get<int>();
|
||||||
PCB_LAYER_ID klayer = LayerToKi( layer );
|
PCB_LAYER_ID klayer = LayerToKi( layer );
|
||||||
|
@ -1366,7 +1389,11 @@ void PCB_IO_EASYEDAPRO_PARSER::ParseBoard(
|
||||||
else if( type == wxS( "IMAGE" ) )
|
else if( type == wxS( "IMAGE" ) )
|
||||||
{
|
{
|
||||||
wxString uuid = line.at( 1 );
|
wxString uuid = line.at( 1 );
|
||||||
int unk = line.at( 2 ).get<int>();
|
|
||||||
|
// if( line.at( 2 ).is_number() )
|
||||||
|
// int unk = line.at( 2 ).get<int>();
|
||||||
|
// else if( line.at( 2 ).is_string() )
|
||||||
|
// int unk = wxAtoi( line.at( 2 ).get<wxString>() );
|
||||||
|
|
||||||
int layer = line.at( 3 ).get<int>();
|
int layer = line.at( 3 ).get<int>();
|
||||||
PCB_LAYER_ID klayer = LayerToKi( layer );
|
PCB_LAYER_ID klayer = LayerToKi( layer );
|
||||||
|
@ -1443,7 +1470,11 @@ void PCB_IO_EASYEDAPRO_PARSER::ParseBoard(
|
||||||
else if( type == wxS( "STRING" ) )
|
else if( type == wxS( "STRING" ) )
|
||||||
{
|
{
|
||||||
wxString uuid = line.at( 1 );
|
wxString uuid = line.at( 1 );
|
||||||
int unk = line.at( 2 );
|
|
||||||
|
// if( line.at( 2 ).is_number() )
|
||||||
|
// int unk = line.at( 2 ).get<int>();
|
||||||
|
// else if( line.at( 2 ).is_string() )
|
||||||
|
// int unk = wxAtoi( line.at( 2 ).get<wxString>() );
|
||||||
|
|
||||||
int layer = line.at( 3 ).get<int>();
|
int layer = line.at( 3 ).get<int>();
|
||||||
PCB_LAYER_ID klayer = LayerToKi( layer );
|
PCB_LAYER_ID klayer = LayerToKi( layer );
|
||||||
|
|
Loading…
Reference in New Issue