From af280f80e0b50a311d82564cfd51a7bd6e340d72 Mon Sep 17 00:00:00 2001 From: Wayne Stambaugh Date: Wed, 8 Dec 2021 19:14:04 -0500 Subject: [PATCH] Fix debug assertion in Altium and CADSTAR schematic importers. --- .../sch_plugins/altium/sch_altium_plugin.cpp | 2 ++ .../cadstar/cadstar_sch_archive_loader.cpp | 20 +++++++++---------- .../cadstar/cadstar_sch_archive_plugin.cpp | 3 ++- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp index 63d55d453e..60af738418 100644 --- a/eeschema/sch_plugins/altium/sch_altium_plugin.cpp +++ b/eeschema/sch_plugins/altium/sch_altium_plugin.cpp @@ -177,6 +177,8 @@ SCH_SHEET* SCH_ALTIUM_PLUGIN::Load( const wxString& aFileName, SCHEMATIC* aSchem m_rootSheet = new SCH_SHEET( aSchematic ); m_rootSheet->SetFileName( fileName.GetFullPath() ); + aSchematic->SetRoot( m_rootSheet ); + SCH_SHEET_PATH sheetpath; sheetpath.push_back( m_rootSheet ); diff --git a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp index fc7adbbf08..dc97f1ee1c 100644 --- a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp +++ b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_loader.cpp @@ -103,25 +103,25 @@ void CADSTAR_SCH_ARCHIVE_LOADER::Load( SCHEMATIC* aSchematic, SCH_SHEET* aRootSh loadTextVariables(); // Load text variables right at the start to ensure bounding box // calculations work correctly for text items - checkPoint(); // Step 1 + checkPoint(); // Step 1 loadSheets(); - checkPoint(); // Step 2 + checkPoint(); // Step 2 loadHierarchicalSheetPins(); - checkPoint(); // Step 3 + checkPoint(); // Step 3 loadPartsLibrary(); - checkPoint(); // Step 4, Subdivided into extra steps + checkPoint(); // Step 4, Subdivided into extra steps loadSchematicSymbolInstances(); - checkPoint(); // Step 5 + checkPoint(); // Step 5 loadBusses(); - checkPoint(); // Step 6 + checkPoint(); // Step 6 loadNets(); - checkPoint(); // Step 7 + checkPoint(); // Step 7 loadFigures(); - checkPoint(); // Step 8 + checkPoint(); // Step 8 loadTexts(); - checkPoint(); // Step 9 + checkPoint(); // Step 9 loadDocumentationSymbols(); - checkPoint(); // Step 10 + checkPoint(); // Step 10 if( Schematic.VariantHierarchy.Variants.size() > 0 ) { diff --git a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_plugin.cpp b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_plugin.cpp index 86171477f5..e65989f37b 100644 --- a/eeschema/sch_plugins/cadstar/cadstar_sch_archive_plugin.cpp +++ b/eeschema/sch_plugins/cadstar/cadstar_sch_archive_plugin.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 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2020-2021 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 @@ -75,6 +75,7 @@ SCH_SHEET* CADSTAR_SCH_ARCHIVE_PLUGIN::Load( const wxString& aFileName, SCHEMATI { rootSheet = new SCH_SHEET( aSchematic ); rootSheet->SetFileName( aFileName ); + aSchematic->SetRoot( rootSheet ); }