From 8cbfd8af9fdc38f03a51621803327af2e3e3ff75 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 28 Sep 2022 15:10:28 +0100 Subject: [PATCH] Files missing from earlier commit. --- pcbnew/pad.cpp | 14 ++++++++++++++ pcbnew/pad.h | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/pcbnew/pad.cpp b/pcbnew/pad.cpp index a511208d16..b8204b6160 100644 --- a/pcbnew/pad.cpp +++ b/pcbnew/pad.cpp @@ -156,6 +156,20 @@ bool PAD::IsLocked() const }; +bool PAD::IsNoConnectPad() const +{ + return GetShortNetname().StartsWith( wxT( "unconnected-(" ) ) + && ( m_pinType == wxT( "no_connect" ) || m_pinType.EndsWith( wxT( "+no_connect" ) ) ); +} + + +bool PAD::IsFreePad() const +{ + return GetShortNetname().StartsWith( wxT( "unconnected-(" ) ) + && m_pinType == wxT( "free" ); +} + + LSET PAD::PTHMask() { static LSET saved = LSET::AllCuMask() | LSET( 2, F_Mask, B_Mask ); diff --git a/pcbnew/pad.h b/pcbnew/pad.h index fcce0edcae..3f36610284 100644 --- a/pcbnew/pad.h +++ b/pcbnew/pad.h @@ -155,6 +155,18 @@ public: return GetParent() == other->GetParent() && m_number == other->m_number; } + /** + * @return true if the pad is associated with an "unconnected" pin (or a no-connect symbol) + * and has no net. + */ + bool IsNoConnectPad() const; + + /** + * @return true if the pad is associated with a "free" pin (not-internally-connected) and has + * not yet been assigned another net (ie: by being routed to). + */ + bool IsFreePad() const; + /** * Set the new shape of this pad. */