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
5742bfb8
Commit
5742bfb8
authored
Jul 16, 2012
by
Marco Mattila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix eeschema single part per line bom generation.
parent
465dabd9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
dialog_build_BOM.cpp
eeschema/dialogs/dialog_build_BOM.cpp
+20
-8
No files found.
eeschema/dialogs/dialog_build_BOM.cpp
View file @
5742bfb8
...
...
@@ -468,7 +468,7 @@ void DIALOG_BUILD_BOM::CreatePartsList( )
cmplist
.
RemoveSubComponentsFromList
();
// sort component list by value
cmplist
.
SortByValue
AndRef
(
);
cmplist
.
SortByValue
Only
(
);
PrintComponentsListByPart
(
f
,
cmplist
,
false
);
fclose
(
f
);
...
...
@@ -872,14 +872,14 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart( FILE* aFile, SCH_REFERENCE_LIST
while
(
index
<
aList
.
GetCount
()
)
{
SCH_COMPONENT
*
component
=
aList
[
index
].
GetComponent
();
wx
String
referenceListStr
;
wx
ArrayString
referenceStrList
;
int
qty
=
1
;
reference
ListStr
.
appen
d
(
aList
[
index
].
GetRef
()
);
reference
StrList
.
Ad
d
(
aList
[
index
].
GetRef
()
);
for
(
unsigned
int
i
=
index
+
1
;
i
<
aList
.
GetCount
();
)
{
if
(
*
(
aList
[
i
].
GetComponent
())
==
*
component
)
{
reference
ListStr
.
append
(
wxT
(
" "
)
+
aList
[
i
].
GetRef
()
);
reference
StrList
.
Add
(
aList
[
i
].
GetRef
()
);
aList
.
RemoveItem
(
i
);
qty
++
;
}
...
...
@@ -887,10 +887,22 @@ int DIALOG_BUILD_BOM::PrintComponentsListByPart( FILE* aFile, SCH_REFERENCE_LIST
i
++
;
// Increment index only when current item is not removed from the list
}
// Write value, quantity and list of references
fprintf
(
aFile
,
"%15s%c%3d%c
\"
%s
\"
"
,
TO_UTF8
(
component
->
GetField
(
VALUE
)
->
GetText
()
),
s_ExportSeparatorSymbol
,
qty
,
s_ExportSeparatorSymbol
,
TO_UTF8
(
referenceListStr
)
);
referenceStrList
.
Sort
(
RefDesStringCompare
);
// Sort references for this component
// Write value, quantity
fprintf
(
aFile
,
"%15s%c%3d"
,
TO_UTF8
(
component
->
GetField
(
VALUE
)
->
GetText
()
),
s_ExportSeparatorSymbol
,
qty
);
// Write list of references
for
(
int
i
=
0
;
i
<
referenceStrList
.
Count
();
i
++
)
{
if
(
i
==
0
)
fprintf
(
aFile
,
"%c
\"
%s"
,
s_ExportSeparatorSymbol
,
TO_UTF8
(
referenceStrList
[
i
]
)
);
else
fprintf
(
aFile
,
" %s"
,
TO_UTF8
(
referenceStrList
[
i
]
)
);
}
if
(
referenceStrList
.
Count
()
)
fprintf
(
aFile
,
"
\"
"
);
// Write the rest of the fields if required
#if defined( KICAD_GOST )
...
...
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