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
b8a2c4e2
Commit
b8a2c4e2
authored
Mar 20, 2012
by
Andrey Fedorushkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eeschema: fix sorting parts generate BOM "Single part per line"
parent
f49c2779
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
2 deletions
+43
-2
component_references_lister.cpp
eeschema/component_references_lister.cpp
+19
-0
dialog_build_BOM.cpp
eeschema/dialogs/dialog_build_BOM.cpp
+2
-2
netlist.h
eeschema/netlist.h
+22
-0
No files found.
eeschema/component_references_lister.cpp
View file @
b8a2c4e2
...
...
@@ -106,6 +106,25 @@ bool SCH_REFERENCE_LIST::sortByRefAndValue( const SCH_REFERENCE& item1,
return
ii
<
0
;
}
bool
SCH_REFERENCE_LIST
::
sortByValueAndRef
(
const
SCH_REFERENCE
&
item1
,
const
SCH_REFERENCE
&
item2
)
{
int
ii
=
item1
.
CompareValue
(
item2
);
if
(
ii
==
0
)
ii
=
RefDesStringCompare
(
item1
.
GetRef
(),
item2
.
GetRef
()
);
if
(
ii
==
0
)
ii
=
item1
.
m_Unit
-
item2
.
m_Unit
;
if
(
ii
==
0
)
ii
=
item1
.
m_SheetNum
-
item2
.
m_SheetNum
;
if
(
ii
==
0
)
ii
=
item1
.
m_CmpPos
.
x
-
item2
.
m_CmpPos
.
x
;
if
(
ii
==
0
)
ii
=
item1
.
m_CmpPos
.
y
-
item2
.
m_CmpPos
.
y
;
if
(
ii
==
0
)
ii
=
item1
.
m_TimeStamp
-
item2
.
m_TimeStamp
;
return
ii
<
0
;
}
static
bool
engStrToDouble
(
wxString
aStr
,
double
*
aDouble
)
{
...
...
eeschema/dialogs/dialog_build_BOM.cpp
View file @
b8a2c4e2
...
...
@@ -427,8 +427,8 @@ void DIALOG_BUILD_BOM::CreatePartsList( const wxString& aFullFileName, bool aInc
cmplist
.
RemoveSubComponentsFromList
();
// sort component list by value
cmplist
.
SortBy
ValueOnly
(
);
PrintComponentsListByPart
(
f
,
cmplist
,
aIncludeSubComponents
);
cmplist
.
SortBy
RefAndValue
(
);
PrintComponentsListByPart
(
f
,
cmplist
,
aIncludeSubComponents
);
fclose
(
f
);
}
...
...
eeschema/netlist.h
View file @
b8a2c4e2
...
...
@@ -376,6 +376,26 @@ public:
sort
(
componentFlatList
.
begin
(),
componentFlatList
.
end
(),
sortByRefAndValue
);
}
/**
* Function SortByValueAndRef
* sorts the list of references by value.
* <p>
* Components are sorted in the following order:
* <ul>
* <li>Value of component.</li>
* <li>Numeric value of reference designator.</li>
* <li>Unit number when component has multiple parts.</li>
* <li>Sheet number.</li>
* <li>X coordinate position.</li>
* <li>Y coordinate position.</li>
* </ul>
* </p>
*/
void
SortByValueAndRef
()
{
sort
(
componentFlatList
.
begin
(),
componentFlatList
.
end
(),
sortByValueAndRef
);
}
/**
* Function SortByReferenceOnly
* sorts the list of references by reference.
...
...
@@ -454,6 +474,8 @@ private:
static
bool
sortByRefAndValue
(
const
SCH_REFERENCE
&
item1
,
const
SCH_REFERENCE
&
item2
);
static
bool
sortByValueAndRef
(
const
SCH_REFERENCE
&
item1
,
const
SCH_REFERENCE
&
item2
);
static
bool
sortByXPosition
(
const
SCH_REFERENCE
&
item1
,
const
SCH_REFERENCE
&
item2
);
static
bool
sortByYPosition
(
const
SCH_REFERENCE
&
item1
,
const
SCH_REFERENCE
&
item2
);
...
...
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