Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
0bf4b5ae
Commit
0bf4b5ae
authored
Feb 05, 2010
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: fixed pad selection by right click according to pad visibility.
parent
f7ad4555
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
73 additions
and
10 deletions
+73
-10
basepcbframe.cpp
pcbnew/basepcbframe.cpp
+2
-0
collectors.cpp
pcbnew/collectors.cpp
+29
-7
collectors.h
pcbnew/collectors.h
+42
-3
No files found.
pcbnew/basepcbframe.cpp
View file @
0bf4b5ae
...
...
@@ -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
;
}
...
...
pcbnew/collectors.cpp
View file @
0bf4b5ae
...
...
@@ -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
()
)
{
...
...
pcbnew/collectors.h
View file @
0bf4b5ae
...
...
@@ -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 - t
ur
e if should ignore MODULEs on component layer.
* @return bool - t
ru
e 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
;
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment