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
8287775b
Commit
8287775b
authored
Mar 13, 2013
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
EAGLE_PLUGIN cu layer map fix broke footprint library loading
parent
22c85e78
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
11 deletions
+25
-11
eagle_plugin.cpp
pcbnew/eagle_plugin.cpp
+23
-11
eagle_plugin.h
pcbnew/eagle_plugin.h
+2
-0
No files found.
pcbnew/eagle_plugin.cpp
View file @
8287775b
...
...
@@ -1057,6 +1057,8 @@ EAGLE_PLUGIN::EAGLE_PLUGIN() :
// m_mod_time( wxDateTime::Now() )
{
init
(
NULL
);
clear_cu_map
();
}
...
...
@@ -1158,10 +1160,6 @@ 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
();
...
...
@@ -1178,6 +1176,15 @@ void EAGLE_PLUGIN::init( PROPERTIES* aProperties )
}
void
EAGLE_PLUGIN
::
clear_cu_map
()
{
// All cu layers are invalid until we see them in the <layers> section while
// loading either a board or library. See loadLayerDefs().
for
(
unsigned
i
=
0
;
i
<
DIM
(
m_cu_map
);
++
i
)
m_cu_map
[
i
]
=
-
1
;
}
void
EAGLE_PLUGIN
::
loadAllSections
(
CPTREE
&
aDoc
)
{
CPTREE
&
drawing
=
aDoc
.
get_child
(
"eagle.drawing"
);
...
...
@@ -1195,8 +1202,12 @@ void EAGLE_PLUGIN::loadAllSections( CPTREE& aDoc )
}
{
m_xpath
->
push
(
"layers"
);
CPTREE
&
layers
=
drawing
.
get_child
(
"layers"
);
loadLayerDefs
(
layers
);
m_xpath
->
pop
();
}
{
...
...
@@ -1231,8 +1242,6 @@ void EAGLE_PLUGIN::loadDesignRules( CPTREE& aDesignRules )
void
EAGLE_PLUGIN
::
loadLayerDefs
(
CPTREE
&
aLayers
)
{
m_xpath
->
push
(
"layers.layer"
);
typedef
std
::
vector
<
ELAYER
>
ELAYERS
;
typedef
ELAYERS
::
const_iterator
EITER
;
...
...
@@ -1281,8 +1290,6 @@ void EAGLE_PLUGIN::loadLayerDefs( CPTREE& aLayers )
// could map the colors here
}
m_xpath
->
pop
();
}
...
...
@@ -2664,12 +2671,17 @@ void EAGLE_PLUGIN::cacheLib( const wxString& aLibPath )
read_xml
(
filename
,
doc
,
xml_parser
::
trim_whitespace
|
xml_parser
::
no_comments
);
CPTREE
&
library
=
doc
.
get_child
(
"eagle.drawing.library"
);
// clear the cu map and then rebuild it.
clear_cu_map
();
m_xpath
->
push
(
"eagle.drawing.library"
);
m_xpath
->
push
(
"eagle.drawing.layers"
);
CPTREE
&
layers
=
doc
.
get_child
(
"eagle.drawing.layers"
);
loadLayerDefs
(
layers
);
m_xpath
->
pop
();
m_xpath
->
push
(
"eagle.drawing.library"
);
CPTREE
&
library
=
doc
.
get_child
(
"eagle.drawing.library"
);
loadLibrary
(
library
,
NULL
);
m_xpath
->
pop
();
m_mod_time
=
modtime
;
...
...
pcbnew/eagle_plugin.h
View file @
8287775b
...
...
@@ -142,6 +142,8 @@ private:
/// initialize PLUGIN like a constructor would, and futz with fresh BOARD if needed.
void
init
(
PROPERTIES
*
aProperties
);
void
clear_cu_map
();
/// Convert an Eagle distance to a KiCad distance.
int
kicad
(
double
d
)
const
;
int
kicad_y
(
double
y
)
const
{
return
-
kicad
(
y
);
}
...
...
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