Pcbnew: fixed pad selection by right click according to pad visibility.
This commit is contained in:
parent
f7ad45558a
commit
0bf4b5ae9a
|
@ -282,6 +282,8 @@ GENERAL_COLLECTORS_GUIDE WinEDA_BasePcbFrame::GetCollectorsGuide()
|
|||
guide.SetIgnoreMTextsOnCmp( ! m_Pcb->IsElementVisible( MOD_TEXT_FR_VISIBLE ));
|
||||
guide.SetIgnoreModulesOnCu( ! m_Pcb->IsElementVisible( MOD_BK_VISIBLE ) );
|
||||
guide.SetIgnoreModulesOnCmp( ! m_Pcb->IsElementVisible( MOD_FR_VISIBLE ) );
|
||||
guide.SetIgnorePadsOnBack( ! m_Pcb->IsElementVisible( PAD_BK_VISIBLE ) );
|
||||
guide.SetIgnorePadsOnFront( ! m_Pcb->IsElementVisible( PAD_FR_VISIBLE ) );
|
||||
|
||||
return guide;
|
||||
}
|
||||
|
|
|
@ -136,6 +136,8 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
|
|||
{
|
||||
BOARD_ITEM* item = (BOARD_ITEM*) testItem;
|
||||
MODULE* module = NULL;
|
||||
D_PAD* pad = NULL;
|
||||
bool pad_through = false;
|
||||
|
||||
#if 0 // debugging
|
||||
static int breakhere = 0;
|
||||
|
@ -207,15 +209,20 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
|
|||
switch( item->Type() )
|
||||
{
|
||||
case TYPE_PAD:
|
||||
|
||||
// there are pad specific visibility controls.
|
||||
// Criterias to select a pad is:
|
||||
// for smd pads: the module parent must be seen, and pads on the corresponding board side must be seen
|
||||
// if pad is a thru hole, then it can be visible when its parent module is not.
|
||||
if( ( (D_PAD*) item )->m_Attribut != PAD_SMD ) // a hole is present, so multiple layers
|
||||
// for through pads: pads on Front or Back board sides must be seen
|
||||
pad = (D_PAD*) item;
|
||||
if( (pad->m_Attribut != PAD_SMD) &&
|
||||
(pad->m_Attribut != PAD_CONN) ) // a hole is present, so multiple layers
|
||||
{
|
||||
// there are no pad specific visibility controls at this time.
|
||||
// proceed to the common tests below, but without the parent module test,
|
||||
// by leaving module==NULL
|
||||
// by leaving module==NULL, but having pad != null
|
||||
pad_through = true;
|
||||
}
|
||||
else // smd, so use common test below
|
||||
else // smd, so use pads test after module test
|
||||
module = (MODULE*) item->GetParent();
|
||||
break;
|
||||
|
||||
|
@ -278,6 +285,21 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
|
|||
goto exit;
|
||||
}
|
||||
|
||||
// Pads are not sensitive to the layer visibility controls.
|
||||
// They all have their own separate visibility controls
|
||||
// skip them if not visible
|
||||
if ( pad )
|
||||
{
|
||||
if( m_Guide->IgnorePads() )
|
||||
goto exit;
|
||||
if( ! pad_through )
|
||||
{
|
||||
if( m_Guide->IgnorePadsOnFront() && pad->IsOnLayer(LAYER_N_FRONT ) )
|
||||
goto exit;
|
||||
if( m_Guide->IgnorePadsOnBack() && pad->IsOnLayer(LAYER_N_BACK ) )
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
if( item->IsOnLayer( m_Guide->GetPreferredLayer() ) || m_Guide->IgnorePreferredLayer() )
|
||||
{
|
||||
|
@ -285,7 +307,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
|
|||
|
||||
// Modules and their subcomponents: text and pads are not sensitive to the layer
|
||||
// visibility controls. They all have their own separate visibility controls
|
||||
if( module || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() )
|
||||
if( module || pad || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() )
|
||||
{
|
||||
if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
|
||||
{
|
||||
|
@ -312,7 +334,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
|
|||
|
||||
// Modules and their subcomponents: text and pads are not sensitive to the layer
|
||||
// visibility controls. They all have their own separate visibility controls
|
||||
if( module || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() )
|
||||
if( module || pad || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() )
|
||||
{
|
||||
if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
|
||||
{
|
||||
|
|
|
@ -137,16 +137,36 @@ public:
|
|||
|
||||
/**
|
||||
* Function IgnoreModulesOnCu
|
||||
* @return bool - true if should ignore MODULEs on copper layer.
|
||||
* @return bool - true if should ignore MODULEs on Back Side.
|
||||
*/
|
||||
virtual bool IgnoreModulesOnCu() const = 0;
|
||||
|
||||
/**
|
||||
* Function IgnoreModulesOnCmp
|
||||
* @return bool - ture if should ignore MODULEs on component layer.
|
||||
* @return bool - ture if should ignore MODULEs on Front Side.
|
||||
*/
|
||||
virtual bool IgnoreModulesOnCmp() const = 0;
|
||||
|
||||
/**
|
||||
* Function IgnorePadsOnBack
|
||||
* @return bool - true if should ignore Pads on Back Side.
|
||||
*/
|
||||
virtual bool IgnorePadsOnBack() const = 0;
|
||||
|
||||
/**
|
||||
* Function IgnorePadsOnFront
|
||||
* @return bool - ture if should ignore PADSs on Front Side.
|
||||
*/
|
||||
virtual bool IgnorePadsOnFront() const = 0;
|
||||
|
||||
/**
|
||||
* Function IgnorePads
|
||||
* @return bool - true if should ignore PADSs on Front side and Back side.
|
||||
*/
|
||||
virtual bool IgnorePads() const
|
||||
{
|
||||
return IgnorePadsOnFront() && IgnorePadsOnBack();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function UseHitTesting
|
||||
|
@ -349,6 +369,8 @@ private:
|
|||
bool m_IgnoreMTextsOnCmp;
|
||||
bool m_IgnoreModulesOnCu;
|
||||
bool m_IgnoreModulesOnCmp;
|
||||
bool m_IgnorePadsOnFront;
|
||||
bool m_IgnorePadsOnBack;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -381,6 +403,9 @@ public:
|
|||
m_IgnoreMTextsOnCmp = false;
|
||||
m_IgnoreModulesOnCu = true; // !Show_Modules_Cmp;
|
||||
m_IgnoreModulesOnCmp = false;
|
||||
|
||||
m_IgnorePadsOnFront = false;
|
||||
m_IgnorePadsOnBack = false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -494,10 +519,24 @@ public:
|
|||
|
||||
/**
|
||||
* Function IgnoreModulesOnCmp
|
||||
* @return bool - ture if should ignore MODULEs on component layer.
|
||||
* @return bool - true if should ignore MODULEs on component layer.
|
||||
*/
|
||||
bool IgnoreModulesOnCmp() const { return m_IgnoreModulesOnCmp; }
|
||||
void SetIgnoreModulesOnCmp( bool ignore ) { m_IgnoreModulesOnCmp = ignore; }
|
||||
|
||||
/**
|
||||
* Function IgnorePadsOnBack
|
||||
* @return bool - true if should ignore Pads on Back Side.
|
||||
*/
|
||||
bool IgnorePadsOnBack() const { return m_IgnorePadsOnBack; }
|
||||
void SetIgnorePadsOnBack(bool ignore) { m_IgnorePadsOnBack = ignore; }
|
||||
|
||||
/**
|
||||
* Function IgnorePadsOnFront
|
||||
* @return bool - true if should ignore PADSs on Front Side.
|
||||
*/
|
||||
bool IgnorePadsOnFront() const { return m_IgnorePadsOnFront; }
|
||||
void SetIgnorePadsOnFront(bool ignore) { m_IgnorePadsOnFront = ignore; }
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue