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
0d3769b2
Commit
0d3769b2
authored
May 08, 2008
by
bennett78
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added SCH_COMPONENT * WinEDA_SchematicFrame::FindComponentByRef
for backanno.cpp, a better candidate for searching.
parent
4186aa8a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
13 deletions
+37
-13
backanno.cpp
eeschema/backanno.cpp
+35
-13
wxEeschemaStruct.h
include/wxEeschemaStruct.h
+2
-0
No files found.
eeschema/backanno.cpp
View file @
0d3769b2
...
...
@@ -17,13 +17,39 @@
#include "protos.h"
/**************************************************************/
SCH_COMPONENT
*
WinEDA_SchematicFrame
::
FindComponentByRef
(
const
wxString
&
reference
)
/**************************************************************/
{
DrawSheetPath
*
sheet
;
SCH_ITEM
*
DrawList
=
NULL
;
EDA_SheetList
SheetList
(
NULL
);
for
(
sheet
=
SheetList
.
GetFirst
();
sheet
!=
NULL
;
sheet
=
SheetList
.
GetNext
()
)
{
DrawList
=
(
SCH_ITEM
*
)
sheet
->
LastDrawList
();
for
(
;
(
DrawList
!=
NULL
);
DrawList
=
DrawList
->
Next
()
)
{
if
(
DrawList
->
Type
()
==
TYPE_SCH_COMPONENT
)
{
SCH_COMPONENT
*
pSch
;
pSch
=
(
SCH_COMPONENT
*
)
DrawList
;
if
(
reference
.
CmpNoCase
(
pSch
->
GetRef
(
sheet
)
)
==
0
)
return
pSch
;
}
}
}
return
NULL
;
}
/**************************************************************/
bool
WinEDA_SchematicFrame
::
ProcessStuffFile
(
FILE
*
StuffFile
)
/**************************************************************/
{
int
LineNum
=
0
;
char
*
cp
,
Ref
[
256
],
FootPrint
[
256
],
Line
[
1024
];
SCH_ITEM
*
DrawList
=
NULL
;
SCH_COMPONENT
*
Cmp
;
PartTextStruct
*
TextField
;
...
...
@@ -39,22 +65,18 @@ bool WinEDA_SchematicFrame::ProcessStuffFile( FILE* StuffFile )
if
(
*
cp
==
'"'
)
*
cp
=
0
;
// printf("'%s' '%s'\n", Ref, FootPrint);
wxString
reference
=
CONV_FROM_UTF8
(
Ref
);
DrawList
=
WinEDA_SchematicFrame
::
FindComponentAndItem
(
reference
,
TRUE
,
2
,
wxEmptyString
,
false
);
if
(
DrawList
==
NULL
)
Cmp
=
WinEDA_SchematicFrame
::
FindComponentByRef
(
reference
);
if
(
Cmp
==
NULL
)
continue
;
if
(
DrawList
->
Type
()
==
TYPE_SCH_COMPONENT
)
{
Cmp
=
(
SCH_COMPONENT
*
)
DrawList
;
TextField
=
&
Cmp
->
m_Field
[
FOOTPRINT
];
TextField
->
m_Text
=
CONV_FROM_UTF8
(
FootPrint
)
;
}
#if defined(DEBUG
)
printf
(
" %s %s
\n
"
,
CONV_TO_UTF8
(
Cmp
->
m_Field
[
REFERENCE
].
m_Text
),
CONV_TO_UTF8
(
Cmp
->
m_Field
[
VALUE
].
m_Text
)
)
;
#endif
TextField
=
&
Cmp
->
m_Field
[
FOOTPRINT
]
;
TextField
->
m_Text
=
CONV_FROM_UTF8
(
FootPrint
);
}
}
...
...
include/wxEeschemaStruct.h
View file @
0d3769b2
...
...
@@ -89,6 +89,8 @@ public:
bool
IncludePin
);
SCH_COMPONENT
*
FindComponentByRef
(
const
wxString
&
reference
);
SCH_ITEM
*
FindComponentAndItem
(
const
wxString
&
component_reference
,
bool
Find_in_hierarchy
,
int
SearchType
,
...
...
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