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
4fec2126
Commit
4fec2126
authored
Sep 26, 2012
by
Felix Morgner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed code to better comply with the coding style guidelines
parent
99c1d45f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
27 deletions
+44
-27
readwrite_dlgs.cpp
cvpcb/readwrite_dlgs.cpp
+44
-27
No files found.
cvpcb/readwrite_dlgs.cpp
View file @
4fec2126
...
...
@@ -41,56 +41,73 @@
void
CVPCB_MAINFRAME
::
SetNewPkg
(
const
wxString
&
aFootprintName
)
{
COMPONENT_INFO
*
Component
;
bool
isUndefined
=
false
;
int
NumCmp
;
int
LastCmp
;
wxString
msg
;
COMPONENT_INFO
*
component
;
bool
hasFootprint
=
false
;
int
componentIndex
;
wxString
description
;
if
(
m_components
.
empty
()
)
return
;
// if no component is selected, select the first one
if
(
m_ListCmp
->
GetFirstSelected
()
<
0
)
{
NumCmp
=
0
;
m_ListCmp
->
SetSelection
(
NumCmp
,
true
);
componentIndex
=
0
;
m_ListCmp
->
SetSelection
(
componentIndex
,
true
);
}
while
(
(
NumCmp
=
m_ListCmp
->
GetFirstSelected
()
)
!=
-
1
)
// iterate over the selection
while
(
m_ListCmp
->
GetFirstSelected
()
!=
-
1
)
{
Component
=
&
m_components
[
NumCmp
];
// get the component for the current iteration
if
(
Component
==
NULL
)
componentIndex
=
m_ListCmp
->
GetFirstSelected
();
component
=
&
m_components
[
componentIndex
];
if
(
component
==
NULL
)
return
;
isUndefined
=
Component
->
m_Footprint
.
IsEmpty
();
// check to see if the component has allready a footprint set.
Component
->
m_Footprint
=
aFootprintName
;
hasFootprint
=
!
(
component
->
m_Footprint
.
IsEmpty
())
;
msg
.
Printf
(
CMP_FORMAT
,
NumCmp
+
1
,
GetChars
(
Component
->
m_Reference
),
GetChars
(
Component
->
m_Value
),
GetChars
(
Component
->
m_Footprint
)
);
component
->
m_Footprint
=
aFootprintName
;
if
(
isUndefined
)
m_undefinedComponentCnt
-=
1
;
m_ListCmp
->
SetString
(
NumCmp
,
msg
);
m_ListCmp
->
SetSelection
(
NumCmp
,
false
);
// create the new component description
isUndefined
=
false
;
LastCmp
=
NumCmp
;
description
.
Printf
(
CMP_FORMAT
,
componentIndex
+
1
,
GetChars
(
component
->
m_Reference
),
GetChars
(
component
->
m_Value
),
GetChars
(
component
->
m_Footprint
)
);
// if the component hasn't had a footprint associated with it
// it now has, so we decrement the count of components without
// a footprint assigned.
DisplayStatus
();
if
(
!
hasFootprint
)
{
hasFootprint
=
true
;
m_undefinedComponentCnt
-=
1
;
}
// set the new description and deselect the processed component
m_ListCmp
->
SetString
(
componentIndex
,
description
);
m_ListCmp
->
SetSelection
(
componentIndex
,
false
);
}
// mark this "session" as modified
m_modified
=
true
;
if
(
LastCmp
<
(
m_ListCmp
->
GetCount
()
-
1
)
)
NumCmp
=
LastCmp
+
1
;
// select the next component, if there is one
if
(
componentIndex
<
(
m_ListCmp
->
GetCount
()
-
1
)
)
componentIndex
++
;
m_ListCmp
->
SetSelection
(
NumCmp
,
true
);
m_ListCmp
->
SetSelection
(
componentIndex
,
true
);
// update the statusbar
DisplayStatus
();
}
...
...
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