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
948f22de
Commit
948f22de
authored
Apr 25, 2014
by
Lorenzo Marcantonio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed the ugly bit stuffing for the bottom via layer number
(just replaced it with a member)
parent
c0879414
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
class_track.cpp
pcbnew/class_track.cpp
+10
-10
class_track.h
pcbnew/class_track.h
+6
-6
No files found.
pcbnew/class_track.cpp
View file @
948f22de
...
@@ -179,6 +179,7 @@ VIA::VIA( BOARD_ITEM* aParent ) :
...
@@ -179,6 +179,7 @@ VIA::VIA( BOARD_ITEM* aParent ) :
TRACK
(
aParent
,
PCB_VIA_T
)
TRACK
(
aParent
,
PCB_VIA_T
)
{
{
SetViaType
(
VIA_THROUGH
);
SetViaType
(
VIA_THROUGH
);
m_BottomLayer
=
LAYER_N_BACK
;
m_Width
=
Millimeter2iu
(
0.5
);
m_Width
=
Millimeter2iu
(
0.5
);
SetDrillDefault
();
SetDrillDefault
();
}
}
...
@@ -432,19 +433,19 @@ LAYER_MSK TRACK::GetLayerMask() const
...
@@ -432,19 +433,19 @@ LAYER_MSK TRACK::GetLayerMask() const
}
}
void
VIA
::
SetLayerPair
(
LAYER_NUM
top_layer
,
LAYER_NUM
bottom_l
ayer
)
void
VIA
::
SetLayerPair
(
LAYER_NUM
aTopLayer
,
LAYER_NUM
aBottomL
ayer
)
{
{
if
(
GetViaType
()
==
VIA_THROUGH
)
if
(
GetViaType
()
==
VIA_THROUGH
)
{
{
top_l
ayer
=
LAYER_N_FRONT
;
aTopL
ayer
=
LAYER_N_FRONT
;
bottom_l
ayer
=
LAYER_N_BACK
;
aBottomL
ayer
=
LAYER_N_BACK
;
}
}
if
(
bottom_layer
>
top_l
ayer
)
if
(
aBottomLayer
>
aTopL
ayer
)
EXCHG
(
bottom_layer
,
top_l
ayer
);
EXCHG
(
aBottomLayer
,
aTopL
ayer
);
// XXX EVIL usage of LAYER
m_Layer
=
aTopLayer
;
m_
Layer
=
(
top_layer
&
15
)
+
(
(
bottom_layer
&
15
)
<<
4
)
;
m_
BottomLayer
=
aBottomLayer
;
}
}
...
@@ -455,9 +456,8 @@ void VIA::LayerPair( LAYER_NUM* top_layer, LAYER_NUM* bottom_layer ) const
...
@@ -455,9 +456,8 @@ void VIA::LayerPair( LAYER_NUM* top_layer, LAYER_NUM* bottom_layer ) const
if
(
GetViaType
()
!=
VIA_THROUGH
)
if
(
GetViaType
()
!=
VIA_THROUGH
)
{
{
// XXX EVIL usage of LAYER
b_layer
=
m_BottomLayer
;
b_layer
=
(
m_Layer
>>
4
)
&
15
;
t_layer
=
m_Layer
;
t_layer
=
m_Layer
&
15
;
if
(
b_layer
>
t_layer
)
if
(
b_layer
>
t_layer
)
EXCHG
(
b_layer
,
t_layer
);
EXCHG
(
b_layer
,
t_layer
);
...
...
pcbnew/class_track.h
View file @
948f22de
...
@@ -371,15 +371,12 @@ public:
...
@@ -371,15 +371,12 @@ public:
/**
/**
* Function SetLayerPair
* Function SetLayerPair
* set the .m_Layer member param:
* For a via m_Layer contains the top layer, the other layer is in
* For a via m_Layer contains the 2 layers :
* m_BottomLayer
* top layer and bottom layer used by the via.
* The via connect all layers from top layer to bottom layer
* 4 bits for the first layer and 4 next bits for the second layer
* @param top_layer = first layer connected by the via
* @param top_layer = first layer connected by the via
* @param bottom_layer = last layer connected by the via
* @param bottom_layer = last layer connected by the via
*/
*/
void
SetLayerPair
(
LAYER_NUM
top_layer
,
LAYER_NUM
bottom_l
ayer
);
void
SetLayerPair
(
LAYER_NUM
aTopLayer
,
LAYER_NUM
aBottomL
ayer
);
/**
/**
* Function LayerPair
* Function LayerPair
...
@@ -453,6 +450,9 @@ protected:
...
@@ -453,6 +450,9 @@ protected:
virtual
void
GetMsgPanelInfoBase
(
std
::
vector
<
MSG_PANEL_ITEM
>&
aList
);
virtual
void
GetMsgPanelInfoBase
(
std
::
vector
<
MSG_PANEL_ITEM
>&
aList
);
private
:
private
:
/// The bottom layer of the via (the top layer is in m_Layer)
LAYER_NUM
m_BottomLayer
;
VIATYPE_T
m_ViaType
;
// Type of via
VIATYPE_T
m_ViaType
;
// Type of via
int
m_Drill
;
// for vias: via drill (- 1 for default value)
int
m_Drill
;
// for vias: via drill (- 1 for default value)
...
...
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