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
97898b92
Commit
97898b92
authored
Aug 04, 2007
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
beautified
parent
7d8f2fcf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
66 deletions
+65
-66
pcbnew.cpp
pcbnew/pcbnew.cpp
+65
-66
No files found.
pcbnew/pcbnew.cpp
View file @
97898b92
/*************************/
/*************************/
/* PCBNEW: main program */
/* PCBNEW: main program */
/*************************/
/*************************/
#define MAIN
#define MAIN
#define eda_global
#define eda_global
...
@@ -24,22 +24,22 @@
...
@@ -24,22 +24,22 @@
#include "eda_dde.h"
#include "eda_dde.h"
wxString
g_Main_Title
(
wxT
(
"PCBNEW"
)
);
wxString
g_Main_Title
(
wxT
(
"PCBNEW"
)
);
IMPLEMENT_APP
(
WinEDA_App
)
IMPLEMENT_APP
(
WinEDA_App
)
/****************************/
/****************************/
bool
WinEDA_App
::
OnInit
(
void
)
bool
WinEDA_App
::
OnInit
(
void
)
/****************************/
/****************************/
{
{
wxString
FFileName
;
wxString
FFileName
;
EDA_Appl
=
this
;
EDA_Appl
=
this
;
InitEDA_Appl
(
wxT
(
"pcbnew"
)
);
InitEDA_Appl
(
wxT
(
"pcbnew"
)
);
if
(
m_Checker
&&
m_Checker
->
IsAnotherRunning
()
)
if
(
m_Checker
&&
m_Checker
->
IsAnotherRunning
()
)
{
{
if
(
!
IsOK
(
NULL
,
_
(
"Pcbnew is already running, Continue?"
)
)
)
if
(
!
IsOK
(
NULL
,
_
(
"Pcbnew is already running, Continue?"
)
)
)
return
false
;
return
false
;
}
}
...
@@ -47,55 +47,54 @@ wxString FFileName;
...
@@ -47,55 +47,54 @@ wxString FFileName;
wxImage
::
AddHandler
(
new
wxPNGHandler
);
wxImage
::
AddHandler
(
new
wxPNGHandler
);
wxImage
::
AddHandler
(
new
wxJPEGHandler
);
wxImage
::
AddHandler
(
new
wxJPEGHandler
);
ScreenPcb
=
new
PCB_SCREEN
(
PCB_FRAME
);
ScreenPcb
=
new
PCB_SCREEN
(
PCB_FRAME
);
GetSettings
();
GetSettings
();
if
(
argc
>
1
)
if
(
argc
>
1
)
{
{
FFileName
=
MakeFileName
(
wxEmptyString
,
argv
[
1
],
PcbExtBuffer
);
FFileName
=
MakeFileName
(
wxEmptyString
,
argv
[
1
],
PcbExtBuffer
);
wxSetWorkingDirectory
(
wxPathOnly
(
FFileName
)
);
wxSetWorkingDirectory
(
wxPathOnly
(
FFileName
)
);
}
}
Read_Config
(
FFileName
);
Read_Config
(
FFileName
);
g_DrawBgColor
=
BLACK
;
g_DrawBgColor
=
BLACK
;
/* allocation de la memoire pour le fichier et autres buffers: */
/* allocation de la memoire pour le fichier et autres buffers: */
/* On reserve BUFMEMSIZE octets de ram pour calcul */
/* On reserve BUFMEMSIZE octets de ram pour calcul */
buf_work
=
adr_lowmem
=
(
char
*
)
MyZMalloc
(
BUFMEMSIZE
)
;
/* adresse de la zone de calcul */
buf_work
=
adr_lowmem
=
(
char
*
)
MyZMalloc
(
BUFMEMSIZE
);
/* adresse de la zone de calcul */
adr_himem
=
adr_lowmem
+
BUFMEMSIZE
;
/* adr limite haute */
adr_himem
=
adr_lowmem
+
BUFMEMSIZE
;
/* adr limite haute */
adr_max
=
adr_lowmem
;
adr_max
=
adr_lowmem
;
if
(
adr_lowmem
==
NULL
)
if
(
adr_lowmem
==
NULL
)
{
{
printf
(
"No Memory, Fatal err Memory alloc
\n
"
);
printf
(
"No Memory, Fatal err Memory alloc
\n
"
);
return
(
FALSE
)
;
return
FALSE
;
}
}
m_PcbFrame
=
new
WinEDA_PcbFrame
(
NULL
,
this
,
wxT
(
"PcbNew"
),
m_PcbFrame
=
new
WinEDA_PcbFrame
(
NULL
,
this
,
wxT
(
"PcbNew"
),
wxPoint
(
0
,
0
),
wxSize
(
600
,
400
)
);
wxPoint
(
0
,
0
),
wxSize
(
600
,
400
)
);
wxString
Title
=
g_Main_Title
+
wxT
(
" "
)
+
GetBuildVersion
();
wxString
Title
=
g_Main_Title
+
wxT
(
" "
)
+
GetBuildVersion
();
m_PcbFrame
->
SetTitle
(
Title
);
m_PcbFrame
->
SetTitle
(
Title
);
ActiveScreen
=
ScreenPcb
;
ActiveScreen
=
ScreenPcb
;
m_PcbFrame
->
m_Pcb
=
new
BOARD
(
NULL
,
m_PcbFrame
);
m_PcbFrame
->
m_Pcb
=
new
BOARD
(
NULL
,
m_PcbFrame
);
SetTopWindow
(
m_PcbFrame
);
SetTopWindow
(
m_PcbFrame
);
m_PcbFrame
->
Show
(
TRUE
);
m_PcbFrame
->
Show
(
TRUE
);
if
(
CreateServer
(
m_PcbFrame
,
KICAD_PCB_PORT_SERVICE_NUMBER
)
)
if
(
CreateServer
(
m_PcbFrame
,
KICAD_PCB_PORT_SERVICE_NUMBER
)
)
{
{
SetupServerFunction
(
RemoteCommand
);
SetupServerFunction
(
RemoteCommand
);
}
}
m_PcbFrame
->
Zoom_Automatique
(
TRUE
);
m_PcbFrame
->
Zoom_Automatique
(
TRUE
);
/* Load file specified in the command line. */
/* Load file specified in the command line. */
if
(
!
FFileName
.
IsEmpty
()
)
if
(
!
FFileName
.
IsEmpty
()
)
{
{
wxClientDC
dc
(
m_PcbFrame
->
DrawPanel
);
wxClientDC
dc
(
m_PcbFrame
->
DrawPanel
);
m_PcbFrame
->
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
m_PcbFrame
->
LoadOnePcbFile
(
FFileName
,
&
dc
,
FALSE
);
m_PcbFrame
->
DrawPanel
->
PrepareGraphicContext
(
&
dc
);
m_PcbFrame
->
LoadOnePcbFile
(
FFileName
,
&
dc
,
FALSE
);
}
}
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