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
762e625c
Commit
762e625c
authored
Apr 24, 2010
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Plain Diff
Fixed bugs #568896 and #569312 and minor code cleaning
parents
c58c388a
1ca9cbe5
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
115 additions
and
153 deletions
+115
-153
build_BOM.cpp
eeschema/build_BOM.cpp
+70
-108
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
dialog_build_BOM.h
eeschema/dialog_build_BOM.h
+2
-1
plot.cpp
eeschema/plot.cpp
+7
-15
dialog_netlist.cpp
pcbnew/dialog_netlist.cpp
+1
-1
No files found.
eeschema/build_BOM.cpp
View file @
762e625c
This diff is collapsed.
Click to expand it.
eeschema/class_libentry.cpp
View file @
762e625c
...
@@ -230,6 +230,22 @@ LIB_COMPONENT::~LIB_COMPONENT()
...
@@ -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
,
void
LIB_COMPONENT
::
Draw
(
WinEDA_DrawPanel
*
aPanel
,
wxDC
*
aDc
,
const
wxPoint
&
aOffset
,
int
aMulti
,
const
wxPoint
&
aOffset
,
int
aMulti
,
...
...
eeschema/class_libentry.h
View file @
762e625c
...
@@ -575,6 +575,20 @@ public:
...
@@ -575,6 +575,20 @@ public:
int
GetPartCount
()
{
return
unitCount
;
}
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.
* Set or clear the alternate body style (DeMorgan) for the component.
*
*
...
...
eeschema/class_libentry_fields.cpp
View file @
762e625c
...
@@ -502,21 +502,11 @@ wxString LIB_FIELD::GetFullText( int unit )
...
@@ -502,21 +502,11 @@ wxString LIB_FIELD::GetFullText( int unit )
return
m_Text
;
return
m_Text
;
wxString
text
=
m_Text
;
wxString
text
=
m_Text
;
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
(
"?"
);
text
<<
wxT
(
"?"
);
if
(
GetParent
()
->
IsMulti
()
)
text
<<
LIB_COMPONENT
::
ReturnSubReference
(
unit
);
return
text
;
return
text
;
}
}
...
...
eeschema/class_sch_cmp_field.cpp
View file @
762e625c
...
@@ -140,14 +140,7 @@ void SCH_FIELD::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
...
@@ -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
/* For more than one part per package, we must add the part selection
* A, B, ... or 1, 2, .. to the reference. */
* A, B, ... or 1, 2, .. to the reference. */
wxString
fulltext
=
m_Text
;
wxString
fulltext
=
m_Text
;
char
part_id
;
fulltext
<<
LIB_COMPONENT
::
ReturnSubReference
(
parentComponent
->
m_Multi
);
#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
);
DrawGraphicText
(
panel
,
DC
,
textpos
,
color
,
fulltext
,
DrawGraphicText
(
panel
,
DC
,
textpos
,
color
,
fulltext
,
orient
,
orient
,
...
@@ -432,13 +425,7 @@ bool SCH_FIELD::Matches( wxFindReplaceData& aSearchData, void * aAuxData )
...
@@ -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
/* For more than one part per package, we must add the part selection
* A, B, ... or 1, 2, .. to the reference. */
* A, B, ... or 1, 2, .. to the reference. */
int
part_id
=
pSch
->
GetUnitSelection
(
sheet
);
int
part_id
=
pSch
->
GetUnitSelection
(
sheet
);
#if defined(KICAD_GOST)
fulltext
<<
LIB_COMPONENT
::
ReturnSubReference
(
part_id
);
fulltext
.
Append
(
'.'
);
part_id
+=
'1'
-
1
;
#else
part_id
+=
'A'
-
1
;
#endif
fulltext
.
Append
(
(
char
)
part_id
);
}
}
return
SCH_ITEM
::
Matches
(
fulltext
,
aSearchData
);
return
SCH_ITEM
::
Matches
(
fulltext
,
aSearchData
);
}
}
...
...
eeschema/dialog_build_BOM.h
View file @
762e625c
...
@@ -34,7 +34,8 @@ private:
...
@@ -34,7 +34,8 @@ private:
bool
CompactForm
,
bool
aIncludeSubComponents
);
bool
CompactForm
,
bool
aIncludeSubComponents
);
int
PrintComponentsListByVal
(
FILE
*
f
,
std
::
vector
<
OBJ_CMP_TO_LIST
>&
aList
,
int
PrintComponentsListByVal
(
FILE
*
f
,
std
::
vector
<
OBJ_CMP_TO_LIST
>&
aList
,
bool
aIncludeSubComponents
);
bool
aIncludeSubComponents
);
int
PrintComponentsListByPart
(
FILE
*
f
,
std
::
vector
<
OBJ_CMP_TO_LIST
>&
aList
);
int
PrintComponentsListByPart
(
FILE
*
f
,
std
::
vector
<
OBJ_CMP_TO_LIST
>&
aList
,
bool
aIncludeSubComponents
);
void
PrintFieldData
(
FILE
*
f
,
SCH_COMPONENT
*
DrawLibItem
,
bool
CompactForm
=
FALSE
);
void
PrintFieldData
(
FILE
*
f
,
SCH_COMPONENT
*
DrawLibItem
,
bool
CompactForm
=
FALSE
);
bool
IsFieldChecked
(
int
aFieldId
);
bool
IsFieldChecked
(
int
aFieldId
);
...
...
eeschema/plot.cpp
View file @
762e625c
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
static
void
Plot_Hierarchical_PIN_Sheet
(
PLOTTER
*
plotter
,
static
void
Plot_Hierarchical_PIN_Sheet
(
PLOTTER
*
plotter
,
SCH_SHEET_PIN
*
Struct
);
SCH_SHEET_PIN
*
Struct
);
static
void
PlotTextField
(
PLOTTER
*
plotter
,
SCH_COMPONENT
*
DrawLibItem
,
static
void
PlotTextField
(
PLOTTER
*
plotter
,
SCH_COMPONENT
*
DrawLibItem
,
int
FieldNumber
,
int
IsMulti
,
int
DrawMode
);
int
FieldNumber
,
bool
IsMulti
,
int
DrawMode
);
static
void
PlotNoConnectStruct
(
PLOTTER
*
plotter
,
SCH_NO_CONNECT
*
Struct
)
static
void
PlotNoConnectStruct
(
PLOTTER
*
plotter
,
SCH_NO_CONNECT
*
Struct
)
...
@@ -53,10 +53,10 @@ static void PlotLibPart( PLOTTER* plotter, SCH_COMPONENT* DrawLibItem )
...
@@ -53,10 +53,10 @@ static void PlotLibPart( PLOTTER* plotter, SCH_COMPONENT* DrawLibItem )
Entry
->
Plot
(
plotter
,
DrawLibItem
->
m_Multi
,
DrawLibItem
->
m_Convert
,
Entry
->
Plot
(
plotter
,
DrawLibItem
->
m_Multi
,
DrawLibItem
->
m_Convert
,
DrawLibItem
->
m_Pos
,
TransMat
);
DrawLibItem
->
m_Pos
,
TransMat
);
bool
isMulti
=
Entry
->
GetPartCount
()
>
1
;
for
(
int
i
=
0
;
i
<
NUMBER_OF_FIELDS
;
i
++
)
for
(
int
fieldId
=
0
;
fieldId
<
NUMBER_OF_FIELDS
;
fieldId
++
)
{
{
PlotTextField
(
plotter
,
DrawLibItem
,
i
,
0
,
0
);
PlotTextField
(
plotter
,
DrawLibItem
,
fieldId
,
isMulti
,
0
);
}
}
}
}
...
@@ -65,13 +65,13 @@ static void PlotLibPart( PLOTTER* plotter, SCH_COMPONENT* DrawLibItem )
...
@@ -65,13 +65,13 @@ static void PlotLibPart( PLOTTER* plotter, SCH_COMPONENT* DrawLibItem )
* Input:
* Input:
* DrawLibItem: pointer to the component
* DrawLibItem: pointer to the component
* FieldNumber: Number Field
* FieldNumber: Number Field
* IsMulti:
No Null flag if there are several sides by housing
.
* IsMulti:
true flag if there are several parts per package
.
* Only useful for the field to add a reference to this one
* Only useful for the field to add a reference to this one
* The identification from (A, B ...)
* The identification from (A, B ...)
* DrawMode: trace mode
* DrawMode: trace mode
*/
*/
static
void
PlotTextField
(
PLOTTER
*
plotter
,
SCH_COMPONENT
*
DrawLibItem
,
static
void
PlotTextField
(
PLOTTER
*
plotter
,
SCH_COMPONENT
*
DrawLibItem
,
int
FieldNumber
,
int
IsMulti
,
int
DrawMode
)
int
FieldNumber
,
bool
IsMulti
,
int
DrawMode
)
{
{
SCH_FIELD
*
field
=
DrawLibItem
->
GetField
(
FieldNumber
);
SCH_FIELD
*
field
=
DrawLibItem
->
GetField
(
FieldNumber
);
EDA_Colors
color
=
UNSPECIFIED_COLOR
;
EDA_Colors
color
=
UNSPECIFIED_COLOR
;
...
@@ -125,15 +125,7 @@ static void PlotTextField( PLOTTER* plotter, SCH_COMPONENT* DrawLibItem,
...
@@ -125,15 +125,7 @@ static void PlotTextField( PLOTTER* plotter, SCH_COMPONENT* DrawLibItem,
{
{
/* Adding A, B ... to the reference */
/* Adding A, B ... to the reference */
wxString
Text
;
wxString
Text
;
Text
=
field
->
m_Text
;
Text
=
field
->
m_Text
+
LIB_COMPONENT
::
ReturnSubReference
(
DrawLibItem
->
m_Multi
);
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
);
plotter
->
text
(
textpos
,
color
,
Text
,
plotter
->
text
(
textpos
,
color
,
Text
,
orient
,
orient
,
field
->
m_Size
,
hjustify
,
vjustify
,
field
->
m_Size
,
hjustify
,
vjustify
,
...
...
pcbnew/dialog_netlist.cpp
View file @
762e625c
...
@@ -70,7 +70,7 @@ void DIALOG_NETLIST::OnOpenNelistClick( wxCommandEvent& event )
...
@@ -70,7 +70,7 @@ void DIALOG_NETLIST::OnOpenNelistClick( wxCommandEvent& event )
{
{
wxFileName
fn
=
lastNetlistRead
;
wxFileName
fn
=
lastNetlistRead
;
lastPath
=
fn
.
GetPath
();
lastPath
=
fn
.
GetPath
();
lastNetlistRead
=
fn
.
GetName
();
lastNetlistRead
=
fn
.
Get
Full
Name
();
}
}
wxLogDebug
(
wxT
(
"Last net list read path <%s>, file name <%s>."
),
wxLogDebug
(
wxT
(
"Last net list read path <%s>, file name <%s>."
),
...
...
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