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
d5a17363
Commit
d5a17363
authored
Dec 14, 2011
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor
parent
74ccc4b5
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
82 deletions
+93
-82
files.cpp
pcbnew/files.cpp
+23
-3
ioascii.cpp
pcbnew/ioascii.cpp
+1
-2
kicad_plugin.cpp
pcbnew/kicad_plugin.cpp
+69
-77
No files found.
pcbnew/files.cpp
View file @
d5a17363
...
@@ -388,7 +388,6 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
...
@@ -388,7 +388,6 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
wxString
msg
;
wxString
msg
;
bool
saveok
=
true
;
bool
saveok
=
true
;
FILE
*
dest
;
if
(
aFileName
==
wxEmptyString
)
if
(
aFileName
==
wxEmptyString
)
{
{
...
@@ -447,7 +446,10 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
...
@@ -447,7 +446,10 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
}
}
}
}
/* Create the file */
#if !defined(USE_NEW_PCBNEW_SAVE)
// Create the file
FILE
*
dest
;
dest
=
wxFopen
(
pcbFileName
.
GetFullPath
(),
wxT
(
"wt"
)
);
dest
=
wxFopen
(
pcbFileName
.
GetFullPath
(),
wxT
(
"wt"
)
);
if
(
dest
==
0
)
if
(
dest
==
0
)
...
@@ -466,6 +468,24 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
...
@@ -466,6 +468,24 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
fclose
(
dest
);
fclose
(
dest
);
}
}
#else
try
{
IO_MGR
::
Save
(
IO_MGR
::
KICAD
,
pcbFileName
.
GetFullPath
(),
GetBoard
(),
NULL
);
// overload
}
catch
(
IO_ERROR
ioe
)
{
wxString
msg
=
wxString
::
Format
(
_
(
"Error loading board.
\n
%s"
),
ioe
.
errorText
.
GetData
()
);
wxMessageBox
(
msg
,
_
(
"Save Board File"
),
wxICON_ERROR
);
saveok
=
false
;
}
#endif
/* Display the file names: */
/* Display the file names: */
m_messagePanel
->
EraseMsgBox
();
m_messagePanel
->
EraseMsgBox
();
...
@@ -481,7 +501,7 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
...
@@ -481,7 +501,7 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
upperTxt
=
_
(
"Backup file: "
)
+
backupFileName
.
GetFullPath
();
upperTxt
=
_
(
"Backup file: "
)
+
backupFileName
.
GetFullPath
();
}
}
if
(
dest
)
if
(
saveok
)
lowerTxt
=
_
(
"Wrote board file: "
);
lowerTxt
=
_
(
"Wrote board file: "
);
else
else
lowerTxt
=
_
(
"Failed to create "
);
lowerTxt
=
_
(
"Failed to create "
);
...
...
pcbnew/ioascii.cpp
View file @
d5a17363
...
@@ -1160,7 +1160,7 @@ int PCB_EDIT_FRAME::SavePcbFormatAscii( FILE* aFile )
...
@@ -1160,7 +1160,7 @@ int PCB_EDIT_FRAME::SavePcbFormatAscii( FILE* aFile )
// Switch the locale to standard C (needed to print floating point numbers
// Switch the locale to standard C (needed to print floating point numbers
// like 1.3)
// like 1.3)
SetLocaleTo_C_standard
()
;
LOCALE_IO
toggle
;
/* Writing file header. */
/* Writing file header. */
fprintf
(
aFile
,
"PCBNEW-BOARD Version %d date %s
\n\n
"
,
BOARD_FILE_VERSION
,
fprintf
(
aFile
,
"PCBNEW-BOARD Version %d date %s
\n\n
"
,
BOARD_FILE_VERSION
,
...
@@ -1179,7 +1179,6 @@ int PCB_EDIT_FRAME::SavePcbFormatAscii( FILE* aFile )
...
@@ -1179,7 +1179,6 @@ int PCB_EDIT_FRAME::SavePcbFormatAscii( FILE* aFile )
rc
=
GetBoard
()
->
Save
(
aFile
);
rc
=
GetBoard
()
->
Save
(
aFile
);
SetLocaleTo_Default
();
// revert to the current locale
wxEndBusyCursor
();
wxEndBusyCursor
();
if
(
!
rc
)
if
(
!
rc
)
...
...
pcbnew/kicad_plugin.cpp
View file @
d5a17363
This diff is collapsed.
Click to expand it.
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