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
c5d16c85
Commit
c5d16c85
authored
May 28, 2009
by
jerryjacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve filetypes for opening gerber
parent
7de19cb6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
20 deletions
+43
-20
files.cpp
gerbview/files.cpp
+43
-20
No files found.
gerbview/files.cpp
View file @
c5d16c85
...
...
@@ -112,8 +112,10 @@ void WinEDA_GerberFrame::Files_io( wxCommandEvent& event )
/*******************************************************************************************/
bool
WinEDA_GerberFrame
::
LoadOneGerberFile
(
const
wxString
&
FullFileName
,
wxDC
*
DC
,
int
mode
)
bool
WinEDA_GerberFrame
::
LoadOneGerberFile
(
const
wxString
&
FullFileName
,
wxDC
*
DC
,
int
mode
)
/*******************************************************************************************/
/*
...
...
@@ -123,36 +125,57 @@ bool WinEDA_GerberFrame::LoadOneGerberFile( const wxString& FullFileName,
* 1 si OK
*/
{
wxString
wildcard
;
wxFileName
f
n
=
FullFileName
;
wxString
filetypes
;
wxFileName
f
ilename
=
FullFileName
;
ActiveScreen
=
GetScreen
();
if
(
!
f
n
.
IsOk
()
)
if
(
!
f
ilename
.
IsOk
()
)
{
wildcard
.
Printf
(
_
(
"Gerber files (.%s .gbr .gbx .lgr .ger .pho)| \
*.%s;*.gbr;*.gbx;*.lgr;*.ger;*.pho|"
),
g_PenFilenameExt
.
c_str
(),
g_PenFilenameExt
.
c_str
());
wildcard
+=
AllFilesWildcard
;
wxString
currpath
=
fn
.
GetPath
();
if
(
currpath
.
IsEmpty
()
)
currpath
=
wxGetCwd
();
wxFileDialog
dlg
(
this
,
_
(
"Open Gerber File"
),
currpath
,
fn
.
GetFullName
(),
wildcard
,
wxString
current_path
=
filename
.
GetPath
();
/* Standard gerber filetypes */
filetypes
+=
_
(
"Gerber files (.gbr .gbx .lgr .ger .pho)| \
*.gbr;*.GBR;*.gbx;*.GBX;*.lgr;*.LGR;*.ger;*.GER;*.pho;*.PHO|"
);
/* Special gerber filetypes */
filetypes
+=
_
(
"Top layer (*.GTL)|*.GTL;*.gtl|"
);
filetypes
+=
_
(
"Bottom solder resist (*.GBS)|*.GBS;*.gbs|"
);
filetypes
+=
_
(
"Top solder resist (*.GTS)|*.GTS;*.gts|"
);
filetypes
+=
_
(
"Bottom overlay (*.GBO)|*.GBO;*.gbo|"
);
filetypes
+=
_
(
"Top overlay (*.GTO)|*.GTO;*.gto|"
);
filetypes
+=
_
(
"Bottom paste (*.GBP)|*.GBP;*.gto|"
);
filetypes
+=
_
(
"Top paste (*.GTP)|*.GTP;*.gtp|"
);
filetypes
+=
_
(
"Keep-out layer (*.GKO)|*.GKO;*.gko|"
);
filetypes
+=
_
(
"Mechanical layers (*.GMx)|*.GM1;*.gm1;*.GM2;*.gm2;*.GM3;*.gm3|"
);
filetypes
+=
_
(
"Top Pad Master (*.GPT)|*.GPT;*.gpt|"
);
filetypes
+=
_
(
"Bottom Pad Master (*.GPB)|*.GPB;*.gpb|"
);
/* All filetypes */
filetypes
+=
AllFilesWildcard
;
/* Get current path if emtpy */
if
(
current_path
.
IsEmpty
()
)
current_path
=
wxGetCwd
();
wxFileDialog
dlg
(
this
,
_
(
"Open Gerber File"
),
current_path
,
filename
.
GetFullName
(),
filetypes
,
wxFD_OPEN
|
wxFD_FILE_MUST_EXIST
);
if
(
dlg
.
ShowModal
()
==
wxID_CANCEL
)
return
false
;
f
n
=
dlg
.
GetPath
();
f
ilename
=
dlg
.
GetPath
();
}
GetScreen
()
->
m_FileName
=
f
n
.
GetFullPath
();
wxSetWorkingDirectory
(
f
n
.
GetPath
()
);
f
n
.
SetExt
(
g_PenFilenameExt
);
GetScreen
()
->
m_FileName
=
f
ilename
.
GetFullPath
();
wxSetWorkingDirectory
(
f
ilename
.
GetPath
()
);
f
ilename
.
SetExt
(
g_PenFilenameExt
);
if
(
Read_GERBER_File
(
DC
,
GetScreen
()
->
m_FileName
,
f
n
.
GetFullPath
()
)
)
if
(
Read_GERBER_File
(
DC
,
GetScreen
()
->
m_FileName
,
f
ilename
.
GetFullPath
()
)
)
SetLastProject
(
GetScreen
()
->
m_FileName
);
Zoom_Automatique
(
FALSE
);
...
...
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