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
cb35b563
Commit
cb35b563
authored
Jul 31, 2010
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Plain Diff
user defined eeschema component fields should fill next available component field slot
parents
e2d4b16b
43d7b723
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
read_from_file_schematic_items_descriptions.cpp
eeschema/read_from_file_schematic_items_descriptions.cpp
+12
-9
template_fieldnames.h
eeschema/template_fieldnames.h
+3
-1
No files found.
eeschema/read_from_file_schematic_items_descriptions.cpp
View file @
cb35b563
...
@@ -703,17 +703,20 @@ int ReadPartDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag,
...
@@ -703,17 +703,20 @@ int ReadPartDescr( wxWindow* frame, char* Line, FILE* f, wxString& aMsgDiag,
if
(
fieldNdx
>=
component
->
GetFieldCount
()
)
if
(
fieldNdx
>=
component
->
GetFieldCount
()
)
{
{
// add as many fields as needed so the m_FieldId's are
// The first MANDATOR_FIELDS _must_ be constructed within
// contiguous, no gaps.
// the SCH_COMPONENT constructor. This assert is simply here
while
(
fieldNdx
>=
component
->
GetFieldCount
()
)
// to guard against a change in that constructor.
{
wxASSERT
(
component
->
GetFieldCount
()
>=
MANDATORY_FIELDS
);
int
newNdx
=
component
->
GetFieldCount
();
// Ignore the _supplied_ fieldNdx. It is not important anymore
// if within the user defined fields region (i.e. >= MANDATORY_FIELDS).
// We freely renumber the index to fit the next available field slot.
SCH_FIELD
field
(
wxPoint
(
0
,
0
),
newNdx
,
component
,
fieldNdx
=
component
->
GetFieldCount
();
// new has this index after insertion
fieldName
);
SCH_FIELD
field
(
wxPoint
(
0
,
0
),
fieldNdx
,
component
,
fieldName
);
component
->
AddField
(
field
);
component
->
AddField
(
field
);
}
}
}
else
else
{
{
component
->
GetField
(
fieldNdx
)
->
m_Name
=
fieldName
;
component
->
GetField
(
fieldNdx
)
->
m_Name
=
fieldName
;
...
...
eeschema/template_fieldnames.h
View file @
cb35b563
...
@@ -24,7 +24,9 @@ enum NumFieldType {
...
@@ -24,7 +24,9 @@ enum NumFieldType {
FOOTPRINT
,
///< Field Name Module PCB, i.e. "16DIP300"
FOOTPRINT
,
///< Field Name Module PCB, i.e. "16DIP300"
DATASHEET
,
///< name of datasheet
DATASHEET
,
///< name of datasheet
MANDATORY_FIELDS
,
///< the first 4 are mandatory or fixed, and instantiated in FIELD constructors
/// The first 4 are mandatory, and must be instantiated in SCH_COMPONENT
/// and LIB_COMPONENT constructors
MANDATORY_FIELDS
,
FIELD1
=
MANDATORY_FIELDS
,
FIELD1
=
MANDATORY_FIELDS
,
FIELD2
,
FIELD2
,
...
...
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