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
c5869705
Commit
c5869705
authored
May 31, 2012
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EAGLE_PLUGIN add mechanical "hole" support for both MODULEs and BOARD
parent
808020b1
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
257 additions
and
132 deletions
+257
-132
class_text_mod.cpp
pcbnew/class_text_mod.cpp
+19
-19
eagle_plugin.cpp
pcbnew/eagle_plugin.cpp
+236
-113
eagle_plugin.h
pcbnew/eagle_plugin.h
+2
-0
No files found.
pcbnew/class_text_mod.cpp
View file @
c5869705
...
@@ -50,7 +50,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
...
@@ -50,7 +50,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
BOARD_ITEM
(
parent
,
PCB_MODULE_TEXT_T
),
BOARD_ITEM
(
parent
,
PCB_MODULE_TEXT_T
),
EDA_TEXT
()
EDA_TEXT
()
{
{
MODULE
*
M
odule
=
(
MODULE
*
)
m_Parent
;
MODULE
*
m
odule
=
(
MODULE
*
)
m_Parent
;
m_Type
=
text_type
;
/* Reference */
m_Type
=
text_type
;
/* Reference */
...
@@ -63,11 +63,11 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
...
@@ -63,11 +63,11 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
SetLayer
(
SILKSCREEN_N_FRONT
);
SetLayer
(
SILKSCREEN_N_FRONT
);
if
(
Module
&&
(
M
odule
->
Type
()
==
PCB_MODULE_T
)
)
if
(
module
&&
(
m
odule
->
Type
()
==
PCB_MODULE_T
)
)
{
{
m_Pos
=
M
odule
->
m_Pos
;
m_Pos
=
m
odule
->
m_Pos
;
int
moduleLayer
=
M
odule
->
GetLayer
();
int
moduleLayer
=
m
odule
->
GetLayer
();
if
(
moduleLayer
==
LAYER_N_BACK
)
if
(
moduleLayer
==
LAYER_N_BACK
)
SetLayer
(
SILKSCREEN_N_BACK
);
SetLayer
(
SILKSCREEN_N_BACK
);
...
@@ -120,18 +120,18 @@ int TEXTE_MODULE::GetLength() const
...
@@ -120,18 +120,18 @@ int TEXTE_MODULE::GetLength() const
// Update draw coordinates
// Update draw coordinates
void
TEXTE_MODULE
::
SetDrawCoord
()
void
TEXTE_MODULE
::
SetDrawCoord
()
{
{
MODULE
*
M
odule
=
(
MODULE
*
)
m_Parent
;
MODULE
*
m
odule
=
(
MODULE
*
)
m_Parent
;
m_Pos
=
m_Pos0
;
m_Pos
=
m_Pos0
;
if
(
M
odule
==
NULL
)
if
(
m
odule
==
NULL
)
return
;
return
;
int
angle
=
Module
->
m_Orient
;
double
angle
=
module
->
GetOrientation
()
;
NORMALIZE_ANGLE_POS
(
angle
);
NORMALIZE_ANGLE_POS
(
angle
);
RotatePoint
(
&
m_Pos
.
x
,
&
m_Pos
.
y
,
angle
);
RotatePoint
(
&
m_Pos
.
x
,
&
m_Pos
.
y
,
angle
);
m_Pos
+=
Module
->
m_Pos
;
m_Pos
+=
module
->
GetPosition
()
;
}
}
...
@@ -139,17 +139,17 @@ void TEXTE_MODULE::SetDrawCoord()
...
@@ -139,17 +139,17 @@ void TEXTE_MODULE::SetDrawCoord()
// anchor point)
// anchor point)
void
TEXTE_MODULE
::
SetLocalCoord
()
void
TEXTE_MODULE
::
SetLocalCoord
()
{
{
MODULE
*
M
odule
=
(
MODULE
*
)
m_Parent
;
MODULE
*
m
odule
=
(
MODULE
*
)
m_Parent
;
if
(
M
odule
==
NULL
)
if
(
m
odule
==
NULL
)
{
{
m_Pos0
=
m_Pos
;
m_Pos0
=
m_Pos
;
return
;
return
;
}
}
m_Pos0
=
m_Pos
-
M
odule
->
m_Pos
;
m_Pos0
=
m_Pos
-
m
odule
->
m_Pos
;
int
angle
=
M
odule
->
m_Orient
;
int
angle
=
m
odule
->
m_Orient
;
NORMALIZE_ANGLE_POS
(
angle
);
NORMALIZE_ANGLE_POS
(
angle
);
RotatePoint
(
&
m_Pos0
.
x
,
&
m_Pos0
.
y
,
-
angle
);
RotatePoint
(
&
m_Pos0
.
x
,
&
m_Pos0
.
y
,
-
angle
);
...
@@ -242,7 +242,7 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w
...
@@ -242,7 +242,7 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w
wxSize
size
;
wxSize
size
;
wxPoint
pos
;
// Center of text
wxPoint
pos
;
// Center of text
PCB_BASE_FRAME
*
frame
;
PCB_BASE_FRAME
*
frame
;
MODULE
*
M
odule
=
(
MODULE
*
)
m_Parent
;
/* parent must *not* be null
MODULE
*
m
odule
=
(
MODULE
*
)
m_Parent
;
/* parent must *not* be null
* (a module text without a footprint
* (a module text without a footprint
* parent has no sense) */
* parent has no sense) */
...
@@ -282,16 +282,16 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w
...
@@ -282,16 +282,16 @@ void TEXTE_MODULE::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int draw_mode, const w
pos
.
x
,
pos
.
y
+
anchor_size
,
0
,
color
);
pos
.
x
,
pos
.
y
+
anchor_size
,
0
,
color
);
}
}
color
=
brd
->
GetLayerColor
(
M
odule
->
GetLayer
());
color
=
brd
->
GetLayerColor
(
m
odule
->
GetLayer
());
if
(
M
odule
->
GetLayer
()
==
LAYER_N_BACK
)
if
(
m
odule
->
GetLayer
()
==
LAYER_N_BACK
)
{
{
if
(
brd
->
IsElementVisible
(
MOD_TEXT_BK_VISIBLE
)
==
false
)
if
(
brd
->
IsElementVisible
(
MOD_TEXT_BK_VISIBLE
)
==
false
)
return
;
return
;
color
=
brd
->
GetVisibleElementColor
(
MOD_TEXT_BK_VISIBLE
);
color
=
brd
->
GetVisibleElementColor
(
MOD_TEXT_BK_VISIBLE
);
}
}
else
if
(
M
odule
->
GetLayer
()
==
LAYER_N_FRONT
)
else
if
(
m
odule
->
GetLayer
()
==
LAYER_N_FRONT
)
{
{
if
(
brd
->
IsElementVisible
(
MOD_TEXT_FR_VISIBLE
)
==
false
)
if
(
brd
->
IsElementVisible
(
MOD_TEXT_FR_VISIBLE
)
==
false
)
return
;
return
;
...
@@ -336,12 +336,12 @@ void TEXTE_MODULE::DrawUmbilical( EDA_DRAW_PANEL* aPanel,
...
@@ -336,12 +336,12 @@ void TEXTE_MODULE::DrawUmbilical( EDA_DRAW_PANEL* aPanel,
int
TEXTE_MODULE
::
GetDrawRotation
()
const
int
TEXTE_MODULE
::
GetDrawRotation
()
const
{
{
int
rotation
;
int
rotation
;
MODULE
*
M
odule
=
(
MODULE
*
)
m_Parent
;
MODULE
*
m
odule
=
(
MODULE
*
)
m_Parent
;
rotation
=
m_Orient
;
rotation
=
m_Orient
;
if
(
M
odule
)
if
(
m
odule
)
rotation
+=
M
odule
->
m_Orient
;
rotation
+=
m
odule
->
m_Orient
;
NORMALIZE_ANGLE_POS
(
rotation
);
NORMALIZE_ANGLE_POS
(
rotation
);
...
...
pcbnew/eagle_plugin.cpp
View file @
c5869705
This diff is collapsed.
Click to expand it.
pcbnew/eagle_plugin.h
View file @
c5869705
...
@@ -117,6 +117,8 @@ public:
...
@@ -117,6 +117,8 @@ public:
private
:
private
:
int
m_hole_count
;
///< generates unique module names from eagle "hole"s.
NET_MAP
m_pads_to_nets
;
NET_MAP
m_pads_to_nets
;
MODULE_MAP
m_templates
;
///< is part of a MODULE factory that operates
MODULE_MAP
m_templates
;
///< is part of a MODULE factory that operates
...
...
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