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
4d9f87bf
Commit
4d9f87bf
authored
Jun 30, 2014
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix BUG parsing the kicad_pcb (layers ..) declaration section. First non-cu was being dropped.
parent
c6af2a79
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
32 deletions
+40
-32
class_board.h
pcbnew/class_board.h
+12
-5
pcb_parser.cpp
pcbnew/pcb_parser.cpp
+28
-27
No files found.
pcbnew/class_board.h
View file @
4d9f87bf
...
...
@@ -89,11 +89,18 @@ enum LAYER_T
*/
struct
LAYER
{
LAYER
()
:
m_type
(
LT_SIGNAL
),
m_visible
(
true
),
m_number
(
0
)
{}
LAYER
()
{
clear
();
}
void
clear
()
{
m_type
=
LT_SIGNAL
;
m_visible
=
true
;
m_number
=
0
;
m_name
.
clear
();
}
/*
LAYER( const wxString& aName = wxEmptyString,
...
...
pcbnew/pcb_parser.cpp
View file @
4d9f87bf
...
...
@@ -703,6 +703,8 @@ void PCB_PARSER::parseLayer( LAYER* aLayer ) throw( IO_ERROR, PARSE_ERROR )
std
::
string
type
;
bool
isVisible
=
true
;
aLayer
->
clear
();
if
(
CurTok
()
!=
T_LEFT
)
Expecting
(
T_LEFT
);
...
...
@@ -744,13 +746,12 @@ void PCB_PARSER::parseLayers() throw( IO_ERROR, PARSE_ERROR )
LSET
visibleLayers
;
LSET
enabledLayers
;
int
copperLayerCount
=
0
;
LAYER
layer
;
std
::
vector
<
LAYER
>
cu
;
for
(
token
=
NextTok
();
token
!=
T_RIGHT
;
token
=
NextTok
()
)
{
LAYER
layer
;
parseLayer
(
&
layer
);
if
(
layer
.
m_type
==
LT_UNDEFINED
)
// it's a non-copper layer
...
...
@@ -794,41 +795,41 @@ void PCB_PARSER::parseLayers() throw( IO_ERROR, PARSE_ERROR )
copperLayerCount
=
cu
.
size
();
}
if
(
token
!=
T_RIGHT
)
// process non-copper layers
while
(
token
!=
T_RIGHT
)
{
// read any non-copper layers
for
(
token
=
NextTok
();
token
!=
T_RIGHT
;
token
=
NextTok
()
)
LAYER_ID_MAP
::
const_iterator
it
=
m_layerIndices
.
find
(
UTF8
(
layer
.
m_name
)
);
if
(
it
==
m_layerIndices
.
end
()
)
{
LAYER
layer
;
wxString
error
=
wxString
::
Format
(
_
(
"Layer '%s' in file '%s' at line %d, is not in fixed layer hash"
),
GetChars
(
layer
.
m_name
),
GetChars
(
CurSource
()
),
CurLineNumber
(),
CurOffset
()
);
THROW_IO_ERROR
(
error
);
}
parseLayer
(
&
layer
)
;
layer
.
m_number
=
it
->
second
;
LAYER_ID_MAP
::
const_iterator
it
=
m_layerIndices
.
find
(
UTF8
(
layer
.
m_name
)
);
enabledLayers
.
set
(
layer
.
m_number
);
if
(
it
==
m_layerIndices
.
end
()
)
{
wxString
error
=
wxString
::
Format
(
_
(
"Layer '%s' in file '%s' at line %d, is not in fixed layer hash"
),
GetChars
(
layer
.
m_name
),
GetChars
(
CurSource
()
),
CurLineNumber
(),
CurOffset
()
);
THROW_IO_ERROR
(
error
);
}
if
(
layer
.
m_visible
)
visibleLayers
.
set
(
layer
.
m_number
);
layer
.
m_number
=
it
->
second
;
// DBG( printf( "aux m_visible:%s\n", layer.m_visible ? "true" : "false" );)
enabledLayers
.
set
(
layer
.
m_numb
er
);
m_board
->
SetLayer
(
it
->
second
,
lay
er
);
if
(
layer
.
m_visible
)
visibleLayers
.
set
(
layer
.
m_number
);
token
=
NextTok
();
//DBG( printf( "aux m_visible:%s\n", layer.m_visible ? "true" : "false" );)
if
(
token
!=
T_LEFT
)
break
;
m_board
->
SetLayer
(
LAYER_ID
(
layer
.
m_number
),
layer
);
}
parseLayer
(
&
layer
);
}
// We need at least 2 copper layers and there must be an even number of them.
...
...
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