From 7664d92028337b792525c12c2257d92524e77bf3 Mon Sep 17 00:00:00 2001 From: Quentin Freimanis Date: Thu, 17 Jul 2025 22:00:35 -0700 Subject: [PATCH] altium pcbs: import pad to die length and delay --- pcbnew/pcb_io/altium/altium_parser_pcb.cpp | 11 +++++++++++ pcbnew/pcb_io/altium/altium_parser_pcb.h | 3 +++ pcbnew/pcb_io/altium/altium_pcb.cpp | 3 +++ 3 files changed, 17 insertions(+) diff --git a/pcbnew/pcb_io/altium/altium_parser_pcb.cpp b/pcbnew/pcb_io/altium/altium_parser_pcb.cpp index d8cc640e0c..e0408c40b2 100644 --- a/pcbnew/pcb_io/altium/altium_parser_pcb.cpp +++ b/pcbnew/pcb_io/altium/altium_parser_pcb.cpp @@ -787,6 +787,9 @@ APAD6::APAD6( ALTIUM_BINARY_PARSER& aReader ) soldermaskexpansionmode = static_cast( aReader.Read() ); aReader.Skip( 3 ); // to 106 + pad_to_die_length = 0; + pad_to_die_delay = 0; + if( subrecord5 == 110 ) { // Don't know exactly what this is, but it's always been 0 in the files with @@ -820,6 +823,14 @@ APAD6::APAD6( ALTIUM_BINARY_PARSER& aReader ) { } + if( subrecord5 >= 202 ) + { + aReader.Skip( 40 ); + pad_to_die_length = aReader.ReadKicadUnit(); + aReader.Skip( 32 ); + pad_to_die_delay = KiROUND( aReader.Read() * 1e18 ); + } + aReader.SkipSubrecord(); // Subrecord 6 diff --git a/pcbnew/pcb_io/altium/altium_parser_pcb.h b/pcbnew/pcb_io/altium/altium_parser_pcb.h index 84c3384748..1350a5468a 100644 --- a/pcbnew/pcb_io/altium/altium_parser_pcb.h +++ b/pcbnew/pcb_io/altium/altium_parser_pcb.h @@ -681,6 +681,9 @@ struct APAD6 ALTIUM_LAYER tolayer; ALTIUM_LAYER fromlayer; + int32_t pad_to_die_length; + int32_t pad_to_die_delay; + std::unique_ptr sizeAndShape; explicit APAD6( ALTIUM_BINARY_PARSER& aReader ); diff --git a/pcbnew/pcb_io/altium/altium_pcb.cpp b/pcbnew/pcb_io/altium/altium_pcb.cpp index 5705dfb74e..c773f9da7b 100644 --- a/pcbnew/pcb_io/altium/altium_pcb.cpp +++ b/pcbnew/pcb_io/altium/altium_pcb.cpp @@ -3609,6 +3609,9 @@ void ALTIUM_PCB::ConvertPads6ToFootprintItemOnCopper( FOOTPRINT* aFootprint, con if( aElem.is_tent_bottom ) pad->SetLayerSet( pad->GetLayerSet().reset( B_Mask ) ); + pad->SetPadToDieLength( aElem.pad_to_die_length ); + pad->SetPadToDieDelay( aElem.pad_to_die_delay ); + aFootprint->Add( pad.release(), ADD_MODE::APPEND ); }