CADSTAR Schematic Archive Importer: Fix parsing of TERMINAL_SHAPE

TRIANGLE shape and a few others do not have a "right length",
only a "length".
Fixes the error "Missing Parameter ‘2’ in ‘TRIANGLE’".
This commit is contained in:
Roberto Fernandez Bautista 2021-02-08 08:06:41 +00:00 committed by Wayne Stambaugh
parent 06c420a2a3
commit 7c06bdbd2e
2 changed files with 6 additions and 3 deletions

View File

@ -199,7 +199,7 @@ void CADSTAR_SCH_ARCHIVE_PARSER::TERMINAL_SHAPE::Parse( XNODE* aNode, PARSER_CON
case TERMINAL_SHAPE_TYPE::POINTER:
case TERMINAL_SHAPE_TYPE::RECTANGLE:
case TERMINAL_SHAPE_TYPE::TRIANGLE:
RightLength = GetXmlAttributeIDLong( aNode, 2 );
RightLength = GetXmlAttributeIDLong( aNode, 2, false ); // Optional
LeftLength = GetXmlAttributeIDLong( aNode, 1 );
break;

View File

@ -83,8 +83,11 @@ public:
{
TERMINAL_SHAPE_TYPE ShapeType;
long Size = UNDEFINED_VALUE;
long LeftLength = UNDEFINED_VALUE;
long RightLength = UNDEFINED_VALUE;
// Note in the CADSTAR GUI, it only talks about "length", but the file seems to
// split it in "left length" and "right length" (similar to PADCODE in the PCB)
// for some terminal shapes such as RECTANGLE but not for others, such as TRIANGLE
long LeftLength = UNDEFINED_VALUE; ///< Might also be total length
long RightLength = UNDEFINED_VALUE; ///< Could be blank
long InternalFeature = UNDEFINED_VALUE;
long OrientAngle = 0; ///< 1/1000 of a Degree