From ad625d8d76a221337d458da18ec57d9e654fd081 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Fri, 24 Jul 2020 15:42:23 -0700 Subject: [PATCH] Add missing KIID to edge_module In order to support grouping in the footprint editor, we need full KIIDs stored with the footprint elements. --- pcbnew/kicad_plugin.cpp | 4 ++++ pcbnew/kicad_plugin.h | 3 ++- pcbnew/pcb_parser.cpp | 10 +++++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index 442d05ec37..b6411f9160 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -865,6 +865,8 @@ void PCB_IO::format( EDGE_MODULE* aModuleDrawing, int aNestLevel ) const m_out->Print( 0, " (width %s)", FormatInternalUnits( aModuleDrawing->GetWidth() ).c_str() ); + m_out->Print( 0, " (tstamp %s)", TO_UTF8( aModuleDrawing->m_Uuid.AsString() ) ); + m_out->Print( 0, ")\n" ); } @@ -1529,6 +1531,8 @@ void PCB_IO::format( TEXTE_MODULE* aText, int aNestLevel ) const aText->EDA_TEXT::Format( m_out, aNestLevel, m_ctl | CTL_OMIT_HIDE ); + m_out->Print( aNestLevel + 1, "(tstamp %s)\n", TO_UTF8( aText->m_Uuid.AsString() ) ); + m_out->Print( aNestLevel, ")\n" ); } diff --git a/pcbnew/kicad_plugin.h b/pcbnew/kicad_plugin.h index 2366e7c45a..1ccedde536 100644 --- a/pcbnew/kicad_plugin.h +++ b/pcbnew/kicad_plugin.h @@ -71,7 +71,8 @@ class TEXTE_PCB; //#define SEXPR_BOARD_FILE_VERSION 20200518 // save hole_to_hole_min //#define SEXPR_BOARD_FILE_VERSION 20200614 // Add support for fp_rects and gr_rects //#define SEXPR_BOARD_FILE_VERSION 20200625 // Multilayer zones, zone names, island controls -#define SEXPR_BOARD_FILE_VERSION 20200628 // remove visibility settings +//#define SEXPR_BOARD_FILE_VERSION 20200628 // remove visibility settings +#define SEXPR_BOARD_FILE_VERSION 20200724 // Add KIID to module components #define CTL_STD_LAYER_NAMES (1 << 0) ///< Use English Standard layer names #define CTL_OMIT_NETS (1 << 1) ///< Omit pads net names (useless in library) diff --git a/pcbnew/pcb_parser.cpp b/pcbnew/pcb_parser.cpp index 80e86f5c94..3728504745 100644 --- a/pcbnew/pcb_parser.cpp +++ b/pcbnew/pcb_parser.cpp @@ -2635,11 +2635,13 @@ MODULE* PCB_PARSER::parseMODULE_unchecked( wxArrayString* aInitialComments ) { case TEXTE_MODULE::TEXT_is_REFERENCE: module->Reference() = *text; + const_cast( module->Reference().m_Uuid ) = text->m_Uuid; delete text; break; case TEXTE_MODULE::TEXT_is_VALUE: module->Value() = *text; + const_cast( module->Value().m_Uuid ) = text->m_Uuid; delete text; break; @@ -2807,8 +2809,14 @@ TEXTE_MODULE* PCB_PARSER::parseTEXTE_MODULE() parseEDA_TEXT( (EDA_TEXT*) text.get() ); break; + case T_tstamp: + NextTok(); + const_cast( text->m_Uuid ) = KIID( CurStr() ); + NeedRIGHT(); + break; + default: - Expecting( "hide or effects" ); + Expecting( "layer, hide, effects or tstamp" ); } }