CADSTAR Schematic Archive Importer: Parse SCALE token in Symbol and warn user this is not supported

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6463
This commit is contained in:
Roberto Fernandez Bautista 2020-11-23 20:54:34 +00:00 committed by jean-pierre charras
parent a058e26ddc
commit d2fbe12cfd
3 changed files with 21 additions and 0 deletions

View File

@ -449,6 +449,20 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadSchematicSymbolInstances()
"net power / symbol. The symbol was not loaded." ), "net power / symbol. The symbol was not loaded." ),
sym.ID ) ); sym.ID ) );
} }
if( sym.ScaleRatioDenominator != 1 || sym.ScaleRatioNumerator != 1 )
{
wxString symbolName = sym.ComponentRef.Designator;
if( symbolName.empty() )
symbolName = wxString::Format( "ID: %s", sym.ID);
wxLogError( wxString::Format(
_( "Symbol '%s' is scaled in the original CADSTAR schematic but this is not"
"supported in KiCad. The symbol was loaded with 1:1 scale and may require "
"manual fixing." ),
symbolName, sym.PartRef.RefID ) );
}
} }
} }

View File

@ -677,6 +677,11 @@ void CADSTAR_SCH_ARCHIVE_PARSER::SYMBOL::Parse( XNODE* aNode )
{ {
Fixed = true; Fixed = true;
} }
else if( cNodeName == wxT( "SCALE" ) )
{
ScaleRatioNumerator = GetXmlAttributeIDLong( cNode, 0 );
ScaleRatioDenominator = GetXmlAttributeIDLong( cNode, 1 );
}
else if( cNodeName == wxT( "READABILITY" ) ) else if( cNodeName == wxT( "READABILITY" ) )
{ {
Readability = ParseReadability( cNode ); Readability = ParseReadability( cNode );

View File

@ -260,6 +260,8 @@ public:
long OrientAngle = 0; long OrientAngle = 0;
bool Mirror = false; bool Mirror = false;
bool Fixed = false; bool Fixed = false;
long ScaleRatioNumerator = 1; ///< Symbols can be arbitrarily scaled in CADSTAR
long ScaleRatioDenominator = 1;
READABILITY Readability = READABILITY::BOTTOM_TO_TOP; READABILITY Readability = READABILITY::BOTTOM_TO_TOP;
bool IsComponent = false; bool IsComponent = false;