Fix Altium schematic import bug.
This commit is contained in:
parent
3460c50afa
commit
ef624199cd
|
@ -136,6 +136,7 @@ ASCH_SYMBOL::ASCH_SYMBOL( const std::map<wxString, wxString>& aProps )
|
||||||
|
|
||||||
partcount = ALTIUM_PARSER::ReadInt( aProps, "PARTCOUNT", 0 );
|
partcount = ALTIUM_PARSER::ReadInt( aProps, "PARTCOUNT", 0 );
|
||||||
displaymodecount = ALTIUM_PARSER::ReadInt( aProps, "DISPLAYMODECOUNT", 0 );
|
displaymodecount = ALTIUM_PARSER::ReadInt( aProps, "DISPLAYMODECOUNT", 0 );
|
||||||
|
m_indexInSheet = ALTIUM_PARSER::ReadInt( aProps, "INDEXINSHEET", -1 );
|
||||||
displaymode = ALTIUM_PARSER::ReadInt( aProps, "DISPLAYMODE", 0 );
|
displaymode = ALTIUM_PARSER::ReadInt( aProps, "DISPLAYMODE", 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -133,6 +133,7 @@ struct ASCH_SHAPE_INTERFACE
|
||||||
struct ASCH_SYMBOL
|
struct ASCH_SYMBOL
|
||||||
{
|
{
|
||||||
int currentpartid;
|
int currentpartid;
|
||||||
|
int m_indexInSheet;
|
||||||
wxString libreference;
|
wxString libreference;
|
||||||
wxString sourcelibraryname;
|
wxString sourcelibraryname;
|
||||||
wxString componentdescription;
|
wxString componentdescription;
|
||||||
|
|
|
@ -480,8 +480,8 @@ void SCH_ALTIUM_PLUGIN::ParseAdditional( const ALTIUM_COMPOUND_FILE& aAltiumSchF
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
m_reporter->Report( wxString::Format( _( "Unknown or unexpected record found inside "
|
m_reporter->Report( wxString::Format( _( "Unknown or unexpected record ID %d found "
|
||||||
"\"Additional\" section, Record id: %d." ),
|
"inside \"Additional\" section." ),
|
||||||
recordId ),
|
recordId ),
|
||||||
RPT_SEVERITY_ERROR );
|
RPT_SEVERITY_ERROR );
|
||||||
break;
|
break;
|
||||||
|
@ -553,7 +553,7 @@ void SCH_ALTIUM_PLUGIN::ParseFileHeader( const ALTIUM_COMPOUND_FILE& aAltiumSchF
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ALTIUM_SCH_RECORD::IEEE_SYMBOL:
|
case ALTIUM_SCH_RECORD::IEEE_SYMBOL:
|
||||||
m_reporter->Report( _( "Record 'IEEE_SYMBOL' no handled. Skipped." ),
|
m_reporter->Report( _( "Record 'IEEE_SYMBOL' not handled." ),
|
||||||
RPT_SEVERITY_INFO );
|
RPT_SEVERITY_INFO );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -578,7 +578,7 @@ void SCH_ALTIUM_PLUGIN::ParseFileHeader( const ALTIUM_COMPOUND_FILE& aAltiumSchF
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ALTIUM_SCH_RECORD::PIECHART:
|
case ALTIUM_SCH_RECORD::PIECHART:
|
||||||
m_reporter->Report( _( "Record 'PIECHART' no handled. Skipped." ),
|
m_reporter->Report( _( "Record 'PIECHART' not handled." ),
|
||||||
RPT_SEVERITY_INFO );
|
RPT_SEVERITY_INFO );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -704,8 +704,8 @@ void SCH_ALTIUM_PLUGIN::ParseFileHeader( const ALTIUM_COMPOUND_FILE& aAltiumSchF
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
m_reporter->Report( wxString::Format( _( "Unknown or unexpected record found inside "
|
m_reporter->Report( wxString::Format( _( "Unknown or unexpected record id %d found "
|
||||||
"\"FileHeader\" section, Record id: %d." ),
|
"inside \"FileHeader\" section." ),
|
||||||
recordId ),
|
recordId ),
|
||||||
RPT_SEVERITY_ERROR );
|
RPT_SEVERITY_ERROR );
|
||||||
break;
|
break;
|
||||||
|
@ -746,7 +746,7 @@ void SCH_ALTIUM_PLUGIN::ParseFileHeader( const ALTIUM_COMPOUND_FILE& aAltiumSchF
|
||||||
ParsePort( port );
|
ParsePort( port );
|
||||||
|
|
||||||
m_altiumPortsCurrentSheet.clear();
|
m_altiumPortsCurrentSheet.clear();
|
||||||
|
m_altiumComponents.clear();
|
||||||
m_symbols.clear();
|
m_symbols.clear();
|
||||||
m_libSymbols.clear();
|
m_libSymbols.clear();
|
||||||
|
|
||||||
|
@ -790,9 +790,6 @@ const ASCH_STORAGE_FILE* SCH_ALTIUM_PLUGIN::GetFileFromStorage( const wxString&
|
||||||
void SCH_ALTIUM_PLUGIN::ParseComponent( int aIndex,
|
void SCH_ALTIUM_PLUGIN::ParseComponent( int aIndex,
|
||||||
const std::map<wxString, wxString>& aProperties )
|
const std::map<wxString, wxString>& aProperties )
|
||||||
{
|
{
|
||||||
auto pair = m_altiumComponents.insert( { aIndex, ASCH_SYMBOL( aProperties ) } );
|
|
||||||
const ASCH_SYMBOL& elem = pair.first->second;
|
|
||||||
|
|
||||||
SCH_SHEET* currentSheet = m_sheetPath.Last();
|
SCH_SHEET* currentSheet = m_sheetPath.Last();
|
||||||
wxCHECK( currentSheet, /* void */ );
|
wxCHECK( currentSheet, /* void */ );
|
||||||
|
|
||||||
|
@ -801,6 +798,24 @@ void SCH_ALTIUM_PLUGIN::ParseComponent( int aIndex,
|
||||||
if( sheetName.IsEmpty() )
|
if( sheetName.IsEmpty() )
|
||||||
sheetName = wxT( "root" );
|
sheetName = wxT( "root" );
|
||||||
|
|
||||||
|
ASCH_SYMBOL altiumSymbol( aProperties );
|
||||||
|
|
||||||
|
if( m_altiumComponents.count( aIndex ) )
|
||||||
|
{
|
||||||
|
const ASCH_SYMBOL& currentSymbol = m_altiumComponents.at( aIndex );
|
||||||
|
|
||||||
|
m_reporter->Report( wxString::Format( _( "Symbol \"%s\" in sheet \"%s\" at index %d "
|
||||||
|
"replaced with symbol \"%s\"." ),
|
||||||
|
currentSymbol.libreference,
|
||||||
|
sheetName,
|
||||||
|
aIndex,
|
||||||
|
altiumSymbol.libreference ),
|
||||||
|
RPT_SEVERITY_ERROR );
|
||||||
|
}
|
||||||
|
|
||||||
|
auto pair = m_altiumComponents.insert( { aIndex, altiumSymbol } );
|
||||||
|
const ASCH_SYMBOL& elem = pair.first->second;
|
||||||
|
|
||||||
// TODO: this is a hack until we correctly apply all transformations to every element
|
// TODO: this is a hack until we correctly apply all transformations to every element
|
||||||
wxString name = wxString::Format( "%s_%d%s_%s",
|
wxString name = wxString::Format( "%s_%d%s_%s",
|
||||||
sheetName,
|
sheetName,
|
||||||
|
|
Loading…
Reference in New Issue