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
c4c58e12
Commit
c4c58e12
authored
May 24, 2013
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
copyright and formatting
parent
8bafc54c
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
85 deletions
+71
-85
class_libentry.cpp
eeschema/class_libentry.cpp
+1
-1
dialog_edit_libentry_fields_in_lib.cpp
eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp
+53
-60
libedit.cpp
eeschema/libedit.cpp
+7
-7
sch_component.cpp
eeschema/sch_component.cpp
+10
-17
No files found.
eeschema/class_libentry.cpp
View file @
c4c58e12
...
...
@@ -623,7 +623,7 @@ bool LIB_COMPONENT::Save( OUTPUTFORMATTER& aFormatter )
LIB_FIELDS
fields
;
GetFields
(
fields
);
//
Fixed
fields:
//
Mandatory
fields:
// may have their own save policy so there is a separate loop for them.
// Empty fields are saved, because the user may have set visibility,
// size and orientation
...
...
eeschema/dialogs/dialog_edit_libentry_fields_in_lib.cpp
View file @
c4c58e12
This diff is collapsed.
Click to expand it.
eeschema/libedit.cpp
View file @
c4c58e12
...
...
@@ -338,7 +338,7 @@ bool LIB_EDIT_FRAME::SaveActiveLibrary( bool newFile )
{
fn
=
wxFileName
(
m_library
->
GetFullFileName
()
);
msg
.
Printf
(
_
(
"Modify library file <%s> ?"
),
msg
.
Printf
(
_
(
"Modify library file <%s> ?"
),
GetChars
(
fn
.
GetFullPath
()
)
);
if
(
!
IsOK
(
this
,
msg
)
)
...
...
@@ -386,7 +386,7 @@ bool LIB_EDIT_FRAME::SaveActiveLibrary( bool newFile )
catch
(
...
/* IO_ERROR ioe */
)
{
libFileName
.
MakeAbsolute
();
msg
.
Printf
(
_
(
"Failed to create component library file <%s>"
),
msg
.
Printf
(
_
(
"Failed to create component library file <%s>"
),
GetChars
(
libFileName
.
GetFullPath
()
)
);
DisplayError
(
this
,
msg
);
return
false
;
...
...
@@ -686,7 +686,7 @@ lost!\n\nClear the current component from the screen?" ) ) )
void
LIB_EDIT_FRAME
::
SaveOnePartInMemory
()
{
LIB_COMPONENT
*
oldComponent
;
LIB_COMPONENT
*
C
omponent
;
LIB_COMPONENT
*
c
omponent
;
wxString
msg
;
if
(
m_component
==
NULL
)
...
...
@@ -720,15 +720,15 @@ void LIB_EDIT_FRAME::SaveOnePartInMemory()
m_drawItem
=
m_lastDrawItem
=
NULL
;
if
(
oldComponent
!=
NULL
)
C
omponent
=
m_library
->
ReplaceComponent
(
oldComponent
,
m_component
);
c
omponent
=
m_library
->
ReplaceComponent
(
oldComponent
,
m_component
);
else
C
omponent
=
m_library
->
AddComponent
(
m_component
);
c
omponent
=
m_library
->
AddComponent
(
m_component
);
if
(
C
omponent
==
NULL
)
if
(
c
omponent
==
NULL
)
return
;
msg
.
Printf
(
_
(
"Component %s saved in library %s"
),
GetChars
(
C
omponent
->
GetName
()
),
GetChars
(
c
omponent
->
GetName
()
),
GetChars
(
m_library
->
GetName
()
)
);
SetStatusText
(
msg
);
}
eeschema/sch_component.cpp
View file @
c4c58e12
...
...
@@ -62,7 +62,7 @@ static LIB_COMPONENT* DummyCmp;
* convert a wxString to UTF8 and replace any control characters with a ~,
* where a control character is one of the first ASCII values up to ' ' 32d.
*/
std
::
string
toUTFTildaText
(
const
wxString
&
txt
)
st
atic
st
d
::
string
toUTFTildaText
(
const
wxString
&
txt
)
{
std
::
string
ret
=
TO_UTF8
(
txt
);
...
...
@@ -957,8 +957,8 @@ bool SCH_COMPONENT::Save( FILE* f ) const
static
wxString
delimiters
(
wxT
(
" "
)
);
//this is redundant with the AR entries below, but it makes the
//files backwards-compatible.
//
this is redundant with the AR entries below, but it makes the
//
files backwards-compatible.
if
(
m_PathsAndReferences
.
GetCount
()
>
0
)
{
reference_fields
=
wxStringTokenize
(
m_PathsAndReferences
[
0
],
delimiters
);
...
...
@@ -1031,9 +1031,8 @@ bool SCH_COMPONENT::Save( FILE* f ) const
}
// Fixed fields:
// Save fixed fields even they are non blank,
// because the visibility, size and orientation are set from libaries
// mainly for footprint names, for those who do not use CvPcb
// Save mandatory fields even if they are blank,
// because the visibility, size and orientation are set from libary editor.
for
(
unsigned
i
=
0
;
i
<
MANDATORY_FIELDS
;
++
i
)
{
SCH_FIELD
*
fld
=
GetField
(
i
);
...
...
@@ -1085,10 +1084,8 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
{
newfmt
=
1
;
if
(
!
aLine
.
ReadLine
(
)
)
if
(
!
(
line
=
aLine
.
ReadLine
()
)
)
return
true
;
line
=
aLine
.
Line
();
}
if
(
sscanf
(
&
line
[
1
],
"%s %s"
,
name1
,
name2
)
!=
2
)
...
...
@@ -1178,11 +1175,9 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
*/
for
(
;
;
)
{
if
(
!
aLine
.
ReadLine
(
)
)
if
(
!
(
line
=
aLine
.
ReadLine
()
)
)
return
false
;
line
=
aLine
.
Line
();
if
(
line
[
0
]
==
'U'
)
{
sscanf
(
line
+
1
,
"%d %d %lX"
,
&
m_unit
,
&
m_convert
,
&
m_TimeStamp
);
...
...
@@ -1354,8 +1349,8 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
return
false
;
}
if
(
!
aLine
.
ReadLine
(
)
||
sscanf
(
((
char
*
)
aLine
)
,
"%d %d %d %d"
,
if
(
!
(
line
=
aLine
.
ReadLine
()
)
||
sscanf
(
line
,
"%d %d %d %d"
,
&
m_transform
.
x1
,
&
m_transform
.
y1
,
&
m_transform
.
x2
,
...
...
@@ -1368,11 +1363,9 @@ bool SCH_COMPONENT::Load( LINE_READER& aLine, wxString& aErrorMsg )
if
(
newfmt
)
{
if
(
!
aLine
.
ReadLine
(
)
)
if
(
!
(
line
=
aLine
.
ReadLine
()
)
)
return
false
;
line
=
aLine
.
Line
();
if
(
strnicmp
(
"$End"
,
line
,
4
)
!=
0
)
{
aErrorMsg
.
Printf
(
wxT
(
"Component End expected at line %d, aborted"
),
...
...
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