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
1661d6d4
Commit
1661d6d4
authored
Feb 26, 2010
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing problems in build_BOM.cpp
parent
24885c98
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
11 deletions
+20
-11
build_BOM.cpp
eeschema/build_BOM.cpp
+19
-10
dialog_build_BOM.h
eeschema/dialog_build_BOM.h
+1
-1
No files found.
eeschema/build_BOM.cpp
View file @
1661d6d4
...
...
@@ -123,7 +123,7 @@ void DIALOG_BUILD_BOM::Create_BOM_Lists( int aTypeFile,
break
;
case
2
:
// Single Part per line
CreatePartsList
(
m_ListFileName
);
CreatePartsList
(
m_ListFileName
,
aIncludeSubComponents
);
break
;
}
...
...
@@ -144,7 +144,7 @@ void DIALOG_BUILD_BOM::Create_BOM_Lists( int aTypeFile,
* form is:
* cmp value; number of components; <footprint>; field1; field2; field3; list of references having the same value
*/
void
DIALOG_BUILD_BOM
::
CreatePartsList
(
const
wxString
&
aFullFileName
)
void
DIALOG_BUILD_BOM
::
CreatePartsList
(
const
wxString
&
aFullFileName
,
bool
aIncludeSubComponents
)
{
FILE
*
f
;
wxString
msg
;
...
...
@@ -160,7 +160,14 @@ void DIALOG_BUILD_BOM::CreatePartsList( const wxString& aFullFileName )
std
::
vector
<
OBJ_CMP_TO_LIST
>
cmplist
;
BuildComponentsListFromSchematic
(
cmplist
);
/* sort component list */
/* sort component list by ref and remove sub components*/
if
(
!
aIncludeSubComponents
)
{
sort
(
cmplist
.
begin
(),
cmplist
.
end
(),
SortComponentsByReference
);
DeleteSubCmp
(
cmplist
);
}
/* sort component list by value*/
sort
(
cmplist
.
begin
(),
cmplist
.
end
(),
SortComponentsByValue
);
PrintComponentsListByPart
(
f
,
cmplist
);
...
...
@@ -792,16 +799,15 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart(
std
::
vector
<
OBJ_CMP_TO_LIST
>&
aList
)
{
int
qty
=
1
;
char
RefName
[
80
];
char
ValName
[
80
];
char
NxtName
[
80
];
char
RNames
[
1
000
];
char
RefName
[
256
];
char
ValName
[
256
];
char
NxtName
[
256
];
char
RNames
[
2
000
];
wxArrayString
cmpFields
;
EDA_BaseStruct
*
DrawList
;
EDA_BaseStruct
*
NxtList
;
SCH_COMPONENT
*
DrawLibItem
;
SCH_COMPONENT
*
NxtLibItem
;
int
jj
;
strcpy
(
NxtName
,
""
);
strcpy
(
RNames
,
""
);
...
...
@@ -835,11 +841,14 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart(
sprintf
(
ValName
,
"%s"
,
CONV_TO_UTF8
(
DrawLibItem
->
GetField
(
VALUE
)
->
m_Text
)
);
if
(
NxtLibItem
)
sprintf
(
NxtName
,
"%s"
,
CONV_TO_UTF8
(
NxtLibItem
->
GetField
(
VALUE
)
->
m_Text
)
);
else
NxtName
[
0
]
=
0
;
// Store fields. try to store non empty fields.
if
(
cmpFields
.
GetCount
()
<
DrawLibItem
->
GetFieldCount
()
)
if
(
(
int
)
cmpFields
.
GetCount
()
<
DrawLibItem
->
GetFieldCount
()
)
cmpFields
.
Alloc
(
DrawLibItem
->
GetFieldCount
());
for
(
jj
=
FIELD1
;
jj
<
DrawLibItem
->
GetFieldCount
();
jj
++
)
for
(
int
jj
=
FIELD1
;
jj
<
DrawLibItem
->
GetFieldCount
();
jj
++
)
{
if
(
cmpFields
[
jj
].
IsEmpty
()
)
cmpFields
[
jj
]
=
DrawLibItem
->
GetField
(
jj
)
->
m_Text
;
...
...
eeschema/dialog_build_BOM.h
View file @
1661d6d4
...
...
@@ -29,7 +29,7 @@ private:
bool
aRunBrowser
);
void
GenereListeOfItems
(
const
wxString
&
FullFileName
,
bool
aIncludeSubComponents
);
void
CreateExportList
(
const
wxString
&
FullFileName
,
bool
aIncludeSubComponents
);
void
CreatePartsList
(
const
wxString
&
FullFileName
);
void
CreatePartsList
(
const
wxString
&
FullFileName
,
bool
aIncludeSubComponents
);
int
PrintComponentsListByRef
(
FILE
*
f
,
std
::
vector
<
OBJ_CMP_TO_LIST
>&
aList
,
bool
CompactForm
,
bool
aIncludeSubComponents
);
int
PrintComponentsListByVal
(
FILE
*
f
,
std
::
vector
<
OBJ_CMP_TO_LIST
>&
aList
,
...
...
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