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
0e8dbc80
Commit
0e8dbc80
authored
May 03, 2011
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: netlist.cpp: code cleaning and coding policy fixes
parent
87d2b44f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
165 additions
and
149 deletions
+165
-149
netlist.cpp
pcbnew/netlist.cpp
+165
-149
No files found.
pcbnew/netlist.cpp
View file @
0e8dbc80
...
...
@@ -101,7 +101,6 @@ public: NETLIST_READER( PCB_EDIT_FRAME* aFrame, wxTextCtrl* aMessageWindow = NUL
m_useCmpFile
=
true
;
}
~
NETLIST_READER
()
{
// Free new modules list:
...
...
@@ -111,7 +110,6 @@ public: NETLIST_READER( PCB_EDIT_FRAME* aFrame, wxTextCtrl* aMessageWindow = NUL
m_newModulesList
.
clear
();
}
/**
* Function ReadNetList
* The main function to read a netlist, and update the board
...
...
@@ -125,13 +123,13 @@ public: NETLIST_READER( PCB_EDIT_FRAME* aFrame, wxTextCtrl* aMessageWindow = NUL
const
wxString
&
aCmplistFileName
);
/**
* Function Build
Footprint
ListFromNetlist
* Fill aBufName with
footprints
references read from the netlist.
* Function Build
Components
ListFromNetlist
* Fill aBufName with
component
references read from the netlist.
* @param aNetlistFilename = netlist full file name
* @param aBufName = wxArrayString to fill with
footprint nam
es
* @return the
footpri
nt count, or -1 if netlist file cannot opened
* @param aBufName = wxArrayString to fill with
component referenc
es
* @return the
compone
nt count, or -1 if netlist file cannot opened
*/
int
Build
Footprint
ListFromNetlist
(
const
wxString
&
aNetlistFilename
,
int
Build
Components
ListFromNetlist
(
const
wxString
&
aNetlistFilename
,
wxArrayString
&
aBufName
);
/**
...
...
@@ -175,15 +173,16 @@ private:
void
loadNewModules
();
/**
* function readModule
sComponentsTab
le
* function readModule
ComponentLinkfi
le
* read the *.cmp file ( filename in m_cmplistFullName )
* giving the equivalence beteween modules and components
* @return true and the module name in aModuleName, false if not found
* giving the equivalence between footprint names and components
* to find the footprint name corresponding to aCmpIdent
* @return true and the module name in aFootprintName, false if not found
*
* @param aCmpIdent = component identification: schematic reference or time stamp
* @param a
Module
Name the footprint name corresponding to the component identification
* @param a
Footprint
Name the footprint name corresponding to the component identification
*/
bool
readModule
sComponentsTable
(
const
wxString
*
aCmpIdent
,
wxString
&
aModule
Name
);
bool
readModule
ComponentLinkfile
(
const
wxString
*
aCmpIdent
,
wxString
&
aFootprint
Name
);
};
/**
...
...
@@ -289,13 +288,11 @@ bool PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFullFilename,
// Rebuild the board connectivity:
Compile_Ratsnest
(
NULL
,
true
);
if
(
GetBoard
()
->
m_Track
)
if
(
aDeleteBadTracks
&&
GetBoard
()
->
m_Track
)
{
if
(
aDeleteBadTracks
)
// Remove erroneous tracks
{
RemoveMisConnectedTracks
(
NULL
);
Compile_Ratsnest
(
NULL
,
true
);
}
// Remove erroneous tracks
RemoveMisConnectedTracks
(
NULL
);
Compile_Ratsnest
(
NULL
,
true
);
}
GetBoard
()
->
DisplayInfo
(
this
);
...
...
@@ -309,26 +306,26 @@ bool PCB_EDIT_FRAME::ReadPcbNetlist( const wxString& aNetlistFullFilename,
*/
void
NETLIST_READER
::
RemoveExtraFootprints
(
const
wxString
&
aNetlistFileName
)
{
wxArrayString
module
sInNetlist
;
wxArrayString
component
sInNetlist
;
// Build list of modules in the netlist
int
modulesCount
=
Build
FootprintListFromNetlist
(
aNetlistFileName
,
module
sInNetlist
);
Build
ComponentsListFromNetlist
(
aNetlistFileName
,
component
sInNetlist
);
if
(
modulesCount
==
0
)
return
;
MODULE
*
N
extModule
;
MODULE
*
M
odule
=
m_pcbframe
->
GetBoard
()
->
m_Modules
;
MODULE
*
n
extModule
;
MODULE
*
m
odule
=
m_pcbframe
->
GetBoard
()
->
m_Modules
;
bool
ask_user
=
true
;
for
(
;
Module
!=
NULL
;
Module
=
N
extModule
)
for
(
;
module
!=
NULL
;
module
=
n
extModule
)
{
int
ii
;
NextModule
=
M
odule
->
Next
();
if
(
M
odule
->
m_ModuleStatus
&
MODULE_is_LOCKED
)
nextModule
=
m
odule
->
Next
();
if
(
m
odule
->
m_ModuleStatus
&
MODULE_is_LOCKED
)
continue
;
for
(
ii
=
0
;
ii
<
modulesCount
;
ii
++
)
{
if
(
Module
->
m_Reference
->
m_Text
.
CmpNoCase
(
module
sInNetlist
[
ii
]
)
==
0
)
if
(
module
->
m_Reference
->
m_Text
.
CmpNoCase
(
component
sInNetlist
[
ii
]
)
==
0
)
break
;
/* Module is found in net list. */
}
...
...
@@ -341,7 +338,7 @@ void NETLIST_READER::RemoveExtraFootprints( const wxString& aNetlistFileName )
_
(
"Ok to delete not locked footprints not found in netlist?"
)
)
)
break
;
}
M
odule
->
DeleteStructure
();
m
odule
->
DeleteStructure
();
}
}
}
...
...
@@ -371,8 +368,8 @@ bool NETLIST_READER::ReadNetList( FILE* aFile,
const
wxString
&
aNetlistFileName
,
const
wxString
&
aCmplistFileName
)
{
int
S
tate
=
0
;
int
Comment
=
0
;
int
s
tate
=
0
;
bool
is_comment
=
false
;
m_netlistFullName
=
aNetlistFileName
;
m_cmplistFullName
=
aCmplistFileName
;
...
...
@@ -387,35 +384,35 @@ bool NETLIST_READER::ReadNetList( FILE* aFile,
{
char
*
line
=
StrPurge
(
netlineReader
.
Line
()
);
if
(
C
omment
)
/* Comments in progress */
if
(
is_c
omment
)
/* Comments in progress */
{
// Test for end of the current comment
if
(
(
line
=
strchr
(
line
,
'}'
)
)
==
NULL
)
continue
;
Comment
=
0
;
is_comment
=
false
;
}
if
(
*
line
==
'{'
)
/* Start Comment */
{
Comment
=
1
;
is_comment
=
true
;
if
(
(
line
=
strchr
(
line
,
'}'
)
)
==
NULL
)
continue
;
}
if
(
*
line
==
'('
)
S
tate
++
;
s
tate
++
;
if
(
*
line
==
')'
)
S
tate
--
;
s
tate
--
;
if
(
S
tate
==
2
)
if
(
s
tate
==
2
)
{
ReadNetlistModuleDescr
(
line
,
TESTONLY
);
continue
;
}
if
(
S
tate
>=
3
)
// First pass: pad descriptions are not read here.
if
(
s
tate
>=
3
)
// First pass: pad descriptions are not read here.
{
S
tate
--
;
s
tate
--
;
}
}
...
...
@@ -427,30 +424,32 @@ bool NETLIST_READER::ReadNetList( FILE* aFile,
*/
netlineReader
.
Rewind
();
m_currModule
=
NULL
;
state
=
0
;
is_comment
=
false
;
while
(
netlineReader
.
ReadLine
()
)
{
char
*
line
=
StrPurge
(
netlineReader
.
Line
()
);
if
(
C
omment
)
// we are reading a comment
if
(
is_c
omment
)
// we are reading a comment
{
// Test for end of the current comment
if
(
(
line
=
strchr
(
line
,
'}'
)
)
==
NULL
)
continue
;
Comment
=
0
;
is_comment
=
false
;
}
if
(
*
line
==
'{'
)
// this is the beginning of a comment
{
Comment
=
1
;
is_comment
=
true
;
if
(
(
line
=
strchr
(
line
,
'}'
)
)
==
NULL
)
continue
;
}
if
(
*
line
==
'('
)
S
tate
++
;
s
tate
++
;
if
(
*
line
==
')'
)
S
tate
--
;
s
tate
--
;
if
(
S
tate
==
2
)
if
(
s
tate
==
2
)
{
m_currModule
=
ReadNetlistModuleDescr
(
line
,
READMODULE
);
if
(
m_currModule
==
NULL
)
// the module could not be created (perhaps
...
...
@@ -458,20 +457,20 @@ bool NETLIST_READER::ReadNetList( FILE* aFile,
continue
;
else
/* clear pads netnames */
{
D_PAD
*
PtP
ad
=
m_currModule
->
m_Pads
;
for
(
;
PtPad
!=
NULL
;
PtPad
=
PtP
ad
->
Next
()
)
D_PAD
*
p
ad
=
m_currModule
->
m_Pads
;
for
(
;
pad
!=
NULL
;
pad
=
p
ad
->
Next
()
)
{
PtP
ad
->
SetNetname
(
wxEmptyString
);
p
ad
->
SetNetname
(
wxEmptyString
);
}
}
continue
;
}
if
(
S
tate
>=
3
)
if
(
s
tate
>=
3
)
{
if
(
m_currModule
)
SetPadNetName
(
line
);
S
tate
--
;
s
tate
--
;
}
}
...
...
@@ -493,96 +492,106 @@ bool NETLIST_READER::ReadNetList( FILE* aFile,
* If false: the netlist only is used
* This flag is reset to false if the .cmp file is not found
* Analyze lines like:
* (
$ 40C08647 noname R20 4.7 K Lib = R
* (
/40C08647 $noname R20 4.7K {Lib=R}
* (1 VCC)
* (2 MODB_1)
* )
*/
MODULE
*
NETLIST_READER
::
ReadNetlistModuleDescr
(
char
*
aText
,
bool
aTstOnly
)
{
char
*
text
;
wxString
TimeStampPath
;
wxString
TextNameLibMod
;
wxString
TextValeur
;
wxString
TextCmpName
;
wxString
NameLibCmp
;
int
Error
=
0
;
char
Line
[
1024
];
wxString
timeStampPath
;
// the full time stamp read from netlist
wxString
textFootprintName
;
// the footprint name read from netlist
wxString
textValue
;
// the component value read from netlist
wxString
textCmpReference
;
// the component schematic reference read from netlist
wxString
cmpFootprintName
;
// the footprint name read from the *.cmp file
// giving the equivalence between footprint names and components
bool
error
=
false
;
char
line
[
1024
];
strcpy
(
Line
,
aText
);
strcpy
(
line
,
aText
);
textValue
=
wxT
(
"~"
);
TextValeur
=
wxT
(
"~"
);
// Read descr line like /40C08647 $noname R20 4.7K {Lib=R}
if
(
(
text
=
strtok
(
Line
,
" ()
\t\n
"
)
)
==
NULL
)
Error
=
1
;
// Read time stamp (first word)
if
(
(
text
=
strtok
(
line
,
" ()
\t\n
"
)
)
==
NULL
)
error
=
true
;
else
T
imeStampPath
=
FROM_UTF8
(
text
);
t
imeStampPath
=
FROM_UTF8
(
text
);
// Read footprint name (second word)
if
(
(
text
=
strtok
(
NULL
,
" ()
\t\n
"
)
)
==
NULL
)
Error
=
1
;
error
=
true
;
else
TextNameLibMod
=
FROM_UTF8
(
text
);
textFootprintName
=
FROM_UTF8
(
text
);
// Read schematic reference (third word)
if
(
(
text
=
strtok
(
NULL
,
" ()
\t\n
"
)
)
==
NULL
)
Error
=
1
;
error
=
true
;
else
TextCmpNam
e
=
FROM_UTF8
(
text
);
textCmpReferenc
e
=
FROM_UTF8
(
text
);
// Read schematic value (forth word)
if
(
(
text
=
strtok
(
NULL
,
" ()
\t\n
"
)
)
==
NULL
)
Error
=
-
1
;
error
=
true
;
else
TextValeur
=
FROM_UTF8
(
text
);
textValue
=
FROM_UTF8
(
text
);
if
(
Error
>
0
)
if
(
error
)
return
NULL
;
/* Test if module is already loaded. */
wxString
*
identMod
=
&
TextCmpNam
e
;
wxString
*
identMod
=
&
textCmpReferenc
e
;
if
(
m_UseTimeStamp
)
identMod
=
&
T
imeStampPath
;
identMod
=
&
t
imeStampPath
;
MODULE
*
M
odule
=
m_pcbframe
->
GetBoard
()
->
m_Modules
;
MODULE
*
N
extModule
;
MODULE
*
m
odule
=
m_pcbframe
->
GetBoard
()
->
m_Modules
;
MODULE
*
n
extModule
;
bool
found
=
false
;
for
(
;
Module
!=
NULL
;
Module
=
N
extModule
)
for
(
;
module
!=
NULL
;
module
=
n
extModule
)
{
NextModule
=
M
odule
->
Next
();
nextModule
=
m
odule
->
Next
();
if
(
m_UseTimeStamp
)
/* identification by time stamp */
{
if
(
TimeStampPath
.
CmpNoCase
(
M
odule
->
m_Path
)
==
0
)
if
(
timeStampPath
.
CmpNoCase
(
m
odule
->
m_Path
)
==
0
)
found
=
true
;
}
else
/* identification by Reference */
{
if
(
TextCmpName
.
CmpNoCase
(
M
odule
->
m_Reference
->
m_Text
)
==
0
)
if
(
textCmpReference
.
CmpNoCase
(
m
odule
->
m_Reference
->
m_Text
)
==
0
)
found
=
true
;
}
if
(
found
)
//
test footprint matching for existing modules: current
if
(
found
)
//
The footprint corresponding to the component is already on board
{
// m_LibRef and module name in netlist must match
// We do do load the footprint, because it is already on board
// but we compare m_LibRef (existing footprint name) and the footprint name from netlist
// and change this footprint if differs from netlist (only on demand).
if
(
aTstOnly
!=
TESTONLY
)
{
NameLibCmp
=
TextNameLibMod
;
// Use footprint name from netlist
if
(
m_useCmpFile
)
// Try to get footprint name from .cmp file
cmpFootprintName
=
textFootprintName
;
// Use footprint name from netlist
if
(
m_useCmpFile
)
// Try to get footprint name from .cmp file
{
m_useCmpFile
=
readModule
sComponentsTable
(
identMod
,
NameLibCmp
);
m_useCmpFile
=
readModule
ComponentLinkfile
(
identMod
,
cmpFootprintName
);
}
/* Module mismatch: current
module and module
specified in
* net list are
different.
/* Module mismatch: current
fotprint and footprint
specified in
* net list are different.
*/
if
(
Module
->
m_LibRef
.
CmpNoCase
(
NameLibCmp
)
!=
0
)
if
(
module
->
m_LibRef
.
CmpNoCase
(
cmpFootprintName
)
!=
0
)
{
if
(
m_ChangeFootprints
)
// footprint exchange allowed.
{
MODULE
*
N
ewModule
=
MODULE
*
n
ewModule
=
m_pcbframe
->
Get_Librairie_Module
(
wxEmptyString
,
NameLibCmp
,
cmpFootprintName
,
true
);
if
(
NewModule
)
/* Change old module to the new module
* (and delete the old one) */
if
(
newModule
)
{
m_pcbframe
->
Exchange_Module
(
Module
,
NewModule
,
NULL
);
Module
=
NewModule
;
// Change old module to the new module (and delete the old one)
m_pcbframe
->
Exchange_Module
(
module
,
newModule
,
NULL
);
module
=
newModule
;
}
}
else
...
...
@@ -591,9 +600,9 @@ MODULE* NETLIST_READER::ReadNetlistModuleDescr( char* aText, bool aTstOnly )
msg
.
Printf
(
_
(
"Component
\"
%s
\"
: Mismatch! module is [%s] and netlist said [%s]
\n
"
),
GetChars
(
TextCmpNam
e
),
GetChars
(
M
odule
->
m_LibRef
),
GetChars
(
NameLibCmp
)
);
GetChars
(
textCmpReferenc
e
),
GetChars
(
m
odule
->
m_LibRef
),
GetChars
(
cmpFootprintName
)
);
if
(
m_messageWindow
)
m_messageWindow
->
AppendText
(
msg
);
...
...
@@ -605,18 +614,18 @@ MODULE* NETLIST_READER::ReadNetlistModuleDescr( char* aText, bool aTstOnly )
}
}
if
(
Module
==
NULL
)
/* a new module must be loaded from libs */
if
(
module
==
NULL
)
// a new module must be loaded from libs
{
NameLibCmp
=
TextNameLibMod
;
// Use footprint name from netlist
if
(
m_useCmpFile
)
// Try to get footprint name from .cmp file
cmpFootprintName
=
textFootprintName
;
// Use footprint name from netlist
if
(
m_useCmpFile
)
// Try to get footprint name from .cmp file
{
m_useCmpFile
=
readModule
sComponentsTable
(
identMod
,
NameLibCmp
);
m_useCmpFile
=
readModule
ComponentLinkfile
(
identMod
,
cmpFootprintName
);
}
if
(
aTstOnly
==
TESTONLY
)
{
MODULE_INFO
*
newMod
;
newMod
=
new
MODULE_INFO
(
NameLibCmp
,
TextCmpName
,
T
imeStampPath
);
newMod
=
new
MODULE_INFO
(
cmpFootprintName
,
textCmpReference
,
t
imeStampPath
);
m_newModulesList
.
push_back
(
newMod
);
}
else
...
...
@@ -625,19 +634,19 @@ MODULE* NETLIST_READER::ReadNetlistModuleDescr( char* aText, bool aTstOnly )
{
wxString
msg
;
msg
.
Printf
(
_
(
"Component [%s] not found"
),
GetChars
(
TextCmpNam
e
)
);
GetChars
(
textCmpReferenc
e
)
);
m_messageWindow
->
AppendText
(
msg
+
wxT
(
"
\n
"
)
);
}
}
return
NULL
;
/
* The module could not be loaded. */
return
NULL
;
/
/ The module could not be loaded.
}
/
* Fields update ( reference, value and "Time Stamp") */
Module
->
m_Reference
->
m_Text
=
TextCmpNam
e
;
Module
->
m_Value
->
m_Text
=
TextValeur
;
Module
->
m_Path
=
T
imeStampPath
;
/
/ Update current module ( reference, value and "Time Stamp")
module
->
m_Reference
->
m_Text
=
textCmpReferenc
e
;
module
->
m_Value
->
m_Text
=
textValue
;
module
->
m_Path
=
t
imeStampPath
;
return
M
odule
;
return
m
odule
;
}
...
...
@@ -762,7 +771,7 @@ void PCB_EDIT_FRAME::Test_Duplicate_Missing_And_Extra_Footprints(
/* Build the list of references of the net list modules. */
NETLIST_READER
netList_Reader
(
this
);
NbModulesNetListe
=
netList_Reader
.
Build
Footprint
ListFromNetlist
(
aNetlistFullFilename
,
tmp
);
NbModulesNetListe
=
netList_Reader
.
Build
Components
ListFromNetlist
(
aNetlistFullFilename
,
tmp
);
if
(
NbModulesNetListe
<
0
)
return
;
/* File not found */
...
...
@@ -843,85 +852,91 @@ void PCB_EDIT_FRAME::Test_Duplicate_Missing_And_Extra_Footprints(
/**
* Function Build
Footprint
ListFromNetlist
*
Fill BufName with footprints nam
es read from the netlist.
* Function Build
Components
ListFromNetlist
*
Fill aBufName with component referenc
es read from the netlist.
* @param aNetlistFilename = netlist full file name
* @param aBufName = wxArrayString to fill with
footprint nam
es
* @return
Footpri
nt count, or -1 if netlist file cannot opened
* @param aBufName = wxArrayString to fill with
component referenc
es
* @return
compone
nt count, or -1 if netlist file cannot opened
*/
int
NETLIST_READER
::
Build
Footprint
ListFromNetlist
(
const
wxString
&
aNetlistFilename
,
int
NETLIST_READER
::
Build
Components
ListFromNetlist
(
const
wxString
&
aNetlistFilename
,
wxArrayString
&
aBufName
)
{
int
nb_modules_lus
;
int
State
,
Comment
;
char
*
Text
,
*
LibModName
;
int
component_count
;
int
state
;
bool
is_comment
;
char
*
text
;
FILE
*
netfile
=
OpenNetlistFile
(
aNetlistFilename
);
if
(
netfile
==
NULL
)
return
-
1
;
FILE_LINE_READER
netlineReader
(
netfile
,
aNetlistFilename
);
FILE_LINE_READER
netlineReader
(
netfile
,
aNetlistFilename
);
// ctor will close netfile
char
*
Line
=
netlineReader
;
State
=
0
;
Comment
=
0
;
nb_modules_lus
=
0
;
state
=
0
;
is_comment
=
false
;
component_count
=
0
;
while
(
netlineReader
.
ReadLine
()
)
{
T
ext
=
StrPurge
(
Line
);
if
(
C
omment
)
t
ext
=
StrPurge
(
Line
);
if
(
is_c
omment
)
{
if
(
(
Text
=
strchr
(
T
ext
,
'}'
)
)
==
NULL
)
if
(
(
text
=
strchr
(
t
ext
,
'}'
)
)
==
NULL
)
continue
;
Comment
=
0
;
is_comment
=
false
;
}
if
(
*
T
ext
==
'{'
)
/* Comments. */
if
(
*
t
ext
==
'{'
)
/* Comments. */
{
Comment
=
1
;
if
(
(
Text
=
strchr
(
T
ext
,
'}'
)
)
==
NULL
)
is_comment
=
true
;
if
(
(
text
=
strchr
(
t
ext
,
'}'
)
)
==
NULL
)
continue
;
}
if
(
*
T
ext
==
'('
)
S
tate
++
;
if
(
*
T
ext
==
')'
)
S
tate
--
;
if
(
*
t
ext
==
'('
)
s
tate
++
;
if
(
*
t
ext
==
')'
)
s
tate
--
;
if
(
S
tate
==
2
)
if
(
s
tate
==
2
)
{
int
Error
=
0
;
bool
error
=
false
;
// skip TimeStamp:
if
(
strtok
(
Line
,
" ()
\t\n
"
)
==
NULL
)
Error
=
1
;
/* TimeStamp */
if
(
(
LibModName
=
strtok
(
NULL
,
" ()
\t\n
"
)
)
==
NULL
)
Error
=
1
;
/* Load the name of the component. */
if
(
(
Text
=
strtok
(
NULL
,
" ()
\t\n
"
)
)
==
NULL
)
Error
=
1
;
nb_modules_lus
++
;
aBufName
.
Add
(
FROM_UTF8
(
Text
)
);
error
=
true
;
// skip footprint name:
if
(
(
strtok
(
NULL
,
" ()
\t\n
"
)
)
==
NULL
)
error
=
true
;
// Load the reference of the component:
if
(
(
text
=
strtok
(
NULL
,
" ()
\t\n
"
)
)
==
NULL
)
error
=
true
;
component_count
++
;
aBufName
.
Add
(
FROM_UTF8
(
text
)
);
continue
;
}
if
(
S
tate
>=
3
)
if
(
s
tate
>=
3
)
{
S
tate
--
;
s
tate
--
;
}
}
return
nb_modules_lus
;
return
component_count
;
}
/*
* function readModule
sComponentsTab
le
* function readModule
ComponentLinkfi
le
* read the *.cmp file ( filename in m_cmplistFullName )
* giving the equivalence modules / components
* return true and the module name in aModuleName, false if not found
* giving the equivalence Footprint_names / components
* to find the footprint name corresponding to aCmpIdent
* return true and the module name in aFootprintName, false if not found
*
* param aCmpIdent = component identification: schematic reference or time stamp
* param aModuleName the footprint name corresponding to the component identification
* Example file:
* param aFootprintName the footprint name corresponding to the component identification
*
* Sample file:
*
* Cmp-Mod V01 Genere by Pcbnew 29/10/2003-13: 11:6 *
* BeginCmp
...
...
@@ -939,7 +954,8 @@ int NETLIST_READER::BuildFootprintListFromNetlist( const wxString& aNetlistFilen
* EndCmp
*
*/
bool
NETLIST_READER
::
readModulesComponentsTable
(
const
wxString
*
aCmpIdent
,
wxString
&
aModuleName
)
bool
NETLIST_READER
::
readModuleComponentLinkfile
(
const
wxString
*
aCmpIdent
,
wxString
&
aFootprintName
)
{
wxString
refcurrcmp
;
// Stores value read from line like Reference = BUS1;
wxString
timestamp
;
// Stores value read from line like TimeStamp = /32307DE2/AA450F67;
...
...
@@ -1004,7 +1020,7 @@ bool NETLIST_READER::readModulesComponentsTable( const wxString* aCmpIdent, wxSt
{
if
(
aCmpIdent
->
CmpNoCase
(
timestamp
)
==
0
&&
!
timestamp
.
IsEmpty
()
)
{
// Found
a
Module
Name
=
idmod
;
a
Footprint
Name
=
idmod
;
return
true
;
}
}
...
...
@@ -1012,7 +1028,7 @@ bool NETLIST_READER::readModulesComponentsTable( const wxString* aCmpIdent, wxSt
{
if
(
aCmpIdent
->
CmpNoCase
(
refcurrcmp
)
==
0
)
// Found!
{
a
Module
Name
=
idmod
;
a
Footprint
Name
=
idmod
;
return
true
;
}
}
...
...
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