From 5896723c608065980aa5997977c0ea4738699e61 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Wed, 14 Mar 2018 09:55:03 +0100 Subject: [PATCH] Eagle PCB import: handle smd.{stop,cream} and pad.stop attributes --- pcbnew/eagle_plugin.cpp | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pcbnew/eagle_plugin.cpp b/pcbnew/eagle_plugin.cpp index 7ae521d461..6aa112e8b2 100644 --- a/pcbnew/eagle_plugin.cpp +++ b/pcbnew/eagle_plugin.cpp @@ -1674,10 +1674,12 @@ void EAGLE_PLUGIN::packageSMD( MODULE* aModule, wxXmlNode* aTree ) const } // Solder paste (only for SMD pads) - int solderPasteSize = m_rules->mvCreamFrame * std::min( padSize.x, padSize.y ); - solderPasteSize = std::min( solderPasteSize, m_rules->mlMaxCreamFrame ); - solderPasteSize = std::max( solderPasteSize, m_rules->mlMinCreamFrame ); - pad->SetLocalSolderPasteMargin( solderPasteSize ); + if( !e.cream || !*e.cream ) // enabled by default + { + pad->SetLocalSolderPasteMargin( Clamp( m_rules->mlMinCreamFrame, + (int)( m_rules->mvCreamFrame * minPadSize ), + m_rules->mlMaxCreamFrame ) ); + } // @todo: handle thermal } @@ -1694,10 +1696,13 @@ void EAGLE_PLUGIN::transferPad( const EPAD_COMMON& aEaglePad, D_PAD* aPad ) cons // Solder mask const wxSize& padSize( aPad->GetSize() ); - int solderMaskSize = m_rules->mvStopFrame * std::min( padSize.x, padSize.y ); - solderMaskSize = std::min( solderMaskSize, m_rules->mlMaxStopFrame ); - solderMaskSize = std::max( solderMaskSize, m_rules->mlMinStopFrame ); - aPad->SetLocalSolderMaskMargin( solderMaskSize ); + + if( !aEaglePad.stop || !*aEaglePad.stop ) // enabled by default + { + aPad->SetLocalSolderMaskMargin( Clamp( m_rules->mlMinStopFrame, + (int)( m_rules->mvStopFrame * std::min( padSize.x, padSize.y ) ), + m_rules->mlMaxStopFrame ) ); + } MODULE* module = aPad->GetParent(); wxCHECK( module, /* void */ );