From 7c06bdbd2edab13c7862681089d1d23b25519b46 Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Mon, 8 Feb 2021 08:06:41 +0000 Subject: [PATCH] =?UTF-8?q?CADSTAR=20Schematic=20Archive=20Importer:=20Fix?= =?UTF-8?q?=20parsing=20of=20TERMINAL=5FSHAPE=20TRIANGLE=20shape=20and=20a?= =?UTF-8?q?=20few=20others=20do=20not=20have=20a=20"right=20length",=20onl?= =?UTF-8?q?y=20a=20"length".=20Fixes=20the=20error=20"Missing=20Parameter?= =?UTF-8?q?=20=E2=80=982=E2=80=99=20in=20=E2=80=98TRIANGLE=E2=80=99".?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sch_plugins/cadstar/cadstar_sch_archive_parser.cpp | 2 +- eeschema/sch_plugins/cadstar/cadstar_sch_archive_parser.h | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_parser.cpp b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_parser.cpp index 9f51c21982..70162420fc 100644 --- a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_parser.cpp +++ b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_parser.cpp @@ -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; diff --git a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_parser.h b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_parser.h index 92eb4b7c0e..dd7bc2042f 100644 --- a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_parser.h +++ b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_parser.h @@ -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