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
96912e6b
Commit
96912e6b
authored
Nov 04, 2013
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter better the unsupported layers coming into EAGLE_PLUGIN::Load()
parent
fe54ceac
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
35 deletions
+52
-35
class_board_item.h
include/class_board_item.h
+6
-1
eagle_plugin.cpp
pcbnew/eagle_plugin.cpp
+46
-34
No files found.
include/class_board_item.h
View file @
96912e6b
...
...
@@ -116,7 +116,12 @@ public:
* is virtual because some items (in fact: class DIMENSION)
* have a slightly different initialization
*/
virtual
void
SetLayer
(
LAYER_NUM
aLayer
)
{
m_Layer
=
aLayer
;
}
virtual
void
SetLayer
(
LAYER_NUM
aLayer
)
{
// trap any invalid layers, then go find the caller and fix it.
// wxASSERT( unsigned( aLayer ) < unsigned( NB_PCB_LAYERS ) );
m_Layer
=
aLayer
;
}
/**
* Function Draw
...
...
pcbnew/eagle_plugin.cpp
View file @
96912e6b
...
...
@@ -1321,6 +1321,7 @@ void EAGLE_PLUGIN::loadLayerDefs( CPTREE& aLayers )
{
LAYER_NUM
layer
=
kicad_layer
(
it
->
number
);
// these function provide their own protection against UNDEFINED_LAYER:
m_board
->
SetLayerName
(
layer
,
FROM_UTF8
(
it
->
name
.
c_str
()
)
);
m_board
->
SetLayerType
(
layer
,
LT_SIGNAL
);
...
...
@@ -1339,6 +1340,7 @@ void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics )
if
(
gr
->
first
==
"wire"
)
{
m_xpath
->
push
(
"wire"
);
EWIRE
w
(
gr
->
second
);
LAYER_NUM
layer
=
kicad_layer
(
w
.
layer
);
...
...
@@ -1366,10 +1368,11 @@ void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics )
}
#endif
m_xpath
->
push
(
"text"
);
ETEXT
t
(
gr
->
second
);
LAYER_NUM
layer
=
kicad_layer
(
t
.
layer
);
if
(
layer
!=
-
1
)
// supported layer
if
(
layer
!=
UNDEFINED_LAYER
)
{
TEXTE_PCB
*
pcbtxt
=
new
TEXTE_PCB
(
m_board
);
m_board
->
Add
(
pcbtxt
,
ADD_APPEND
);
...
...
@@ -1456,6 +1459,7 @@ void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics )
else
if
(
gr
->
first
==
"circle"
)
{
m_xpath
->
push
(
"circle"
);
ECIRCLE
c
(
gr
->
second
);
LAYER_NUM
layer
=
kicad_layer
(
c
.
layer
);
...
...
@@ -1479,6 +1483,7 @@ void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics )
else
if
(
gr
->
first
==
"rectangle"
)
{
m_xpath
->
push
(
"rectangle"
);
ERECT
r
(
gr
->
second
);
LAYER_NUM
layer
=
kicad_layer
(
r
.
layer
);
...
...
@@ -1501,9 +1506,8 @@ void EAGLE_PLUGIN::loadPlain( CPTREE& aGraphics )
zone
->
Outline
()
->
CloseLastContour
();
// this is not my fault:
zone
->
Outline
()
->
SetHatch
(
outline_hatch
,
Mils2iu
(
zone
->
Outline
()
->
GetDefaultHatchPitchMils
()
),
true
);
zone
->
Outline
()
->
SetHatch
(
outline_hatch
,
Mils2iu
(
zone
->
Outline
()
->
GetDefaultHatchPitchMils
()
),
true
);
}
m_xpath
->
pop
();
...
...
@@ -1917,7 +1921,7 @@ void EAGLE_PLUGIN::packageWire( MODULE* aModule, CPTREE& aTree ) const
EWIRE
w
(
aTree
);
LAYER_NUM
layer
=
kicad_layer
(
w
.
layer
);
if
(
IsNonCopperLayer
(
layer
)
)
//
skip copper package wires
if
(
IsNonCopperLayer
(
layer
)
)
// only valid non-copper wires,
skip copper package wires
{
wxPoint
start
(
kicad_x
(
w
.
x1
),
kicad_y
(
w
.
y1
)
);
wxPoint
end
(
kicad_x
(
w
.
x2
),
kicad_y
(
w
.
y2
)
);
...
...
@@ -2024,6 +2028,11 @@ void EAGLE_PLUGIN::packageText( MODULE* aModule, CPTREE& aTree ) const
ETEXT
t
(
aTree
);
LAYER_NUM
layer
=
kicad_layer
(
t
.
layer
);
if
(
layer
==
UNDEFINED_LAYER
)
{
layer
=
COMMENT_N
;
}
TEXTE_MODULE
*
txt
;
if
(
t
.
text
==
">NAME"
||
t
.
text
==
">name"
)
...
...
@@ -2208,19 +2217,20 @@ void EAGLE_PLUGIN::packageCircle( MODULE* aModule, CPTREE& aTree ) const
{
ECIRCLE
e
(
aTree
);
LAYER_NUM
layer
=
kicad_layer
(
e
.
layer
);
EDGE_MODULE
*
gr
=
new
EDGE_MODULE
(
aModule
,
S_CIRCLE
);
aModule
->
GraphicalItems
().
PushBack
(
gr
);
gr
->
SetWidth
(
kicad
(
e
.
width
)
);
/*
switch
(
layer
)
{
case
UNDEFINED_LAYER
:
layer
=
COMMENT_N
;
break
;
/*
case ECO1_N: layer = SILKSCREEN_N_FRONT; break;
case ECO2_N: layer = SILKSCREEN_N_BACK; break;
}
*/
}
gr
->
SetLayer
(
layer
);
gr
->
SetTimeStamp
(
timeStamp
(
aTree
)
);
...
...
@@ -2468,6 +2478,7 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals )
else
if
(
it
->
first
==
"polygon"
)
{
m_xpath
->
push
(
"polygon"
);
EPOLYGON
p
(
it
->
second
);
LAYER_NUM
layer
=
kicad_layer
(
p
.
layer
);
...
...
@@ -2552,7 +2563,7 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals )
}
LAYER_NUM
EAGLE_PLUGIN
::
kicad_layer
(
int
aEagleLayer
)
const
int
EAGLE_PLUGIN
::
kicad_layer
(
int
aEagleLayer
)
const
{
/* will assume this is a valid mapping for all eagle boards until I get paid more:
...
...
@@ -2681,8 +2692,9 @@ LAYER_NUM EAGLE_PLUGIN::kicad_layer( int aEagleLayer ) const
case
95
:
kiLayer
=
ECO1_N
;
break
;
case
96
:
kiLayer
=
ECO2_N
;
break
;
default
:
// D( printf( "unsupported eagle layer: %d\n", aEagleLayer );)
kiLayer
=
-
1
;
break
;
// some layers do not map to KiCad
// some layers do not map to KiCad
// DBG( printf( "unsupported eagle layer: %d\n", aEagleLayer );)
kiLayer
=
UNDEFINED_LAYER
;
break
;
}
}
...
...
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