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
c79c0d9c
Commit
c79c0d9c
authored
Feb 19, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
load multiple files
parent
572c4487
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
45 deletions
+59
-45
gerbview.cpp
gerbview/gerbview.cpp
+59
-45
No files found.
gerbview/gerbview.cpp
View file @
c79c0d9c
/************************************************/
/************************************************/
/* GERBVIEW main file */
/* GERBVIEW main file */
/************************************************/
/************************************************/
#define MAIN
#define MAIN
#define eda_global
#define eda_global
...
@@ -18,25 +18,23 @@
...
@@ -18,25 +18,23 @@
#include "protos.h"
#include "protos.h"
wxString
g_Main_Title
=
wxT
(
"GerbView"
);
wxString
g_Main_Title
=
wxT
(
"GerbView"
);
IMPLEMENT_APP
(
WinEDA_App
)
IMPLEMENT_APP
(
WinEDA_App
)
bool
WinEDA_App
::
OnInit
()
bool
WinEDA_App
::
OnInit
()
{
{
wxString
FFileName
;
g_EDA_Appl
=
this
;
g_EDA_Appl
=
this
;
InitEDA_Appl
(
wxT
(
"gerbview"
)
);
if
(
argc
>
1
)
FFileName
=
MakeFileName
(
wxEmptyString
,
argv
[
1
],
g_PhotoFilenameExt
);
InitEDA_Appl
(
wxT
(
"gerbview"
)
);
ScreenPcb
=
new
PCB_SCREEN
(
PCB_FRAME
);
ScreenPcb
=
new
PCB_SCREEN
(
PCB_FRAME
);
ActiveScreen
=
ScreenPcb
;
ActiveScreen
=
ScreenPcb
;
GetSettings
();
GetSettings
();
if
(
m_Checker
&&
m_Checker
->
IsAnotherRunning
()
)
if
(
m_Checker
&&
m_Checker
->
IsAnotherRunning
()
)
{
{
if
(
!
IsOK
(
NULL
,
_
(
"GerbView is already running. Continue?"
)
)
)
if
(
!
IsOK
(
NULL
,
_
(
"GerbView is already running. Continue?"
)
)
)
return
false
;
return
false
;
}
}
...
@@ -47,34 +45,50 @@ wxString FFileName;
...
@@ -47,34 +45,50 @@ wxString FFileName;
* in order to display the real hotkeys
* in order to display the real hotkeys
* in menus or tool tips */
* in menus or tool tips */
m_GerberFrame
=
new
WinEDA_GerberFrame
(
NULL
,
this
,
wxT
(
"GerbView"
),
m_GerberFrame
=
new
WinEDA_GerberFrame
(
NULL
,
this
,
wxT
(
"GerbView"
),
wxPoint
(
0
,
0
),
wxSize
(
600
,
400
)
);
wxPoint
(
0
,
0
),
wxSize
(
600
,
400
)
);
wxString
Title
=
g_Main_Title
+
wxT
(
" "
)
+
GetBuildVersion
();
m_GerberFrame
->
SetTitle
(
Title
);
wxString
Title
=
g_Main_Title
+
wxT
(
" "
)
+
GetBuildVersion
();
m_GerberFrame
->
m_Pcb
=
new
BOARD
(
NULL
,
m_GerberFrame
);
m_GerberFrame
->
SetTitle
(
Title
);
m_GerberFrame
->
m_Pcb
=
new
BOARD
(
NULL
,
m_GerberFrame
);
SetTopWindow
(
m_GerberFrame
);
SetTopWindow
(
m_GerberFrame
);
m_GerberFrame
->
Show
(
TRUE
);
m_GerberFrame
->
Show
(
TRUE
);
m_GerberFrame
->
m_Pcb
=
new
BOARD
(
NULL
,
m_GerberFrame
);
m_GerberFrame
->
m_Pcb
=
new
BOARD
(
NULL
,
m_GerberFrame
);
m_GerberFrame
->
Zoom_Automatique
(
TRUE
);
/* Load file specified in the command line. */
m_GerberFrame
->
Zoom_Automatique
(
TRUE
);
if
(
!
FFileName
.
IsEmpty
()
)
if
(
argc
>
1
)
{
{
wxString
path
=
wxPathOnly
(
FFileName
);
wxString
fileName
=
MakeFileName
(
wxEmptyString
,
argv
[
1
],
g_PhotoFilenameExt
);
wxSetWorkingDirectory
(
path
);
if
(
!
fileName
.
IsEmpty
()
)
{
wxClientDC
dc
(
m_GerberFrame
->
DrawPanel
);
m_GerberFrame
->
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
wxString
path
=
wxPathOnly
(
fileName
);
wxSetWorkingDirectory
(
path
);
Read_Config
();
Read_Config
();
if
(
wxFileExists
(
FFileName
)
)
// Load all files specified on the command line.
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
fileName
=
MakeFileName
(
wxEmptyString
,
argv
[
i
],
g_PhotoFilenameExt
);
if
(
wxFileExists
(
fileName
)
)
{
{
wxClientDC
dc
(
m_GerberFrame
->
DrawPanel
)
;
((
PCB_SCREEN
*
)
m_GerberFrame
->
GetScreen
())
->
m_Active_Layer
=
i
-
1
;
m_GerberFrame
->
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
m_GerberFrame
->
LoadOneGerberFile
(
fileName
,
&
dc
,
FALSE
);
m_GerberFrame
->
LoadOneGerberFile
(
FFileName
,
&
dc
,
FALSE
);
}
}
}
}
}
else
Read_Config
();
}
else
Read_Config
();
return
TRUE
;
return
TRUE
;
}
}
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