CADSTAR Schematic: Hide all KiCad sheet properties

Sheet name/filename not applicable in CADSTAR so displaying it just
makes the import look messy.
This commit is contained in:
Roberto Fernandez Bautista 2021-10-17 18:31:42 +01:00
parent 927b633c01
commit 3ea3d5274c
1 changed files with 11 additions and 9 deletions

View File

@ -2190,17 +2190,18 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadChildSheets( LAYER_ID aCadstarSheetID,
loadSheetAndChildSheets( block.AssocLayerID, blockExtents.first, blockExtents.second, loadSheetAndChildSheets( block.AssocLayerID, blockExtents.first, blockExtents.second,
aSheet ); aSheet );
// Hide all KiCad sheet properties (sheet name/filename is not applicable in CADSTAR)
SCH_SHEET* loadedSheet = m_sheetMap.at( block.AssocLayerID );
SCH_FIELDS fields = loadedSheet->GetFields();
for( SCH_FIELD& field : fields )
{
field.SetVisible( false );
}
if( block.HasBlockLabel ) if( block.HasBlockLabel )
{ {
// Add the block label as a separate field // Add the block label as a separate field
SCH_SHEET* loadedSheet = m_sheetMap.at( block.AssocLayerID );
SCH_FIELDS fields = loadedSheet->GetFields();
for( SCH_FIELD& field : fields )
{
field.SetVisible( false );
}
SCH_FIELD blockNameField( getKiCadPoint( block.BlockLabel.Position ), 2, SCH_FIELD blockNameField( getKiCadPoint( block.BlockLabel.Position ), 2,
loadedSheet, wxString( "Block name" ) ); loadedSheet, wxString( "Block name" ) );
blockNameField.SetText( block.Name ); blockNameField.SetText( block.Name );
@ -2214,8 +2215,9 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadChildSheets( LAYER_ID aCadstarSheetID,
block.BlockLabel.Mirror ); block.BlockLabel.Mirror );
fields.push_back( blockNameField ); fields.push_back( blockNameField );
loadedSheet->SetFields( fields );
} }
loadedSheet->SetFields( fields );
} }
} }
} }