From 738b36cf7d2ef2ab6995f577b439a88152b32f33 Mon Sep 17 00:00:00 2001 From: Roberto Fernandez Bautista Date: Sun, 5 Mar 2023 14:56:18 +0100 Subject: [PATCH] CADSTAR csa / cpa ignore Hierarchy This node doesn't have any equivalent in KiCad so for now we ignore it. In future, we could parse it in detail, to obtain the tree-structure of symbols/footprints in a cadstar library --- .../sch_plugins/cadstar/cadstar_sch_archive_parser.cpp | 10 +++++++++- pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_parser.cpp b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_parser.cpp index 524363cbb9..ca9bb2e8cc 100644 --- a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_parser.cpp +++ b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_parser.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2020-2021 Roberto Fernandez Bautista - * Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -457,6 +457,14 @@ void CADSTAR_SCH_ARCHIVE_PARSER::LIBRARY_SCM::Parse( XNODE* aNode, PARSER_CONTEX symdef.Parse( cNode, aContext ); SymbolDefinitions.insert( std::make_pair( symdef.ID, symdef ) ); } + else if( cNodeName == wxT( "HIERARCHY" ) ) + { + // Ignore for now + // + // This node doesn't have any equivalent in KiCad so for now we ignore it. In + // future, we could parse it in detail, to obtain the tree-structure of + // symbols in a cadstar library + } else { THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, aNode->GetName() ); diff --git a/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp b/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp index c848b8d2da..c2bd3f208f 100644 --- a/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp +++ b/pcbnew/plugins/cadstar/cadstar_pcb_archive_parser.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2020 Roberto Fernandez Bautista - * Copyright (C) 2020-2021 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -1618,6 +1618,14 @@ void CADSTAR_PCB_ARCHIVE_PARSER::LIBRARY::Parse( XNODE* aNode, PARSER_CONTEXT* a symdef.Parse( cNode, aContext ); ComponentDefinitions.insert( std::make_pair( symdef.ID, symdef ) ); } + else if( cNodeName == wxT( "HIERARCHY" ) ) + { + // Ignore for now + // + // This node doesn't have any equivalent in KiCad so for now we ignore it. In + // future, we could parse it in detail, to obtain the tree-structure of + // footprints in a cadstar library + } else { THROW_UNKNOWN_NODE_IO_ERROR( cNodeName, aNode->GetName() );