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
e6306723
Commit
e6306723
authored
Jan 30, 2012
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: Minor fix and enhancement.
parent
ee8d721c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
16 deletions
+39
-16
class_module.cpp
pcbnew/class_module.cpp
+3
-0
netlist.cpp
pcbnew/netlist.cpp
+36
-16
No files found.
pcbnew/class_module.cpp
View file @
e6306723
...
...
@@ -85,7 +85,9 @@ MODULE::MODULE( const MODULE& aModule ) :
m_Pos
=
aModule
.
m_Pos
;
m_LibRef
=
aModule
.
m_LibRef
;
m_Layer
=
aModule
.
m_Layer
;
m_Attributs
=
aModule
.
m_Attributs
;
m_ModuleStatus
=
aModule
.
m_ModuleStatus
;
m_Orient
=
aModule
.
m_Orient
;
m_BoundaryBox
=
aModule
.
m_BoundaryBox
;
m_PadNum
=
aModule
.
m_PadNum
;
...
...
@@ -199,6 +201,7 @@ void MODULE::Copy( MODULE* aModule )
m_Layer
=
aModule
->
m_Layer
;
m_LibRef
=
aModule
->
m_LibRef
;
m_Attributs
=
aModule
->
m_Attributs
;
m_ModuleStatus
=
aModule
->
m_ModuleStatus
;
m_Orient
=
aModule
->
m_Orient
;
m_BoundaryBox
=
aModule
->
m_BoundaryBox
;
m_PadNum
=
aModule
->
m_PadNum
;
...
...
pcbnew/netlist.cpp
View file @
e6306723
...
...
@@ -65,6 +65,7 @@
#include <class_module.h>
#include <pcbnew.h>
#include <dialog_netlist.h>
#include <html_messagebox.h>
#include <netlist_reader.h>
...
...
@@ -528,8 +529,9 @@ MODULE* PCB_EDIT_FRAME::ListAndSelectModuleName( void )
void
PCB_EDIT_FRAME
::
Test_Duplicate_Missing_And_Extra_Footprints
(
const
wxString
&
aNetlistFullFilename
)
{
int
nberr
=
0
;
wxArrayString
list
;
// The list of messages to display
#define ERR_CNT_MAX 100 // Max number of errors to output in dialog
// to avoid a too long calculation time
wxString
list
;
// The messages to display
if
(
GetBoard
()
->
m_Modules
==
NULL
)
{
...
...
@@ -542,6 +544,7 @@ void PCB_EDIT_FRAME::Test_Duplicate_Missing_And_Extra_Footprints(
return
;
SetLastNetListRead
(
aNetlistFullFilename
);
// Build the list of references of the net list modules.
NETLIST_READER
netList_Reader
(
this
);
netList_Reader
.
SetFilesnames
(
aNetlistFullFilename
,
wxEmptyString
);
...
...
@@ -558,10 +561,10 @@ void PCB_EDIT_FRAME::Test_Duplicate_Missing_And_Extra_Footprints(
}
// Search for duplicate footprints.
list
.
Add
(
_
(
"Duplicates"
)
);
list
<<
wxT
(
"<p><b>"
)
<<
_
(
"Duplicates:"
)
<<
wxT
(
"</b></p>"
);
int
err_cnt
=
0
;
MODULE
*
module
=
GetBoard
()
->
m_Modules
;
for
(
;
module
!=
NULL
;
module
=
module
->
Next
()
)
{
MODULE
*
altmodule
=
module
->
Next
();
...
...
@@ -571,18 +574,21 @@ void PCB_EDIT_FRAME::Test_Duplicate_Missing_And_Extra_Footprints(
if
(
module
->
m_Reference
->
m_Text
.
CmpNoCase
(
altmodule
->
m_Reference
->
m_Text
)
==
0
)
{
if
(
module
->
m_Reference
->
m_Text
.
IsEmpty
()
)
list
.
Add
(
wxT
(
"<noref>"
)
);
list
<<
wxT
(
"<br>"
)
<<
wxT
(
"[noref)"
);
else
list
.
Add
(
module
->
m_Reference
->
m_Text
)
;
list
<<
wxT
(
"<br>"
)
<<
module
->
m_Reference
->
m_Text
;
nberr
++
;
list
<<
wxT
(
" (<i>"
)
<<
module
->
m_Value
->
m_Text
<<
wxT
(
"</i>)"
);
err_cnt
++
;
break
;
}
}
if
(
ERR_CNT_MAX
<
err_cnt
)
break
;
}
// Search for missing modules on board.
list
.
Add
(
_
(
"Missing:"
)
);
list
<<
wxT
(
"<p><b>"
)
<<
_
(
"Missing:"
)
<<
wxT
(
"</b></p>"
);
for
(
unsigned
ii
=
0
;
ii
<
moduleInfoList
.
size
();
ii
++
)
{
...
...
@@ -590,13 +596,16 @@ void PCB_EDIT_FRAME::Test_Duplicate_Missing_And_Extra_Footprints(
module
=
GetBoard
()
->
FindModuleByReference
(
mod_info
->
m_Reference
);
if
(
module
==
NULL
)
// Module missing, not found in board
{
list
.
Add
(
mod_info
->
m_Reference
);
nberr
++
;
list
<<
wxT
(
"<br>"
)
<<
mod_info
->
m_Reference
;
list
<<
wxT
(
" (<i>"
)
<<
mod_info
->
m_Value
<<
wxT
(
"</i>)"
);
err_cnt
++
;
}
if
(
ERR_CNT_MAX
<
err_cnt
)
break
;
}
// Search for modules found on board but not in net list.
list
.
Add
(
_
(
"Not in Netlist:"
)
);
list
<<
wxT
(
"<p><b>"
)
<<
_
(
"Not in Netlist:"
)
<<
wxT
(
"</b></p>"
);
module
=
GetBoard
()
->
m_Modules
;
for
(
;
module
!=
NULL
;
module
=
module
->
Next
()
)
...
...
@@ -611,14 +620,25 @@ void PCB_EDIT_FRAME::Test_Duplicate_Missing_And_Extra_Footprints(
if
(
ii
==
moduleInfoList
.
size
()
)
// Module not found in netlist
{
list
.
Add
(
module
->
m_Reference
->
m_Text
);
nberr
++
;
if
(
module
->
m_Reference
->
m_Text
.
IsEmpty
()
)
list
<<
wxT
(
"<br>"
)
<<
wxT
(
"[noref)"
);
else
list
<<
wxT
(
"<br>"
)
<<
module
->
m_Reference
->
m_Text
;
list
<<
wxT
(
" (<i>"
)
<<
module
->
m_Value
->
m_Text
<<
wxT
(
"</i>)"
);
err_cnt
++
;
}
if
(
ERR_CNT_MAX
<
err_cnt
)
break
;
}
if
(
ERR_CNT_MAX
<
err_cnt
)
{
list
<<
wxT
(
"<p><b>"
)
<<
_
(
"Too many errors: some are skipped"
)
<<
wxT
(
"</b></p>"
);
}
wxSingleChoiceDialog
dlg
(
this
,
wxEmptyString
,
_
(
"Check Modules"
),
list
,
NULL
,
wxCHOICEDLG_STYLE
&
~
wxCANCEL
);
HTML_MESSAGE_BOX
dlg
(
this
,
_
(
"Check Modules"
)
);
dlg
.
AddHTML_Text
(
list
);
dlg
.
ShowModal
();
}
...
...
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