From 02c1eef3be31d55f5484512f8dd512b421a9e22d Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 26 Apr 2024 09:56:33 +0100 Subject: [PATCH] Simplify parsing of alt pin definitions. --- eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.cpp | 8 +++----- eeschema/sch_pin.cpp | 4 +++- eeschema/sch_pin.h | 3 ++- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.cpp b/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.cpp index 54db6948b0..afdc48a0b4 100644 --- a/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.cpp +++ b/eeschema/sch_io/kicad_sexpr/sch_io_kicad_sexpr_parser.cpp @@ -3172,12 +3172,10 @@ SCH_SYMBOL* SCH_IO_KICAD_SEXPR_PARSER::parseSchematicSymbol() } } - symbol->GetRawPins().emplace_back( std::make_unique( symbol.get(), - number, alt ) ); - - const_cast( symbol->GetRawPins().back()->m_Uuid ) = uuid; - } + symbol->GetRawPins().emplace_back( std::make_unique( symbol.get(), number, + alt, uuid ) ); break; + } default: Expecting( "lib_id, lib_name, at, mirror, uuid, on_board, in_bom, dnp, " diff --git a/eeschema/sch_pin.cpp b/eeschema/sch_pin.cpp index 86e10157f0..c33c152355 100644 --- a/eeschema/sch_pin.cpp +++ b/eeschema/sch_pin.cpp @@ -172,7 +172,8 @@ SCH_PIN::SCH_PIN( SCH_SYMBOL* aParentSymbol, SCH_PIN* aLibPin ) : * Create a proxy pin from an alternate pin designation. * The SCH_PIN data will be filled in when the pin is resolved (see SCH_SYMBOL::UpdatePins). */ -SCH_PIN::SCH_PIN( SCH_SYMBOL* aParentSymbol, const wxString& aNumber, const wxString& aAlt ) : +SCH_PIN::SCH_PIN( SCH_SYMBOL* aParentSymbol, const wxString& aNumber, const wxString& aAlt, + const KIID& aUuid ) : SCH_ITEM( aParentSymbol, SCH_PIN_T ), m_libPin( nullptr ), m_orientation( PIN_ORIENTATION::INHERIT ), @@ -184,6 +185,7 @@ SCH_PIN::SCH_PIN( SCH_SYMBOL* aParentSymbol, const wxString& aNumber, const wxSt { wxASSERT( aParentSymbol ); + const_cast( m_Uuid ) = aUuid; m_layer = LAYER_PIN; } diff --git a/eeschema/sch_pin.h b/eeschema/sch_pin.h index 7d628921e1..28a511d2d0 100644 --- a/eeschema/sch_pin.h +++ b/eeschema/sch_pin.h @@ -53,7 +53,8 @@ public: SCH_PIN( SCH_SYMBOL* aParentSymbol, SCH_PIN* aLibPin ); - SCH_PIN( SCH_SYMBOL* aParentSymbol, const wxString& aNumber, const wxString& aAlt ); + SCH_PIN( SCH_SYMBOL* aParentSymbol, const wxString& aNumber, const wxString& aAlt, + const KIID& aUuid ); SCH_PIN( const SCH_PIN& aPin );