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
080746ac
Commit
080746ac
authored
Apr 23, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug support for fixing modules not marked with MOD_CMS
parent
f1ead64a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
4 deletions
+45
-4
gen_modules_placefile.cpp
pcbnew/gen_modules_placefile.cpp
+45
-4
No files found.
pcbnew/gen_modules_placefile.cpp
View file @
080746ac
...
@@ -34,6 +34,29 @@ static int ListeModCmp( LIST_MOD* Ref, LIST_MOD* Cmp )
...
@@ -34,6 +34,29 @@ static int ListeModCmp( LIST_MOD* Ref, LIST_MOD* Cmp )
}
}
#if defined(DEBUG)
/**
* Function HasNonSMDPins
* returns true if the given module has any non smd pins, such as through hole
* and therefore cannot be placed automatically.
*/
static
bool
HasNonSMDPins
(
MODULE
*
aModule
)
{
D_PAD
*
pad
;
for
(
pad
=
aModule
->
m_Pads
;
pad
;
pad
=
pad
->
Next
()
)
{
if
(
pad
->
m_Attribut
!=
PAD_SMD
)
return
true
;
}
return
false
;
}
#endif
/**************************************************************/
/**************************************************************/
void
WinEDA_PcbFrame
::
GenModulesPosition
(
wxCommandEvent
&
event
)
void
WinEDA_PcbFrame
::
GenModulesPosition
(
wxCommandEvent
&
event
)
/**************************************************************/
/**************************************************************/
...
@@ -59,13 +82,31 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
...
@@ -59,13 +82,31 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
File_Place_Offset
=
m_Auxiliary_Axis_Position
;
File_Place_Offset
=
m_Auxiliary_Axis_Position
;
/* Calcul du nombre de modules utiles ( Attribut CMS, non VIRTUAL ) ) */
/* Calcul du nombre de modules utiles ( Attribut CMS, non VIRTUAL ) ) */
NbMod
=
0
;
Module
=
m_Pcb
->
m_Modules
;
NbMod
=
0
;
for
(
;
Module
!=
NULL
;
Module
=
(
MODULE
*
)
Module
->
Pnext
)
for
(
Module
=
m_Pcb
->
m_Modules
;
Module
;
Module
=
Module
->
Next
()
)
{
{
if
(
Module
->
m_Attributs
&
MOD_VIRTUAL
)
if
(
Module
->
m_Attributs
&
MOD_VIRTUAL
)
{
D
(
printf
(
"skipping module %s because its virtual
\n
"
,
CONV_TO_UTF8
(
Module
->
GetReference
())
);)
continue
;
continue
;
}
if
(
(
Module
->
m_Attributs
&
MOD_CMS
)
==
0
)
if
(
(
Module
->
m_Attributs
&
MOD_CMS
)
==
0
)
{
#if 0 && defined(DEBUG) // enable this code to fix a bunch of mis-labeled modules:
if( !HasNonSMDPins( Module ) )
Module->m_Attributs |= MOD_CMS; // all pins are SMD, fix the problem
else
{
printf( "skipping %s because its attribute is not CMS and it has non SMD pins\n", CONV_TO_UTF8(Module->GetReference()) );
continue;
}
#else
continue
;
continue
;
#endif
}
if
(
Module
->
GetLayer
()
==
COPPER_LAYER_N
)
if
(
Module
->
GetLayer
()
==
COPPER_LAYER_N
)
GenCu
=
TRUE
;
GenCu
=
TRUE
;
NbMod
++
;
NbMod
++
;
...
@@ -119,8 +160,8 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
...
@@ -119,8 +160,8 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
/* Etablissement de la liste des modules par ordre alphabetique */
/* Etablissement de la liste des modules par ordre alphabetique */
Liste
=
(
LIST_MOD
*
)
MyZMalloc
(
NbMod
*
sizeof
(
LIST_MOD
)
);
Liste
=
(
LIST_MOD
*
)
MyZMalloc
(
NbMod
*
sizeof
(
LIST_MOD
)
);
Module
=
(
MODULE
*
)
m_Pcb
->
m_Modules
;
Module
=
m_Pcb
->
m_Modules
;
for
(
ii
=
0
;
Module
!=
NULL
;
Module
=
Module
->
Next
()
)
for
(
ii
=
0
;
Module
;
Module
=
Module
->
Next
()
)
{
{
if
(
Module
->
m_Attributs
&
MOD_VIRTUAL
)
if
(
Module
->
m_Attributs
&
MOD_VIRTUAL
)
continue
;
continue
;
...
...
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