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:
parent
a058e26ddc
commit
d2fbe12cfd
|
@ -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 ) );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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 );
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue