altium: import component image only if part id matches
This commit is contained in:
parent
b72cc23a00
commit
f4e22cdcdb
|
@ -726,6 +726,7 @@ ASCH_IMAGE::ASCH_IMAGE( const std::map<wxString, wxString>& aProps )
|
||||||
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::IMAGE );
|
wxASSERT( ReadRecord( aProps ) == ALTIUM_SCH_RECORD::IMAGE );
|
||||||
|
|
||||||
indexinsheet = ALTIUM_PARSER::ReadInt( aProps, "INDEXINSHEET", 0 );
|
indexinsheet = ALTIUM_PARSER::ReadInt( aProps, "INDEXINSHEET", 0 );
|
||||||
|
ownerindex = ReadOwnerIndex( aProps );
|
||||||
ownerpartid = ReadOwnerPartId( aProps );
|
ownerpartid = ReadOwnerPartId( aProps );
|
||||||
|
|
||||||
filename = ALTIUM_PARSER::ReadString( aProps, "FILENAME", "" );
|
filename = ALTIUM_PARSER::ReadString( aProps, "FILENAME", "" );
|
||||||
|
|
|
@ -704,6 +704,7 @@ struct ASCH_JUNCTION
|
||||||
struct ASCH_IMAGE
|
struct ASCH_IMAGE
|
||||||
{
|
{
|
||||||
int indexinsheet;
|
int indexinsheet;
|
||||||
|
int ownerindex;
|
||||||
int ownerpartid;
|
int ownerpartid;
|
||||||
|
|
||||||
wxString filename;
|
wxString filename;
|
||||||
|
|
|
@ -2724,6 +2724,13 @@ void SCH_ALTIUM_PLUGIN::ParseImage( const std::map<wxString, wxString>& aPropert
|
||||||
{
|
{
|
||||||
ASCH_IMAGE elem( aProperties );
|
ASCH_IMAGE elem( aProperties );
|
||||||
|
|
||||||
|
const auto& component = m_altiumComponents.find( elem.ownerindex );
|
||||||
|
|
||||||
|
//Hide the image if it is owned by a component but the part id do not match
|
||||||
|
if( component != m_altiumComponents.end()
|
||||||
|
&& component->second.currentpartid != elem.ownerpartid )
|
||||||
|
return;
|
||||||
|
|
||||||
VECTOR2I center = ( elem.location + elem.corner ) / 2 + m_sheetOffset;
|
VECTOR2I center = ( elem.location + elem.corner ) / 2 + m_sheetOffset;
|
||||||
std::unique_ptr<SCH_BITMAP> bitmap = std::make_unique<SCH_BITMAP>( center );
|
std::unique_ptr<SCH_BITMAP> bitmap = std::make_unique<SCH_BITMAP>( center );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue