Browse Source

CADSTAR Schematic / PCB Archive Importers: Fix string formatting asserts

pull/16/head
Roberto Fernandez Bautista 5 years ago
parent
commit
6f5f6a0fba
  1. 8
      eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp
  2. 2
      eeschema/sch_plugins/cadstar/cadstar_sch_archive_parser.cpp
  3. 2
      pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp

8
eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp

@ -486,7 +486,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadNets()
std::map<NETELEMENT_ID, SCH_LABEL*> netlabels;
if( netName.IsEmpty() )
netName = wxString::Format( "$%d", net.SignalNum );
netName = wxString::Format( "$%d", int{ net.SignalNum } );
for( std::pair<NETELEMENT_ID, NET_SCH::SYM_TERM> terminalPair : net.Terminals )
@ -765,7 +765,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary( const SYMDEF_ID& aSymdef
for( std::pair<TERMINAL_ID, TERMINAL> termPair : symbol.Terminals )
{
TERMINAL term = termPair.second;
wxString pinNum = wxString::Format( "%d", term.ID );
wxString pinNum = wxString::Format( "%d", int{ term.ID } );
wxString pinName = wxEmptyString;
if( aCadstarPart )
@ -773,7 +773,7 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadSymDefIntoLibrary( const SYMDEF_ID& aSymdef
PART::DEFINITION::PIN csPin = getPartDefinitionPin( *aCadstarPart, aGateID, term.ID );
pinName = csPin.Name;
pinNum = wxString::Format( "%d", csPin.ID );
pinNum = wxString::Format( "%d", int{ csPin.ID } );
if( pinName.IsEmpty() )
{
@ -1148,7 +1148,7 @@ wxString CADSTAR_SCH_ARCHIVE_LOADER::getNetName( const NET_SCH& aNet )
wxString netname = aNet.Name;
if( netname.IsEmpty() )
netname = wxString::Format( "$%d", aNet.SignalNum );
netname = wxString::Format( "$%d", int{ aNet.SignalNum } );
return netname;
}

2
eeschema/sch_plugins/cadstar/cadstar_sch_archive_parser.cpp

@ -298,7 +298,7 @@ void CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL::Parse( XNODE* aNode )
TerminalCodeID = GetXmlAttributeIDString( aNode, 1 );
XNODE* cNode = aNode->GetChildren();
wxString location = wxString::Format( "TERMINAL %d", ID );
wxString location = wxString::Format( "TERMINAL %d", int{ ID } );
if( !cNode )
THROW_MISSING_NODE_IO_ERROR( wxT( "PT" ), location );

2
pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp

@ -1134,7 +1134,7 @@ void CADSTAR_PCB_ARCHIVE_PARSER::PAD::Parse( XNODE* aNode )
Side = GetPadSide( GetXmlAttributeIDString( aNode, 3 ) );
XNODE* cNode = aNode->GetChildren();
wxString location = wxString::Format( "PAD %d", ID );
wxString location = wxString::Format( "PAD %d", int{ ID } );
if( !cNode )
THROW_MISSING_NODE_IO_ERROR( wxT( "PT" ), location );

Loading…
Cancel
Save