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
22c85e78
Commit
22c85e78
authored
Mar 13, 2013
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EAGLE_PLUGIN cu layer map fix
parent
1be0b66d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
5 deletions
+31
-5
eagle_plugin.cpp
pcbnew/eagle_plugin.cpp
+28
-4
eagle_plugin.h
pcbnew/eagle_plugin.h
+3
-1
No files found.
pcbnew/eagle_plugin.cpp
View file @
22c85e78
...
...
@@ -1158,6 +1158,10 @@ void EAGLE_PLUGIN::init( PROPERTIES* aProperties )
{
m_hole_count
=
0
;
// all cu layers are invalid until we see one in the <layers> section while board loading.
for
(
unsigned
i
=
0
;
i
<
DIM
(
m_cu_map
);
++
i
)
m_cu_map
[
i
]
=
-
1
;
m_xpath
->
clear
();
m_pads_to_nets
.
clear
();
...
...
@@ -1245,6 +1249,27 @@ void EAGLE_PLUGIN::loadLayerDefs( CPTREE& aLayers )
}
}
// establish cu layer map:
int
ki_layer_count
=
0
;
for
(
EITER
it
=
cu
.
begin
();
it
!=
cu
.
end
();
++
it
,
++
ki_layer_count
)
{
if
(
ki_layer_count
==
0
)
m_cu_map
[
it
->
number
]
=
LAYER_N_FRONT
;
else
if
(
ki_layer_count
==
int
(
cu
.
size
()
-
1
)
)
m_cu_map
[
it
->
number
]
=
LAYER_N_BACK
;
else
// some eagle boards do not have contiguous layer number sequences.
m_cu_map
[
it
->
number
]
=
cu
.
size
()
-
1
-
ki_layer_count
;
}
#if 0 && defined(DEBUG)
printf( "m_cu_map:\n" );
for( unsigned i=0; i<DIM(m_cu_map); ++i )
{
printf( "\t[%d]:%d\n", i, m_cu_map[i] );
}
#endif
m_board
->
SetCopperLayerCount
(
cu
.
size
()
);
for
(
EITER
it
=
cu
.
begin
();
it
!=
cu
.
end
();
++
it
)
...
...
@@ -2438,7 +2463,7 @@ void EAGLE_PLUGIN::loadSignals( CPTREE& aSignals )
}
int
EAGLE_PLUGIN
::
kicad_layer
(
int
aEagleLayer
)
int
EAGLE_PLUGIN
::
kicad_layer
(
int
aEagleLayer
)
const
{
/* will assume this is a valid mapping for all eagle boards until I get paid more:
...
...
@@ -2507,13 +2532,12 @@ int EAGLE_PLUGIN::kicad_layer( int aEagleLayer )
*/
int
kiLayer
;
// eagle copper layer:
if
(
aEagleLayer
>=
1
&&
aEagleLayer
<
=
16
)
if
(
aEagleLayer
>=
1
&&
aEagleLayer
<
int
(
DIM
(
m_cu_map
)
)
)
{
kiLayer
=
LAYER_N_FRONT
-
(
aEagleLayer
-
1
)
;
return
m_cu_map
[
aEagleLayer
]
;
}
else
...
...
pcbnew/eagle_plugin.h
View file @
22c85e78
...
...
@@ -116,6 +116,8 @@ public:
private
:
int
m_cu_map
[
17
];
///< map eagle to kicad, cu layers only.
ERULES
*
m_rules
;
///< Eagle design rules.
XPATH
*
m_xpath
;
///< keeps track of what we are working on within
///< XML document during a Load().
...
...
@@ -149,7 +151,7 @@ private:
wxSize
kicad_fontz
(
double
d
)
const
;
/// Convert an Eagle layer to a KiCad layer.
static
int
kicad_layer
(
int
aLayer
)
;
int
kicad_layer
(
int
aLayer
)
const
;
/// Convert a KiCad distance to an Eagle distance.
double
eagle
(
BIU
d
)
const
{
return
mm_per_biu
*
d
;
}
...
...
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