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
1ca9cbe5
Commit
1ca9cbe5
authored
Apr 24, 2010
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bugs #568896 and #569312 and minor code cleaning
parent
3b658b4b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
65 deletions
+53
-65
build_BOM.cpp
eeschema/build_BOM.cpp
+17
-28
class_libentry.cpp
eeschema/class_libentry.cpp
+16
-0
class_libentry.h
eeschema/class_libentry.h
+14
-0
class_libentry_fields.cpp
eeschema/class_libentry_fields.cpp
+3
-13
class_sch_cmp_field.cpp
eeschema/class_sch_cmp_field.cpp
+2
-15
plot.cpp
eeschema/plot.cpp
+1
-9
No files found.
eeschema/build_BOM.cpp
View file @
1ca9cbe5
...
...
@@ -630,7 +630,6 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef(
bool
CompactForm
,
bool
aIncludeSubComponents
)
{
int
Multi
,
Unit
;
EDA_BaseStruct
*
DrawList
;
SCH_COMPONENT
*
DrawLibItem
;
LIB_COMPONENT
*
Entry
;
...
...
@@ -688,22 +687,20 @@ int DIALOG_BUILD_BOM::PrintComponentsListByRef(
DrawLibItem
=
(
SCH_COMPONENT
*
)
DrawList
;
Multi
=
0
;
Unit
=
' '
;
bool
isMulti
=
false
;
wxString
subRef
;
Entry
=
CMP_LIBRARY
::
FindLibraryComponent
(
DrawLibItem
->
m_ChipName
);
if
(
Entry
)
Multi
=
Entry
->
GetPartCount
();
isMulti
=
Entry
->
IsMulti
();
if
(
(
Multi
>
1
)
&&
aIncludeSubComponents
)
#if defined(KICAD_GOST)
Unit
=
aList
[
ii
].
m_Unit
+
'1'
-
1
;
#else
Unit
=
aList
[
ii
].
m_Unit
+
'A'
-
1
;
#endif
if
(
isMulti
&&
aIncludeSubComponents
)
subRef
=
LIB_COMPONENT
::
ReturnSubReference
(
aList
[
ii
].
m_Unit
);
else
subRef
.
Empty
();
sprintf
(
CmpName
,
"%s"
,
aList
[
ii
].
m_Reference
);
if
(
!
CompactForm
||
Unit
!=
' '
)
sprintf
(
CmpName
+
strlen
(
CmpName
),
"%
c"
,
Unit
);
if
(
!
CompactForm
)
sprintf
(
CmpName
+
strlen
(
CmpName
),
"%
s"
,
CONV_TO_UTF8
(
subRef
)
);
if
(
CompactForm
)
#if defined(KICAD_GOST)
...
...
@@ -875,8 +872,6 @@ int DIALOG_BUILD_BOM::PrintComponentsListByVal(
std
::
vector
<
OBJ_CMP_TO_LIST
>&
aList
,
bool
aIncludeSubComponents
)
{
int
Multi
;
wxChar
Unit
;
EDA_BaseStruct
*
DrawList
;
SCH_COMPONENT
*
DrawLibItem
;
LIB_COMPONENT
*
Entry
;
...
...
@@ -902,25 +897,19 @@ int DIALOG_BUILD_BOM::PrintComponentsListByVal(
DrawLibItem
=
(
SCH_COMPONENT
*
)
DrawList
;
Multi
=
0
;
Unit
=
' '
;
bool
isMulti
=
false
;
Entry
=
CMP_LIBRARY
::
FindLibraryComponent
(
DrawLibItem
->
m_ChipName
);
if
(
Entry
)
Multi
=
Entry
->
GetPartCount
();
isMulti
=
Entry
->
IsMulti
();
if
(
(
Multi
>
1
)
&&
aIncludeSubComponents
)
{
#if defined(KICAD_GOST)
Unit
=
aList
[
ii
].
m_Unit
+
'1'
-
1
;
}
wxString
subRef
;
if
(
isMulti
&&
aIncludeSubComponents
)
subRef
=
LIB_COMPONENT
::
ReturnSubReference
(
aList
[
ii
].
m_Unit
);
else
subRef
.
Empty
();
sprintf
(
CmpName
,
"%s.%c"
,
aList
[
ii
].
m_Reference
,
Unit
);
#else
Unit
=
aList
[
ii
].
m_Unit
+
'A'
-
1
;
}
sprintf
(
CmpName
,
"%s%s"
,
aList
[
ii
].
m_Reference
,
CONV_TO_UTF8
(
subRef
)
);
sprintf
(
CmpName
,
"%s%c"
,
aList
[
ii
].
m_Reference
,
Unit
);
#endif
fprintf
(
f
,
"| %-12s %-10s"
,
CONV_TO_UTF8
(
DrawLibItem
->
GetField
(
VALUE
)
->
m_Text
),
CmpName
);
...
...
eeschema/class_libentry.cpp
View file @
1ca9cbe5
...
...
@@ -230,6 +230,22 @@ LIB_COMPONENT::~LIB_COMPONENT()
{
}
/** function IsMulti
* @return the sub reference for component having multiple parts per package.
* The sub reference identify the part (or unit)
* @param aUnit = the part identifier ( 1 to 26)
*/
wxString
LIB_COMPONENT
::
ReturnSubReference
(
int
aUnit
)
{
wxString
subRef
;
#if defined(KICAD_GOST)
subRef
.
Printf
(
wxT
(
".%d"
),
aUnit
);
#else
subRef
.
Append
(
aUnit
+
'A'
-
1
);
#endif
return
subRef
;
}
void
LIB_COMPONENT
::
Draw
(
WinEDA_DrawPanel
*
aPanel
,
wxDC
*
aDc
,
const
wxPoint
&
aOffset
,
int
aMulti
,
...
...
eeschema/class_libentry.h
View file @
1ca9cbe5
...
...
@@ -575,6 +575,20 @@ public:
int
GetPartCount
()
{
return
unitCount
;
}
/** function IsMulti
* @return true if the component has multiple parts per package.
* When happens, the reference has a sub reference ti identify part
*/
bool
IsMulti
()
{
return
unitCount
>
1
;
}
/** function IsMulti
* @return the sub reference for component having multiple parts per package.
* The sub reference identify the part (or unit)
* @param aUnit = the part identifier ( 1 to max count)
* Note: this is a static function.
*/
static
wxString
ReturnSubReference
(
int
aUnit
);
/**
* Set or clear the alternate body style (DeMorgan) for the component.
*
...
...
eeschema/class_libentry_fields.cpp
View file @
1ca9cbe5
...
...
@@ -502,20 +502,10 @@ wxString LIB_FIELD::GetFullText( int unit )
return
m_Text
;
wxString
text
=
m_Text
;
text
<<
wxT
(
"?"
);
if
(
GetParent
()
->
GetPartCount
()
>
1
)
{
#if defined(KICAD_GOST)
text
.
Printf
(
wxT
(
"%s?.%c"
),
m_Text
.
GetData
(),
unit
+
'1'
-
1
);
#else
text
.
Printf
(
wxT
(
"%s?%c"
),
m_Text
.
GetData
(),
unit
+
'A'
-
1
);
#endif
}
else
text
<<
wxT
(
"?"
);
if
(
GetParent
()
->
IsMulti
()
)
text
<<
LIB_COMPONENT
::
ReturnSubReference
(
unit
);
return
text
;
}
...
...
eeschema/class_sch_cmp_field.cpp
View file @
1ca9cbe5
...
...
@@ -140,14 +140,7 @@ void SCH_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
/* For more than one part per package, we must add the part selection
* A, B, ... or 1, 2, .. to the reference. */
wxString
fulltext
=
m_Text
;
char
part_id
;
#if defined(KICAD_GOST)
fulltext
.
Append
(
'.'
);
part_id
=
'1'
-
1
+
parentComponent
->
m_Multi
;
#else
part_id
=
'A'
-
1
+
parentComponent
->
m_Multi
;
#endif
fulltext
.
Append
(
part_id
);
fulltext
<<
LIB_COMPONENT
::
ReturnSubReference
(
parentComponent
->
m_Multi
);
DrawGraphicText
(
panel
,
DC
,
textpos
,
color
,
fulltext
,
orient
,
...
...
@@ -432,13 +425,7 @@ bool SCH_FIELD::Matches( wxFindReplaceData& aSearchData, void * aAuxData )
/* For more than one part per package, we must add the part selection
* A, B, ... or 1, 2, .. to the reference. */
int
part_id
=
pSch
->
GetUnitSelection
(
sheet
);
#if defined(KICAD_GOST)
fulltext
.
Append
(
'.'
);
part_id
+=
'1'
-
1
;
#else
part_id
+=
'A'
-
1
;
#endif
fulltext
.
Append
(
(
char
)
part_id
);
fulltext
<<
LIB_COMPONENT
::
ReturnSubReference
(
part_id
);
}
return
SCH_ITEM
::
Matches
(
fulltext
,
aSearchData
);
}
...
...
eeschema/plot.cpp
View file @
1ca9cbe5
...
...
@@ -125,15 +125,7 @@ static void PlotTextField( PLOTTER* plotter, SCH_COMPONENT* DrawLibItem,
{
/* Adding A, B ... to the reference */
wxString
Text
;
Text
=
field
->
m_Text
;
char
unit_id
;
#if defined(KICAD_GOST)
Text
.
Append
(
'.'
);
unit_id
=
'1'
-
1
+
DrawLibItem
->
m_Multi
;
#else
unit_id
=
'A'
-
1
+
DrawLibItem
->
m_Multi
;
#endif
Text
.
Append
(
unit_id
);
Text
=
field
->
m_Text
+
LIB_COMPONENT
::
ReturnSubReference
(
DrawLibItem
->
m_Multi
);
plotter
->
text
(
textpos
,
color
,
Text
,
orient
,
field
->
m_Size
,
hjustify
,
vjustify
,
...
...
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