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
2af3e5f6
Commit
2af3e5f6
authored
Jun 03, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix #1325743: cvpcb crashes when opening any netlist.
parent
563502b8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
8 deletions
+28
-8
legacy_plugin.cpp
pcbnew/legacy_plugin.cpp
+4
-4
legacy_plugin.h
pcbnew/legacy_plugin.h
+10
-0
pcb_parser.cpp
pcbnew/pcb_parser.cpp
+4
-4
pcb_parser.h
pcbnew/pcb_parser.h
+10
-0
No files found.
pcbnew/legacy_plugin.cpp
View file @
2af3e5f6
...
...
@@ -1305,13 +1305,13 @@ void LEGACY_PLUGIN::loadPAD( MODULE* aModule )
int
netcode
=
intParse
(
line
+
SZ
(
"Ne"
),
&
data
);
// Store the new code mapping
pad
->
SetNetCode
(
m_netCodes
[
netcode
]
);
pad
->
SetNetCode
(
getNetCode
(
netcode
)
);
// read Netname
ReadDelimitedText
(
buf
,
data
,
sizeof
(
buf
)
);
#ifndef NDEBUG
if
(
m_board
)
assert
(
m_board
->
FindNet
(
m_netCodes
[
netcode
]
)
->
GetNetname
()
==
assert
(
m_board
->
FindNet
(
getNetCode
(
netcode
)
)
->
GetNetname
()
==
FROM_UTF8
(
StrPurge
(
buf
)
)
);
#endif
/* NDEBUG */
}
...
...
@@ -2102,7 +2102,7 @@ void LEGACY_PLUGIN::loadTrackList( int aStructType )
via
->
SetLayerPair
(
LAYER_N_FRONT
,
LAYER_N_BACK
);
}
newTrack
->
SetNetCode
(
m_netCodes
[
net_code
]
);
newTrack
->
SetNetCode
(
getNetCode
(
net_code
)
);
newTrack
->
SetState
(
flags
,
true
);
m_board
->
Add
(
newTrack
);
...
...
@@ -2250,7 +2250,7 @@ void LEGACY_PLUGIN::loadZONE_CONTAINER()
// Init the net code only, not the netname, to be sure
// the zone net name is the name read in file.
// (When mismatch, the user will be prompted in DRC, to fix the actual name)
zc
->
BOARD_CONNECTED_ITEM
::
SetNetCode
(
m_netCodes
[
netcode
]
);
zc
->
BOARD_CONNECTED_ITEM
::
SetNetCode
(
getNetCode
(
netcode
)
);
}
else
if
(
TESTLINE
(
"ZLayer"
)
)
// layer found
...
...
pcbnew/legacy_plugin.h
View file @
2af3e5f6
...
...
@@ -139,6 +139,16 @@ protected:
double
diskToBiu
;
///< convert from disk engineering units to BIUs
///< with this scale factor
///> Converts net code using the mapping table if available,
///> otherwise returns unchanged net code
inline
int
getNetCode
(
int
aNetCode
)
{
if
(
aNetCode
<
(
int
)
m_netCodes
.
size
()
)
return
m_netCodes
[
aNetCode
];
return
aNetCode
;
}
/**
* Function biuParse
* parses an ASCII decimal floating point value and scales it into a BIU
...
...
pcbnew/pcb_parser.cpp
View file @
2af3e5f6
...
...
@@ -2201,7 +2201,7 @@ D_PAD* PCB_PARSER::parseD_PAD( MODULE* aParent ) throw( IO_ERROR, PARSE_ERROR )
break
;
case
T_net
:
pad
->
SetNetCode
(
m_netCodes
[
parseInt
(
"net number"
)]
);
pad
->
SetNetCode
(
getNetCode
(
parseInt
(
"net number"
)
)
);
NeedSYMBOLorNUMBER
();
assert
(
FromUTF8
()
==
m_board
->
FindNet
(
pad
->
GetNetCode
()
)
->
GetNetname
()
);
NeedRIGHT
();
...
...
@@ -2299,7 +2299,7 @@ TRACK* PCB_PARSER::parseTRACK() throw( IO_ERROR, PARSE_ERROR )
break
;
case
T_net
:
track
->
SetNetCode
(
m_netCodes
[
parseInt
(
"net number"
)]
);
track
->
SetNetCode
(
getNetCode
(
parseInt
(
"net number"
)
)
);
break
;
case
T_tstamp
:
...
...
@@ -2377,7 +2377,7 @@ VIA* PCB_PARSER::parseVIA() throw( IO_ERROR, PARSE_ERROR )
break
;
case
T_net
:
via
->
SetNetCode
(
m_netCodes
[
parseInt
(
"net number"
)]
);
via
->
SetNetCode
(
getNetCode
(
parseInt
(
"net number"
)
)
);
NeedRIGHT
();
break
;
...
...
@@ -2429,7 +2429,7 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER() throw( IO_ERROR, PARSE_ERROR )
// Init the net code only, not the netname, to be sure
// the zone net name is the name read in file.
// (When mismatch, the user will be prompted in DRC, to fix the actual name)
zone
->
SetNetCode
(
m_netCodes
[
parseInt
(
"net number"
)]
);
zone
->
SetNetCode
(
getNetCode
(
parseInt
(
"net number"
)
)
);
NeedRIGHT
();
break
;
...
...
pcbnew/pcb_parser.h
View file @
2af3e5f6
...
...
@@ -69,6 +69,16 @@ class PCB_PARSER : public PCB_LEXER
LAYER_MSK_MAP
m_layerMasks
;
///< map layer names to their masks
std
::
vector
<
int
>
m_netCodes
;
///< net codes mapping for boards being loaded
///> Converts net code using the mapping table if available,
///> otherwise returns unchanged net code
inline
int
getNetCode
(
int
aNetCode
)
{
if
(
aNetCode
<
(
int
)
m_netCodes
.
size
()
)
return
m_netCodes
[
aNetCode
];
return
aNetCode
;
}
/**
* Function init
* clears and re-establishes m_layerMap with the default layer names.
...
...
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