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
10e13ae5
Commit
10e13ae5
authored
Mar 04, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
layer names in *.brd file
parent
7c482f68
Changes
39
Hide whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
1786 additions
and
1630 deletions
+1786
-1630
change_log.txt
change_log.txt
+13
-2
common.cpp
common/common.cpp
+2
-63
projet_config.cpp
common/projet_config.cpp
+4
-3
cfg.cpp
cvpcb/cfg.cpp
+55
-47
displayframe.cpp
cvpcb/displayframe.cpp
+1
-1
gerbview.cpp
gerbview/gerbview.cpp
+0
-2
gerbview_config.cpp
gerbview/gerbview_config.cpp
+8
-4
select_layers_to_pcb.cpp
gerbview/select_layers_to_pcb.cpp
+14
-13
pcbstruct.h
include/pcbstruct.h
+2
-32
wxPcbStruct.h
include/wxPcbStruct.h
+31
-23
basepcbframe.cpp
pcbnew/basepcbframe.cpp
+8
-1
class_board.cpp
pcbnew/class_board.cpp
+79
-5
class_board.h
pcbnew/class_board.h
+41
-3
class_drawsegment.cpp
pcbnew/class_drawsegment.cpp
+4
-1
class_module.cpp
pcbnew/class_module.cpp
+19
-9
class_module.h
pcbnew/class_module.h
+12
-1
class_pcb_text.cpp
pcbnew/class_pcb_text.cpp
+16
-13
class_text_mod.cpp
pcbnew/class_text_mod.cpp
+37
-32
class_zone.cpp
pcbnew/class_zone.cpp
+32
-28
classpcb.cpp
pcbnew/classpcb.cpp
+3
-0
cotation.cpp
pcbnew/cotation.cpp
+8
-8
cross-probing.cpp
pcbnew/cross-probing.cpp
+3
-3
dialog_zones_by_polygon.cpp
pcbnew/dialog_zones_by_polygon.cpp
+99
-90
editedge.cpp
pcbnew/editedge.cpp
+1
-1
initpcb.cpp
pcbnew/initpcb.cpp
+7
-48
ioascii.cpp
pcbnew/ioascii.cpp
+24
-22
locate.cpp
pcbnew/locate.cpp
+47
-96
pcbframe.cpp
pcbnew/pcbframe.cpp
+53
-50
pcbnew.cpp
pcbnew/pcbnew.cpp
+0
-1
pcbplot.cpp
pcbnew/pcbplot.cpp
+590
-524
pcbtexte.cpp
pcbnew/pcbtexte.cpp
+9
-5
protos.h
pcbnew/protos.h
+1
-5
sel_layer.cpp
pcbnew/sel_layer.cpp
+13
-11
set_color.cpp
pcbnew/set_color.cpp
+3
-3
set_color.h
pcbnew/set_color.h
+3
-3
specctra_export.cpp
pcbnew/specctra_export.cpp
+11
-0
swap_layers.cpp
pcbnew/swap_layers.cpp
+8
-5
tool_pcb.cpp
pcbnew/tool_pcb.cpp
+1
-1
wxprint.cpp
share/wxprint.cpp
+524
-471
No files found.
change_log.txt
View file @
10e13ae5
...
@@ -5,16 +5,27 @@ Started 2007-June-11
...
@@ -5,16 +5,27 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.
2008-Mar-3 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew
Completed transision to BOARD::GetLayerName() and away from ReturnPcbLayerName().
LayerNames and LAYER_T are saved int the *.brd file and may be edited
there with a text editor until the UI is in place to edit them in PCBNEW.
To understand the strategy, see BOARD::GetLayerName() in class_board.cpp
and see WinEDA_BasePcbFrame::ReadSetup(). I will be adding "Board" menu
item to Preferences, but there is more to come before the UI gets done:
net classes.
2008-mars-03 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2008-mars-03 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
================================================================================
3d display:
3d display:
Added Jonas Diemer's patch (enhanced movings from mouse and tools)
Added Jonas Diemer's patch (enhanced movings from mouse and tools)
2008-Mar-1 UPDATE Dick Hollenbeck <dick@softplc.com>
2008-Mar-1 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
+pcbnew
+pcbnew
Changed ioascii.cpp to save and load board specific layer names, for DEBUG
Changed ioascii.cpp to save and load board specific layer names, for DEBUG
build only. I want to add class LAYER, see below. Added
build only. I want to add class LAYER, see below. Added
BOARD::SetLayerName(), BOARD::SetLayerType(), and BOARD::GetLayerType().
BOARD::SetLayerName(), BOARD::SetLayerType(), and BOARD::GetLayerType().
...
...
common/common.cpp
View file @
10e13ae5
...
@@ -265,8 +265,6 @@ void MyFree( void* pt_mem )
...
@@ -265,8 +265,6 @@ void MyFree( void* pt_mem )
}
}
/**************************************************************/
/**************************************************************/
wxString
ReturnPcbLayerName
(
int
layer_number
,
bool
omitSpacePadding
)
wxString
ReturnPcbLayerName
(
int
layer_number
,
bool
omitSpacePadding
)
/**************************************************************/
/**************************************************************/
...
@@ -276,32 +274,11 @@ wxString ReturnPcbLayerName( int layer_number, bool omitSpacePadding )
...
@@ -276,32 +274,11 @@ wxString ReturnPcbLayerName( int layer_number, bool omitSpacePadding )
* (not internatinalized, no space)
* (not internatinalized, no space)
*/
*/
{
{
#if 1 && defined(DEBUG)
// Dick: this code is working fine, but we have no place to store the layer names yet.
const
unsigned
LAYER_LIMIT
=
29
;
const
unsigned
LAYER_LIMIT
=
29
;
// @todo: these layer names should be configurable on a per project basis.
// These are only default layer names. For PCBNEW, the copper names
// In anticipation of that enhancement, here is a different strategy for
// may be over-ridden in the BOARD file *.brd.
// deriving the file names from the "configured" layer names.
// The main idea is to use a single array of names, and then remove
// spaces on the fly from the names when writing to disk.
#if 1 // my specific layer names
static
const
wxString
layer_name_list
[]
=
{
_
(
"H2 Bottom"
),
_
(
"Power"
),
_
(
"V2 Signal"
),
_
(
"H1 Signal"
),
_
(
"Ground"
),
_
(
"Inner L5"
),
_
(
"Inner L6"
),
_
(
"Inner L7"
),
_
(
"Inner L8"
),
_
(
"Inner L9"
),
_
(
"Inner L10"
),
_
(
"Inner L11"
),
_
(
"Inner L12"
),
_
(
"Inner L13"
),
_
(
"Inner L14"
),
_
(
"Component"
),
_
(
"Adhes Cop"
),
_
(
"Adhes Cmp"
),
_
(
"SoldP Cop"
),
_
(
"SoldP Cmp"
),
_
(
"SilkS Cop"
),
_
(
"SilkS Cmp"
),
_
(
"Mask Cop"
),
_
(
"Mask Cmp"
),
_
(
"Drawings "
),
_
(
"Comments"
),
_
(
"Eco1"
),
_
(
"Eco2"
),
_
(
"Edges Pcb"
),
_
(
"BAD INDEX"
),
};
#else
static
const
wxString
layer_name_list
[]
=
{
static
const
wxString
layer_name_list
[]
=
{
_
(
"Copper "
),
_
(
"Inner L1 "
),
_
(
"Inner L2 "
),
_
(
"Inner L3 "
),
_
(
"Copper "
),
_
(
"Inner L1 "
),
_
(
"Inner L2 "
),
_
(
"Inner L3 "
),
_
(
"Inner L4 "
),
_
(
"Inner L5 "
),
_
(
"Inner L6 "
),
_
(
"Inner L7 "
),
_
(
"Inner L4 "
),
_
(
"Inner L5 "
),
_
(
"Inner L6 "
),
_
(
"Inner L7 "
),
...
@@ -313,8 +290,6 @@ wxString ReturnPcbLayerName( int layer_number, bool omitSpacePadding )
...
@@ -313,8 +290,6 @@ wxString ReturnPcbLayerName( int layer_number, bool omitSpacePadding )
_
(
"Edges Pcb"
),
_
(
"BAD INDEX"
),
_
(
"Edges Pcb"
),
_
(
"BAD INDEX"
),
};
};
#endif
if
(
(
unsigned
)
layer_number
>
LAYER_LIMIT
)
if
(
(
unsigned
)
layer_number
>
LAYER_LIMIT
)
layer_number
=
LAYER_LIMIT
;
layer_number
=
LAYER_LIMIT
;
...
@@ -332,42 +307,6 @@ wxString ReturnPcbLayerName( int layer_number, bool omitSpacePadding )
...
@@ -332,42 +307,6 @@ wxString ReturnPcbLayerName( int layer_number, bool omitSpacePadding )
}
}
else
else
return
*
p
;
return
*
p
;
#else // long standing established code:
static
const
wxString
layer_name_list
[]
=
{
_
(
"Copper "
),
_
(
"Inner L1 "
),
_
(
"Inner L2 "
),
_
(
"Inner L3 "
),
_
(
"Inner L4 "
),
_
(
"Inner L5 "
),
_
(
"Inner L6 "
),
_
(
"Inner L7 "
),
_
(
"Inner L8 "
),
_
(
"Inner L9 "
),
_
(
"Inner L10"
),
_
(
"Inner L11"
),
_
(
"Inner L12"
),
_
(
"Inner L13"
),
_
(
"Inner L14"
),
_
(
"Component"
),
_
(
"Adhes Cop"
),
_
(
"Adhes Cmp"
),
_
(
"SoldP Cop"
),
_
(
"SoldP Cmp"
),
_
(
"SilkS Cop"
),
_
(
"SilkS Cmp"
),
_
(
"Mask Cop "
),
_
(
"Mask Cmp "
),
_
(
"Drawings "
),
_
(
"Comments "
),
_
(
"Eco1 "
),
_
(
"Eco2 "
),
_
(
"Edges Pcb"
),
_
(
"--- "
),
_
(
"--- "
),
_
(
"--- "
)
};
// Same as layer_name_list, without space, not internationalized
static
const
wxString
layer_name_list_for_filename
[]
=
{
wxT
(
"Copper"
),
wxT
(
"InnerL1"
),
wxT
(
"InnerL2"
),
wxT
(
"InnerL3"
),
wxT
(
"InnerL4"
),
wxT
(
"InnerL5"
),
wxT
(
"InnerL6"
),
wxT
(
"InnerL7"
),
wxT
(
"InnerL8"
),
wxT
(
"InnerL9"
),
wxT
(
"InnerL10"
),
wxT
(
"InnerL11"
),
wxT
(
"InnerL12"
),
wxT
(
"InnerL13"
),
wxT
(
"InnerL14"
),
wxT
(
"Component"
),
wxT
(
"AdhesCop"
),
wxT
(
"AdhesCmp"
),
wxT
(
"SoldPCop"
),
wxT
(
"SoldPCmp"
),
wxT
(
"SilkSCop"
),
wxT
(
"SilkSCmp"
),
wxT
(
"MaskCop"
),
wxT
(
"MaskCmp"
),
wxT
(
"Drawings"
),
wxT
(
"Comments"
),
wxT
(
"Eco1"
),
wxT
(
"Eco2"
),
wxT
(
"EdgesPcb"
),
wxT
(
"---"
),
wxT
(
"---"
),
wxT
(
"---"
)
};
if
(
(
unsigned
)
layer_number
>=
31u
)
layer_number
=
31
;
return
omitSpacePadding
?
layer_name_list_for_filename
[
layer_number
]
:
layer_name_list
[
layer_number
];
#endif
}
}
...
...
common/projet_config.cpp
View file @
10e13ae5
...
@@ -125,8 +125,8 @@ void WinEDA_App::WriteProjectConfig( const wxString& local_config_filename,
...
@@ -125,8 +125,8 @@ void WinEDA_App::WriteProjectConfig( const wxString& local_config_filename,
switch
(
pt_cfg
->
m_Type
)
switch
(
pt_cfg
->
m_Type
)
{
{
case
PARAM_INT
:
case
PARAM_INT
:
#undef PTCFG
#undef PTCFG
#define PTCFG ( (PARAM_CFG_INT*) pt_cfg )
#define PTCFG ( (PARAM_CFG_INT*) pt_cfg )
if
(
PTCFG
->
m_Pt_param
==
NULL
)
if
(
PTCFG
->
m_Pt_param
==
NULL
)
break
;
break
;
...
@@ -319,7 +319,8 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
...
@@ -319,7 +319,8 @@ bool WinEDA_App::ReadProjectConfig( const wxString& local_config_filename,
{
{
#undef PTCFG
#undef PTCFG
#define PTCFG ( (PARAM_CFG_DOUBLE*) pt_cfg )
#define PTCFG ( (PARAM_CFG_DOUBLE*) pt_cfg )
double
ftmp
=
0
;
wxString
msg
;
double
ftmp
=
0
;
wxString
msg
;
if
(
pt_cfg
->
m_Setup
)
if
(
pt_cfg
->
m_Setup
)
msg
=
m_EDA_Config
->
Read
(
pt_cfg
->
m_Ident
,
wxT
(
""
)
);
msg
=
m_EDA_Config
->
Read
(
pt_cfg
->
m_Ident
,
wxT
(
""
)
);
else
else
...
...
cvpcb/cfg.cpp
View file @
10e13ae5
/***************************************/
/***************************************/
/** cfg.cpp : configuration de CVPCB **/
/** cfg.cpp : configuration de CVPCB **/
/***************************************/
/***************************************/
/* lit ou met a jour la configuration de CVPCB */
/* lit ou met a jour la configuration de CVPCB */
...
@@ -18,68 +18,76 @@
...
@@ -18,68 +18,76 @@
/**************************************************/
/**************************************************/
void
Read_Config
(
const
wxString
&
FileName
)
void
Read_Config
(
const
wxString
&
FileName
)
/**************************************************/
/**************************************************/
/* lit la configuration
1 - lit cvpcb.cnf
2 - si non trouve lit <chemin de cvpcb.exe>/cvpcb.cnf
3 - si non trouve: init des variables aux valeurs par defaut
Remarque:
/* lit la configuration
le chemin de l'executable cvpcb.exe doit etre dans BinDir
* 1 - lit cvpcb.cnf
*/
* 2 - si non trouve lit <chemin de cvpcb.exe>/cvpcb.cnf
* 3 - si non trouve: init des variables aux valeurs par defaut
*
* Remarque:
* le chemin de l'executable cvpcb.exe doit etre dans BinDir
*/
{
{
wxString
FullFileName
=
FileName
;
wxString
FullFileName
=
FileName
;
/* Init des valeurs par defaut */
g_LibName_List
.
Clear
();
g_ListName_Equ
.
Clear
();
/* Init des valeurs par defaut */
g_EDA_Appl
->
ReadProjectConfig
(
FullFileName
,
g_LibName_List
.
Clear
();
GROUP
,
ParamCfgList
,
FALSE
);
g_ListName_Equ
.
Clear
();
g_EDA_Appl
->
ReadProjectConfig
(
FullFileName
,
if
(
PkgInExtBuffer
.
IsEmpty
()
)
GROUP
,
ParamCfgList
,
FALSE
);
PkgInExtBuffer
=
wxT
(
".pkg"
);
if
(
PkgInExtBuffer
.
IsEmpty
()
)
PkgInExtBuffer
=
wxT
(
".pkg"
);
if
(
NetInExtBuffer
.
IsEmpty
()
)
if
(
NetInExtBuffer
.
IsEmpty
()
)
NetInExtBuffer
=
wxT
(
".net"
),
NetInExtBuffer
=
wxT
(
".net"
);
/* Inits autres variables */
/* Inits autres variables */
SetRealLibraryPath
(
wxT
(
"modules"
)
);
SetRealLibraryPath
(
wxT
(
"modules"
)
);
}
}
/************************************************************/
/************************************************************/
void
WinEDA_CvpcbFrame
::
Update_Config
(
wxCommandEvent
&
event
)
void
WinEDA_CvpcbFrame
::
Update_Config
(
wxCommandEvent
&
event
)
/************************************************************/
/************************************************************/
/* fonction relai d'appel a Save_Config,
/* fonction relai d'appel a Save_Config,
la vraie fonction de sauvegarde de la config
*
la vraie fonction de sauvegarde de la config
*/
*/
{
{
Save_Config
(
this
);
Save_Config
(
this
);
}
}
/************************************/
/************************************/
void
Save_Config
(
wxWindow
*
parent
)
void
Save_Config
(
wxWindow
*
parent
)
/************************************/
/************************************/
/* enregistrement de la config */
/* enregistrement de la config */
{
{
wxString
path
,
FullFileName
;
wxString
path
,
FullFileName
;
wxString
mask
(
wxT
(
"*"
));
FullFileName
=
FFileName
;
ChangeFileNameExt
(
FullFileName
,
g_Prj_Config_Filename_ext
);
path
=
wxGetCwd
();
FullFileName
=
EDA_FileSelector
(
_
(
"Save preferences"
),
path
,
/* Chemin par defaut */
FullFileName
,
/* nom fichier par defaut */
g_Prj_Config_Filename_ext
,
/* extension par defaut */
mask
,
/* Masque d'affichage */
parent
,
wxFD_SAVE
,
TRUE
);
if
(
FullFileName
.
IsEmpty
())
return
;
/* ecriture de la configuration */
g_EDA_Appl
->
WriteProjectConfig
(
FullFileName
,
GROUP
,
ParamCfgList
);
}
wxString
mask
(
wxT
(
"*"
)
);
FullFileName
=
FFileName
;
ChangeFileNameExt
(
FullFileName
,
g_Prj_Config_Filename_ext
);
path
=
wxGetCwd
();
FullFileName
=
EDA_FileSelector
(
_
(
"Save preferences"
),
path
,
/* Chemin par defaut */
FullFileName
,
/* nom fichier par defaut */
g_Prj_Config_Filename_ext
,
/* extension par defaut */
mask
,
/* Masque d'affichage */
parent
,
wxFD_SAVE
,
TRUE
);
if
(
FullFileName
.
IsEmpty
()
)
return
;
/* ecriture de la configuration */
g_EDA_Appl
->
WriteProjectConfig
(
FullFileName
,
GROUP
,
ParamCfgList
);
}
cvpcb/displayframe.cpp
View file @
10e13ae5
...
@@ -51,7 +51,7 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( wxWindow* father, WinEDA_App* parent,
...
@@ -51,7 +51,7 @@ WinEDA_DisplayFrame::WinEDA_DisplayFrame( wxWindow* father, WinEDA_App* parent,
#endif
#endif
SetTitle
(
title
);
SetTitle
(
title
);
m_Pcb
=
new
BOARD
(
NULL
,
this
);
m_Pcb
=
new
BOARD
(
NULL
,
this
);
m_CurrentScreen
=
new
PCB_SCREEN
(
CVPCB_DISPLAY_FRAME
);
m_CurrentScreen
=
new
PCB_SCREEN
(
CVPCB_DISPLAY_FRAME
);
...
...
gerbview/gerbview.cpp
View file @
10e13ae5
...
@@ -55,8 +55,6 @@ bool WinEDA_App::OnInit()
...
@@ -55,8 +55,6 @@ bool WinEDA_App::OnInit()
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
->
Zoom_Automatique
(
TRUE
);
m_GerberFrame
->
Zoom_Automatique
(
TRUE
);
if
(
argc
>
1
)
if
(
argc
>
1
)
...
...
gerbview/gerbview_config.cpp
View file @
10e13ae5
...
@@ -16,11 +16,14 @@
...
@@ -16,11 +16,14 @@
#include "protos.h"
#include "protos.h"
#define HOTKEY_FILENAME wxT( "gerbview" )
/* Routines Locales */
/* Routines Locales */
/* Variables locales */
#define HOTKEY_FILENAME wxT( "gerbview" )
/* Variables locales */
/*************************************************************/
/*************************************************************/
...
@@ -32,7 +35,8 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event )
...
@@ -32,7 +35,8 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event )
wxString
FullFileName
;
wxString
FullFileName
;
pos
=
GetPosition
();
pos
=
GetPosition
();
pos
.
x
+=
20
;
pos
.
y
+=
20
;
pos
.
x
+=
20
;
pos
.
y
+=
20
;
switch
(
id
)
switch
(
id
)
{
{
...
@@ -69,7 +73,7 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event )
...
@@ -69,7 +73,7 @@ void WinEDA_GerberFrame::Process_Config( wxCommandEvent& event )
case
ID_PREFERENCES_HOTKEY_PATH_IS_HOME
:
case
ID_PREFERENCES_HOTKEY_PATH_IS_HOME
:
case
ID_PREFERENCES_HOTKEY_PATH_IS_KICAD
:
case
ID_PREFERENCES_HOTKEY_PATH_IS_KICAD
:
HandleHotkeyConfigMenuSelection
(
this
,
id
);
HandleHotkeyConfigMenuSelection
(
this
,
id
);
break
;
break
;
default
:
default
:
...
...
gerbview/select_layers_to_pcb.cpp
View file @
10e13ae5
...
@@ -13,10 +13,11 @@
...
@@ -13,10 +13,11 @@
#include "wx/statline.h"
#include "wx/statline.h"
/* Variables locales */
/* Variables locales */
#define LAYER_UNSELECTED NB_LAYERS
#define LAYER_UNSELECTED NB_LAYERS
static
int
ButtonTable
[
32
];
// Indexes buttons to Gerber layers
static
int
LayerLookUpTable
[
32
];
// Indexes Gerber layers to PCB file layers
static
int
ButtonTable
[
32
];
// Indexes buttons to Gerber layers
wxStaticText
*
layer_list
[
32
];
// Indexes text strings to buttons
static
int
LayerLookUpTable
[
32
];
// Indexes Gerber layers to PCB file layers
wxStaticText
*
layer_list
[
32
];
// Indexes text strings to buttons
enum
swap_layer_id
{
enum
swap_layer_id
{
ID_WINEDA_SWAPLAYERFRAME
=
1800
,
ID_WINEDA_SWAPLAYERFRAME
=
1800
,
...
@@ -75,12 +76,13 @@ int * InstallDialogLayerPairChoice(WinEDA_GerberFrame * parent)
...
@@ -75,12 +76,13 @@ int * InstallDialogLayerPairChoice(WinEDA_GerberFrame * parent)
*/
*/
{
{
WinEDA_SwapLayerFrame
*
frame
=
new
WinEDA_SwapLayerFrame
(
parent
);
WinEDA_SwapLayerFrame
*
frame
=
new
WinEDA_SwapLayerFrame
(
parent
);
int
ii
=
frame
->
ShowModal
();
frame
->
Destroy
();
int
ii
=
frame
->
ShowModal
();
if
(
ii
>=
0
)
frame
->
Destroy
();
return
LayerLookUpTable
;
if
(
ii
>=
0
)
else
return
LayerLookUpTable
;
return
NULL
;
else
return
NULL
;
}
}
...
@@ -138,7 +140,6 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame(WinEDA_GerberFrame *parent) :
...
@@ -138,7 +140,6 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame(WinEDA_GerberFrame *parent) :
int
pcb_layer_number
=
0
;
int
pcb_layer_number
=
0
;
for
(
nb_items
=
0
,
ii
=
0
;
ii
<
32
;
ii
++
)
for
(
nb_items
=
0
,
ii
=
0
;
ii
<
32
;
ii
++
)
{
{
if
(
g_GERBER_Descr_List
[
ii
]
==
NULL
)
if
(
g_GERBER_Descr_List
[
ii
]
==
NULL
)
continue
;
continue
;
...
@@ -353,8 +354,8 @@ void WinEDA_SwapLayerFrame::OnCancelClick(wxCommandEvent& event)
...
@@ -353,8 +354,8 @@ void WinEDA_SwapLayerFrame::OnCancelClick(wxCommandEvent& event)
void
WinEDA_SwapLayerFrame
::
OnOkClick
(
wxCommandEvent
&
event
)
void
WinEDA_SwapLayerFrame
::
OnOkClick
(
wxCommandEvent
&
event
)
/*********************************************************/
/*********************************************************/
{
{
int
ii
;
int
ii
;
bool
AsCmpLayer
=
false
;
bool
AsCmpLayer
=
false
;
/* Compute the number of copper layers
/* Compute the number of copper layers
* this is the max layer number + 1 (if some internal layers exist)
* this is the max layer number + 1 (if some internal layers exist)
...
...
include/pcbstruct.h
View file @
10e13ae5
...
@@ -148,38 +148,6 @@ struct CHEVELU;
...
@@ -148,38 +148,6 @@ struct CHEVELU;
/* Class to handle a board */
/* Class to handle a board */
#include "class_board.h"
#include "class_board.h"
/**
* Class LAYER
* holds information pertinent to a layer of a BOARD.
*/
class
LAYER
{
wxString
m_Name
;
LAYER_T
m_Type
;
int
m_Color
;
bool
m_Visible
;
// ? use flags in m_Color instead ?
public
:
bool
SetName
(
const
wxString
&
aLayerName
);
const
wxString
&
GetName
();
bool
SetType
(
LAYER_T
aLayerType
);
LAYER_T
GetType
();
int
GetColor
()
{
return
m_Color
;
}
void
SetColor
(
int
aColor
)
{
m_Color
=
aColor
;
}
bool
IsVisible
();
void
SetVisible
(
bool
isVisible
);
};
// Class for handle current printed board design settings
// Class for handle current printed board design settings
#define HISTORY_NUMBER 8
#define HISTORY_NUMBER 8
class
EDA_BoardDesignSettings
class
EDA_BoardDesignSettings
...
@@ -207,7 +175,9 @@ public:
...
@@ -207,7 +175,9 @@ public:
// Color options for screen display of the Printed Board:
// Color options for screen display of the Printed Board:
int
m_PcbGridColor
;
// Grid color
int
m_PcbGridColor
;
// Grid color
int
m_LayerColor
[
32
];
// Layer colors (tracks and graphic items)
int
m_LayerColor
[
32
];
// Layer colors (tracks and graphic items)
int
m_ViaColor
[
4
];
// Via color (depending on is type)
int
m_ViaColor
[
4
];
// Via color (depending on is type)
int
m_ModuleTextCMPColor
;
// Text module color for modules on the COMPONENT layer
int
m_ModuleTextCMPColor
;
// Text module color for modules on the COMPONENT layer
int
m_ModuleTextCUColor
;
// Text module color for modules on the COPPER layer
int
m_ModuleTextCUColor
;
// Text module color for modules on the COPPER layer
...
...
include/wxPcbStruct.h
View file @
10e13ae5
...
@@ -74,6 +74,14 @@ public:
...
@@ -74,6 +74,14 @@ public:
~
WinEDA_BasePcbFrame
();
~
WinEDA_BasePcbFrame
();
/**
* Function SetBOARD
* sets the m_Pcb member in such as way as to ensure deleting any previous
* BOARD.
* @param aBoard The BOARD to put into the frame.
*/
void
SetBOARD
(
BOARD
*
aBoard
);
// General
// General
virtual
void
OnCloseWindow
(
wxCloseEvent
&
Event
)
=
0
;
virtual
void
OnCloseWindow
(
wxCloseEvent
&
Event
)
=
0
;
virtual
void
Process_Special_Functions
(
wxCommandEvent
&
event
)
=
0
;
virtual
void
Process_Special_Functions
(
wxCommandEvent
&
event
)
=
0
;
...
@@ -378,7 +386,7 @@ public:
...
@@ -378,7 +386,7 @@ public:
bool
RecreateCmpFileFromBoard
();
bool
RecreateCmpFileFromBoard
();
void
ExportToGenCAD
(
wxCommandEvent
&
event
);
void
ExportToGenCAD
(
wxCommandEvent
&
event
);
/**
/**
* Function ExporttoSPECCTRA
* Function ExporttoSPECCTRA
* will export the current BOARD to a specctra dsn file. See
* will export the current BOARD to a specctra dsn file. See
...
@@ -389,7 +397,7 @@ public:
...
@@ -389,7 +397,7 @@ public:
/**
/**
* Function ImportSpecctraSession
* Function ImportSpecctraSession
* will import a specctra *.ses file and use it to relocate MODULEs and
* will import a specctra *.ses file and use it to relocate MODULEs and
* to replace all vias and tracks in an existing and loaded BOARD.
* to replace all vias and tracks in an existing and loaded BOARD.
* See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
* See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
* specification.
* specification.
...
@@ -398,13 +406,13 @@ public:
...
@@ -398,13 +406,13 @@ public:
/**
/**
* Function ImportSpecctraDesign
* Function ImportSpecctraDesign
* will import a specctra *.dsn file and use it to replace an entire BOARD.
* will import a specctra *.dsn file and use it to replace an entire BOARD.
* The new board will not have any graphics, only components, tracks and vias.
* The new board will not have any graphics, only components, tracks and vias.
* See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
* See http://www.autotraxeda.com/docs/SPECCTRA/SPECCTRA.pdf for the
* specification.
* specification.
*/
*/
void
ImportSpecctraDesign
(
wxCommandEvent
&
event
);
void
ImportSpecctraDesign
(
wxCommandEvent
&
event
);
/* Fonctions specifiques */
/* Fonctions specifiques */
MODULE
*
ListAndSelectModuleName
();
MODULE
*
ListAndSelectModuleName
();
void
Liste_Equipot
(
wxCommandEvent
&
event
);
void
Liste_Equipot
(
wxCommandEvent
&
event
);
...
@@ -499,12 +507,12 @@ public:
...
@@ -499,12 +507,12 @@ public:
/** Function Delete_LastCreatedCorner
/** Function Delete_LastCreatedCorner
* Used only while creating a new zone outline
* Used only while creating a new zone outline
* Remove and delete the current outline segment in progress
* Remove and delete the current outline segment in progress
* @return 0 if no corner in list, or corner number
* @return 0 if no corner in list, or corner number
*/
*/
int
Delete_LastCreatedCorner
(
wxDC
*
DC
);
int
Delete_LastCreatedCorner
(
wxDC
*
DC
);
/**
/**
* Function Begin_Zone
* Function Begin_Zone
...
@@ -517,7 +525,7 @@ public:
...
@@ -517,7 +525,7 @@ public:
* Function End_Zone
* Function End_Zone
* terminates (if no DRC error ) the zone edge creation process
* terminates (if no DRC error ) the zone edge creation process
* @param DC = current Device Context
* @param DC = current Device Context
* @return true if Ok, false if DRC error
* @return true if Ok, false if DRC error
*/
*/
bool
End_Zone
(
wxDC
*
DC
);
bool
End_Zone
(
wxDC
*
DC
);
...
@@ -586,11 +594,11 @@ public:
...
@@ -586,11 +594,11 @@ public:
ZONE_CONTAINER
*
zone_container
,
ZONE_CONTAINER
*
zone_container
,
int
corner_id
);
int
corner_id
);
/**
/**
* Function End_Move_Zone_Corner_Or_Outlines
* Function End_Move_Zone_Corner_Or_Outlines
* Terminates a move corner in a zone outline, or a move zone outlines
* Terminates a move corner in a zone outline, or a move zone outlines
* @param DC = current Device Context (can be NULL)
* @param DC = current Device Context (can be NULL)
* @param zone_container: the given zone
* @param zone_container: the given zone
*/
*/
void
End_Move_Zone_Corner_Or_Outlines
(
wxDC
*
DC
,
ZONE_CONTAINER
*
zone_container
);
void
End_Move_Zone_Corner_Or_Outlines
(
wxDC
*
DC
,
ZONE_CONTAINER
*
zone_container
);
...
@@ -612,13 +620,13 @@ public:
...
@@ -612,13 +620,13 @@ public:
*/
*/
void
Delete_Zone_Contour
(
wxDC
*
DC
,
ZONE_CONTAINER
*
zone_container
);
void
Delete_Zone_Contour
(
wxDC
*
DC
,
ZONE_CONTAINER
*
zone_container
);
/**
/**
* Function Start_Move_Zone_Outlines
* Function Start_Move_Zone_Outlines
* Initialise parametres to move an existing zone outlines.
* Initialise parametres to move an existing zone outlines.
* @param DC = current Device Context (can be NULL)
* @param DC = current Device Context (can be NULL)
* @param zone_container: the given zone to move
* @param zone_container: the given zone to move
*/
*/
void
Start_Move_Zone_Outlines
(
wxDC
*
DC
,
ZONE_CONTAINER
*
zone_container
);
void
Start_Move_Zone_Outlines
(
wxDC
*
DC
,
ZONE_CONTAINER
*
zone_container
);
// Target handling
// Target handling
MIREPCB
*
Create_Mire
(
wxDC
*
DC
);
MIREPCB
*
Create_Mire
(
wxDC
*
DC
);
...
@@ -725,7 +733,7 @@ public:
...
@@ -725,7 +733,7 @@ public:
int
BestZoom
();
// Retourne le meilleur zoom
int
BestZoom
();
// Retourne le meilleur zoom
void
OnSelectOptionToolbar
(
wxCommandEvent
&
event
);
void
OnSelectOptionToolbar
(
wxCommandEvent
&
event
);
void
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
);
void
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
);
PCB_SCREEN
*
GetPCBScreen
(){
return
(
PCB_SCREEN
*
)
GetScreen
();
}
PCB_SCREEN
*
GetPCBScreen
(){
return
(
PCB_SCREEN
*
)
GetScreen
();
}
EDA_BaseStruct
*
GerberGeneralLocateAndDisplay
();
EDA_BaseStruct
*
GerberGeneralLocateAndDisplay
();
EDA_BaseStruct
*
Locate
(
int
typeloc
);
EDA_BaseStruct
*
Locate
(
int
typeloc
);
...
...
pcbnew/basepcbframe.cpp
View file @
10e13ae5
...
@@ -66,6 +66,13 @@ WinEDA_BasePcbFrame::~WinEDA_BasePcbFrame( void )
...
@@ -66,6 +66,13 @@ WinEDA_BasePcbFrame::~WinEDA_BasePcbFrame( void )
}
}
void
WinEDA_BasePcbFrame
::
SetBOARD
(
BOARD
*
aBoard
)
{
delete
m_Pcb
;
m_Pcb
=
aBoard
;
}
/**************************************/
/**************************************/
int
WinEDA_BasePcbFrame
::
BestZoom
(
void
)
int
WinEDA_BasePcbFrame
::
BestZoom
(
void
)
/**************************************/
/**************************************/
...
@@ -102,7 +109,7 @@ void WinEDA_BasePcbFrame::CursorGoto( const wxPoint& aPos )
...
@@ -102,7 +109,7 @@ void WinEDA_BasePcbFrame::CursorGoto( const wxPoint& aPos )
{
{
// factored out of pcbnew/find.cpp
// factored out of pcbnew/find.cpp
PCB_SCREEN
*
screen
=
(
PCB_SCREEN
*
)
GetScreen
();
PCB_SCREEN
*
screen
=
(
PCB_SCREEN
*
)
GetScreen
();
wxClientDC
dc
(
DrawPanel
);
wxClientDC
dc
(
DrawPanel
);
...
...
pcbnew/class_board.cpp
View file @
10e13ae5
...
@@ -38,6 +38,12 @@ BOARD::BOARD( EDA_BaseStruct* parent, WinEDA_BasePcbFrame* frame ) :
...
@@ -38,6 +38,12 @@ BOARD::BOARD( EDA_BaseStruct* parent, WinEDA_BasePcbFrame* frame ) :
m_LocalRatsnest
=
NULL
;
// pointeur liste rats local
m_LocalRatsnest
=
NULL
;
// pointeur liste rats local
m_CurrentZoneContour
=
NULL
;
// This ZONE_CONTAINER handle the zone contour cuurently in progress
m_CurrentZoneContour
=
NULL
;
// This ZONE_CONTAINER handle the zone contour cuurently in progress
// de determination des contours de zone
// de determination des contours de zone
for
(
int
layer
=
0
;
layer
<
NB_COPPER_LAYERS
;
++
layer
)
{
m_Layer
[
layer
].
m_Name
=
ReturnPcbLayerName
(
layer
);
m_Layer
[
layer
].
m_Type
=
LT_SIGNAL
;
}
}
}
...
@@ -80,28 +86,96 @@ BOARD::~BOARD()
...
@@ -80,28 +86,96 @@ BOARD::~BOARD()
wxString
BOARD
::
GetLayerName
(
int
aLayerIndex
)
const
wxString
BOARD
::
GetLayerName
(
int
aLayerIndex
)
const
{
{
// copper layer names are stored in the BOARD.
if
(
(
unsigned
)
aLayerIndex
<
(
unsigned
)
GetCopperLayerCount
()
)
{
// default names were set in BOARD::BOARD() but they may be
// over-ridden by BOARD::SetLayerName()
return
m_Layer
[
aLayerIndex
].
m_Name
;
}
return
ReturnPcbLayerName
(
aLayerIndex
,
true
);
return
ReturnPcbLayerName
(
aLayerIndex
,
true
);
}
}
bool
BOARD
::
SetLayerName
(
int
aLayerIndex
,
const
wxString
&
aLayerName
)
bool
BOARD
::
SetLayerName
(
int
aLayerIndex
,
const
wxString
&
aLayerName
)
{
{
// a dummy temporarily.
if
(
(
unsigned
)
aLayerIndex
<
(
unsigned
)
GetCopperLayerCount
()
)
D
(
printf
(
"SetLayerName( %d, %s )
\n
"
,
aLayerIndex
,
CONV_TO_UTF8
(
aLayerName
)
);)
{
return
true
;
if
(
aLayerName
==
wxEmptyString
||
aLayerName
.
Len
()
>
20
)
return
false
;
// no quote chars in the name allowed
if
(
aLayerName
.
Find
(
wxChar
(
'"'
)
)
!=
wxNOT_FOUND
)
return
false
;
// ensure unique-ness of layer names
for
(
int
layer
=
0
;
layer
<
GetCopperLayerCount
();
++
layer
)
{
if
(
layer
!=
aLayerIndex
&&
aLayerName
==
m_Layer
[
layer
].
m_Name
)
return
false
;
}
m_Layer
[
aLayerIndex
].
m_Name
=
aLayerName
;
// replace any spaces with underscores
m_Layer
[
aLayerIndex
].
m_Name
.
Replace
(
wxT
(
" "
),
wxT
(
"_"
)
);
return
true
;
}
return
false
;
}
}
LAYER_T
BOARD
::
GetLayerType
(
int
aLayerIndex
)
const
LAYER_T
BOARD
::
GetLayerType
(
int
aLayerIndex
)
const
{
{
if
(
(
unsigned
)
aLayerIndex
<
(
unsigned
)
GetCopperLayerCount
()
)
return
m_Layer
[
aLayerIndex
].
m_Type
;
return
LT_SIGNAL
;
return
LT_SIGNAL
;
}
}
bool
BOARD
::
SetLayerType
(
int
aLayerIndex
,
LAYER_T
aLayerType
)
bool
BOARD
::
SetLayerType
(
int
aLayerIndex
,
LAYER_T
aLayerType
)
{
{
// a dummy temporarily.
if
(
(
unsigned
)
aLayerIndex
<
(
unsigned
)
GetCopperLayerCount
()
)
return
true
;
{
m_Layer
[
aLayerIndex
].
m_Type
=
aLayerType
;
return
true
;
}
return
false
;
}
const
char
*
LAYER
::
ShowType
(
LAYER_T
aType
)
{
const
char
*
cp
;
switch
(
aType
)
{
default
:
case
LT_SIGNAL
:
cp
=
"signal"
;
break
;
case
LT_POWER
:
cp
=
"power"
;
break
;
case
LT_MIXED
:
cp
=
"mixed"
;
break
;
case
LT_JUMPER
:
cp
=
"jumper"
;
break
;
}
return
cp
;
}
LAYER_T
LAYER
::
ParseType
(
const
char
*
aType
)
{
if
(
strcmp
(
aType
,
"signal"
)
==
0
)
return
LT_SIGNAL
;
else
if
(
strcmp
(
aType
,
"power"
)
==
0
)
return
LT_POWER
;
else
if
(
strcmp
(
aType
,
"mixed"
)
==
0
)
return
LT_MIXED
;
else
if
(
strcmp
(
aType
,
"jumper"
)
==
0
)
return
LT_JUMPER
;
else
return
LAYER_T
(
-
1
);
}
}
...
...
pcbnew/class_board.h
View file @
10e13ae5
...
@@ -18,14 +18,49 @@ enum LAYER_T
...
@@ -18,14 +18,49 @@ enum LAYER_T
LT_SIGNAL
,
LT_SIGNAL
,
LT_POWER
,
LT_POWER
,
LT_MIXED
,
LT_MIXED
,
LT_JUMPER
,
};
};
/***********************************************/
/**
/* class BOARD : handle datas to build a board */
* Struct LAYER
/***********************************************/
* holds information pertinent to a layer of a BOARD.
*/
struct
LAYER
{
/** The name of the layer, there should be no spaces in this name. */
wxString
m_Name
;
/** The type of the layer */
LAYER_T
m_Type
;
// int m_Color;
// bool m_Visible; // ? use flags in m_Color instead ?
/**
* Function ShowType
* converts a LAYER_T enum to a const char*
* @param aType The LAYER_T to convert
* @return const char* - The string representation of the layer type.
*/
static
const
char
*
ShowType
(
LAYER_T
aType
);
/**
* Function ParseType
* converts a string to a LAYER_T
* @param aType The const char* to convert
* @return LAYER_T - The binary representation of the layer type, or
* LAYER_T(-1) if the string is invalid
*/
static
LAYER_T
ParseType
(
const
char
*
aType
);
};
/**
* Class BOARD
* holds information pertinent to a PCBNEW printed circuit board.
*/
class
BOARD
:
public
BOARD_ITEM
class
BOARD
:
public
BOARD_ITEM
{
{
friend
class
WinEDA_PcbFrame
;
friend
class
WinEDA_PcbFrame
;
...
@@ -37,6 +72,8 @@ private:
...
@@ -37,6 +72,8 @@ private:
typedef
std
::
vector
<
ZONE_CONTAINER
*>
ZONE_CONTAINERS
;
// @todo: switch to boost::ptr_vector, and change ~BOARD()
typedef
std
::
vector
<
ZONE_CONTAINER
*>
ZONE_CONTAINERS
;
// @todo: switch to boost::ptr_vector, and change ~BOARD()
ZONE_CONTAINERS
m_ZoneDescriptorList
;
///< edge zone descriptors, owned by pointer
ZONE_CONTAINERS
m_ZoneDescriptorList
;
///< edge zone descriptors, owned by pointer
LAYER
m_Layer
[
NB_COPPER_LAYERS
];
public
:
public
:
WinEDA_BasePcbFrame
*
m_PcbFrame
;
// Window de visualisation
WinEDA_BasePcbFrame
*
m_PcbFrame
;
// Window de visualisation
EDA_Rect
m_BoundaryBox
;
// Board size and position
EDA_Rect
m_BoundaryBox
;
// Board size and position
...
@@ -294,6 +331,7 @@ public:
...
@@ -294,6 +331,7 @@ public:
return
wxT
(
"BOARD"
);
return
wxT
(
"BOARD"
);
}
}
#if defined(DEBUG)
#if defined(DEBUG)
/**
/**
* Function Show
* Function Show
...
...
pcbnew/class_drawsegment.cpp
View file @
10e13ae5
...
@@ -150,6 +150,9 @@ void DRAWSEGMENT::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -150,6 +150,9 @@ void DRAWSEGMENT::Display_Infos( WinEDA_DrawFrame* frame )
int
itype
;
int
itype
;
wxString
msg
;
wxString
msg
;
BOARD
*
board
=
(
BOARD
*
)
m_Parent
;
wxASSERT
(
board
);
frame
->
MsgPanel
->
EraseMsgBox
();
frame
->
MsgPanel
->
EraseMsgBox
();
itype
=
m_Type
&
0x0F
;
itype
=
m_Type
&
0x0F
;
...
@@ -173,7 +176,7 @@ void DRAWSEGMENT::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -173,7 +176,7 @@ void DRAWSEGMENT::Display_Infos( WinEDA_DrawFrame* frame )
Affiche_1_Parametre
(
frame
,
-
1
,
wxEmptyString
,
_
(
"Segment"
),
RED
);
Affiche_1_Parametre
(
frame
,
-
1
,
wxEmptyString
,
_
(
"Segment"
),
RED
);
Affiche_1_Parametre
(
frame
,
48
,
_
(
"Layer"
),
Affiche_1_Parametre
(
frame
,
48
,
_
(
"Layer"
),
ReturnPcb
LayerName
(
m_Layer
),
BROWN
);
board
->
Get
LayerName
(
m_Layer
),
BROWN
);
valeur_param
(
(
unsigned
)
m_Width
,
msg
);
valeur_param
(
(
unsigned
)
m_Width
,
msg
);
Affiche_1_Parametre
(
frame
,
60
,
_
(
"Width"
),
msg
,
DARKCYAN
);
Affiche_1_Parametre
(
frame
,
60
,
_
(
"Width"
),
msg
,
DARKCYAN
);
...
...
pcbnew/class_module.cpp
View file @
10e13ae5
...
@@ -1135,15 +1135,6 @@ bool MODULE::HitTest( const wxPoint& refPos )
...
@@ -1135,15 +1135,6 @@ bool MODULE::HitTest( const wxPoint& refPos )
if
(
m_BoundaryBox
.
Inside
(
spot_cX
,
spot_cY
)
)
if
(
m_BoundaryBox
.
Inside
(
spot_cX
,
spot_cY
)
)
return
true
;
return
true
;
/* no
// The GENERAL_COLLECTOR needs these two tests in order to find a MODULE
// when the user clicks on its text. Keep these 2, needed in OnRightClick().
if( m_Reference->HitTest( refPos ) )
return true;
if( m_Value->HitTest( refPos ) )
return true;
*/
return
false
;
return
false
;
}
}
...
@@ -1173,6 +1164,25 @@ bool MODULE::HitTest( EDA_Rect& refArea )
...
@@ -1173,6 +1164,25 @@ bool MODULE::HitTest( EDA_Rect& refArea )
}
}
D_PAD
*
MODULE
::
FindPadByName
(
const
wxString
&
aPadName
)
const
{
wxString
buf
;
for
(
D_PAD
*
pad
=
m_Pads
;
pad
;
pad
=
pad
->
Next
()
)
{
pad
->
ReturnStringPadName
(
buf
);
#if 1
if
(
buf
.
CmpNoCase
(
aPadName
)
==
0
)
// why case insensitive?
#else
if
(
buf
==
aPadName
)
#endif
return
pad
;
}
return
NULL
;
}
// see class_module.h
// see class_module.h
SEARCH_RESULT
MODULE
::
Visit
(
INSPECTOR
*
inspector
,
const
void
*
testData
,
SEARCH_RESULT
MODULE
::
Visit
(
INSPECTOR
*
inspector
,
const
void
*
testData
,
const
KICAD_T
scanTypes
[]
)
const
KICAD_T
scanTypes
[]
)
...
...
pcbnew/class_module.h
View file @
10e13ae5
...
@@ -65,7 +65,7 @@ public:
...
@@ -65,7 +65,7 @@ public:
unsigned
long
m_Link
;
// variable temporaire ( pour editions, ...)
unsigned
long
m_Link
;
// variable temporaire ( pour editions, ...)
long
m_LastEdit_Time
;
// Date de la derniere modification du module (gestion de librairies)
long
m_LastEdit_Time
;
// Date de la derniere modification du module (gestion de librairies)
wxString
m_Path
;
wxString
m_Path
;
wxString
m_Doc
;
// Texte de description du module
wxString
m_Doc
;
// Texte de description du module
wxString
m_KeyWord
;
// Liste des mots cles relatifs au module
wxString
m_KeyWord
;
// Liste des mots cles relatifs au module
...
@@ -197,6 +197,17 @@ public:
...
@@ -197,6 +197,17 @@ public:
return
m_Value
->
m_Text
;
return
m_Value
->
m_Text
;
}
}
/**
* Function FindPadByName
* returns a D_PAD* with a matching name. Note that names may not be
* unique, depending on how the foot print was created.
* @param
* @return D_PAD* - The first matching name is returned, or NULL if not found.
*/
D_PAD
*
FindPadByName
(
const
wxString
&
aPadName
)
const
;
/**
/**
* Function Visit
* Function Visit
* should be re-implemented for each derived class in order to handle
* should be re-implemented for each derived class in order to handle
...
...
pcbnew/class_pcb_text.cpp
View file @
10e13ae5
...
@@ -119,26 +119,26 @@ bool TEXTE_PCB::Save( FILE* aFile ) const
...
@@ -119,26 +119,26 @@ bool TEXTE_PCB::Save( FILE* aFile ) const
if
(
m_Text
.
IsEmpty
()
)
if
(
m_Text
.
IsEmpty
()
)
return
true
;
return
true
;
bool
rc
=
false
;
bool
rc
=
false
;
if
(
fprintf
(
aFile
,
"$TEXTPCB
\n
"
)
!=
sizeof
(
"$TEXTPCB
\n
"
)
-
1
)
if
(
fprintf
(
aFile
,
"$TEXTPCB
\n
"
)
!=
sizeof
(
"$TEXTPCB
\n
"
)
-
1
)
goto
out
;
goto
out
;
fprintf
(
aFile
,
"Te
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
m_Text
)
);
fprintf
(
aFile
,
"Te
\"
%s
\"\n
"
,
CONV_TO_UTF8
(
m_Text
)
);
fprintf
(
aFile
,
"Po %d %d %d %d %d %d
\n
"
,
fprintf
(
aFile
,
"Po %d %d %d %d %d %d
\n
"
,
m_Pos
.
x
,
m_Pos
.
y
,
m_Size
.
x
,
m_Size
.
y
,
m_Width
,
m_Orient
);
m_Pos
.
x
,
m_Pos
.
y
,
m_Size
.
x
,
m_Size
.
y
,
m_Width
,
m_Orient
);
fprintf
(
aFile
,
"De %d %d %lX %d
\n
"
,
m_Layer
,
m_Miroir
,
m_TimeStamp
,
0
);
fprintf
(
aFile
,
"De %d %d %lX %d
\n
"
,
m_Layer
,
m_Miroir
,
m_TimeStamp
,
0
);
if
(
fprintf
(
aFile
,
"$EndTEXTPCB
\n
"
)
!=
sizeof
(
"$EndTEXTPCB
\n
"
)
-
1
)
if
(
fprintf
(
aFile
,
"$EndTEXTPCB
\n
"
)
!=
sizeof
(
"$EndTEXTPCB
\n
"
)
-
1
)
goto
out
;
goto
out
;
rc
=
true
;
rc
=
true
;
out
:
out
:
return
rc
;
return
rc
;
}
}
/**********************************************************************/
/**********************************************************************/
...
@@ -167,15 +167,18 @@ void TEXTE_PCB::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -167,15 +167,18 @@ void TEXTE_PCB::Display_Infos( WinEDA_DrawFrame* frame )
{
{
wxString
msg
;
wxString
msg
;
BOARD
*
board
=
(
BOARD
*
)
m_Parent
;
wxASSERT
(
board
);
frame
->
MsgPanel
->
EraseMsgBox
();
frame
->
MsgPanel
->
EraseMsgBox
();
if
(
m_Parent
&&
m_Parent
->
Type
()
==
TYPECOTATION
)
if
(
m_Parent
&&
m_Parent
->
Type
()
==
TYPECOTATION
)
Affiche_1_Parametre
(
frame
,
1
,
_
(
"COTATION"
),
m_Text
,
DARKGREEN
);
Affiche_1_Parametre
(
frame
,
1
,
_
(
"COTATION"
),
m_Text
,
DARKGREEN
);
else
else
Affiche_1_Parametre
(
frame
,
1
,
_
(
"PCB Text"
),
m_Text
,
DARKGREEN
);
Affiche_1_Parametre
(
frame
,
1
,
_
(
"PCB Text"
),
m_Text
,
DARKGREEN
);
Affiche_1_Parametre
(
frame
,
28
,
_
(
"Layer"
),
Affiche_1_Parametre
(
frame
,
28
,
_
(
"Layer"
),
ReturnPcb
LayerName
(
m_Layer
),
board
->
Get
LayerName
(
m_Layer
),
g_DesignSettings
.
m_LayerColor
[
m_Layer
]
&
MASKCOLOR
);
g_DesignSettings
.
m_LayerColor
[
m_Layer
]
&
MASKCOLOR
);
Affiche_1_Parametre
(
frame
,
36
,
_
(
"Mirror"
),
wxEmptyString
,
GREEN
);
Affiche_1_Parametre
(
frame
,
36
,
_
(
"Mirror"
),
wxEmptyString
,
GREEN
);
...
@@ -203,7 +206,7 @@ void TEXTE_PCB::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -203,7 +206,7 @@ void TEXTE_PCB::Display_Infos( WinEDA_DrawFrame* frame )
/**
/**
* Function Show
* Function Show
* is used to output the object tree, currently for debugging only.
* is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level
* @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree.
* of nesting of this object within the overall tree.
* @param os The ostream& to output to.
* @param os The ostream& to output to.
*/
*/
...
@@ -211,8 +214,8 @@ void TEXTE_PCB::Show( int nestLevel, std::ostream& os )
...
@@ -211,8 +214,8 @@ void TEXTE_PCB::Show( int nestLevel, std::ostream& os )
{
{
// for now, make it look like XML:
// for now, make it look like XML:
NestedSpace
(
nestLevel
,
os
)
<<
'<'
<<
GetClass
().
Lower
().
mb_str
()
<<
NestedSpace
(
nestLevel
,
os
)
<<
'<'
<<
GetClass
().
Lower
().
mb_str
()
<<
" string=
\"
"
<<
m_Text
.
mb_str
()
<<
"
\"
/>
\n
"
;
" string=
\"
"
<<
m_Text
.
mb_str
()
<<
"
\"
/>
\n
"
;
// NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
// NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
}
}
...
...
pcbnew/class_text_mod.cpp
View file @
10e13ae5
...
@@ -41,21 +41,21 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
...
@@ -41,21 +41,21 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
m_Orient
=
0
;
/* en 1/10 degre */
m_Orient
=
0
;
/* en 1/10 degre */
m_Miroir
=
1
;
// Mode normal (pas de miroir)
m_Miroir
=
1
;
// Mode normal (pas de miroir)
m_Unused
=
0
;
m_Unused
=
0
;
SetLayer
(
SILKSCREEN_N_CMP
);
SetLayer
(
SILKSCREEN_N_CMP
);
if
(
Module
&&
(
Module
->
Type
()
==
TYPEMODULE
)
)
if
(
Module
&&
(
Module
->
Type
()
==
TYPEMODULE
)
)
{
{
m_Pos
=
Module
->
m_Pos
;
m_Pos
=
Module
->
m_Pos
;
int
moduleLayer
=
Module
->
GetLayer
();
int
moduleLayer
=
Module
->
GetLayer
();
if
(
moduleLayer
==
COPPER_LAYER_N
)
if
(
moduleLayer
==
COPPER_LAYER_N
)
SetLayer
(
SILKSCREEN_N_CU
);
SetLayer
(
SILKSCREEN_N_CU
);
else
if
(
moduleLayer
==
CMP_N
)
else
if
(
moduleLayer
==
CMP_N
)
SetLayer
(
SILKSCREEN_N_CMP
);
SetLayer
(
SILKSCREEN_N_CMP
);
else
else
SetLayer
(
moduleLayer
);
SetLayer
(
moduleLayer
);
if
(
moduleLayer
==
SILKSCREEN_N_CU
if
(
moduleLayer
==
SILKSCREEN_N_CU
||
moduleLayer
==
ADHESIVE_N_CU
||
moduleLayer
==
ADHESIVE_N_CU
||
moduleLayer
==
COPPER_LAYER_N
)
||
moduleLayer
==
COPPER_LAYER_N
)
...
@@ -75,20 +75,20 @@ bool TEXTE_MODULE::Save( FILE* aFile ) const
...
@@ -75,20 +75,20 @@ bool TEXTE_MODULE::Save( FILE* aFile ) const
{
{
MODULE
*
parent
=
(
MODULE
*
)
GetParent
();
MODULE
*
parent
=
(
MODULE
*
)
GetParent
();
int
orient
=
m_Orient
;
int
orient
=
m_Orient
;
if
(
parent
)
if
(
parent
)
orient
+=
parent
->
m_Orient
;
orient
+=
parent
->
m_Orient
;
int
ret
=
fprintf
(
aFile
,
"T%d %d %d %d %d %d %d %c %c %d
\"
%.16s
\"\n
"
,
int
ret
=
fprintf
(
aFile
,
"T%d %d %d %d %d %d %d %c %c %d
\"
%.16s
\"\n
"
,
m_Type
,
m_Type
,
m_Pos0
.
x
,
m_Pos0
.
y
,
m_Pos0
.
x
,
m_Pos0
.
y
,
m_Size
.
y
,
m_Size
.
x
,
m_Size
.
y
,
m_Size
.
x
,
orient
,
orient
,
m_Width
,
m_Width
,
m_Miroir
?
'N'
:
'M'
,
m_NoShow
?
'I'
:
'V'
,
m_Miroir
?
'N'
:
'M'
,
m_NoShow
?
'I'
:
'V'
,
GetLayer
(),
GetLayer
(),
CONV_TO_UTF8
(
m_Text
)
);
CONV_TO_UTF8
(
m_Text
)
);
return
(
ret
>
20
);
return
(
ret
>
20
);
}
}
...
@@ -209,11 +209,11 @@ bool TEXTE_MODULE::HitTest( const wxPoint& posref )
...
@@ -209,11 +209,11 @@ bool TEXTE_MODULE::HitTest( const wxPoint& posref )
/* le point de reference est tourn�de - angle
/* le point de reference est tourn�de - angle
* pour se ramener a un rectangle de reference horizontal */
* pour se ramener a un rectangle de reference horizontal */
mX
=
posref
.
x
-
m_Pos
.
x
;
mX
=
posref
.
x
-
m_Pos
.
x
;
mY
=
posref
.
y
-
m_Pos
.
y
;
mY
=
posref
.
y
-
m_Pos
.
y
;
RotatePoint
(
&
mX
,
&
mY
,
-
angle
);
RotatePoint
(
&
mX
,
&
mY
,
-
angle
);
/* le point de reference est-il dans ce rectangle */
/* le point de reference est-il dans ce rectangle */
if
(
(
abs
(
mX
)
<=
abs
(
dx
)
)
&&
(
abs
(
mY
)
<=
abs
(
dy
)
)
)
if
(
(
abs
(
mX
)
<=
abs
(
dx
)
)
&&
(
abs
(
mY
)
<=
abs
(
dy
)
)
)
{
{
...
@@ -257,7 +257,7 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, wxPoint offset, int
...
@@ -257,7 +257,7 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, wxPoint offset, int
orient
=
GetDrawRotation
();
orient
=
GetDrawRotation
();
miroir
=
m_Miroir
&
1
;
// = 0 si vu en miroir
miroir
=
m_Miroir
&
1
;
// = 0 si vu en miroir
width
=
m_Width
;
width
=
m_Width
;
if
(
(
frame
->
m_DisplayModText
==
FILAIRE
)
||
(
(
width
/
zoom
)
<
L_MIN_DESSIN
)
)
if
(
(
frame
->
m_DisplayModText
==
FILAIRE
)
||
(
(
width
/
zoom
)
<
L_MIN_DESSIN
)
)
width
=
0
;
width
=
0
;
else
if
(
frame
->
m_DisplayModText
==
SKETCH
)
else
if
(
frame
->
m_DisplayModText
==
SKETCH
)
...
@@ -281,7 +281,7 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, wxPoint offset, int
...
@@ -281,7 +281,7 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, wxPoint offset, int
if
(
Module
&&
Module
->
GetLayer
()
==
COPPER_LAYER_N
)
if
(
Module
&&
Module
->
GetLayer
()
==
COPPER_LAYER_N
)
color
=
g_ModuleTextCUColor
;
color
=
g_ModuleTextCUColor
;
else
if
(
Module
&&
Module
->
GetLayer
()
==
CMP_N
)
else
if
(
Module
&&
Module
->
GetLayer
()
==
CMP_N
)
color
=
g_ModuleTextCMPColor
;
color
=
g_ModuleTextCMPColor
;
...
@@ -290,7 +290,7 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, wxPoint offset, int
...
@@ -290,7 +290,7 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, wxPoint offset, int
if
(
m_NoShow
)
if
(
m_NoShow
)
color
=
g_ModuleTextNOVColor
;
color
=
g_ModuleTextNOVColor
;
if
(
(
color
&
ITEM_NOT_SHOW
)
!=
0
)
if
(
(
color
&
ITEM_NOT_SHOW
)
!=
0
)
return
;
return
;
...
@@ -330,20 +330,25 @@ int TEXTE_MODULE::GetDrawRotation()
...
@@ -330,20 +330,25 @@ int TEXTE_MODULE::GetDrawRotation()
}
}
// see class_text_mod.h
// see class_text_mod.h
void
TEXTE_MODULE
::
Display_Infos
(
WinEDA_DrawFrame
*
frame
)
void
TEXTE_MODULE
::
Display_Infos
(
WinEDA_DrawFrame
*
frame
)
{
{
wxString
msg
,
Line
;
wxString
msg
,
Line
;
int
ii
;
int
ii
;
MODULE
*
module
=
(
MODULE
*
)
m_Parent
;
MODULE
*
module
=
(
MODULE
*
)
m_Parent
;
wxASSERT
(
module
);
if
(
!
module
)
if
(
!
module
)
return
;
return
;
static
const
wxString
text_type_msg
[
3
]
=
{
BOARD
*
board
=
(
BOARD
*
)
module
->
m_Parent
;
wxASSERT
(
board
);
static
const
wxString
text_type_msg
[
3
]
=
{
_
(
"Ref."
),
_
(
"Value"
),
_
(
"Text"
)
};
_
(
"Ref."
),
_
(
"Value"
),
_
(
"Text"
)
};
frame
->
MsgPanel
->
EraseMsgBox
();
frame
->
MsgPanel
->
EraseMsgBox
();
Line
=
module
->
m_Reference
->
m_Text
;
Line
=
module
->
m_Reference
->
m_Text
;
...
@@ -352,10 +357,10 @@ void TEXTE_MODULE::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -352,10 +357,10 @@ void TEXTE_MODULE::Display_Infos( WinEDA_DrawFrame* frame )
Line
=
m_Text
;
Line
=
m_Text
;
Affiche_1_Parametre
(
frame
,
10
,
_
(
"Text"
),
Line
,
YELLOW
);
Affiche_1_Parametre
(
frame
,
10
,
_
(
"Text"
),
Line
,
YELLOW
);
ii
=
m_Type
;
ii
=
m_Type
;
if
(
ii
>
2
)
if
(
ii
>
2
)
ii
=
2
;
ii
=
2
;
Affiche_1_Parametre
(
frame
,
20
,
_
(
"Type"
),
text_type_msg
[
ii
],
DARKGREEN
);
Affiche_1_Parametre
(
frame
,
20
,
_
(
"Type"
),
text_type_msg
[
ii
],
DARKGREEN
);
Affiche_1_Parametre
(
frame
,
25
,
_
(
"Display"
),
wxEmptyString
,
DARKGREEN
);
Affiche_1_Parametre
(
frame
,
25
,
_
(
"Display"
),
wxEmptyString
,
DARKGREEN
);
...
@@ -366,7 +371,7 @@ void TEXTE_MODULE::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -366,7 +371,7 @@ void TEXTE_MODULE::Display_Infos( WinEDA_DrawFrame* frame )
ii
=
m_Layer
;
ii
=
m_Layer
;
if
(
ii
<
NB_LAYERS
)
if
(
ii
<
NB_LAYERS
)
Affiche_1_Parametre
(
frame
,
28
,
_
(
"Layer"
),
ReturnPcb
LayerName
(
ii
),
DARKGREEN
);
Affiche_1_Parametre
(
frame
,
28
,
_
(
"Layer"
),
board
->
Get
LayerName
(
ii
),
DARKGREEN
);
else
else
{
{
msg
.
Printf
(
wxT
(
"%d"
),
ii
);
msg
.
Printf
(
wxT
(
"%d"
),
ii
);
...
@@ -376,7 +381,7 @@ void TEXTE_MODULE::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -376,7 +381,7 @@ void TEXTE_MODULE::Display_Infos( WinEDA_DrawFrame* frame )
msg
=
wxT
(
" Yes"
);
msg
=
wxT
(
" Yes"
);
if
(
m_Miroir
&
1
)
if
(
m_Miroir
&
1
)
msg
=
wxT
(
" No"
);
msg
=
wxT
(
" No"
);
Affiche_1_Parametre
(
frame
,
36
,
_
(
"Mirror"
),
msg
,
DARKGREEN
);
Affiche_1_Parametre
(
frame
,
36
,
_
(
"Mirror"
),
msg
,
DARKGREEN
);
msg
.
Printf
(
wxT
(
"%.1f"
),
(
float
)
m_Orient
/
10
);
msg
.
Printf
(
wxT
(
"%.1f"
),
(
float
)
m_Orient
/
10
);
...
@@ -402,27 +407,27 @@ bool TEXTE_MODULE::IsOnLayer( int aLayer ) const
...
@@ -402,27 +407,27 @@ bool TEXTE_MODULE::IsOnLayer( int aLayer ) const
/* test the parent, which is a MODULE */
/* test the parent, which is a MODULE */
if
(
aLayer
==
GetParent
()
->
GetLayer
()
)
if
(
aLayer
==
GetParent
()
->
GetLayer
()
)
return
true
;
return
true
;
if
(
aLayer
==
COPPER_LAYER_N
)
if
(
aLayer
==
COPPER_LAYER_N
)
{
{
if
(
m_Layer
==
ADHESIVE_N_CU
||
m_Layer
==
SILKSCREEN_N_CU
)
if
(
m_Layer
==
ADHESIVE_N_CU
||
m_Layer
==
SILKSCREEN_N_CU
)
return
true
;
return
true
;
}
}
else
if
(
aLayer
==
CMP_N
)
else
if
(
aLayer
==
CMP_N
)
{
{
if
(
m_Layer
==
ADHESIVE_N_CMP
||
m_Layer
==
SILKSCREEN_N_CMP
)
if
(
m_Layer
==
ADHESIVE_N_CMP
||
m_Layer
==
SILKSCREEN_N_CMP
)
return
true
;
return
true
;
}
}
return
false
;
return
false
;
}
}
/* see class_text_mod.h
/* see class_text_mod.h
bool TEXTE_MODULE::IsOnOneOfTheseLayers( int aLayerMask ) const
bool TEXTE_MODULE::IsOnOneOfTheseLayers( int aLayerMask ) const
{
{
}
}
*/
*/
...
@@ -431,7 +436,7 @@ bool TEXTE_MODULE::IsOnOneOfTheseLayers( int aLayerMask ) const
...
@@ -431,7 +436,7 @@ bool TEXTE_MODULE::IsOnOneOfTheseLayers( int aLayerMask ) const
/**
/**
* Function Show
* Function Show
* is used to output the object tree, currently for debugging only.
* is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level
* @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree.
* of nesting of this object within the overall tree.
* @param os The ostream& to output to.
* @param os The ostream& to output to.
*/
*/
...
@@ -439,8 +444,8 @@ void TEXTE_MODULE::Show( int nestLevel, std::ostream& os )
...
@@ -439,8 +444,8 @@ void TEXTE_MODULE::Show( int nestLevel, std::ostream& os )
{
{
// for now, make it look like XML:
// for now, make it look like XML:
NestedSpace
(
nestLevel
,
os
)
<<
'<'
<<
GetClass
().
Lower
().
mb_str
()
<<
NestedSpace
(
nestLevel
,
os
)
<<
'<'
<<
GetClass
().
Lower
().
mb_str
()
<<
" string=
\"
"
<<
m_Text
.
mb_str
()
<<
"
\"
/>
\n
"
;
" string=
\"
"
<<
m_Text
.
mb_str
()
<<
"
\"
/>
\n
"
;
// NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
// NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
}
}
#endif
#endif
pcbnew/class_zone.cpp
View file @
10e13ae5
...
@@ -248,7 +248,7 @@ void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& off
...
@@ -248,7 +248,7 @@ void ZONE_CONTAINER::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& off
if
(
DC
==
NULL
)
if
(
DC
==
NULL
)
return
;
return
;
wxPoint
seg_start
,
seg_end
;
wxPoint
seg_start
,
seg_end
;
int
curr_layer
=
(
(
PCB_SCREEN
*
)
panel
->
GetScreen
()
)
->
m_Active_Layer
;
int
curr_layer
=
(
(
PCB_SCREEN
*
)
panel
->
GetScreen
()
)
->
m_Active_Layer
;
int
color
=
g_DesignSettings
.
m_LayerColor
[
m_Layer
];
int
color
=
g_DesignSettings
.
m_LayerColor
[
m_Layer
];
...
@@ -319,9 +319,9 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( WinEDA_DrawPanel* panel, wxDC* DC,
...
@@ -319,9 +319,9 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( WinEDA_DrawPanel* panel, wxDC* DC,
* @param draw_mode = draw mode: OR, XOR ..
* @param draw_mode = draw mode: OR, XOR ..
*/
*/
{
{
int
current_gr_mode
=
draw_mode
;
int
current_gr_mode
=
draw_mode
;
bool
is_close_segment
=
false
;
bool
is_close_segment
=
false
;
wxPoint
seg_start
,
seg_end
;
wxPoint
seg_start
,
seg_end
;
if
(
DC
==
NULL
)
if
(
DC
==
NULL
)
return
;
return
;
...
@@ -339,7 +339,7 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( WinEDA_DrawPanel* panel, wxDC* DC,
...
@@ -339,7 +339,7 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( WinEDA_DrawPanel* panel, wxDC* DC,
// draw the lines
// draw the lines
wxPoint
start_contour_pos
=
GetCornerPosition
(
0
);
wxPoint
start_contour_pos
=
GetCornerPosition
(
0
);
for
(
int
ic
=
0
;
ic
<
GetNumCorners
();
ic
++
)
for
(
int
ic
=
0
;
ic
<
GetNumCorners
();
ic
++
)
{
{
int
xi
=
GetCornerPosition
(
ic
).
x
;
int
xi
=
GetCornerPosition
(
ic
).
x
;
...
@@ -347,27 +347,27 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( WinEDA_DrawPanel* panel, wxDC* DC,
...
@@ -347,27 +347,27 @@ void ZONE_CONTAINER::DrawWhileCreateOutline( WinEDA_DrawPanel* panel, wxDC* DC,
int
xf
,
yf
;
int
xf
,
yf
;
if
(
m_Poly
->
corner
[
ic
].
end_contour
==
FALSE
&&
ic
<
GetNumCorners
()
-
1
)
if
(
m_Poly
->
corner
[
ic
].
end_contour
==
FALSE
&&
ic
<
GetNumCorners
()
-
1
)
{
{
is_close_segment
=
false
;
is_close_segment
=
false
;
xf
=
GetCornerPosition
(
ic
+
1
).
x
;
xf
=
GetCornerPosition
(
ic
+
1
).
x
;
yf
=
GetCornerPosition
(
ic
+
1
).
y
;
yf
=
GetCornerPosition
(
ic
+
1
).
y
;
if
(
(
m_Poly
->
corner
[
ic
+
1
].
end_contour
)
||
(
ic
==
GetNumCorners
()
-
2
)
)
if
(
(
m_Poly
->
corner
[
ic
+
1
].
end_contour
)
||
(
ic
==
GetNumCorners
()
-
2
)
)
current_gr_mode
=
GR_XOR
;
current_gr_mode
=
GR_XOR
;
else
else
current_gr_mode
=
draw_mode
;
current_gr_mode
=
draw_mode
;
}
}
else
else
{
{
is_close_segment
=
true
;
is_close_segment
=
true
;
current_gr_mode
=
GR_XOR
;
current_gr_mode
=
GR_XOR
;
xf
=
start_contour_pos
.
x
;
xf
=
start_contour_pos
.
x
;
yf
=
start_contour_pos
.
y
;
yf
=
start_contour_pos
.
y
;
start_contour_pos
=
GetCornerPosition
(
ic
+
1
);
start_contour_pos
=
GetCornerPosition
(
ic
+
1
);
}
}
GRSetDrawMode
(
DC
,
current_gr_mode
);
GRSetDrawMode
(
DC
,
current_gr_mode
);
if
(
is_close_segment
)
if
(
is_close_segment
)
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
xi
,
yi
,
xf
,
yf
,
0
,
WHITE
);
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
xi
,
yi
,
xf
,
yf
,
0
,
WHITE
);
else
else
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
xi
,
yi
,
xf
,
yf
,
0
,
color
);
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
xi
,
yi
,
xf
,
yf
,
0
,
color
);
}
}
}
}
...
@@ -514,6 +514,10 @@ void ZONE_CONTAINER::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -514,6 +514,10 @@ void ZONE_CONTAINER::Display_Infos( WinEDA_DrawFrame* frame )
wxString
msg
;
wxString
msg
;
int
text_pos
;
int
text_pos
;
BOARD
*
board
=
(
BOARD
*
)
m_Parent
;
wxASSERT
(
board
);
frame
->
MsgPanel
->
EraseMsgBox
();
frame
->
MsgPanel
->
EraseMsgBox
();
msg
=
_
(
"Zone Outline"
);
msg
=
_
(
"Zone Outline"
);
...
@@ -551,7 +555,7 @@ void ZONE_CONTAINER::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -551,7 +555,7 @@ void ZONE_CONTAINER::Display_Infos( WinEDA_DrawFrame* frame )
Affiche_1_Parametre
(
frame
,
text_pos
,
_
(
"NetCode"
),
msg
,
RED
);
Affiche_1_Parametre
(
frame
,
text_pos
,
_
(
"NetCode"
),
msg
,
RED
);
text_pos
+=
8
;
text_pos
+=
8
;
msg
=
ReturnPcb
LayerName
(
m_Layer
);
msg
=
board
->
Get
LayerName
(
m_Layer
);
Affiche_1_Parametre
(
frame
,
text_pos
,
_
(
"Layer"
),
msg
,
BROWN
);
Affiche_1_Parametre
(
frame
,
text_pos
,
_
(
"Layer"
),
msg
,
BROWN
);
text_pos
+=
8
;
text_pos
+=
8
;
...
@@ -588,19 +592,19 @@ void ZONE_CONTAINER::Move( const wxPoint& offset )
...
@@ -588,19 +592,19 @@ void ZONE_CONTAINER::Move( const wxPoint& offset )
*/
*/
void
ZONE_CONTAINER
::
MoveEdge
(
const
wxPoint
&
offset
)
void
ZONE_CONTAINER
::
MoveEdge
(
const
wxPoint
&
offset
)
{
{
int
ii
=
m_CornerSelection
;
int
ii
=
m_CornerSelection
;
// Move the start point of the selected edge:
// Move the start point of the selected edge:
SetCornerPosition
(
ii
,
GetCornerPosition
(
ii
)
+
offset
);
SetCornerPosition
(
ii
,
GetCornerPosition
(
ii
)
+
offset
);
// Move the end point of the selected edge:
// Move the end point of the selected edge:
if
(
m_Poly
->
corner
[
ii
].
end_contour
||
ii
==
GetNumCorners
()
-
1
)
if
(
m_Poly
->
corner
[
ii
].
end_contour
||
ii
==
GetNumCorners
()
-
1
)
{
{
int
icont
=
m_Poly
->
GetContour
(
ii
);
int
icont
=
m_Poly
->
GetContour
(
ii
);
ii
=
m_Poly
->
GetContourStart
(
icont
);
ii
=
m_Poly
->
GetContourStart
(
icont
);
}
}
else
else
ii
++
;
ii
++
;
SetCornerPosition
(
ii
,
GetCornerPosition
(
ii
)
+
offset
);
SetCornerPosition
(
ii
,
GetCornerPosition
(
ii
)
+
offset
);
m_Poly
->
Hatch
();
m_Poly
->
Hatch
();
...
...
pcbnew/classpcb.cpp
View file @
10e13ae5
...
@@ -156,6 +156,7 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
...
@@ -156,6 +156,7 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
m_MicroViaDrill
=
50
;
// micro via drill (for the entire board)
m_MicroViaDrill
=
50
;
// micro via drill (for the entire board)
m_CurrentMicroViaSize
=
150
;
// Current micro via size
m_CurrentMicroViaSize
=
150
;
// Current micro via size
m_MicroViasAllowed
=
false
;
// true to allow micro vias
m_MicroViasAllowed
=
false
;
// true to allow micro vias
for
(
ii
=
0
;
ii
<
HISTORY_NUMBER
;
ii
++
)
for
(
ii
=
0
;
ii
<
HISTORY_NUMBER
;
ii
++
)
{
{
m_TrackWidthHistory
[
ii
]
=
0
;
// Last HISTORY_NUMBER used track widths
m_TrackWidthHistory
[
ii
]
=
0
;
// Last HISTORY_NUMBER used track widths
...
@@ -171,6 +172,7 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
...
@@ -171,6 +172,7 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
m_MaskMargin
=
150
;
// Solder mask margin
m_MaskMargin
=
150
;
// Solder mask margin
/* Color options for screen display of the Printed Board: */
/* Color options for screen display of the Printed Board: */
m_PcbGridColor
=
DARKGRAY
;
// Grid color
m_PcbGridColor
=
DARKGRAY
;
// Grid color
for
(
ii
=
0
;
ii
<
32
;
ii
++
)
for
(
ii
=
0
;
ii
<
32
;
ii
++
)
m_LayerColor
[
ii
]
=
default_layer_color
[
ii
];
m_LayerColor
[
ii
]
=
default_layer_color
[
ii
];
...
@@ -179,6 +181,7 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
...
@@ -179,6 +181,7 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
m_ViaColor
[
VIA_MICROVIA
]
=
CYAN
;
m_ViaColor
[
VIA_MICROVIA
]
=
CYAN
;
m_ViaColor
[
VIA_BLIND_BURIED
]
=
BROWN
;
m_ViaColor
[
VIA_BLIND_BURIED
]
=
BROWN
;
m_ViaColor
[
VIA_THROUGH
]
=
WHITE
;
m_ViaColor
[
VIA_THROUGH
]
=
WHITE
;
m_ModuleTextCMPColor
=
LIGHTGRAY
;
// Text module color for modules on the COMPONENT layer
m_ModuleTextCMPColor
=
LIGHTGRAY
;
// Text module color for modules on the COMPONENT layer
m_ModuleTextCUColor
=
MAGENTA
;
// Text module color for modules on the COPPER layer
m_ModuleTextCUColor
=
MAGENTA
;
// Text module color for modules on the COPPER layer
m_ModuleTextNOVColor
=
DARKGRAY
;
// Text module color for "invisible" texts (must be BLACK if really not displayed)
m_ModuleTextNOVColor
=
DARKGRAY
;
// Text module color for "invisible" texts (must be BLACK if really not displayed)
...
...
pcbnew/cotation.cpp
View file @
10e13ae5
...
@@ -22,12 +22,12 @@ static int status_cotation; /* = 0 : pas de cotation en cours
...
@@ -22,12 +22,12 @@ static int status_cotation; /* = 0 : pas de cotation en cours
/*
/*
* Les routines generent une cotation de la forme
* Les routines generent une cotation de la forme
* - cote usuelle:
* - cote usuelle:
*
*
| |
| |
| dist |
| dist |
|<---------->|
|<---------->|
| |
| |
*
*
*/
*/
#define MAX_CHAR 40
/* longueur maxi de la cotation */
#define MAX_CHAR 40
/* longueur maxi de la cotation */
...
@@ -135,10 +135,10 @@ WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame*
...
@@ -135,10 +135,10 @@ WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame*
m_SelLayerBox
=
new
WinEDAChoiceBox
(
this
,
ID_TEXTPCB_SELECT_LAYER
,
m_SelLayerBox
=
new
WinEDAChoiceBox
(
this
,
ID_TEXTPCB_SELECT_LAYER
,
wxDefaultPosition
,
wxDefaultSize
);
wxDefaultPosition
,
wxDefaultSize
);
LeftBoxSizer
->
Add
(
m_SelLayerBox
,
0
,
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxBOTTOM
,
5
);
LeftBoxSizer
->
Add
(
m_SelLayerBox
,
0
,
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxBOTTOM
,
5
);
int
ii
;
for
(
i
i
=
FIRST_NO_COPPER_LAYER
;
ii
<
NB_LAYERS
;
ii
++
)
for
(
i
nt
layer
=
FIRST_NO_COPPER_LAYER
;
layer
<
NB_LAYERS
;
layer
++
)
{
{
m_SelLayerBox
->
Append
(
ReturnPcbLayerName
(
ii
)
);
m_SelLayerBox
->
Append
(
parent
->
m_Pcb
->
GetLayerName
(
layer
)
);
}
}
m_SelLayerBox
->
SetSelection
(
Cotation
->
GetLayer
()
-
FIRST_NO_COPPER_LAYER
);
m_SelLayerBox
->
SetSelection
(
Cotation
->
GetLayer
()
-
FIRST_NO_COPPER_LAYER
);
...
@@ -174,8 +174,8 @@ void WinEDA_CotationPropertiesFrame::OnOkClick( wxCommandEvent& event )
...
@@ -174,8 +174,8 @@ void WinEDA_CotationPropertiesFrame::OnOkClick( wxCommandEvent& event )
CurrentCotation
->
m_Text
->
m_Width
=
CurrentCotation
->
m_Width
=
CurrentCotation
->
m_Text
->
m_Width
=
CurrentCotation
->
m_Width
=
m_TxtWidthCtrl
->
GetValue
();
m_TxtWidthCtrl
->
GetValue
();
CurrentCotation
->
m_Text
->
m_Miroir
=
(
m_Mirror
->
GetSelection
()
==
0
)
?
1
:
0
;
CurrentCotation
->
m_Text
->
m_Miroir
=
(
m_Mirror
->
GetSelection
()
==
0
)
?
1
:
0
;
CurrentCotation
->
SetLayer
(
m_SelLayerBox
->
GetChoice
()
+
FIRST_NO_COPPER_LAYER
);
CurrentCotation
->
SetLayer
(
m_SelLayerBox
->
GetChoice
()
+
FIRST_NO_COPPER_LAYER
);
CurrentCotation
->
m_Text
->
SetLayer
(
m_SelLayerBox
->
GetChoice
()
+
FIRST_NO_COPPER_LAYER
);
CurrentCotation
->
m_Text
->
SetLayer
(
m_SelLayerBox
->
GetChoice
()
+
FIRST_NO_COPPER_LAYER
);
CurrentCotation
->
m_Text
->
CreateDrawData
();
CurrentCotation
->
m_Text
->
CreateDrawData
();
...
@@ -213,7 +213,7 @@ static void Exit_EditCotation( WinEDA_DrawPanel* Panel, wxDC* DC )
...
@@ -213,7 +213,7 @@ static void Exit_EditCotation( WinEDA_DrawPanel* Panel, wxDC* DC )
status_cotation
=
0
;
status_cotation
=
0
;
Panel
->
ManageCurseur
=
NULL
;
Panel
->
ManageCurseur
=
NULL
;
Panel
->
ForceCloseManageCurseur
=
NULL
;
Panel
->
ForceCloseManageCurseur
=
NULL
;
((
WinEDA_PcbFrame
*
)
Panel
->
m_Parent
)
->
SetCurItem
(
NULL
);
((
WinEDA_PcbFrame
*
)
Panel
->
m_Parent
)
->
SetCurItem
(
NULL
);
}
}
...
...
pcbnew/cross-probing.cpp
View file @
10e13ae5
...
@@ -48,7 +48,7 @@ void RemoteCommand( const char* cmdline )
...
@@ -48,7 +48,7 @@ void RemoteCommand( const char* cmdline )
{
{
modName
=
CONV_FROM_UTF8
(
text
);
modName
=
CONV_FROM_UTF8
(
text
);
module
=
ReturnModule
(
frame
->
m_Pcb
,
modName
);
module
=
frame
->
m_Pcb
->
FindModuleByReference
(
modName
);
if
(
module
)
if
(
module
)
msg
.
Printf
(
_
(
"%s found"
),
modName
.
GetData
()
);
msg
.
Printf
(
_
(
"%s found"
),
modName
.
GetData
()
);
...
@@ -86,9 +86,9 @@ void RemoteCommand( const char* cmdline )
...
@@ -86,9 +86,9 @@ void RemoteCommand( const char* cmdline )
modName
=
CONV_FROM_UTF8
(
text
);
modName
=
CONV_FROM_UTF8
(
text
);
module
=
ReturnModule
(
frame
->
m_Pcb
,
modName
);
module
=
frame
->
m_Pcb
->
FindModuleByReference
(
modName
);
if
(
module
)
if
(
module
)
pad
=
ReturnPad
(
module
,
pinName
);
pad
=
module
->
FindPadByName
(
pinName
);
if
(
pad
)
if
(
pad
)
netcode
=
pad
->
GetNet
();
netcode
=
pad
->
GetNet
();
...
...
pcbnew/dialog_zones_by_polygon.cpp
View file @
10e13ae5
...
@@ -68,7 +68,7 @@ WinEDA_ZoneFrame::WinEDA_ZoneFrame()
...
@@ -68,7 +68,7 @@ WinEDA_ZoneFrame::WinEDA_ZoneFrame()
WinEDA_ZoneFrame
::
WinEDA_ZoneFrame
(
WinEDA_PcbFrame
*
parent
,
WinEDA_ZoneFrame
::
WinEDA_ZoneFrame
(
WinEDA_PcbFrame
*
parent
,
ZONE_CONTAINER
*
zone_container
,
ZONE_CONTAINER
*
zone_container
,
wxWindowID
id
,
wxWindowID
id
,
const
wxString
&
caption
,
const
wxString
&
caption
,
const
wxPoint
&
pos
,
const
wxPoint
&
pos
,
...
@@ -76,14 +76,14 @@ WinEDA_ZoneFrame::WinEDA_ZoneFrame( WinEDA_PcbFrame* parent,
...
@@ -76,14 +76,14 @@ WinEDA_ZoneFrame::WinEDA_ZoneFrame( WinEDA_PcbFrame* parent,
long
style
)
long
style
)
{
{
m_Parent
=
parent
;
m_Parent
=
parent
;
m_Zone_Container
=
zone_container
;
m_Zone_Container
=
zone_container
;
if
(
m_Parent
->
m_Parent
->
m_EDA_Config
)
if
(
m_Parent
->
m_Parent
->
m_EDA_Config
)
{
{
m_NetSorting
=
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
ZONE_NET_SORT_OPTION_KEY
,
(
long
)
BOARD
::
PAD_CNT_SORT
);
m_NetSorting
=
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
ZONE_NET_SORT_OPTION_KEY
,
(
long
)
BOARD
::
PAD_CNT_SORT
);
}
}
Create
(
parent
,
id
,
caption
,
pos
,
size
,
style
);
Create
(
parent
,
id
,
caption
,
pos
,
size
,
style
);
SetReturnCode
(
ZONE_ABORT
);
// Will be changed on buttons click
SetReturnCode
(
ZONE_ABORT
);
// Will be changed on buttons click
}
}
...
@@ -110,7 +110,7 @@ bool WinEDA_ZoneFrame::Create( wxWindow* parent,
...
@@ -110,7 +110,7 @@ bool WinEDA_ZoneFrame::Create( wxWindow* parent,
m_ListNetNameSelection
=
NULL
;
m_ListNetNameSelection
=
NULL
;
m_LayerSelectionCtrl
=
NULL
;
m_LayerSelectionCtrl
=
NULL
;
////@end WinEDA_ZoneFrame member initialisation
////@end WinEDA_ZoneFrame member initialisation
////@begin WinEDA_ZoneFrame creation
////@begin WinEDA_ZoneFrame creation
SetExtraStyle
(
wxWS_EX_BLOCK_EVENTS
);
SetExtraStyle
(
wxWS_EX_BLOCK_EVENTS
);
wxDialog
::
Create
(
parent
,
id
,
caption
,
pos
,
size
,
style
);
wxDialog
::
Create
(
parent
,
id
,
caption
,
pos
,
size
,
style
);
...
@@ -133,6 +133,8 @@ bool WinEDA_ZoneFrame::Create( wxWindow* parent,
...
@@ -133,6 +133,8 @@ bool WinEDA_ZoneFrame::Create( wxWindow* parent,
void
WinEDA_ZoneFrame
::
CreateControls
()
void
WinEDA_ZoneFrame
::
CreateControls
()
{
{
BOARD
*
board
=
m_Parent
->
m_Pcb
;
SetFont
(
*
g_DialogFont
);
SetFont
(
*
g_DialogFont
);
////@begin WinEDA_ZoneFrame content construction
////@begin WinEDA_ZoneFrame content construction
...
@@ -244,8 +246,8 @@ void WinEDA_ZoneFrame::CreateControls()
...
@@ -244,8 +246,8 @@ void WinEDA_ZoneFrame::CreateControls()
m_NetSortingOption
->
SetValidator
(
wxGenericValidator
(
&
m_NetSorting
)
);
m_NetSortingOption
->
SetValidator
(
wxGenericValidator
(
&
m_NetSorting
)
);
////@end WinEDA_ZoneFrame content construction
////@end WinEDA_ZoneFrame content construction
// Initialise options
// Initialise options
wxString
title
=
_
(
"Zone clearance value:"
)
+
ReturnUnitSymbol
(
g_UnitMetric
);
wxString
title
=
_
(
"Zone clearance value:"
)
+
ReturnUnitSymbol
(
g_UnitMetric
);
m_ClearanceValueTitle
->
SetLabel
(
title
);
m_ClearanceValueTitle
->
SetLabel
(
title
);
title
=
_
(
"Grid :"
)
+
ReturnUnitSymbol
(
g_UnitMetric
);;
title
=
_
(
"Grid :"
)
+
ReturnUnitSymbol
(
g_UnitMetric
);;
...
@@ -280,89 +282,97 @@ void WinEDA_ZoneFrame::CreateControls()
...
@@ -280,89 +282,97 @@ void WinEDA_ZoneFrame::CreateControls()
{
{
case
ZONE_CONTAINER
:
:
PAD_NOT_IN_ZONE
:
// Pads are not covered
case
ZONE_CONTAINER
:
:
PAD_NOT_IN_ZONE
:
// Pads are not covered
m_FillOpt
->
SetSelection
(
2
);
m_FillOpt
->
SetSelection
(
2
);
break
;
break
;
case
ZONE_CONTAINER
:
:
THERMAL_PAD
:
// Use thermal relief for pads
case
ZONE_CONTAINER
:
:
THERMAL_PAD
:
// Use thermal relief for pads
m_FillOpt
->
SetSelection
(
1
);
m_FillOpt
->
SetSelection
(
1
);
break
;
break
;
case
ZONE_CONTAINER
:
:
PAD_IN_ZONE
:
// pads are covered by copper
case
ZONE_CONTAINER
:
:
PAD_IN_ZONE
:
// pads are covered by copper
m_FillOpt
->
SetSelection
(
0
);
m_FillOpt
->
SetSelection
(
0
);
break
;
break
;
}
}
if
(
m_Zone_Container
)
if
(
m_Zone_Container
)
s_Zone_Hatching
=
m_Zone_Container
->
m_Poly
->
GetHatchStyle
();
s_Zone_Hatching
=
m_Zone_Container
->
m_Poly
->
GetHatchStyle
();
else
else
s_Zone_Hatching
=
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
ZONE_NET_OUTLINES_HATCH_OPTION_KEY
,
s_Zone_Hatching
=
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
ZONE_NET_OUTLINES_HATCH_OPTION_KEY
,
(
long
)
CPolyLine
::
DIAGONAL_EDGE
);
(
long
)
CPolyLine
::
DIAGONAL_EDGE
);
switch
(
s_Zone_Hatching
)
switch
(
s_Zone_Hatching
)
{
{
case
CPolyLine
:
:
NO_HATCH
:
case
CPolyLine
:
:
NO_HATCH
:
m_OutlineAppearanceCtrl
->
SetSelection
(
0
);
m_OutlineAppearanceCtrl
->
SetSelection
(
0
);
break
;
break
;
case
CPolyLine
:
:
DIAGONAL_EDGE
:
case
CPolyLine
:
:
DIAGONAL_EDGE
:
m_OutlineAppearanceCtrl
->
SetSelection
(
1
);
m_OutlineAppearanceCtrl
->
SetSelection
(
1
);
break
;
break
;
case
CPolyLine
:
:
DIAGONAL_FULL
:
case
CPolyLine
:
:
DIAGONAL_FULL
:
m_OutlineAppearanceCtrl
->
SetSelection
(
2
);
m_OutlineAppearanceCtrl
->
SetSelection
(
2
);
break
;
break
;
}
}
int
layer_cnt
=
g_DesignSettings
.
m_CopperLayerCount
;
int
layer_cnt
=
board
->
GetCopperLayerCount
()
;
for
(
int
ii
=
0
;
ii
<
g_DesignSettings
.
m_CopperLayerCount
;
ii
++
)
for
(
int
ii
=
0
;
ii
<
board
->
GetCopperLayerCount
()
;
ii
++
)
{
{
wxString
msg
;
wxString
msg
;
int
layer_number
=
COPPER_LAYER_N
;
int
layer_number
=
COPPER_LAYER_N
;
if
(
layer_cnt
==
0
||
ii
<
layer_cnt
-
1
)
if
(
layer_cnt
==
0
||
ii
<
layer_cnt
-
1
)
layer_number
=
ii
;
layer_number
=
ii
;
else
if
(
ii
==
layer_cnt
-
1
)
else
if
(
ii
==
layer_cnt
-
1
)
layer_number
=
LAYER_CMP_N
;
layer_number
=
LAYER_CMP_N
;
m_LayerId
[
ii
]
=
layer_number
;
m_LayerId
[
ii
]
=
layer_number
;
msg
=
ReturnPcbLayerName
(
layer_number
).
Trim
();
msg
=
board
->
GetLayerName
(
layer_number
).
Trim
();
m_LayerSelectionCtrl
->
InsertItems
(
1
,
&
msg
,
ii
);
m_LayerSelectionCtrl
->
InsertItems
(
1
,
&
msg
,
ii
);
if
(
m_Zone_Container
)
{
if
(
m_Zone_Container
)
if
(
m_Zone_Container
->
GetLayer
()
==
layer_number
)
{
m_LayerSelectionCtrl
->
SetSelection
(
ii
);
if
(
m_Zone_Container
->
GetLayer
()
==
layer_number
)
}
m_LayerSelectionCtrl
->
SetSelection
(
ii
);
else
}
{
else
if
(
((
PCB_SCREEN
*
)(
m_Parent
->
GetScreen
()))
->
m_Active_Layer
==
layer_number
)
{
m_LayerSelectionCtrl
->
SetSelection
(
ii
);
if
(
((
PCB_SCREEN
*
)(
m_Parent
->
GetScreen
()))
->
m_Active_Layer
==
layer_number
)
}
m_LayerSelectionCtrl
->
SetSelection
(
ii
);
}
}
}
m_NetSortingOption
->
SetSelection
(
m_NetSorting
==
BOARD
::
ALPHA_SORT
?
0
:
1
);
m_NetSortingOption
->
SetSelection
(
m_NetSorting
==
BOARD
::
ALPHA_SORT
?
0
:
1
);
wxString
NetNameFilter
;
if
(
m_Parent
->
m_Parent
->
m_EDA_Config
)
wxString
NetNameFilter
;
if
(
m_Parent
->
m_Parent
->
m_EDA_Config
)
{
{
NetNameFilter
=
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
ZONE_NET_FILTER_STRING_KEY
,
wxT
(
"N_0*"
)
);
NetNameFilter
=
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
ZONE_NET_FILTER_STRING_KEY
,
wxT
(
"N_0*"
)
);
}
}
m_NetNameFilter
->
SetValue
(
NetNameFilter
);
m_NetNameFilter
->
SetValue
(
NetNameFilter
);
wxArrayString
ListNetName
;
wxArrayString
ListNetName
;
m_Parent
->
m_Pcb
->
ReturnSortedNetnamesList
(
ListNetName
,
m_Parent
->
m_Pcb
->
ReturnSortedNetnamesList
(
ListNetName
,
m_NetSorting
==
0
?
BOARD
::
ALPHA_SORT
:
BOARD
::
PAD_CNT_SORT
);
m_NetSorting
==
0
?
BOARD
::
ALPHA_SORT
:
BOARD
::
PAD_CNT_SORT
);
if
(
m_NetSorting
!=
0
)
{
if
(
m_NetSorting
!=
0
)
wxString
Filter
=
m_NetNameFilter
->
GetValue
();
{
for
(
unsigned
ii
=
0
;
ii
<
ListNetName
.
GetCount
();
ii
++
)
wxString
Filter
=
m_NetNameFilter
->
GetValue
();
{
for
(
unsigned
ii
=
0
;
ii
<
ListNetName
.
GetCount
();
ii
++
)
if
(
ListNetName
[
ii
].
Matches
(
Filter
.
GetData
()
)
)
{
{
if
(
ListNetName
[
ii
].
Matches
(
Filter
.
GetData
()
)
)
ListNetName
.
RemoveAt
(
ii
);
{
ii
--
;
ListNetName
.
RemoveAt
(
ii
);
}
ii
--
;
}
}
}
}
}
m_ListNetNameSelection
->
InsertItems
(
ListNetName
,
0
);
m_ListNetNameSelection
->
InsertItems
(
ListNetName
,
0
);
// Select net:
// Select net:
int
net_select
=
g_HightLigth_NetCode
;
int
net_select
=
g_HightLigth_NetCode
;
if
(
m_Zone_Container
)
if
(
m_Zone_Container
)
net_select
=
m_Zone_Container
->
GetNet
();
net_select
=
m_Zone_Container
->
GetNet
();
if
(
net_select
>
0
)
if
(
net_select
>
0
)
{
{
EQUIPOT
*
equipot
=
m_Parent
->
m_Pcb
->
FindNet
(
net_select
);
EQUIPOT
*
equipot
=
m_Parent
->
m_Pcb
->
FindNet
(
net_select
);
...
@@ -468,8 +478,8 @@ bool WinEDA_ZoneFrame::AcceptOptions(bool aPromptForErrors)
...
@@ -468,8 +478,8 @@ bool WinEDA_ZoneFrame::AcceptOptions(bool aPromptForErrors)
if
(
m_Parent
->
m_Parent
->
m_EDA_Config
)
if
(
m_Parent
->
m_Parent
->
m_EDA_Config
)
{
{
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
ZONE_NET_OUTLINES_HATCH_OPTION_KEY
,
(
long
)
s_Zone_Hatching
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
ZONE_NET_OUTLINES_HATCH_OPTION_KEY
,
(
long
)
s_Zone_Hatching
);
}
}
switch
(
m_GridCtrl
->
GetSelection
()
)
switch
(
m_GridCtrl
->
GetSelection
()
)
{
{
...
@@ -481,7 +491,7 @@ bool WinEDA_ZoneFrame::AcceptOptions(bool aPromptForErrors)
...
@@ -481,7 +491,7 @@ bool WinEDA_ZoneFrame::AcceptOptions(bool aPromptForErrors)
g_GridRoutingSize
=
50
;
g_GridRoutingSize
=
50
;
break
;
break
;
default
:
default
:
case
2
:
case
2
:
g_GridRoutingSize
=
100
;
g_GridRoutingSize
=
100
;
break
;
break
;
...
@@ -521,7 +531,7 @@ bool WinEDA_ZoneFrame::AcceptOptions(bool aPromptForErrors)
...
@@ -521,7 +531,7 @@ bool WinEDA_ZoneFrame::AcceptOptions(bool aPromptForErrors)
/* Search net_code for this net */
/* Search net_code for this net */
EQUIPOT
*
net
;
EQUIPOT
*
net
;
s_NetcodeSelection
=
0
;
s_NetcodeSelection
=
0
;
for
(
net
=
m_Parent
->
m_Pcb
->
m_Equipots
;
net
;
net
=
net
->
Next
()
)
for
(
net
=
m_Parent
->
m_Pcb
->
m_Equipots
;
net
;
net
=
net
->
Next
()
)
{
{
if
(
net
->
m_Netname
==
net_name
)
if
(
net
->
m_Netname
==
net_name
)
{
{
...
@@ -529,8 +539,8 @@ bool WinEDA_ZoneFrame::AcceptOptions(bool aPromptForErrors)
...
@@ -529,8 +539,8 @@ bool WinEDA_ZoneFrame::AcceptOptions(bool aPromptForErrors)
break
;
break
;
}
}
}
}
return
true
;
return
true
;
}
}
...
@@ -541,29 +551,28 @@ bool WinEDA_ZoneFrame::AcceptOptions(bool aPromptForErrors)
...
@@ -541,29 +551,28 @@ bool WinEDA_ZoneFrame::AcceptOptions(bool aPromptForErrors)
void
WinEDA_ZoneFrame
::
OnNetSortingOptionSelected
(
wxCommandEvent
&
event
)
void
WinEDA_ZoneFrame
::
OnNetSortingOptionSelected
(
wxCommandEvent
&
event
)
{
{
wxArrayString
ListNetName
;
wxArrayString
ListNetName
;
m_NetSorting
=
m_NetSortingOption
->
GetSelection
();
m_NetSorting
=
m_NetSortingOption
->
GetSelection
();
m_Parent
->
m_Pcb
->
ReturnSortedNetnamesList
(
ListNetName
,
m_Parent
->
m_Pcb
->
ReturnSortedNetnamesList
(
ListNetName
,
m_NetSorting
==
0
?
BOARD
::
ALPHA_SORT
:
BOARD
::
PAD_CNT_SORT
);
m_NetSorting
==
0
?
BOARD
::
ALPHA_SORT
:
BOARD
::
PAD_CNT_SORT
);
if
(
m_NetSorting
!=
0
)
if
(
m_NetSorting
!=
0
)
{
{
wxString
Filter
=
m_NetNameFilter
->
GetValue
();
wxString
Filter
=
m_NetNameFilter
->
GetValue
();
for
(
unsigned
ii
=
0
;
ii
<
ListNetName
.
GetCount
();
ii
++
)
for
(
unsigned
ii
=
0
;
ii
<
ListNetName
.
GetCount
();
ii
++
)
{
{
if
(
ListNetName
[
ii
].
Matches
(
Filter
.
GetData
()
)
)
if
(
ListNetName
[
ii
].
Matches
(
Filter
.
GetData
()
)
)
{
{
ListNetName
.
RemoveAt
(
ii
);
ListNetName
.
RemoveAt
(
ii
);
ii
--
;
ii
--
;
}
}
}
}
}
}
m_ListNetNameSelection
->
Clear
();
m_ListNetNameSelection
->
Clear
();
m_ListNetNameSelection
->
InsertItems
(
ListNetName
,
0
);
m_ListNetNameSelection
->
InsertItems
(
ListNetName
,
0
);
if
(
m_Parent
->
m_Parent
->
m_EDA_Config
)
if
(
m_Parent
->
m_Parent
->
m_EDA_Config
)
{
{
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
ZONE_NET_SORT_OPTION_KEY
,
(
long
)
m_NetSorting
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
ZONE_NET_SORT_OPTION_KEY
,
(
long
)
m_NetSorting
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
ZONE_NET_FILTER_STRING_KEY
,
m_NetNameFilter
->
GetValue
()
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
ZONE_NET_FILTER_STRING_KEY
,
m_NetNameFilter
->
GetValue
()
);
}
}
}
}
...
@@ -573,7 +582,7 @@ void WinEDA_ZoneFrame::OnNetSortingOptionSelected( wxCommandEvent& event )
...
@@ -573,7 +582,7 @@ void WinEDA_ZoneFrame::OnNetSortingOptionSelected( wxCommandEvent& event )
void
WinEDA_ZoneFrame
::
OnOkClick
(
wxCommandEvent
&
event
)
void
WinEDA_ZoneFrame
::
OnOkClick
(
wxCommandEvent
&
event
)
{
{
if
(
AcceptOptions
(
true
)
)
if
(
AcceptOptions
(
true
)
)
EndModal
(
ZONE_OK
);
EndModal
(
ZONE_OK
);
}
}
pcbnew/editedge.cpp
View file @
10e13ae5
...
@@ -174,7 +174,7 @@ void WinEDA_PcbFrame::Delete_Drawings_All_Layer( DRAWSEGMENT* Segment, wxDC* DC
...
@@ -174,7 +174,7 @@ void WinEDA_PcbFrame::Delete_Drawings_All_Layer( DRAWSEGMENT* Segment, wxDC* DC
return
;
return
;
}
}
wxString
msg
=
_
(
"Delete Layer "
)
+
ReturnPcb
LayerName
(
layer
);
wxString
msg
=
_
(
"Delete Layer "
)
+
m_Pcb
->
Get
LayerName
(
layer
);
if
(
!
IsOK
(
this
,
msg
)
)
if
(
!
IsOK
(
this
,
msg
)
)
return
;
return
;
...
...
pcbnew/initpcb.cpp
View file @
10e13ae5
...
@@ -127,26 +127,9 @@ bool WinEDA_BasePcbFrame::Clear_Pcb( bool query )
...
@@ -127,26 +127,9 @@ bool WinEDA_BasePcbFrame::Clear_Pcb( bool query )
}
}
}
}
/* Suppression des listes chainees */
// delete the old BOARD and create a new BOARD so that the default
m_Pcb
->
m_Equipots
->
DeleteStructList
();
// layer names are put into the BOARD.
m_Pcb
->
m_Equipots
=
NULL
;
SetBOARD
(
new
BOARD
(
NULL
,
this
)
);
m_Pcb
->
m_Drawings
->
DeleteStructList
();
m_Pcb
->
m_Drawings
=
NULL
;
m_Pcb
->
m_Modules
->
DeleteStructList
();
m_Pcb
->
m_Modules
=
NULL
;
m_Pcb
->
m_Track
->
DeleteStructList
();
m_Pcb
->
m_Track
=
NULL
;
m_Pcb
->
m_NbSegmTrack
=
0
;
m_Pcb
->
m_Zone
->
DeleteStructList
();
m_Pcb
->
m_Zone
=
NULL
;
m_Pcb
->
m_NbSegmZone
=
0
;
m_Pcb
->
DeleteMARKERs
();
m_Pcb
->
DeleteZONEOutlines
();
for
(
;
g_UnDeleteStackPtr
!=
0
;
)
for
(
;
g_UnDeleteStackPtr
!=
0
;
)
{
{
...
@@ -159,30 +142,6 @@ bool WinEDA_BasePcbFrame::Clear_Pcb( bool query )
...
@@ -159,30 +142,6 @@ bool WinEDA_BasePcbFrame::Clear_Pcb( bool query )
memset
(
buf_work
,
0
,
BUFMEMSIZE
);
memset
(
buf_work
,
0
,
BUFMEMSIZE
);
adr_lowmem
=
adr_max
=
buf_work
;
adr_lowmem
=
adr_max
=
buf_work
;
if
(
m_Pcb
->
m_Pads
)
{
MyFree
(
m_Pcb
->
m_Pads
);
m_Pcb
->
m_Pads
=
NULL
;
}
if
(
m_Pcb
->
m_Ratsnest
)
MyFree
(
m_Pcb
->
m_Ratsnest
);
if
(
m_Pcb
->
m_LocalRatsnest
)
MyFree
(
m_Pcb
->
m_LocalRatsnest
);
m_Pcb
->
m_Ratsnest
=
NULL
;
m_Pcb
->
m_LocalRatsnest
=
NULL
;
/* remise a 0 ou a une valeur initiale des variables de la structure */
m_Pcb
->
m_BoundaryBox
.
SetOrigin
(
wxPoint
(
0
,
0
)
);
m_Pcb
->
m_BoundaryBox
.
SetSize
(
wxSize
(
0
,
0
)
);
m_Pcb
->
m_Status_Pcb
=
0
;
m_Pcb
->
m_NbLoclinks
=
0
;
m_Pcb
->
m_NbLinks
=
0
;
m_Pcb
->
m_NbPads
=
0
;
m_Pcb
->
m_NbNets
=
0
;
m_Pcb
->
m_NbNodes
=
0
;
m_Pcb
->
m_NbNoconnect
=
0
;
m_Pcb
->
m_NbSegmTrack
=
0
;
m_Pcb
->
m_NbSegmZone
=
0
;
SetCurItem
(
NULL
);
SetCurItem
(
NULL
);
/* Init parametres de gestion */
/* Init parametres de gestion */
...
@@ -219,8 +178,8 @@ void WinEDA_PcbFrame::Erase_Zones( bool query )
...
@@ -219,8 +178,8 @@ void WinEDA_PcbFrame::Erase_Zones( bool query )
m_Pcb
->
m_Zone
=
NULL
;
m_Pcb
->
m_Zone
=
NULL
;
m_Pcb
->
m_NbSegmZone
=
0
;
m_Pcb
->
m_NbSegmZone
=
0
;
}
}
m_Pcb
->
DeleteZONEOutlines
();
m_Pcb
->
DeleteZONEOutlines
();
GetScreen
()
->
SetModify
();
GetScreen
()
->
SetModify
();
}
}
...
@@ -291,10 +250,10 @@ void WinEDA_PcbFrame::Erase_Pistes( wxDC * DC, int masque_type, bool query )
...
@@ -291,10 +250,10 @@ void WinEDA_PcbFrame::Erase_Pistes( wxDC * DC, int masque_type, bool query )
for
(
pt_segm
=
m_Pcb
->
m_Track
;
pt_segm
!=
NULL
;
pt_segm
=
(
TRACK
*
)
PtNext
)
for
(
pt_segm
=
m_Pcb
->
m_Track
;
pt_segm
!=
NULL
;
pt_segm
=
(
TRACK
*
)
PtNext
)
{
{
PtNext
=
(
TRACK
*
)
pt_segm
->
Pnext
;
PtNext
=
(
TRACK
*
)
pt_segm
->
Pnext
;
if
(
pt_segm
->
GetState
(
SEGM_FIXE
|
SEGM_AR
)
&
masque_type
)
if
(
pt_segm
->
GetState
(
SEGM_FIXE
|
SEGM_AR
)
&
masque_type
)
continue
;
continue
;
pt_segm
->
DeleteStructure
();
pt_segm
->
DeleteStructure
();
}
}
...
...
pcbnew/ioascii.cpp
View file @
10e13ae5
...
@@ -308,11 +308,25 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum )
...
@@ -308,11 +308,25 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum )
if
(
strncmp
(
Line
,
"Layer["
,
LAYERKEYZ
)
==
0
)
if
(
strncmp
(
Line
,
"Layer["
,
LAYERKEYZ
)
==
0
)
{
{
const
char
*
cp
=
Line
+
LAYERKEYZ
;
// parse:
// Layer[n] "a Layer name" <LAYER_T>
char
*
cp
=
Line
+
LAYERKEYZ
;
int
layer
=
atoi
(
cp
);
int
layer
=
atoi
(
cp
);
wxString
layerName
=
CONV_FROM_UTF8
(
data
);
if
(
data
)
m_Pcb
->
SetLayerName
(
layer
,
layerName
);
{
wxString
layerName
=
CONV_FROM_UTF8
(
data
);
m_Pcb
->
SetLayerName
(
layer
,
layerName
);
data
=
strtok
(
NULL
,
" "
);
if
(
data
)
{
LAYER_T
type
=
LAYER
::
ParseType
(
data
);
m_Pcb
->
SetLayerType
(
layer
,
type
);
}
}
continue
;
continue
;
}
}
...
@@ -500,13 +514,9 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum )
...
@@ -500,13 +514,9 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum )
#ifdef PCBNEW
#ifdef PCBNEW
/***************************************************************/
/******************************************************************************/
static
int
WriteSetup
(
FILE
*
aFile
,
WinEDA_BasePcbFrame
*
aFrame
static
int
WriteSetup
(
FILE
*
aFile
,
WinEDA_BasePcbFrame
*
aFrame
,
BOARD
*
aBoard
)
#if defined(DEBUG)
/******************************************************************************/
,
BOARD
*
aBoard
#endif
)
/***************************************************************/
{
{
char
text
[
1024
];
char
text
[
1024
];
int
ii
,
jj
;
int
ii
,
jj
;
...
@@ -533,18 +543,14 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame
...
@@ -533,18 +543,14 @@ static int WriteSetup( FILE* aFile, WinEDA_BasePcbFrame* aFrame
fprintf
(
aFile
,
"ZoneGridSize %d
\n
"
,
g_GridRoutingSize
);
fprintf
(
aFile
,
"ZoneGridSize %d
\n
"
,
g_GridRoutingSize
);
#if defined(DEBUG)
fprintf
(
aFile
,
"Layers %d
\n
"
,
aBoard
->
GetCopperLayerCount
()
);
fprintf
(
aFile
,
"Layers %d
\n
"
,
aBoard
->
GetCopperLayerCount
()
);
for
(
int
layer
=
0
;
layer
<
aBoard
->
GetCopperLayerCount
();
++
layer
)
for
(
int
layer
=
0
;
layer
<
aBoard
->
GetCopperLayerCount
();
++
layer
)
{
{
fprintf
(
aFile
,
"Layer[%d] %s
\n
"
,
layer
,
CONV_TO_UTF8
(
aBoard
->
GetLayerName
(
layer
)
)
);
fprintf
(
aFile
,
"Layer[%d] %s %s
\n
"
,
layer
,
CONV_TO_UTF8
(
aBoard
->
GetLayerName
(
layer
)
),
LAYER
::
ShowType
(
aBoard
->
GetLayerType
(
layer
)
)
);
}
}
#else
fprintf
(
aFile
,
"Layers %d
\n
"
,
g_DesignSettings
.
m_CopperLayerCount
);
#endif
fprintf
(
aFile
,
"TrackWidth %d
\n
"
,
g_DesignSettings
.
m_CurrentTrackWidth
);
fprintf
(
aFile
,
"TrackWidth %d
\n
"
,
g_DesignSettings
.
m_CurrentTrackWidth
);
for
(
ii
=
0
;
ii
<
HISTORY_NUMBER
;
ii
++
)
for
(
ii
=
0
;
ii
<
HISTORY_NUMBER
;
ii
++
)
{
{
...
@@ -1057,11 +1063,7 @@ int WinEDA_PcbFrame::SavePcbFormatAscii( FILE* aFile )
...
@@ -1057,11 +1063,7 @@ int WinEDA_PcbFrame::SavePcbFormatAscii( FILE* aFile )
WriteGeneralDescrPcb
(
aFile
);
WriteGeneralDescrPcb
(
aFile
);
WriteSheetDescr
(
m_CurrentScreen
,
aFile
);
WriteSheetDescr
(
m_CurrentScreen
,
aFile
);
WriteSetup
(
aFile
,
this
WriteSetup
(
aFile
,
this
,
m_Pcb
);
#if defined(DEBUG)
,
m_Pcb
#endif
);
rc
=
m_Pcb
->
Save
(
aFile
);
rc
=
m_Pcb
->
Save
(
aFile
);
...
...
pcbnew/locate.cpp
View file @
10e13ae5
...
@@ -10,15 +10,15 @@
...
@@ -10,15 +10,15 @@
#include "protos.h"
#include "protos.h"
/**
/**
* Function RefPos
* Function RefPos
* returns the reference position, coming from either the mouse position or the
* returns the reference position, coming from either the mouse position or the
* the cursor position, based on whether the typeloc has the CURSEUR_OFF_GRILLE
* the cursor position, based on whether the typeloc has the CURSEUR_OFF_GRILLE
* flag ORed in or not.
* flag ORed in or not.
* @param typeloc int with possible CURSEUR_OFF_GRILLE bit on.
* @param typeloc int with possible CURSEUR_OFF_GRILLE bit on.
* @return wxPoint - The reference point, either the mouse position or
* @return wxPoint - The reference point, either the mouse position or
* the cursor position.
* the cursor position.
*/
*/
wxPoint
inline
RefPos
(
int
typeloc
)
wxPoint
inline
RefPos
(
int
typeloc
)
...
@@ -27,55 +27,6 @@ wxPoint inline RefPos( int typeloc )
...
@@ -27,55 +27,6 @@ wxPoint inline RefPos( int typeloc )
}
}
/*************************************************************/
MODULE
*
ReturnModule
(
BOARD
*
pcb
,
const
wxString
&
reference
)
/*************************************************************/
/*
* Recherche d'un module par sa reference
* Retourne:
* un pointeur sur le module
* Null si pas localis�
*/
{
MODULE
*
Module
=
pcb
->
m_Modules
;
for
(
;
Module
!=
NULL
;
Module
=
(
MODULE
*
)
Module
->
Pnext
)
{
if
(
reference
.
CmpNoCase
(
Module
->
m_Reference
->
m_Text
)
==
0
)
return
Module
;
}
return
NULL
;
}
/********************************************************/
D_PAD
*
ReturnPad
(
MODULE
*
module
,
const
wxString
&
name
)
/********************************************************/
/* Recherche d'un pad par son nom, pour le module Module
*/
{
D_PAD
*
pt_pad
;
wxString
buf
;
if
(
module
==
NULL
)
return
NULL
;
pt_pad
=
module
->
m_Pads
;
for
(
;
pt_pad
!=
NULL
;
pt_pad
=
(
D_PAD
*
)
pt_pad
->
Pnext
)
{
pt_pad
->
ReturnStringPadName
(
buf
);
if
(
buf
.
CmpNoCase
(
name
)
==
0
)
return
pt_pad
;
}
return
NULL
;
}
/*******************************************************************/
/*******************************************************************/
TRACK
*
Locate_Via
(
BOARD
*
Pcb
,
const
wxPoint
&
pos
,
int
layer
)
TRACK
*
Locate_Via
(
BOARD
*
Pcb
,
const
wxPoint
&
pos
,
int
layer
)
/*******************************************************************/
/*******************************************************************/
...
@@ -156,7 +107,7 @@ D_PAD* Locate_Pad_Connecte( BOARD* Pcb, TRACK* ptr_piste, int extr )
...
@@ -156,7 +107,7 @@ D_PAD* Locate_Pad_Connecte( BOARD* Pcb, TRACK* ptr_piste, int extr )
wxPoint
ref_pos
;
wxPoint
ref_pos
;
int
masque_layer
=
g_TabOneLayerMask
[
ptr_piste
->
GetLayer
()];
int
masque_layer
=
g_TabOneLayerMask
[
ptr_piste
->
GetLayer
()];
if
(
extr
==
START
)
if
(
extr
==
START
)
{
{
ref_pos
=
ptr_piste
->
m_Start
;
ref_pos
=
ptr_piste
->
m_Start
;
...
@@ -165,7 +116,7 @@ D_PAD* Locate_Pad_Connecte( BOARD* Pcb, TRACK* ptr_piste, int extr )
...
@@ -165,7 +116,7 @@ D_PAD* Locate_Pad_Connecte( BOARD* Pcb, TRACK* ptr_piste, int extr )
{
{
ref_pos
=
ptr_piste
->
m_End
;
ref_pos
=
ptr_piste
->
m_End
;
}
}
for
(
MODULE
*
module
=
Pcb
->
m_Modules
;
module
;
module
=
module
->
Next
()
)
for
(
MODULE
*
module
=
Pcb
->
m_Modules
;
module
;
module
=
module
->
Next
()
)
{
{
ptr_pad
=
Locate_Pads
(
module
,
ref_pos
,
masque_layer
);
ptr_pad
=
Locate_Pads
(
module
,
ref_pos
,
masque_layer
);
...
@@ -192,7 +143,7 @@ D_PAD* Locate_Pad_Connecte( BOARD* Pcb, TRACK* ptr_piste, int extr )
...
@@ -192,7 +143,7 @@ D_PAD* Locate_Pad_Connecte( BOARD* Pcb, TRACK* ptr_piste, int extr )
* pointeur sur la description de la pastille si localisation
* pointeur sur la description de la pastille si localisation
* pointeur NULL si pastille non trouvee
* pointeur NULL si pastille non trouvee
* num_empr = numero d'empreinte du pad
* num_empr = numero d'empreinte du pad
*
*
* la priorit� est donn�e a la couche active
* la priorit� est donn�e a la couche active
*/
*/
...
@@ -210,7 +161,7 @@ D_PAD* Locate_Any_Pad( BOARD* Pcb, const wxPoint& ref_pos, bool OnlyCurrentLayer
...
@@ -210,7 +161,7 @@ D_PAD* Locate_Any_Pad( BOARD* Pcb, const wxPoint& ref_pos, bool OnlyCurrentLayer
for
(
MODULE
*
module
=
Pcb
->
m_Modules
;
module
;
module
=
module
->
Next
()
)
for
(
MODULE
*
module
=
Pcb
->
m_Modules
;
module
;
module
=
module
->
Next
()
)
{
{
D_PAD
*
pt_pad
;
D_PAD
*
pt_pad
;
/* First: Search a pad on the active layer: */
/* First: Search a pad on the active layer: */
if
(
(
pt_pad
=
Locate_Pads
(
module
,
ref_pos
,
layer_mask
)
)
!=
NULL
)
if
(
(
pt_pad
=
Locate_Pads
(
module
,
ref_pos
,
layer_mask
)
)
!=
NULL
)
return
pt_pad
;
return
pt_pad
;
...
@@ -272,7 +223,7 @@ D_PAD* Locate_Pads( MODULE* module, const wxPoint& ref_pos, int masque_layer )
...
@@ -272,7 +223,7 @@ D_PAD* Locate_Pads( MODULE* module, const wxPoint& ref_pos, int masque_layer )
* The current mouse or cursor coordinates are grabbed from the active window
* The current mouse or cursor coordinates are grabbed from the active window
* to performe hit-testing.
* to performe hit-testing.
* distance is calculated via manhattan distance from the center of the bounding rectangle
* distance is calculated via manhattan distance from the center of the bounding rectangle
* to the cursor postition.
* to the cursor postition.
*
*
* @param Pcb The BOARD to search within.
* @param Pcb The BOARD to search within.
* @param typeloc Flag bits, tuning the search, see pcbnew.h
* @param typeloc Flag bits, tuning the search, see pcbnew.h
...
@@ -313,26 +264,26 @@ MODULE* Locate_Prefered_Module( BOARD* Pcb, int typeloc )
...
@@ -313,26 +264,26 @@ MODULE* Locate_Prefered_Module( BOARD* Pcb, int typeloc )
else
if
(
layer
==
ADHESIVE_N_CMP
||
layer
==
SILKSCREEN_N_CMP
)
else
if
(
layer
==
ADHESIVE_N_CMP
||
layer
==
SILKSCREEN_N_CMP
)
layer
=
CMP_N
;
layer
=
CMP_N
;
/* Localisation: test des dimensions minimales, choix du meilleur candidat */
/* Localisation: test des dimensions minimales, choix du meilleur candidat */
/* calcul des dimensions du cadre :*/
/* calcul des dimensions du cadre :*/
int
offx
=
pt_module
->
m_BoundaryBox
.
m_Size
.
x
/
2
+
int
offx
=
pt_module
->
m_BoundaryBox
.
m_Size
.
x
/
2
+
pt_module
->
m_BoundaryBox
.
m_Pos
.
x
+
pt_module
->
m_BoundaryBox
.
m_Pos
.
x
+
pt_module
->
m_Pos
.
x
;
pt_module
->
m_Pos
.
x
;
int
offy
=
pt_module
->
m_BoundaryBox
.
m_Size
.
y
/
2
int
offy
=
pt_module
->
m_BoundaryBox
.
m_Size
.
y
/
2
+
pt_module
->
m_BoundaryBox
.
m_Pos
.
y
+
pt_module
->
m_BoundaryBox
.
m_Pos
.
y
+
pt_module
->
m_Pos
.
y
;
+
pt_module
->
m_Pos
.
y
;
//off x & offy point to the middle of the box.
//off x & offy point to the middle of the box.
int
dist
=
abs
(
ref_pos
.
x
-
offx
)
+
abs
(
ref_pos
.
y
-
offy
);
int
dist
=
abs
(
ref_pos
.
x
-
offx
)
+
abs
(
ref_pos
.
y
-
offy
);
lx
=
pt_module
->
m_BoundaryBox
.
GetWidth
();
lx
=
pt_module
->
m_BoundaryBox
.
GetWidth
();
ly
=
pt_module
->
m_BoundaryBox
.
GetHeight
();
ly
=
pt_module
->
m_BoundaryBox
.
GetHeight
();
//int dist = MIN(lx, ly); // to pick the smallest module (kinda screwy with same-sized modules -- this is bad!)
//int dist = MIN(lx, ly); // to pick the smallest module (kinda screwy with same-sized modules -- this is bad!)
if
(
(
(
PCB_SCREEN
*
)
ActiveScreen
)
->
m_Active_Layer
==
layer
){
if
(
(
(
PCB_SCREEN
*
)
ActiveScreen
)
->
m_Active_Layer
==
layer
){
if
(
dist
<=
min_dim
){
if
(
dist
<=
min_dim
){
/* meilleure empreinte localisee sur couche active */
/* meilleure empreinte localisee sur couche active */
module
=
pt_module
;
module
=
pt_module
;
min_dim
=
dist
;
min_dim
=
dist
;
}
}
}
}
...
@@ -370,17 +321,17 @@ Currently in test (currently rasnest algos work only if p1 == p2)
...
@@ -370,17 +321,17 @@ Currently in test (currently rasnest algos work only if p1 == p2)
*/
*/
{
{
#if 0 // Do not change it: does not work
#if 0 // Do not change it: does not work
{
{
int dist;
int dist;
dist = abs(p1.x - p2.x) + abs (p1.y - p2.y);
dist = abs(p1.x - p2.x) + abs (p1.y - p2.y);
dist *= 7;
dist *= 7;
dist /= 10;
dist /= 10;
if ( dist < max_dist ) return true;
if ( dist < max_dist ) return true;
}
}
#else
#else
if
(
p1
==
p2
)
return
true
;
if
(
p1
==
p2
)
return
true
;
#endif
#endif
return
false
;
return
false
;
}
}
/**************************************************************/
/**************************************************************/
...
@@ -392,7 +343,7 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
...
@@ -392,7 +343,7 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
* if extr == START, the starting track segment PtRefSegm is used to locate a connected segment
* if extr == START, the starting track segment PtRefSegm is used to locate a connected segment
* if extr == END, the ending track segment PtRefSegm is used
* if extr == END, the ending track segment PtRefSegm is used
* The test connection consider only end track segments
* The test connection consider only end track segments
*
*
* Search is made from pt_base to pt_lim (in the track linked list)
* Search is made from pt_base to pt_lim (in the track linked list)
* if pt_lim == NULL, the search is made from pt_base to the end of list
* if pt_lim == NULL, the search is made from pt_base to the end of list
*
*
...
@@ -406,12 +357,12 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
...
@@ -406,12 +357,12 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
* @param extr = START or END = end of ref track segment to use in tests
* @param extr = START or END = end of ref track segment to use in tests
*/
*/
{
{
#define NEIGHTBOUR_COUNT_MAX 50
#define NEIGHTBOUR_COUNT_MAX 50
TRACK
*
PtSegmB
,
*
PtSegmN
;
TRACK
*
PtSegmB
,
*
PtSegmN
;
int
Reflayer
;
int
Reflayer
;
wxPoint
pos_ref
;
wxPoint
pos_ref
;
int
ii
;
int
ii
;
int
max_dist
;
int
max_dist
;
if
(
extr
==
START
)
if
(
extr
==
START
)
pos_ref
=
PtRefSegm
->
m_Start
;
pos_ref
=
PtRefSegm
->
m_Start
;
...
@@ -435,8 +386,8 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
...
@@ -435,8 +386,8 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
if
(
PtSegmN
==
PtRefSegm
)
if
(
PtSegmN
==
PtRefSegm
)
goto
suite
;
goto
suite
;
/* max_dist is the max distance between 2 tack ends which ensure a copper continuty */
/* max_dist is the max distance between 2 tack ends which ensure a copper continuty */
max_dist
=
(
PtSegmN
->
m_Width
+
PtRefSegm
->
m_Width
)
/
2
;
max_dist
=
(
PtSegmN
->
m_Width
+
PtRefSegm
->
m_Width
)
/
2
;
if
(
IsPointsAreNear
(
pos_ref
,
PtSegmN
->
m_Start
,
max_dist
)
)
if
(
IsPointsAreNear
(
pos_ref
,
PtSegmN
->
m_Start
,
max_dist
)
)
{
/* Test des couches */
{
/* Test des couches */
...
@@ -463,7 +414,7 @@ suite:
...
@@ -463,7 +414,7 @@ suite:
if
(
PtSegmB
==
PtRefSegm
)
if
(
PtSegmB
==
PtRefSegm
)
goto
suite1
;
goto
suite1
;
max_dist
=
(
PtSegmB
->
m_Width
+
PtRefSegm
->
m_Width
)
/
2
;
max_dist
=
(
PtSegmB
->
m_Width
+
PtRefSegm
->
m_Width
)
/
2
;
if
(
IsPointsAreNear
(
pos_ref
,
PtSegmB
->
m_Start
,
max_dist
)
)
if
(
IsPointsAreNear
(
pos_ref
,
PtSegmB
->
m_Start
,
max_dist
)
)
{
/* Test des couches */
{
/* Test des couches */
...
@@ -503,7 +454,7 @@ suite1:
...
@@ -503,7 +454,7 @@ suite1:
}
}
max_dist
=
(
PtSegmN
->
m_Width
+
PtRefSegm
->
m_Width
)
/
2
;
max_dist
=
(
PtSegmN
->
m_Width
+
PtRefSegm
->
m_Width
)
/
2
;
if
(
IsPointsAreNear
(
pos_ref
,
PtSegmN
->
m_Start
,
max_dist
)
)
if
(
IsPointsAreNear
(
pos_ref
,
PtSegmN
->
m_Start
,
max_dist
)
)
{
/* Test des couches */
{
/* Test des couches */
...
@@ -534,7 +485,7 @@ suite1:
...
@@ -534,7 +485,7 @@ suite1:
* 1 - routine de localisation du segment de piste pointe par la souris.
* 1 - routine de localisation du segment de piste pointe par la souris.
* 2 - routine de localisation du segment de piste pointe par le point
* 2 - routine de localisation du segment de piste pointe par le point
* ref_pos.x , ref_pos.y.r
* ref_pos.x , ref_pos.y.r
*
*
* La recherche commence a l'adresse start_adresse
* La recherche commence a l'adresse start_adresse
*/
*/
...
@@ -552,7 +503,7 @@ TRACK* Locate_Pistes( TRACK* start_adresse, const wxPoint& ref_pos, int MasqueLa
...
@@ -552,7 +503,7 @@ TRACK* Locate_Pistes( TRACK* start_adresse, const wxPoint& ref_pos, int MasqueLa
{
{
if
(
Track
->
GetState
(
BUSY
|
DELETED
)
)
if
(
Track
->
GetState
(
BUSY
|
DELETED
)
)
continue
;
continue
;
if
(
(
g_DesignSettings
.
m_LayerColor
[
Track
->
GetLayer
()]
&
ITEM_NOT_SHOW
)
)
if
(
(
g_DesignSettings
.
m_LayerColor
[
Track
->
GetLayer
()]
&
ITEM_NOT_SHOW
)
)
continue
;
continue
;
...
@@ -566,12 +517,12 @@ TRACK* Locate_Pistes( TRACK* start_adresse, const wxPoint& ref_pos, int MasqueLa
...
@@ -566,12 +517,12 @@ TRACK* Locate_Pistes( TRACK* start_adresse, const wxPoint& ref_pos, int MasqueLa
if
(
MasqueLayer
!=
-
1
)
if
(
MasqueLayer
!=
-
1
)
if
(
(
g_TabOneLayerMask
[
Track
->
GetLayer
()]
&
MasqueLayer
)
==
0
)
if
(
(
g_TabOneLayerMask
[
Track
->
GetLayer
()]
&
MasqueLayer
)
==
0
)
continue
;
/* Segments sur couches differentes */
continue
;
/* Segments sur couches differentes */
if
(
Track
->
HitTest
(
ref_pos
)
)
if
(
Track
->
HitTest
(
ref_pos
)
)
return
Track
;
return
Track
;
}
}
}
}
return
NULL
;
return
NULL
;
}
}
...
@@ -587,9 +538,9 @@ TRACK* Locate_Pistes( TRACK* start_adresse, const wxPoint& ref_pos, int MasqueLa
...
@@ -587,9 +538,9 @@ TRACK* Locate_Pistes( TRACK* start_adresse, const wxPoint& ref_pos, int MasqueLa
* 1 - routine de localisation du segment de zone pointe par la souris.
* 1 - routine de localisation du segment de zone pointe par la souris.
* 2 - routine de localisation du segment de zone pointe par le point
* 2 - routine de localisation du segment de zone pointe par le point
* ref_pos.x , ref_pos.y.r
* ref_pos.x , ref_pos.y.r
*
*
* Si layer == -1 , le tst de la couche n'est pas fait
* Si layer == -1 , le tst de la couche n'est pas fait
*
*
* La recherche commence a l'adresse start_adresse
* La recherche commence a l'adresse start_adresse
*/
*/
TRACK
*
Locate_Zone
(
TRACK
*
start_adresse
,
int
layer
,
int
typeloc
)
TRACK
*
Locate_Zone
(
TRACK
*
start_adresse
,
int
layer
,
int
typeloc
)
...
@@ -606,7 +557,7 @@ TRACK* Locate_Zone( TRACK* start_adresse, const wxPoint& ref_pos, int layer )
...
@@ -606,7 +557,7 @@ TRACK* Locate_Zone( TRACK* start_adresse, const wxPoint& ref_pos, int layer )
{
{
if
(
(
layer
!=
-
1
)
&&
(
Zone
->
GetLayer
()
!=
layer
)
)
if
(
(
layer
!=
-
1
)
&&
(
Zone
->
GetLayer
()
!=
layer
)
)
continue
;
continue
;
if
(
Zone
->
HitTest
(
ref_pos
)
)
if
(
Zone
->
HitTest
(
ref_pos
)
)
return
Zone
;
return
Zone
;
}
}
...
@@ -624,7 +575,7 @@ D_PAD* Fast_Locate_Pad_Connecte( BOARD* Pcb, const wxPoint& ref_pos, int masque_
...
@@ -624,7 +575,7 @@ D_PAD* Fast_Locate_Pad_Connecte( BOARD* Pcb, const wxPoint& ref_pos, int masque_
* sur la couche indiquee par masque_layer (bit a bit)
* sur la couche indiquee par masque_layer (bit a bit)
* ( extremite de piste )
* ( extremite de piste )
* La liste des pads doit deja exister.
* La liste des pads doit deja exister.
*
*
* retourne :
* retourne :
* NULL si pas de pad localise.
* NULL si pas de pad localise.
* pointeur sur la structure descr_pad correspondante si pad trouve
* pointeur sur la structure descr_pad correspondante si pad trouve
...
@@ -673,14 +624,14 @@ TRACK* Fast_Locate_Piste( TRACK* start_adr, TRACK* end_adr,
...
@@ -673,14 +624,14 @@ TRACK* Fast_Locate_Piste( TRACK* start_adr, TRACK* end_adr,
if
(
PtSegm
->
GetState
(
DELETED
|
BUSY
)
==
0
)
if
(
PtSegm
->
GetState
(
DELETED
|
BUSY
)
==
0
)
{
{
if
(
ref_pos
==
PtSegm
->
m_Start
)
if
(
ref_pos
==
PtSegm
->
m_Start
)
{
{
/* Test des couches */
/* Test des couches */
if
(
MaskLayer
&
PtSegm
->
ReturnMaskLayer
()
)
if
(
MaskLayer
&
PtSegm
->
ReturnMaskLayer
()
)
return
PtSegm
;
return
PtSegm
;
}
}
if
(
ref_pos
==
PtSegm
->
m_End
)
if
(
ref_pos
==
PtSegm
->
m_End
)
{
{
/* Test des couches */
/* Test des couches */
if
(
MaskLayer
&
PtSegm
->
ReturnMaskLayer
()
)
if
(
MaskLayer
&
PtSegm
->
ReturnMaskLayer
()
)
return
PtSegm
;
return
PtSegm
;
...
@@ -715,7 +666,7 @@ TRACK* Fast_Locate_Via( TRACK* start_adr, TRACK* end_adr,
...
@@ -715,7 +666,7 @@ TRACK* Fast_Locate_Via( TRACK* start_adr, TRACK* end_adr,
if
(
pos
==
PtSegm
->
m_Start
)
if
(
pos
==
PtSegm
->
m_Start
)
{
{
if
(
PtSegm
->
GetState
(
BUSY
|
DELETED
)
==
0
)
if
(
PtSegm
->
GetState
(
BUSY
|
DELETED
)
==
0
)
{
{
/* Test des couches */
/* Test des couches */
if
(
MaskLayer
&
PtSegm
->
ReturnMaskLayer
()
)
if
(
MaskLayer
&
PtSegm
->
ReturnMaskLayer
()
)
return
PtSegm
;
return
PtSegm
;
...
...
pcbnew/pcbframe.cpp
View file @
10e13ae5
...
@@ -20,33 +20,33 @@
...
@@ -20,33 +20,33 @@
BEGIN_EVENT_TABLE
(
WinEDA_PcbFrame
,
WinEDA_BasePcbFrame
)
BEGIN_EVENT_TABLE
(
WinEDA_PcbFrame
,
WinEDA_BasePcbFrame
)
COMMON_EVENTS_DRAWFRAME
COMMON_EVENTS_DRAWFRAME
EVT_SOCKET
(
ID_EDA_SOCKET_EVENT_SERV
,
WinEDA_PcbFrame
::
OnSockRequestServer
)
EVT_SOCKET
(
ID_EDA_SOCKET_EVENT_SERV
,
WinEDA_PcbFrame
::
OnSockRequestServer
)
EVT_SOCKET
(
ID_EDA_SOCKET_EVENT
,
WinEDA_PcbFrame
::
OnSockRequest
)
EVT_SOCKET
(
ID_EDA_SOCKET_EVENT
,
WinEDA_PcbFrame
::
OnSockRequest
)
EVT_KICAD_CHOICEBOX
(
ID_ON_ZOOM_SELECT
,
WinEDA_PcbFrame
::
OnSelectZoom
)
EVT_KICAD_CHOICEBOX
(
ID_ON_ZOOM_SELECT
,
WinEDA_PcbFrame
::
OnSelectZoom
)
EVT_KICAD_CHOICEBOX
(
ID_ON_GRID_SELECT
,
WinEDA_PcbFrame
::
OnSelectGrid
)
EVT_KICAD_CHOICEBOX
(
ID_ON_GRID_SELECT
,
WinEDA_PcbFrame
::
OnSelectGrid
)
EVT_CLOSE
(
WinEDA_PcbFrame
::
OnCloseWindow
)
EVT_CLOSE
(
WinEDA_PcbFrame
::
OnCloseWindow
)
EVT_SIZE
(
WinEDA_PcbFrame
::
OnSize
)
EVT_SIZE
(
WinEDA_PcbFrame
::
OnSize
)
EVT_TOOL_RANGE
(
ID_ZOOM_IN_BUTT
,
ID_ZOOM_PAGE_BUTT
,
EVT_TOOL_RANGE
(
ID_ZOOM_IN_BUTT
,
ID_ZOOM_PAGE_BUTT
,
WinEDA_PcbFrame
::
Process_Zoom
)
WinEDA_PcbFrame
::
Process_Zoom
)
EVT_TOOL
(
ID_LOAD_FILE
,
WinEDA_PcbFrame
::
Files_io
)
EVT_TOOL
(
ID_LOAD_FILE
,
WinEDA_PcbFrame
::
Files_io
)
EVT_TOOL
(
ID_MENU_READ_LAST_SAVED_VERSION_BOARD
,
WinEDA_PcbFrame
::
Files_io
)
EVT_TOOL
(
ID_MENU_READ_LAST_SAVED_VERSION_BOARD
,
WinEDA_PcbFrame
::
Files_io
)
EVT_TOOL
(
ID_MENU_RECOVER_BOARD
,
WinEDA_PcbFrame
::
Files_io
)
EVT_TOOL
(
ID_MENU_RECOVER_BOARD
,
WinEDA_PcbFrame
::
Files_io
)
EVT_TOOL
(
ID_NEW_BOARD
,
WinEDA_PcbFrame
::
Files_io
)
EVT_TOOL
(
ID_NEW_BOARD
,
WinEDA_PcbFrame
::
Files_io
)
EVT_TOOL
(
ID_SAVE_BOARD
,
WinEDA_PcbFrame
::
Files_io
)
EVT_TOOL
(
ID_SAVE_BOARD
,
WinEDA_PcbFrame
::
Files_io
)
EVT_TOOL
(
ID_OPEN_MODULE_EDITOR
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_TOOL
(
ID_OPEN_MODULE_EDITOR
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_MENU_RANGE
(
ID_PREFERENCES_FONT_INFOSCREEN
,
ID_PREFERENCES_FONT_END
,
EVT_MENU_RANGE
(
ID_PREFERENCES_FONT_INFOSCREEN
,
ID_PREFERENCES_FONT_END
,
WinEDA_DrawFrame
::
ProcessFontPreferences
)
WinEDA_DrawFrame
::
ProcessFontPreferences
)
// Menu Files:
// Menu Files:
EVT_MENU
(
ID_MAIN_MENUBAR
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_MENU
(
ID_MAIN_MENUBAR
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_MENU
(
ID_MENU_LOAD_FILE
,
WinEDA_PcbFrame
::
Files_io
)
EVT_MENU
(
ID_MENU_LOAD_FILE
,
WinEDA_PcbFrame
::
Files_io
)
EVT_MENU
(
ID_MENU_NEW_BOARD
,
WinEDA_PcbFrame
::
Files_io
)
EVT_MENU
(
ID_MENU_NEW_BOARD
,
WinEDA_PcbFrame
::
Files_io
)
EVT_MENU
(
ID_MENU_SAVE_BOARD
,
WinEDA_PcbFrame
::
Files_io
)
EVT_MENU
(
ID_MENU_SAVE_BOARD
,
WinEDA_PcbFrame
::
Files_io
)
...
@@ -55,22 +55,22 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
...
@@ -55,22 +55,22 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
EVT_MENU
(
ID_GEN_PLOT
,
WinEDA_PcbFrame
::
ToPlotter
)
EVT_MENU
(
ID_GEN_PLOT
,
WinEDA_PcbFrame
::
ToPlotter
)
EVT_MENU_RANGE
(
ID_LOAD_FILE_1
,
ID_LOAD_FILE_10
,
EVT_MENU_RANGE
(
ID_LOAD_FILE_1
,
ID_LOAD_FILE_10
,
WinEDA_PcbFrame
::
Files_io
)
WinEDA_PcbFrame
::
Files_io
)
EVT_MENU
(
ID_GEN_EXPORT_SPECCTRA
,
WinEDA_PcbFrame
::
ExportToSpecctra
)
EVT_MENU
(
ID_GEN_EXPORT_SPECCTRA
,
WinEDA_PcbFrame
::
ExportToSpecctra
)
EVT_MENU
(
ID_GEN_EXPORT_FILE_GENCADFORMAT
,
WinEDA_PcbFrame
::
ExportToGenCAD
)
EVT_MENU
(
ID_GEN_EXPORT_FILE_GENCADFORMAT
,
WinEDA_PcbFrame
::
ExportToGenCAD
)
EVT_MENU
(
ID_GEN_EXPORT_FILE_MODULE_REPORT
,
WinEDA_PcbFrame
::
GenModuleReport
)
EVT_MENU
(
ID_GEN_EXPORT_FILE_MODULE_REPORT
,
WinEDA_PcbFrame
::
GenModuleReport
)
EVT_MENU
(
ID_GEN_IMPORT_SPECCTRA_SESSION
,
WinEDA_PcbFrame
::
ImportSpecctraSession
)
EVT_MENU
(
ID_GEN_IMPORT_SPECCTRA_SESSION
,
WinEDA_PcbFrame
::
ImportSpecctraSession
)
EVT_MENU
(
ID_GEN_IMPORT_SPECCTRA_DESIGN
,
WinEDA_PcbFrame
::
ImportSpecctraDesign
)
EVT_MENU
(
ID_GEN_IMPORT_SPECCTRA_DESIGN
,
WinEDA_PcbFrame
::
ImportSpecctraDesign
)
EVT_MENU
(
ID_MENU_ARCHIVE_NEW_MODULES
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_MENU
(
ID_MENU_ARCHIVE_NEW_MODULES
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_MENU
(
ID_MENU_ARCHIVE_ALL_MODULES
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_MENU
(
ID_MENU_ARCHIVE_ALL_MODULES
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_MENU
(
ID_EXIT
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_MENU
(
ID_EXIT
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
// menu Config
// menu Config
EVT_MENU_RANGE
(
ID_CONFIG_AND_PREFERENCES_START
,
ID_CONFIG_AND_PREFERENCES_END
,
EVT_MENU_RANGE
(
ID_CONFIG_AND_PREFERENCES_START
,
ID_CONFIG_AND_PREFERENCES_END
,
WinEDA_PcbFrame
::
Process_Config
)
WinEDA_PcbFrame
::
Process_Config
)
EVT_MENU
(
ID_COLORS_SETUP
,
WinEDA_PcbFrame
::
Process_Config
)
EVT_MENU
(
ID_COLORS_SETUP
,
WinEDA_PcbFrame
::
Process_Config
)
EVT_MENU
(
ID_OPTIONS_SETUP
,
WinEDA_PcbFrame
::
Process_Config
)
EVT_MENU
(
ID_OPTIONS_SETUP
,
WinEDA_PcbFrame
::
Process_Config
)
...
@@ -81,29 +81,29 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
...
@@ -81,29 +81,29 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
EVT_MENU
(
ID_CONFIG_SAVE
,
WinEDA_PcbFrame
::
Process_Config
)
EVT_MENU
(
ID_CONFIG_SAVE
,
WinEDA_PcbFrame
::
Process_Config
)
EVT_MENU
(
ID_CONFIG_READ
,
WinEDA_PcbFrame
::
Process_Config
)
EVT_MENU
(
ID_CONFIG_READ
,
WinEDA_PcbFrame
::
Process_Config
)
EVT_MENU
(
ID_PCB_USER_GRID_SETUP
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_MENU
(
ID_PCB_USER_GRID_SETUP
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_MENU_RANGE
(
ID_LANGUAGE_CHOICE
,
ID_LANGUAGE_CHOICE_END
,
EVT_MENU_RANGE
(
ID_LANGUAGE_CHOICE
,
ID_LANGUAGE_CHOICE_END
,
WinEDA_DrawFrame
::
SetLanguage
)
WinEDA_DrawFrame
::
SetLanguage
)
// menu Postprocess
// menu Postprocess
EVT_MENU
(
ID_PCB_GEN_POS_MODULES_FILE
,
WinEDA_PcbFrame
::
GenModulesPosition
)
EVT_MENU
(
ID_PCB_GEN_POS_MODULES_FILE
,
WinEDA_PcbFrame
::
GenModulesPosition
)
EVT_MENU
(
ID_PCB_GEN_DRILL_FILE
,
WinEDA_PcbFrame
::
InstallDrillFrame
)
EVT_MENU
(
ID_PCB_GEN_DRILL_FILE
,
WinEDA_PcbFrame
::
InstallDrillFrame
)
EVT_MENU
(
ID_PCB_GEN_CMP_FILE
,
WinEDA_PcbFrame
::
Files_io
)
EVT_MENU
(
ID_PCB_GEN_CMP_FILE
,
WinEDA_PcbFrame
::
Files_io
)
// menu Miscellaneous
// menu Miscellaneous
EVT_MENU
(
ID_MENU_LIST_NETS
,
WinEDA_PcbFrame
::
Liste_Equipot
)
EVT_MENU
(
ID_MENU_LIST_NETS
,
WinEDA_PcbFrame
::
Liste_Equipot
)
EVT_MENU
(
ID_PCB_GLOBAL_DELETE
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_MENU
(
ID_PCB_GLOBAL_DELETE
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_MENU
(
ID_MENU_PCB_CLEAN
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_MENU
(
ID_MENU_PCB_CLEAN
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_MENU
(
ID_MENU_PCB_SWAP_LAYERS
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_MENU
(
ID_MENU_PCB_SWAP_LAYERS
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
// Menu Help
// Menu Help
EVT_MENU
(
ID_GENERAL_HELP
,
WinEDA_DrawFrame
::
GetKicadHelp
)
EVT_MENU
(
ID_GENERAL_HELP
,
WinEDA_DrawFrame
::
GetKicadHelp
)
EVT_MENU
(
ID_KICAD_ABOUT
,
WinEDA_DrawFrame
::
GetKicadAbout
)
EVT_MENU
(
ID_KICAD_ABOUT
,
WinEDA_DrawFrame
::
GetKicadAbout
)
// Menu 3D Frame
// Menu 3D Frame
EVT_MENU
(
ID_MENU_PCB_SHOW_3D_FRAME
,
WinEDA_PcbFrame
::
Show3D_Frame
)
EVT_MENU
(
ID_MENU_PCB_SHOW_3D_FRAME
,
WinEDA_PcbFrame
::
Show3D_Frame
)
// Horizontal toolbar
// Horizontal toolbar
EVT_TOOL
(
ID_TO_LIBRARY
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_TOOL
(
ID_TO_LIBRARY
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_TOOL
(
ID_SHEET_SET
,
WinEDA_DrawFrame
::
Process_PageSettings
)
EVT_TOOL
(
ID_SHEET_SET
,
WinEDA_DrawFrame
::
Process_PageSettings
)
...
@@ -126,11 +126,11 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
...
@@ -126,11 +126,11 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
WinEDA_PcbFrame
::
Process_Special_Functions
)
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_TOOL
(
ID_TOOLBARH_PCB_AUTOPLACE
,
WinEDA_PcbFrame
::
AutoPlace
)
EVT_TOOL
(
ID_TOOLBARH_PCB_AUTOPLACE
,
WinEDA_PcbFrame
::
AutoPlace
)
EVT_TOOL
(
ID_TOOLBARH_PCB_AUTOROUTE
,
WinEDA_PcbFrame
::
AutoPlace
)
EVT_TOOL
(
ID_TOOLBARH_PCB_AUTOROUTE
,
WinEDA_PcbFrame
::
AutoPlace
)
// Option toolbar
// Option toolbar
EVT_TOOL_RANGE
(
ID_TB_OPTIONS_START
,
ID_TB_OPTIONS_END
,
EVT_TOOL_RANGE
(
ID_TB_OPTIONS_START
,
ID_TB_OPTIONS_END
,
WinEDA_PcbFrame
::
OnSelectOptionToolbar
)
WinEDA_PcbFrame
::
OnSelectOptionToolbar
)
// Vertical toolbar:
// Vertical toolbar:
EVT_TOOL
(
ID_NO_SELECT_BUTT
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_TOOL
(
ID_NO_SELECT_BUTT
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_TOOL
(
ID_PCB_HIGHLIGHT_BUTT
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_TOOL
(
ID_PCB_HIGHLIGHT_BUTT
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
...
@@ -146,24 +146,24 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
...
@@ -146,24 +146,24 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
EVT_TOOL
(
ID_PCB_DELETE_ITEM_BUTT
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_TOOL
(
ID_PCB_DELETE_ITEM_BUTT
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_TOOL
(
ID_PCB_SHOW_1_RATSNEST_BUTT
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_TOOL
(
ID_PCB_SHOW_1_RATSNEST_BUTT
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_TOOL
(
ID_PCB_PLACE_OFFSET_COORD_BUTT
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_TOOL
(
ID_PCB_PLACE_OFFSET_COORD_BUTT
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
EVT_TOOL_RANGE
(
ID_PCB_MUWAVE_START_CMD
,
ID_PCB_MUWAVE_END_CMD
,
EVT_TOOL_RANGE
(
ID_PCB_MUWAVE_START_CMD
,
ID_PCB_MUWAVE_END_CMD
,
WinEDA_PcbFrame
::
ProcessMuWaveFunctions
)
WinEDA_PcbFrame
::
ProcessMuWaveFunctions
)
EVT_TOOL_RCLICKED
(
ID_TRACK_BUTT
,
WinEDA_PcbFrame
::
ToolOnRightClick
)
EVT_TOOL_RCLICKED
(
ID_TRACK_BUTT
,
WinEDA_PcbFrame
::
ToolOnRightClick
)
EVT_TOOL_RCLICKED
(
ID_PCB_CIRCLE_BUTT
,
WinEDA_PcbFrame
::
ToolOnRightClick
)
EVT_TOOL_RCLICKED
(
ID_PCB_CIRCLE_BUTT
,
WinEDA_PcbFrame
::
ToolOnRightClick
)
EVT_TOOL_RCLICKED
(
ID_PCB_ARC_BUTT
,
WinEDA_PcbFrame
::
ToolOnRightClick
)
EVT_TOOL_RCLICKED
(
ID_PCB_ARC_BUTT
,
WinEDA_PcbFrame
::
ToolOnRightClick
)
EVT_TOOL_RCLICKED
(
ID_TEXT_COMMENT_BUTT
,
WinEDA_PcbFrame
::
ToolOnRightClick
)
EVT_TOOL_RCLICKED
(
ID_TEXT_COMMENT_BUTT
,
WinEDA_PcbFrame
::
ToolOnRightClick
)
EVT_TOOL_RCLICKED
(
ID_LINE_COMMENT_BUTT
,
WinEDA_PcbFrame
::
ToolOnRightClick
)
EVT_TOOL_RCLICKED
(
ID_LINE_COMMENT_BUTT
,
WinEDA_PcbFrame
::
ToolOnRightClick
)
EVT_TOOL_RCLICKED
(
ID_PCB_COTATION_BUTT
,
WinEDA_PcbFrame
::
ToolOnRightClick
)
EVT_TOOL_RCLICKED
(
ID_PCB_COTATION_BUTT
,
WinEDA_PcbFrame
::
ToolOnRightClick
)
EVT_MENU_RANGE
(
ID_POPUP_PCB_AUTOPLACE_START_RANGE
,
EVT_MENU_RANGE
(
ID_POPUP_PCB_AUTOPLACE_START_RANGE
,
ID_POPUP_PCB_AUTOPLACE_END_RANGE
,
ID_POPUP_PCB_AUTOPLACE_END_RANGE
,
WinEDA_PcbFrame
::
AutoPlace
)
WinEDA_PcbFrame
::
AutoPlace
)
EVT_MENU_RANGE
(
ID_POPUP_PCB_START_RANGE
,
ID_POPUP_PCB_END_RANGE
,
EVT_MENU_RANGE
(
ID_POPUP_PCB_START_RANGE
,
ID_POPUP_PCB_END_RANGE
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
WinEDA_PcbFrame
::
Process_Special_Functions
)
// Annulation de commande en cours
// Annulation de commande en cours
EVT_MENU_RANGE
(
ID_POPUP_GENERAL_START_RANGE
,
ID_POPUP_GENERAL_END_RANGE
,
EVT_MENU_RANGE
(
ID_POPUP_GENERAL_START_RANGE
,
ID_POPUP_GENERAL_END_RANGE
,
WinEDA_PcbFrame
::
Process_Special_Functions
)
WinEDA_PcbFrame
::
Process_Special_Functions
)
...
@@ -183,7 +183,7 @@ END_EVENT_TABLE()
...
@@ -183,7 +183,7 @@ END_EVENT_TABLE()
WinEDA_PcbFrame
::
WinEDA_PcbFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
WinEDA_PcbFrame
::
WinEDA_PcbFrame
(
wxWindow
*
father
,
WinEDA_App
*
parent
,
const
wxString
&
title
,
const
wxString
&
title
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
const
wxPoint
&
pos
,
const
wxSize
&
size
,
long
style
)
:
long
style
)
:
WinEDA_BasePcbFrame
(
father
,
parent
,
PCB_FRAME
,
title
,
pos
,
size
,
style
)
WinEDA_BasePcbFrame
(
father
,
parent
,
PCB_FRAME
,
title
,
pos
,
size
,
style
)
{
{
m_FrameName
=
wxT
(
"PcbFrame"
);
m_FrameName
=
wxT
(
"PcbFrame"
);
...
@@ -200,7 +200,9 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent,
...
@@ -200,7 +200,9 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent,
m_SelViaSizeBox_Changed
=
FALSE
;
m_SelViaSizeBox_Changed
=
FALSE
;
m_drc
=
new
DRC
(
this
);
// these 2 objects point to each other
m_drc
=
new
DRC
(
this
);
// these 2 objects point to each other
SetBOARD
(
new
BOARD
(
NULL
,
this
)
);
m_DisplayPcbTrackFill
=
DisplayOpt
.
DisplayPcbTrackFill
;
m_DisplayPcbTrackFill
=
DisplayOpt
.
DisplayPcbTrackFill
;
m_DisplayPadFill
=
DisplayOpt
.
DisplayPadFill
;
m_DisplayPadFill
=
DisplayOpt
.
DisplayPadFill
;
m_DisplayPadNum
=
DisplayOpt
.
DisplayPadNum
;
m_DisplayPadNum
=
DisplayOpt
.
DisplayPadNum
;
...
@@ -221,7 +223,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent,
...
@@ -221,7 +223,7 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father, WinEDA_App* parent,
if
(
m_Parent
&&
m_Parent
->
m_EDA_Config
)
if
(
m_Parent
&&
m_Parent
->
m_EDA_Config
)
{
{
long
SizeX
,
SizeY
;
long
SizeX
,
SizeY
;
if
(
m_Parent
->
m_EDA_Config
->
Read
(
wxT
(
"PcbEditGrid_X"
),
&
SizeX
)
if
(
m_Parent
->
m_EDA_Config
->
Read
(
wxT
(
"PcbEditGrid_X"
),
&
SizeX
)
&&
m_Parent
->
m_EDA_Config
->
Read
(
wxT
(
"PcbEditGrid_Y"
),
&
SizeY
)
)
&&
m_Parent
->
m_EDA_Config
->
Read
(
wxT
(
"PcbEditGrid_Y"
),
&
SizeY
)
)
{
{
...
@@ -247,6 +249,7 @@ WinEDA_PcbFrame::~WinEDA_PcbFrame()
...
@@ -247,6 +249,7 @@ WinEDA_PcbFrame::~WinEDA_PcbFrame()
m_Parent
->
m_PcbFrame
=
NULL
;
m_Parent
->
m_PcbFrame
=
NULL
;
m_CurrentScreen
=
ScreenPcb
;
m_CurrentScreen
=
ScreenPcb
;
delete
m_drc
;
delete
m_drc
;
delete
m_Pcb
;
}
}
...
@@ -382,7 +385,7 @@ void WinEDA_PcbFrame::SetToolbars()
...
@@ -382,7 +385,7 @@ void WinEDA_PcbFrame::SetToolbars()
DisplayOpt
.
DisplayPolarCood
);
DisplayOpt
.
DisplayPolarCood
);
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_POLAR_COORD
,
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_POLAR_COORD
,
DisplayOpt
.
DisplayPolarCood
?
DisplayOpt
.
DisplayPolarCood
?
_
(
"Polar Coords not show"
)
:
_
(
"Polar Coords not show"
)
:
_
(
"Display Polar Coords"
)
);
_
(
"Display Polar Coords"
)
);
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_GRID
,
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_GRID
,
...
@@ -396,27 +399,27 @@ void WinEDA_PcbFrame::SetToolbars()
...
@@ -396,27 +399,27 @@ void WinEDA_PcbFrame::SetToolbars()
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_RATSNEST
,
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_RATSNEST
,
g_Show_Ratsnest
);
g_Show_Ratsnest
);
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_RATSNEST
,
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_RATSNEST
,
g_Show_Ratsnest
?
g_Show_Ratsnest
?
_
(
"General ratsnest not show"
)
:
_
(
"Show General ratsnest"
)
);
_
(
"General ratsnest not show"
)
:
_
(
"Show General ratsnest"
)
);
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_MODULE_RATSNEST
,
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_MODULE_RATSNEST
,
g_Show_Module_Ratsnest
);
g_Show_Module_Ratsnest
);
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_MODULE_RATSNEST
,
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_MODULE_RATSNEST
,
g_Show_Module_Ratsnest
?
g_Show_Module_Ratsnest
?
_
(
"Module ratsnest not show"
)
:
_
(
"Module ratsnest not show"
)
:
_
(
"Show Module ratsnest"
)
);
_
(
"Show Module ratsnest"
)
);
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_AUTO_DEL_TRACK
,
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_AUTO_DEL_TRACK
,
g_AutoDeleteOldTrack
);
g_AutoDeleteOldTrack
);
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_AUTO_DEL_TRACK
,
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_AUTO_DEL_TRACK
,
g_AutoDeleteOldTrack
?
g_AutoDeleteOldTrack
?
_
(
"Disable Auto Delete old Track"
)
:
_
(
"Disable Auto Delete old Track"
)
:
_
(
"Enable Auto Delete old Track"
)
);
_
(
"Enable Auto Delete old Track"
)
);
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_ZONES
,
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_ZONES
,
DisplayOpt
.
DisplayZones
);
DisplayOpt
.
DisplayZones
);
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_ZONES
,
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_ZONES
,
DisplayOpt
.
DisplayZones
?
DisplayOpt
.
DisplayZones
?
_
(
"Do not Show Zones"
)
:
_
(
"Show Zones"
)
);
_
(
"Do not Show Zones"
)
:
_
(
"Show Zones"
)
);
...
@@ -431,7 +434,7 @@ void WinEDA_PcbFrame::SetToolbars()
...
@@ -431,7 +434,7 @@ void WinEDA_PcbFrame::SetToolbars()
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_TRACKS_SKETCH
,
m_OptionsToolBar
->
ToggleTool
(
ID_TB_OPTIONS_SHOW_TRACKS_SKETCH
,
!
m_DisplayPcbTrackFill
);
!
m_DisplayPcbTrackFill
);
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_TRACKS_SKETCH
,
m_OptionsToolBar
->
SetToolShortHelp
(
ID_TB_OPTIONS_SHOW_TRACKS_SKETCH
,
m_DisplayPcbTrackFill
?
m_DisplayPcbTrackFill
?
_
(
"Show Tracks Sketch mode"
)
:
_
(
"Show Tracks Sketch mode"
)
:
_
(
"Show Tracks filled mode"
)
);
_
(
"Show Tracks filled mode"
)
);
...
@@ -453,12 +456,12 @@ void WinEDA_PcbFrame::SetToolbars()
...
@@ -453,12 +456,12 @@ void WinEDA_PcbFrame::SetToolbars()
m_SelTrackWidthBox_Changed
=
FALSE
;
m_SelTrackWidthBox_Changed
=
FALSE
;
m_SelTrackWidthBox
->
Clear
();
m_SelTrackWidthBox
->
Clear
();
wxString
format
=
_
(
"Track"
);
wxString
format
=
_
(
"Track"
);
if
(
g_UnitMetric
==
INCHES
)
if
(
g_UnitMetric
==
INCHES
)
format
+=
wxT
(
" %.1f"
);
format
+=
wxT
(
" %.1f"
);
else
else
format
+=
wxT
(
" %.3f"
);
format
+=
wxT
(
" %.3f"
);
for
(
ii
=
0
;
ii
<
HISTORY_NUMBER
;
ii
++
)
for
(
ii
=
0
;
ii
<
HISTORY_NUMBER
;
ii
++
)
{
{
if
(
g_DesignSettings
.
m_TrackWidthHistory
[
ii
]
==
0
)
if
(
g_DesignSettings
.
m_TrackWidthHistory
[
ii
]
==
0
)
...
@@ -471,9 +474,9 @@ void WinEDA_PcbFrame::SetToolbars()
...
@@ -471,9 +474,9 @@ void WinEDA_PcbFrame::SetToolbars()
msg
.
Printf
(
format
.
GetData
(),
value
*
1000
);
msg
.
Printf
(
format
.
GetData
(),
value
*
1000
);
else
else
msg
.
Printf
(
format
.
GetData
(),
value
);
msg
.
Printf
(
format
.
GetData
(),
value
);
m_SelTrackWidthBox
->
Append
(
msg
);
m_SelTrackWidthBox
->
Append
(
msg
);
if
(
g_DesignSettings
.
m_TrackWidthHistory
[
ii
]
==
if
(
g_DesignSettings
.
m_TrackWidthHistory
[
ii
]
==
g_DesignSettings
.
m_CurrentTrackWidth
)
g_DesignSettings
.
m_CurrentTrackWidth
)
m_SelTrackWidthBox
->
SetSelection
(
ii
);
m_SelTrackWidthBox
->
SetSelection
(
ii
);
...
@@ -485,17 +488,17 @@ void WinEDA_PcbFrame::SetToolbars()
...
@@ -485,17 +488,17 @@ void WinEDA_PcbFrame::SetToolbars()
m_SelViaSizeBox_Changed
=
FALSE
;
m_SelViaSizeBox_Changed
=
FALSE
;
m_SelViaSizeBox
->
Clear
();
m_SelViaSizeBox
->
Clear
();
wxString
format
=
_
(
"Via"
);
wxString
format
=
_
(
"Via"
);
if
(
g_UnitMetric
==
INCHES
)
if
(
g_UnitMetric
==
INCHES
)
format
+=
wxT
(
" %.1f"
);
format
+=
wxT
(
" %.1f"
);
else
else
format
+=
wxT
(
" %.3f"
);
format
+=
wxT
(
" %.3f"
);
for
(
ii
=
0
;
ii
<
HISTORY_NUMBER
;
ii
++
)
for
(
ii
=
0
;
ii
<
HISTORY_NUMBER
;
ii
++
)
{
{
if
(
g_DesignSettings
.
m_ViaSizeHistory
[
ii
]
==
0
)
if
(
g_DesignSettings
.
m_ViaSizeHistory
[
ii
]
==
0
)
break
;
// Fin de liste
break
;
// Fin de liste
double
value
=
To_User_Unit
(
g_UnitMetric
,
double
value
=
To_User_Unit
(
g_UnitMetric
,
g_DesignSettings
.
m_ViaSizeHistory
[
ii
],
g_DesignSettings
.
m_ViaSizeHistory
[
ii
],
PCB_INTERNAL_UNIT
);
PCB_INTERNAL_UNIT
);
...
@@ -504,7 +507,7 @@ void WinEDA_PcbFrame::SetToolbars()
...
@@ -504,7 +507,7 @@ void WinEDA_PcbFrame::SetToolbars()
msg
.
Printf
(
format
.
GetData
(),
value
*
1000
);
msg
.
Printf
(
format
.
GetData
(),
value
*
1000
);
else
else
msg
.
Printf
(
format
.
GetData
(),
value
);
msg
.
Printf
(
format
.
GetData
(),
value
);
m_SelViaSizeBox
->
Append
(
msg
);
m_SelViaSizeBox
->
Append
(
msg
);
if
(
g_DesignSettings
.
m_ViaSizeHistory
[
ii
]
==
g_DesignSettings
.
m_CurrentViaSize
)
if
(
g_DesignSettings
.
m_ViaSizeHistory
[
ii
]
==
g_DesignSettings
.
m_CurrentViaSize
)
m_SelViaSizeBox
->
SetSelection
(
ii
);
m_SelViaSizeBox
->
SetSelection
(
ii
);
...
@@ -516,7 +519,7 @@ void WinEDA_PcbFrame::SetToolbars()
...
@@ -516,7 +519,7 @@ void WinEDA_PcbFrame::SetToolbars()
int
old_choice
=
m_SelZoomBox
->
GetChoice
();
int
old_choice
=
m_SelZoomBox
->
GetChoice
();
int
new_choice
=
1
;
int
new_choice
=
1
;
int
zoom
;
int
zoom
;
for
(
jj
=
1
,
zoom
=
1
;
zoom
<=
m_ZoomMaxValue
;
zoom
<<=
1
,
jj
++
)
for
(
jj
=
1
,
zoom
=
1
;
zoom
<=
m_ZoomMaxValue
;
zoom
<<=
1
,
jj
++
)
{
{
if
(
m_CurrentScreen
&&
(
m_CurrentScreen
->
GetZoom
()
==
zoom
)
)
if
(
m_CurrentScreen
&&
(
m_CurrentScreen
->
GetZoom
()
==
zoom
)
)
...
@@ -531,7 +534,7 @@ void WinEDA_PcbFrame::SetToolbars()
...
@@ -531,7 +534,7 @@ void WinEDA_PcbFrame::SetToolbars()
if
(
m_SelGridBox
&&
m_CurrentScreen
)
if
(
m_SelGridBox
&&
m_CurrentScreen
)
{
{
int
kk
=
m_SelGridBox
->
GetChoice
();
int
kk
=
m_SelGridBox
->
GetChoice
();
for
(
ii
=
0
;
g_GridList
[
ii
].
x
>
0
;
ii
++
)
for
(
ii
=
0
;
g_GridList
[
ii
].
x
>
0
;
ii
++
)
{
{
if
(
!
m_CurrentScreen
->
m_UserGridIsON
if
(
!
m_CurrentScreen
->
m_UserGridIsON
...
...
pcbnew/pcbnew.cpp
View file @
10e13ae5
...
@@ -75,7 +75,6 @@ bool WinEDA_App::OnInit()
...
@@ -75,7 +75,6 @@ bool WinEDA_App::OnInit()
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
);
SetTopWindow
(
m_PcbFrame
);
SetTopWindow
(
m_PcbFrame
);
m_PcbFrame
->
Show
(
TRUE
);
m_PcbFrame
->
Show
(
TRUE
);
...
...
pcbnew/pcbplot.cpp
View file @
10e13ae5
/***********************/
/***********************/
/* fichier pcbplot.cpp */
/* fichier pcbplot.cpp */
/***********************/
/***********************/
#include "fctsys.h"
#include "fctsys.h"
#include "gr_basic.h"
#include "gr_basic.h"
...
@@ -14,101 +14,101 @@
...
@@ -14,101 +14,101 @@
#include "protos.h"
#include "protos.h"
#define PLOT_DEFAULT_MARGE 300
// mils
#define PLOT_DEFAULT_MARGE 300
// mils
/* Keywords to r/w options in config */
/* Keywords to r/w options in config */
#define EDGELAYER_GERBER_OPT_KEY wxT(
"EdgeLayerGerberOpt"
)
#define EDGELAYER_GERBER_OPT_KEY wxT(
"EdgeLayerGerberOpt"
)
#define PLOT_XFINESCALE_ADJ_KEY
wxT("PlotXFineScaleAdj"
)
#define PLOT_XFINESCALE_ADJ_KEY
wxT( "PlotXFineScaleAdj"
)
#define PLOT_YFINESCALE_ADJ_KEY
wxT("PlotYFineScaleAdj"
)
#define PLOT_YFINESCALE_ADJ_KEY
wxT( "PlotYFineScaleAdj"
)
// variables locale :
// variables locale :
static
long
s_SelectedLayers
=
CUIVRE_LAYER
|
CMP_LAYER
|
static
long
s_SelectedLayers
=
CUIVRE_LAYER
|
CMP_LAYER
|
SILKSCREEN_LAYER_CMP
|
SILKSCREEN_LAYER_CU
;
SILKSCREEN_LAYER_CMP
|
SILKSCREEN_LAYER_CU
;
static
bool
s_PlotOriginIsAuxAxis
=
FALSE
;
static
bool
s_PlotOriginIsAuxAxis
=
FALSE
;
// Routines Locales
// Routines Locales
enum
id_plotps
enum
id_plotps
{
{
ID_CLOSE_PLOT
=
8020
,
ID_CLOSE_PLOT
=
8020
,
ID_DRILL_SHAPE_OPT
,
ID_DRILL_SHAPE_OPT
,
ID_SCALE_OPT
,
ID_SCALE_OPT
,
ID_ROTATE_OPT
,
ID_ROTATE_OPT
,
ID_MIROR_OPT
,
ID_MIROR_OPT
,
ID_EXEC_PLOT
,
ID_EXEC_PLOT
,
ID_PLOT_MODE_OPT
,
ID_PLOT_MODE_OPT
,
ID_MASKVIA_OPT
,
ID_MASKVIA_OPT
,
ID_PLOT_CENTRE_OPT
,
ID_PLOT_CENTRE_OPT
,
ID_SEL_PLOT_FORMAT
,
ID_SEL_PLOT_FORMAT
,
ID_SEL_GERBER_FORMAT
,
ID_SEL_GERBER_FORMAT
,
ID_SAVE_OPT_PLOT
,
ID_SAVE_OPT_PLOT
,
ID_EXCLUDE_EDGES_PCB
,
ID_EXCLUDE_EDGES_PCB
,
ID_PRINT_REF
,
ID_PRINT_REF
,
ID_PRINT_VALUE
,
ID_PRINT_VALUE
,
ID_PRINT_MODULE_TEXTS
,
ID_PRINT_MODULE_TEXTS
,
ID_FORCE_PRINT_INVISIBLE_TEXT
,
ID_FORCE_PRINT_INVISIBLE_TEXT
,
ID_PRINT_PAD_ON_SILKSCREEN
,
ID_PRINT_PAD_ON_SILKSCREEN
,
ID_FORCE_PRINT_PAD
,
ID_FORCE_PRINT_PAD
,
ID_CREATE_DRILL_FILE
,
ID_CREATE_DRILL_FILE
,
ID_SEL_PLOT_OFFSET_OPTION
ID_SEL_PLOT_OFFSET_OPTION
};
};
/*******************************/
/*******************************/
/* Dialog box for plot control */
/* Dialog box for plot control */
/*******************************/
/*******************************/
class
WinEDA_PlotFrame
:
public
wxDialog
class
WinEDA_PlotFrame
:
public
wxDialog
{
{
public
:
public
:
WinEDA_BasePcbFrame
*
m_Parent
;
WinEDA_BasePcbFrame
*
m_Parent
;
wxButton
*
m_MergePlotButton
;
wxButton
*
m_MergePlotButton
;
wxCheckBox
*
m_BoxSelecLayer
[
32
];
wxCheckBox
*
m_BoxSelecLayer
[
32
];
wxRadioBox
*
m_PlotFormatOpt
;
wxRadioBox
*
m_PlotFormatOpt
;
wxRadioBox
*
m_Choice_Plot_Offset
;
wxRadioBox
*
m_Choice_Plot_Offset
;
wxRadioBox
*
m_Drill_Shape_Opt
;
wxRadioBox
*
m_Drill_Shape_Opt
;
wxRadioBox
*
m_Scale_Opt
;
wxRadioBox
*
m_Scale_Opt
;
wxRadioBox
*
m_PlotModeOpt
;
wxRadioBox
*
m_PlotModeOpt
;
wxCheckBox
*
m_PlotMirorOpt
;
wxCheckBox
*
m_PlotMirorOpt
;
wxCheckBox
*
m_PlotNoViaOnMaskOpt
;
wxCheckBox
*
m_PlotNoViaOnMaskOpt
;
wxCheckBox
*
m_HPGL_PlotCenter_Opt
;
wxCheckBox
*
m_HPGL_PlotCenter_Opt
;
wxCheckBox
*
m_Exclude_Edges_Pcb
;
wxCheckBox
*
m_Exclude_Edges_Pcb
;
wxCheckBox
*
m_Plot_Sheet_Ref
;
wxCheckBox
*
m_Plot_Sheet_Ref
;
wxCheckBox
*
m_Plot_Invisible_Text
;
wxCheckBox
*
m_Plot_Invisible_Text
;
wxCheckBox
*
m_Plot_Text_Value
;
wxCheckBox
*
m_Plot_Text_Value
;
wxCheckBox
*
m_Plot_Text_Ref
;
wxCheckBox
*
m_Plot_Text_Ref
;
wxCheckBox
*
m_Plot_Text_Div
;
wxCheckBox
*
m_Plot_Text_Div
;
wxCheckBox
*
m_Plot_Pads_on_Silkscreen
;
wxCheckBox
*
m_Plot_Pads_on_Silkscreen
;
wxCheckBox
*
m_Force_Plot_Pads
;
wxCheckBox
*
m_Force_Plot_Pads
;
wxCheckBox
*
m_Plot_PS_Negative
;
wxCheckBox
*
m_Plot_PS_Negative
;
WinEDA_ValueCtrl
*
m_GerbSpotSizeMinOpt
;
WinEDA_ValueCtrl
*
m_GerbSpotSizeMinOpt
;
WinEDA_ValueCtrl
*
m_LinesWidth
;
WinEDA_ValueCtrl
*
m_LinesWidth
;
WinEDA_ValueCtrl
*
m_HPGLPenSizeOpt
;
WinEDA_ValueCtrl
*
m_HPGLPenSizeOpt
;
WinEDA_ValueCtrl
*
m_HPGLPenSpeedOpt
;
WinEDA_ValueCtrl
*
m_HPGLPenSpeedOpt
;
WinEDA_ValueCtrl
*
m_HPGLPenOverlayOpt
;
WinEDA_ValueCtrl
*
m_HPGLPenOverlayOpt
;
WinEDA_DFloatValueCtrl
*
m_FineAdjustXscaleOpt
,
*
m_FineAdjustYscaleOpt
;
WinEDA_DFloatValueCtrl
*
m_FineAdjustXscaleOpt
,
*
m_FineAdjustYscaleOpt
;
double
m_XScaleAdjust
,
m_YScaleAdjust
;
double
m_XScaleAdjust
,
m_YScaleAdjust
;
int
m_PlotFormat
;
int
m_PlotFormat
;
public
:
public
:
WinEDA_PlotFrame
(
WinEDA_BasePcbFrame
*
parent
);
WinEDA_PlotFrame
(
WinEDA_BasePcbFrame
*
parent
);
private
:
private
:
void
Plot
(
wxCommandEvent
&
event
);
void
Plot
(
wxCommandEvent
&
event
);
void
OnQuit
(
wxCommandEvent
&
event
);
void
OnQuit
(
wxCommandEvent
&
event
);
void
OnClose
(
wxCloseEvent
&
event
);
void
OnClose
(
wxCloseEvent
&
event
);
void
SetCommands
(
wxCommandEvent
&
event
);
void
SetCommands
(
wxCommandEvent
&
event
);
void
SaveOptPlot
(
wxCommandEvent
&
event
);
void
SaveOptPlot
(
wxCommandEvent
&
event
);
void
CreateDrillFile
(
wxCommandEvent
&
event
);
void
CreateDrillFile
(
wxCommandEvent
&
event
);
DECLARE_EVENT_TABLE
()
DECLARE_EVENT_TABLE
()
};
};
BEGIN_EVENT_TABLE
(
WinEDA_PlotFrame
,
wxDialog
)
BEGIN_EVENT_TABLE
(
WinEDA_PlotFrame
,
wxDialog
)
EVT_CLOSE
(
WinEDA_PlotFrame
::
OnClose
)
EVT_CLOSE
(
WinEDA_PlotFrame
::
OnClose
)
EVT_BUTTON
(
ID_CLOSE_PLOT
,
WinEDA_PlotFrame
::
OnQuit
)
EVT_BUTTON
(
ID_CLOSE_PLOT
,
WinEDA_PlotFrame
::
OnQuit
)
EVT_BUTTON
(
ID_EXEC_PLOT
,
WinEDA_PlotFrame
::
Plot
)
EVT_BUTTON
(
ID_EXEC_PLOT
,
WinEDA_PlotFrame
::
Plot
)
EVT_BUTTON
(
ID_SAVE_OPT_PLOT
,
WinEDA_PlotFrame
::
SaveOptPlot
)
EVT_BUTTON
(
ID_SAVE_OPT_PLOT
,
WinEDA_PlotFrame
::
SaveOptPlot
)
EVT_BUTTON
(
ID_CREATE_DRILL_FILE
,
WinEDA_PlotFrame
::
CreateDrillFile
)
EVT_BUTTON
(
ID_CREATE_DRILL_FILE
,
WinEDA_PlotFrame
::
CreateDrillFile
)
EVT_RADIOBOX
(
ID_SEL_PLOT_FORMAT
,
WinEDA_PlotFrame
::
SetCommands
)
EVT_RADIOBOX
(
ID_SEL_PLOT_FORMAT
,
WinEDA_PlotFrame
::
SetCommands
)
END_EVENT_TABLE
()
END_EVENT_TABLE
()
...
@@ -116,507 +116,573 @@ const int UNITS_MILS = 1000;
...
@@ -116,507 +116,573 @@ const int UNITS_MILS = 1000;
/********************************************************************/
/********************************************************************/
WinEDA_PlotFrame
::
WinEDA_PlotFrame
(
WinEDA_BasePcbFrame
*
parent
)
:
WinEDA_PlotFrame
::
WinEDA_PlotFrame
(
WinEDA_BasePcbFrame
*
parent
)
:
wxDialog
(
parent
,
-
1
,
_
(
"Plot"
),
wxDialog
(
parent
,
-
1
,
_
(
"Plot"
),
wxPoint
(
-
1
,
-
1
),
wxDefaultSize
,
wxPoint
(
-
1
,
-
1
),
wxDefaultSize
,
wxDEFAULT_DIALOG_STYLE
)
wxDEFAULT_DIALOG_STYLE
)
/********************************************************************/
/********************************************************************/
{
{
wxButton
*
Button
;
wxButton
*
Button
;
int
ii
;
int
ii
;
m_Parent
=
parent
;
m_Parent
=
parent
;
SetFont
(
*
g_DialogFont
);
Centre
();
BOARD
*
board
=
parent
->
m_Pcb
;
m_PlotFormat
=
format_plot
;
m_Plot_Sheet_Ref
=
NULL
;
SetFont
(
*
g_DialogFont
);
Centre
();
wxBoxSizer
*
MainBoxSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
SetSizer
(
MainBoxSizer
);
m_PlotFormat
=
format_plot
;
wxBoxSizer
*
RightBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
m_Plot_Sheet_Ref
=
NULL
;
wxBoxSizer
*
MidRightBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
wxBoxSizer
*
MidLeftBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
wxBoxSizer
*
MainBoxSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
wxBoxSizer
*
LeftBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
MainBoxSizer
->
Add
(
LeftBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
SetSizer
(
MainBoxSizer
);
MainBoxSizer
->
Add
(
MidLeftBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
wxBoxSizer
*
RightBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
MainBoxSizer
->
Add
(
MidRightBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
MainBoxSizer
->
Add
(
RightBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
wxBoxSizer
*
MidRightBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
wxBoxSizer
*
LayersBoxSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
wxBoxSizer
*
MidLeftBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
LeftBoxSizer
->
Add
(
LayersBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
wxBoxSizer
*
LeftBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
wxString
fmtmsg
[
4
]
=
{
wxT
(
"HPGL"
),
wxT
(
"Gerber"
),
wxT
(
"Postscript"
),
wxT
(
"Postscript A4"
)
};
m_PlotFormatOpt
=
new
wxRadioBox
(
this
,
ID_SEL_PLOT_FORMAT
,
MainBoxSizer
->
Add
(
LeftBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
_
(
"Plot Format"
),
wxDefaultPosition
,
wxSize
(
-
1
,
-
1
),
MainBoxSizer
->
Add
(
MidLeftBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
4
,
fmtmsg
,
1
,
wxRA_SPECIFY_COLS
);
MainBoxSizer
->
Add
(
MidRightBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
MidRightBoxSizer
->
Add
(
m_PlotFormatOpt
,
0
,
wxGROW
|
wxALL
,
5
);
MainBoxSizer
->
Add
(
RightBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
switch
(
m_PlotFormat
)
{
wxBoxSizer
*
LayersBoxSizer
=
new
wxBoxSizer
(
wxHORIZONTAL
);
case
PLOT_FORMAT_HPGL
:
m_PlotFormatOpt
->
SetSelection
(
0
);
LeftBoxSizer
->
Add
(
LayersBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
break
;
static
const
wxString
fmtmsg
[
4
]
=
{
case
PLOT_FORMAT_GERBER
:
wxT
(
"HPGL"
),
wxT
(
"Gerber"
),
wxT
(
"Postscript"
),
wxT
(
"Postscript A4"
)
m_PlotFormatOpt
->
SetSelection
(
1
);
};
break
;
m_PlotFormatOpt
=
new
wxRadioBox
(
this
,
ID_SEL_PLOT_FORMAT
,
default
:
// ( PLOT_FORMAT_POST or PLOT_FORMAT_POST_A4 )
_
(
"Plot Format"
),
wxDefaultPosition
,
wxSize
(
-
1
,
-
1
),
// As m_PlotFormat is never set to a value of PLOT_FORMAT_POST_A4,
4
,
fmtmsg
,
1
,
wxRA_SPECIFY_COLS
);
// use the value of g_ForcePlotPS_On_A4 to determine whether the
// "Postscript" or "Postscipt A4" radiobutton had been selected
MidRightBoxSizer
->
Add
(
m_PlotFormatOpt
,
0
,
wxGROW
|
wxALL
,
5
);
// previously (and thus which button should be reselected now).
if
(
g_ForcePlotPS_On_A4
)
switch
(
m_PlotFormat
)
m_PlotFormatOpt
->
SetSelection
(
3
);
{
else
case
PLOT_FORMAT_HPGL
:
m_PlotFormatOpt
->
SetSelection
(
2
);
m_PlotFormatOpt
->
SetSelection
(
0
);
break
;
break
;
}
case
PLOT_FORMAT_GERBER
:
// Creation des menus d'option du format GERBER
m_PlotFormatOpt
->
SetSelection
(
1
);
m_GerbSpotSizeMinOpt
=
new
WinEDA_ValueCtrl
(
this
,
_
(
"Spot min"
),
break
;
spot_mini
,
g_UnitMetric
,
MidRightBoxSizer
,
UNITS_MILS
);
default
:
// ( PLOT_FORMAT_POST or PLOT_FORMAT_POST_A4 )
// Creation des menus d'option du format HPGL
// As m_PlotFormat is never set to a value of PLOT_FORMAT_POST_A4,
m_HPGLPenSizeOpt
=
new
WinEDA_ValueCtrl
(
this
,
_
(
"Pen Size"
),
// use the value of g_ForcePlotPS_On_A4 to determine whether the
g_HPGL_Pen_Diam
,
g_UnitMetric
,
MidRightBoxSizer
,
UNITS_MILS
);
// "Postscript" or "Postscipt A4" radiobutton had been selected
// previously (and thus which button should be reselected now).
// unites standards = cm pour vitesse plume en HPGL
if
(
g_ForcePlotPS_On_A4
)
m_HPGLPenSpeedOpt
=
new
WinEDA_ValueCtrl
(
this
,
_
(
"Pen Speed (cm/s)"
),
m_PlotFormatOpt
->
SetSelection
(
3
);
g_HPGL_Pen_Speed
,
CENTIMETRE
,
MidRightBoxSizer
,
1
);
else
m_HPGLPenSpeedOpt
->
SetToolTip
(
_
(
"Set pen speed in cm/s"
));
m_PlotFormatOpt
->
SetSelection
(
2
);
break
;
m_HPGLPenOverlayOpt
=
new
WinEDA_ValueCtrl
(
this
,
_
(
"Pen Ovr"
),
}
g_HPGL_Pen_Recouvrement
,
g_UnitMetric
,
MidRightBoxSizer
,
UNITS_MILS
);
m_HPGLPenOverlayOpt
->
SetToolTip
(
_
(
"Set plot overlay for filling"
));
// Creation des menus d'option du format GERBER
m_GerbSpotSizeMinOpt
=
new
WinEDA_ValueCtrl
(
this
,
_
(
"Spot min"
),
m_LinesWidth
=
new
WinEDA_ValueCtrl
(
this
,
_
(
"Lines Width"
),
spot_mini
,
g_UnitMetric
,
MidRightBoxSizer
,
g_PlotLine_Width
,
g_UnitMetric
,
MidRightBoxSizer
,
PCB_INTERNAL_UNIT
);
UNITS_MILS
);
m_LinesWidth
->
SetToolTip
(
_
(
"Set width for lines in Line plot mode"
));
// Creation des menus d'option du format HPGL
// Create the right column commands
m_HPGLPenSizeOpt
=
new
WinEDA_ValueCtrl
(
this
,
_
(
"Pen Size"
),
wxString
choice_plot_offset_msg
[]
=
g_HPGL_Pen_Diam
,
g_UnitMetric
,
MidRightBoxSizer
,
{
_
(
"Absolute"
),
_
(
"Auxiliary axis"
)};
UNITS_MILS
);
m_Choice_Plot_Offset
=
new
wxRadioBox
(
this
,
ID_SEL_PLOT_OFFSET_OPTION
,
_
(
"Plot Origin"
),
// unites standards = cm pour vitesse plume en HPGL
wxDefaultPosition
,
wxSize
(
-
1
,
-
1
),
m_HPGLPenSpeedOpt
=
new
WinEDA_ValueCtrl
(
this
,
_
(
"Pen Speed (cm/s)"
),
2
,
choice_plot_offset_msg
,
1
,
wxRA_SPECIFY_COLS
);
g_HPGL_Pen_Speed
,
CENTIMETRE
,
MidRightBoxSizer
,
if
(
s_PlotOriginIsAuxAxis
)
1
);
m_Choice_Plot_Offset
->
SetSelection
(
1
);
RightBoxSizer
->
Add
(
m_Choice_Plot_Offset
,
0
,
wxGROW
|
wxALL
,
5
);
m_HPGLPenSpeedOpt
->
SetToolTip
(
_
(
"Set pen speed in cm/s"
)
);
/* Add a spacer for a better look */
RightBoxSizer
->
Add
(
5
,
5
,
0
,
wxALIGN_CENTER_HORIZONTAL
|
wxALL
,
20
);
m_HPGLPenOverlayOpt
=
new
WinEDA_ValueCtrl
(
this
,
_
(
"Pen Ovr"
),
g_HPGL_Pen_Recouvrement
,
g_UnitMetric
,
/* Create the command buttons */
MidRightBoxSizer
,
UNITS_MILS
);
Button
=
new
wxButton
(
this
,
ID_EXEC_PLOT
,
_
(
"Plot"
));
Button
->
SetForegroundColour
(
*
wxRED
);
m_HPGLPenOverlayOpt
->
SetToolTip
(
_
(
"Set plot overlay for filling"
)
);
RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
m_LinesWidth
=
new
WinEDA_ValueCtrl
(
this
,
_
(
"Lines Width"
),
Button
=
new
wxButton
(
this
,
ID_CLOSE_PLOT
,
_
(
"Close"
));
g_PlotLine_Width
,
g_UnitMetric
,
MidRightBoxSizer
,
Button
->
SetForegroundColour
(
*
wxBLUE
);
PCB_INTERNAL_UNIT
);
RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
m_LinesWidth
->
SetToolTip
(
_
(
"Set width for lines in Line plot mode"
)
);
Button
=
new
wxButton
(
this
,
ID_SAVE_OPT_PLOT
,
_
(
"Save options"
));
Button
->
SetForegroundColour
(
wxColour
(
0
,
80
,
0
)
);
// Create the right column commands
RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
static
const
wxString
choice_plot_offset_msg
[]
=
{
_
(
"Absolute"
),
_
(
"Auxiliary axis"
)
};
Button
=
new
wxButton
(
this
,
ID_CREATE_DRILL_FILE
,
_
(
"Create Drill File"
));
Button
->
SetForegroundColour
(
wxColour
(
0
,
80
,
80
)
);
m_Choice_Plot_Offset
=
new
wxRadioBox
(
this
,
ID_SEL_PLOT_OFFSET_OPTION
,
RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
_
(
"Plot Origin"
),
wxDefaultPosition
,
wxSize
(
-
1
,
-
1
),
// Create scale adjust option
2
,
choice_plot_offset_msg
,
1
,
wxRA_SPECIFY_COLS
);
m_XScaleAdjust
=
m_YScaleAdjust
=
1.0
;
if
(
m_Parent
->
m_Parent
->
m_EDA_Config
)
if
(
s_PlotOriginIsAuxAxis
)
{
m_Choice_Plot_Offset
->
SetSelection
(
1
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
EDGELAYER_GERBER_OPT_KEY
,
&
g_Exclude_Edges_Pcb
);
RightBoxSizer
->
Add
(
m_Choice_Plot_Offset
,
0
,
wxGROW
|
wxALL
,
5
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
PLOT_XFINESCALE_ADJ_KEY
,
&
m_XScaleAdjust
);
/* Add a spacer for a better look */
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
PLOT_XFINESCALE_ADJ_KEY
,
&
m_YScaleAdjust
);
RightBoxSizer
->
Add
(
5
,
5
,
0
,
wxALIGN_CENTER_HORIZONTAL
|
wxALL
,
20
);
}
m_FineAdjustXscaleOpt
=
new
WinEDA_DFloatValueCtrl
(
this
,
_
(
"X Scale Adjust"
),
m_XScaleAdjust
,
RightBoxSizer
);
/* Create the command buttons */
m_FineAdjustXscaleOpt
->
SetToolTip
(
_
(
"Set X scale adjust for exact scale plotting"
));
Button
=
new
wxButton
(
this
,
ID_EXEC_PLOT
,
_
(
"Plot"
)
);
m_FineAdjustYscaleOpt
=
new
WinEDA_DFloatValueCtrl
(
this
,
_
(
"Y Scale Adjust"
),
m_YScaleAdjust
,
RightBoxSizer
);
m_FineAdjustYscaleOpt
->
SetToolTip
(
_
(
"Set Y scale adjust for exact scale plotting"
));
Button
->
SetForegroundColour
(
*
wxRED
);
RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
m_Plot_PS_Negative
=
new
wxCheckBox
(
this
,
-
1
,
_
(
"Plot Negative"
)
);
m_Plot_PS_Negative
->
SetValue
(
g_Plot_PS_Negative
);
Button
=
new
wxButton
(
this
,
ID_CLOSE_PLOT
,
_
(
"Close"
)
);
RightBoxSizer
->
Add
(
m_Plot_PS_Negative
,
0
,
wxGROW
|
wxALL
,
5
);
Button
->
SetForegroundColour
(
*
wxBLUE
);
// Creation de la liste des layers
RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
int
mask
=
1
;
wxBoxSizer
*
OneColonLayerBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
Button
=
new
wxButton
(
this
,
ID_SAVE_OPT_PLOT
,
_
(
"Save options"
)
);
LayersBoxSizer
->
Add
(
OneColonLayerBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
for
(
ii
=
0
;
ii
<
NB_LAYERS
;
ii
++
,
mask
<<=
1
)
Button
->
SetForegroundColour
(
wxColour
(
0
,
80
,
0
)
);
{
RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
if
(
ii
==
16
)
{
Button
=
new
wxButton
(
this
,
ID_CREATE_DRILL_FILE
,
_
(
"Create Drill File"
)
);
OneColonLayerBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
LayersBoxSizer
->
Add
(
OneColonLayerBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
Button
->
SetForegroundColour
(
wxColour
(
0
,
80
,
80
)
);
}
RightBoxSizer
->
Add
(
Button
,
0
,
wxGROW
|
wxALL
,
5
);
m_BoxSelecLayer
[
ii
]
=
new
wxCheckBox
(
this
,
-
1
,
ReturnPcbLayerName
(
ii
));
// Create scale adjust option
if
(
mask
&
s_SelectedLayers
)
m_XScaleAdjust
=
m_YScaleAdjust
=
1.0
;
m_BoxSelecLayer
[
ii
]
->
SetValue
(
true
);
if
(
m_Parent
->
m_Parent
->
m_EDA_Config
)
OneColonLayerBoxSizer
->
Add
(
m_BoxSelecLayer
[
ii
],
0
,
wxGROW
|
wxALL
,
1
);
{
}
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
EDGELAYER_GERBER_OPT_KEY
,
&
g_Exclude_Edges_Pcb
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
PLOT_XFINESCALE_ADJ_KEY
,
&
m_XScaleAdjust
);
// Option for excluding contents of "Edges Pcb" layer
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
PLOT_XFINESCALE_ADJ_KEY
,
&
m_YScaleAdjust
);
}
m_Exclude_Edges_Pcb
=
new
wxCheckBox
(
this
,
m_FineAdjustXscaleOpt
=
new
WinEDA_DFloatValueCtrl
(
this
,
_
(
ID_EXCLUDE_EDGES_PCB
,
_
(
"Exclude Edges Pcb Layer"
)
);
"X Scale Adjust"
),
m_XScaleAdjust
,
m_Exclude_Edges_Pcb
->
SetValue
(
g_Exclude_Edges_Pcb
);
RightBoxSizer
);
m_Exclude_Edges_Pcb
->
SetToolTip
(
_
(
"Exclude contents of Edges Pcb layer from all other layers"
)
);
m_FineAdjustXscaleOpt
->
SetToolTip
(
_
(
"Set X scale adjust for exact scale plotting"
)
);
LeftBoxSizer
->
Add
(
m_Exclude_Edges_Pcb
,
0
,
wxGROW
|
wxALL
,
1
);
m_FineAdjustYscaleOpt
=
new
WinEDA_DFloatValueCtrl
(
this
,
_
(
"Y Scale Adjust"
),
m_YScaleAdjust
,
// Option d'impression du cartouche:
RightBoxSizer
);
if
(
m_Parent
->
m_Print_Sheet_Ref
)
{
m_FineAdjustYscaleOpt
->
SetToolTip
(
_
(
"Set Y scale adjust for exact scale plotting"
)
);
m_Plot_Sheet_Ref
=
new
wxCheckBox
(
this
,
ID_PRINT_REF
,
_
(
"Print Sheet Ref"
)
);
m_Plot_Sheet_Ref
->
SetValue
(
Plot_Sheet_Ref
);
m_Plot_PS_Negative
=
new
wxCheckBox
(
this
,
-
1
,
_
(
"Plot Negative"
)
);
LeftBoxSizer
->
Add
(
m_Plot_Sheet_Ref
,
0
,
wxGROW
|
wxALL
,
1
);
}
m_Plot_PS_Negative
->
SetValue
(
g_Plot_PS_Negative
);
else
RightBoxSizer
->
Add
(
m_Plot_PS_Negative
,
0
,
wxGROW
|
wxALL
,
5
);
Plot_Sheet_Ref
=
false
;
// Creation de la liste des layers
// Option d'impression des pads sur toutes les couches
int
mask
=
1
;
m_Plot_Pads_on_Silkscreen
=
new
wxCheckBox
(
this
,
wxBoxSizer
*
OneColonLayerBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
ID_PRINT_PAD_ON_SILKSCREEN
,
_
(
"Print Pads on Silkscreen"
)
);
m_Plot_Pads_on_Silkscreen
->
SetValue
(
PlotPadsOnSilkLayer
);
LayersBoxSizer
->
Add
(
OneColonLayerBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
m_Plot_Pads_on_Silkscreen
->
SetToolTip
(
_
(
"Enable/disable print/plot pads on Silkscreen layers"
)
);
for
(
ii
=
0
;
ii
<
NB_LAYERS
;
ii
++
,
mask
<<=
1
)
LeftBoxSizer
->
Add
(
m_Plot_Pads_on_Silkscreen
,
0
,
wxGROW
|
wxALL
,
1
);
{
if
(
ii
==
16
)
m_Force_Plot_Pads
=
new
wxCheckBox
(
this
,
ID_FORCE_PRINT_PAD
,
{
_
(
"Always Print Pads"
)
);
OneColonLayerBoxSizer
=
new
wxBoxSizer
(
wxVERTICAL
);
m_Force_Plot_Pads
->
SetValue
(
Plot_Pads_All_Layers
);
m_Force_Plot_Pads
->
SetToolTip
(
_
(
"Force print/plot pads on ALL layers"
)
);
LayersBoxSizer
->
Add
(
OneColonLayerBoxSizer
,
0
,
wxGROW
|
wxALL
,
5
);
LeftBoxSizer
->
Add
(
m_Force_Plot_Pads
,
0
,
wxGROW
|
wxALL
,
1
);
}
// Options d'impression des textes modules
m_BoxSelecLayer
[
ii
]
=
new
wxCheckBox
(
this
,
-
1
,
board
->
GetLayerName
(
ii
)
);
m_Plot_Text_Value
=
new
wxCheckBox
(
this
,
ID_PRINT_VALUE
,
_
(
"Print Module Value"
)
);
m_Plot_Text_Value
->
SetValue
(
Sel_Texte_Valeur
);
if
(
mask
&
s_SelectedLayers
)
m_Plot_Text_Value
->
SetToolTip
(
m_BoxSelecLayer
[
ii
]
->
SetValue
(
true
);
_
(
"Enable/disable print/plot module value on Silkscreen layers"
)
);
OneColonLayerBoxSizer
->
Add
(
m_BoxSelecLayer
[
ii
],
0
,
wxGROW
|
wxALL
,
1
);
LeftBoxSizer
->
Add
(
m_Plot_Text_Value
,
0
,
wxGROW
|
wxALL
,
1
);
}
m_Plot_Text_Ref
=
new
wxCheckBox
(
this
,
ID_PRINT_REF
,
_
(
"Print Module Reference"
));
// Option for excluding contents of "Edges Pcb" layer
m_Plot_Text_Ref
->
SetValue
(
Sel_Texte_Reference
);
m_Plot_Text_Ref
->
SetToolTip
(
m_Exclude_Edges_Pcb
=
new
wxCheckBox
(
this
,
_
(
"Enable/disable print/plot module reference on Silkscreen layers"
)
);
ID_EXCLUDE_EDGES_PCB
,
_
(
"Exclude Edges Pcb Layer"
)
);
LeftBoxSizer
->
Add
(
m_Plot_Text_Ref
,
0
,
wxGROW
|
wxALL
,
1
);
m_Exclude_Edges_Pcb
->
SetValue
(
g_Exclude_Edges_Pcb
);
m_Plot_Text_Div
=
new
wxCheckBox
(
this
,
ID_PRINT_MODULE_TEXTS
,
m_Exclude_Edges_Pcb
->
SetToolTip
(
_
(
"Print other Module texts"
)
);
_
(
"Exclude contents of Edges Pcb layer from all other layers"
)
);
m_Plot_Text_Div
->
SetValue
(
Sel_Texte_Divers
);
LeftBoxSizer
->
Add
(
m_Exclude_Edges_Pcb
,
0
,
wxGROW
|
wxALL
,
1
);
m_Plot_Text_Div
->
SetToolTip
(
_
(
"Enable/disable print/plot module field texts on Silkscreen layers"
)
);
// Option d'impression du cartouche:
LeftBoxSizer
->
Add
(
m_Plot_Text_Div
,
0
,
wxGROW
|
wxALL
,
1
);
if
(
m_Parent
->
m_Print_Sheet_Ref
)
{
m_Plot_Invisible_Text
=
new
wxCheckBox
(
this
,
m_Plot_Sheet_Ref
=
new
wxCheckBox
(
this
,
ID_PRINT_REF
,
_
(
"Print Sheet Ref"
)
);
ID_FORCE_PRINT_INVISIBLE_TEXT
,
_
(
"Force Print Invisible Texts"
)
);
m_Plot_Invisible_Text
->
SetValue
(
Sel_Texte_Invisible
);
m_Plot_Sheet_Ref
->
SetValue
(
Plot_Sheet_Ref
);
m_Plot_Invisible_Text
->
SetToolTip
(
LeftBoxSizer
->
Add
(
m_Plot_Sheet_Ref
,
0
,
wxGROW
|
wxALL
,
1
);
_
(
"Force print/plot module invisible texts on Silkscreen layers"
)
);
}
LeftBoxSizer
->
Add
(
m_Plot_Invisible_Text
,
0
,
wxGROW
|
wxALL
,
1
);
else
Plot_Sheet_Ref
=
false
;
wxString
drillmsg
[
3
]
=
{
_
(
"No Drill mark"
),
_
(
"Small mark"
),
_
(
"Real Drill"
)
};
// Option d'impression des pads sur toutes les couches
m_Drill_Shape_Opt
=
new
wxRadioBox
(
this
,
ID_DRILL_SHAPE_OPT
,
m_Plot_Pads_on_Silkscreen
=
new
wxCheckBox
(
this
,
_
(
"Pads Drill Opt"
),
wxDefaultPosition
,
wxSize
(
-
1
,
-
1
),
ID_PRINT_PAD_ON_SILKSCREEN
,
_
(
3
,
drillmsg
,
1
,
wxRA_SPECIFY_COLS
);
"Print Pads on Silkscreen"
)
);
m_Drill_Shape_Opt
->
SetSelection
(
g_DrillShapeOpt
);
MidLeftBoxSizer
->
Add
(
m_Drill_Shape_Opt
,
0
,
wxGROW
|
wxALL
,
5
);
m_Plot_Pads_on_Silkscreen
->
SetValue
(
PlotPadsOnSilkLayer
);
m_Plot_Pads_on_Silkscreen
->
SetToolTip
(
wxString
scalemsg
[
5
]
=
_
(
"Enable/disable print/plot pads on Silkscreen layers"
)
);
{
_
(
"Auto scale"
),
_
(
"Scale 1"
),
_
(
"Scale 1.5"
),
_
(
"Scale 2"
),
_
(
"Scale 3"
)
};
LeftBoxSizer
->
Add
(
m_Plot_Pads_on_Silkscreen
,
0
,
wxGROW
|
wxALL
,
1
);
m_Scale_Opt
=
new
wxRadioBox
(
this
,
ID_SCALE_OPT
,
_
(
"Scale Opt"
),
wxDefaultPosition
,
wxSize
(
-
1
,
-
1
),
m_Force_Plot_Pads
=
new
wxCheckBox
(
this
,
ID_FORCE_PRINT_PAD
,
5
,
scalemsg
,
1
,
wxRA_SPECIFY_COLS
);
_
(
"Always Print Pads"
)
);
m_Scale_Opt
->
SetSelection
(
g_PlotScaleOpt
);
MidLeftBoxSizer
->
Add
(
m_Scale_Opt
,
0
,
wxGROW
|
wxALL
,
5
);
m_Force_Plot_Pads
->
SetValue
(
Plot_Pads_All_Layers
);
m_Force_Plot_Pads
->
SetToolTip
(
_
(
"Force print/plot pads on ALL layers"
)
);
wxString
list_opt3
[
3
]
=
{
_
(
"Line"
),
_
(
"Filled"
),
_
(
"Sketch"
)
};
LeftBoxSizer
->
Add
(
m_Force_Plot_Pads
,
0
,
wxGROW
|
wxALL
,
1
);
m_PlotModeOpt
=
new
wxRadioBox
(
this
,
ID_PLOT_MODE_OPT
,
_
(
"Plot Mode"
),
wxDefaultPosition
,
wxDefaultSize
,
// Options d'impression des textes modules
3
,
list_opt3
,
1
);
m_Plot_Text_Value
=
new
wxCheckBox
(
this
,
ID_PRINT_VALUE
,
_
(
"Print Module Value"
)
);
m_PlotModeOpt
->
SetSelection
(
Plot_Mode
);
MidLeftBoxSizer
->
Add
(
m_PlotModeOpt
,
0
,
wxGROW
|
wxALL
,
5
);
m_Plot_Text_Value
->
SetValue
(
Sel_Texte_Valeur
);
m_Plot_Text_Value
->
SetToolTip
(
m_PlotMirorOpt
=
new
wxCheckBox
(
this
,
ID_MIROR_OPT
,
_
(
"Enable/disable print/plot module value on Silkscreen layers"
)
);
_
(
"Plot Mirror"
));
LeftBoxSizer
->
Add
(
m_Plot_Text_Value
,
0
,
wxGROW
|
wxALL
,
1
);
m_PlotMirorOpt
->
SetValue
(
Plot_Set_MIROIR
);
MidLeftBoxSizer
->
Add
(
m_PlotMirorOpt
,
0
,
wxGROW
|
wxALL
,
5
);
m_Plot_Text_Ref
=
new
wxCheckBox
(
this
,
ID_PRINT_REF
,
_
(
"Print Module Reference"
)
);
m_PlotNoViaOnMaskOpt
=
new
wxCheckBox
(
this
,
ID_MASKVIA_OPT
,
m_Plot_Text_Ref
->
SetValue
(
Sel_Texte_Reference
);
_
(
"Vias on Mask"
));
m_Plot_Text_Ref
->
SetToolTip
(
m_PlotNoViaOnMaskOpt
->
SetValue
(
g_DrawViaOnMaskLayer
);
_
(
"Enable/disable print/plot module reference on Silkscreen layers"
)
);
m_PlotNoViaOnMaskOpt
->
SetToolTip
(
LeftBoxSizer
->
Add
(
m_Plot_Text_Ref
,
0
,
wxGROW
|
wxALL
,
1
);
_
(
"Print/plot vias on mask layers. They are in this case not protected"
)
);
MidLeftBoxSizer
->
Add
(
m_PlotNoViaOnMaskOpt
,
0
,
wxGROW
|
wxALL
,
5
);
m_Plot_Text_Div
=
new
wxCheckBox
(
this
,
ID_PRINT_MODULE_TEXTS
,
_
(
"Print other Module texts"
)
);
m_HPGL_PlotCenter_Opt
=
new
wxCheckBox
(
this
,
ID_PLOT_CENTRE_OPT
,
_
(
"Org = Centre"
));
m_Plot_Text_Div
->
SetValue
(
Sel_Texte_Divers
);
m_HPGL_PlotCenter_Opt
->
SetValue
(
HPGL_Org_Centre
);
m_Plot_Text_Div
->
SetToolTip
(
m_HPGL_PlotCenter_Opt
->
SetToolTip
(
_
(
"Draw origin ( 0,0 ) in sheet center"
)
);
_
(
"Enable/disable print/plot module field texts on Silkscreen layers"
)
);
MidLeftBoxSizer
->
Add
(
m_HPGL_PlotCenter_Opt
,
0
,
wxGROW
|
wxALL
,
5
);
LeftBoxSizer
->
Add
(
m_Plot_Text_Div
,
0
,
wxGROW
|
wxALL
,
1
);
// Mise a jour des activations des menus:
wxCommandEvent
event
;
m_Plot_Invisible_Text
=
new
wxCheckBox
(
this
,
SetCommands
(
event
);
ID_FORCE_PRINT_INVISIBLE_TEXT
,
_
(
"Force Print Invisible Texts"
)
);
GetSizer
()
->
Fit
(
this
);
GetSizer
()
->
SetSizeHints
(
this
);
m_Plot_Invisible_Text
->
SetValue
(
Sel_Texte_Invisible
);
m_Plot_Invisible_Text
->
SetToolTip
(
_
(
"Force print/plot module invisible texts on Silkscreen layers"
)
);
LeftBoxSizer
->
Add
(
m_Plot_Invisible_Text
,
0
,
wxGROW
|
wxALL
,
1
);
static
const
wxString
drillmsg
[
3
]
=
{
_
(
"No Drill mark"
),
_
(
"Small mark"
),
_
(
"Real Drill"
)
};
m_Drill_Shape_Opt
=
new
wxRadioBox
(
this
,
ID_DRILL_SHAPE_OPT
,
_
(
"Pads Drill Opt"
),
wxDefaultPosition
,
wxSize
(
-
1
,
-
1
),
3
,
drillmsg
,
1
,
wxRA_SPECIFY_COLS
);
m_Drill_Shape_Opt
->
SetSelection
(
g_DrillShapeOpt
);
MidLeftBoxSizer
->
Add
(
m_Drill_Shape_Opt
,
0
,
wxGROW
|
wxALL
,
5
);
static
const
wxString
scalemsg
[
5
]
=
{
_
(
"Auto scale"
),
_
(
"Scale 1"
),
_
(
"Scale 1.5"
),
_
(
"Scale 2"
),
_
(
"Scale 3"
)
};
m_Scale_Opt
=
new
wxRadioBox
(
this
,
ID_SCALE_OPT
,
_
(
"Scale Opt"
),
wxDefaultPosition
,
wxSize
(
-
1
,
-
1
),
5
,
scalemsg
,
1
,
wxRA_SPECIFY_COLS
);
m_Scale_Opt
->
SetSelection
(
g_PlotScaleOpt
);
MidLeftBoxSizer
->
Add
(
m_Scale_Opt
,
0
,
wxGROW
|
wxALL
,
5
);
static
const
wxString
list_opt3
[
3
]
=
{
_
(
"Line"
),
_
(
"Filled"
),
_
(
"Sketch"
)
};
m_PlotModeOpt
=
new
wxRadioBox
(
this
,
ID_PLOT_MODE_OPT
,
_
(
"Plot Mode"
),
wxDefaultPosition
,
wxDefaultSize
,
3
,
list_opt3
,
1
);
m_PlotModeOpt
->
SetSelection
(
Plot_Mode
);
MidLeftBoxSizer
->
Add
(
m_PlotModeOpt
,
0
,
wxGROW
|
wxALL
,
5
);
m_PlotMirorOpt
=
new
wxCheckBox
(
this
,
ID_MIROR_OPT
,
_
(
"Plot Mirror"
)
);
m_PlotMirorOpt
->
SetValue
(
Plot_Set_MIROIR
);
MidLeftBoxSizer
->
Add
(
m_PlotMirorOpt
,
0
,
wxGROW
|
wxALL
,
5
);
m_PlotNoViaOnMaskOpt
=
new
wxCheckBox
(
this
,
ID_MASKVIA_OPT
,
_
(
"Vias on Mask"
)
);
m_PlotNoViaOnMaskOpt
->
SetValue
(
g_DrawViaOnMaskLayer
);
m_PlotNoViaOnMaskOpt
->
SetToolTip
(
_
(
"Print/plot vias on mask layers. They are in this case not protected"
)
);
MidLeftBoxSizer
->
Add
(
m_PlotNoViaOnMaskOpt
,
0
,
wxGROW
|
wxALL
,
5
);
m_HPGL_PlotCenter_Opt
=
new
wxCheckBox
(
this
,
ID_PLOT_CENTRE_OPT
,
_
(
"Org = Centre"
)
);
m_HPGL_PlotCenter_Opt
->
SetValue
(
HPGL_Org_Centre
);
m_HPGL_PlotCenter_Opt
->
SetToolTip
(
_
(
"Draw origin ( 0,0 ) in sheet center"
)
);
MidLeftBoxSizer
->
Add
(
m_HPGL_PlotCenter_Opt
,
0
,
wxGROW
|
wxALL
,
5
);
// Mise a jour des activations des menus:
wxCommandEvent
event
;
SetCommands
(
event
);
GetSizer
()
->
Fit
(
this
);
GetSizer
()
->
SetSizeHints
(
this
);
}
}
/***************************************************************/
/***************************************************************/
void
WinEDA_PlotFrame
::
OnQuit
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
void
WinEDA_PlotFrame
::
OnQuit
(
wxCommandEvent
&
WXUNUSED
(
event
)
)
/***************************************************************/
/***************************************************************/
/* Called by the close button
/* Called by the close button
*/
*/
{
{
Close
(
true
);
// true is to force the frame to close
Close
(
true
);
// true is to force the frame to close
}
}
/****************************************************/
/****************************************************/
void
WinEDA_PlotFrame
::
OnClose
(
wxCloseEvent
&
event
)
void
WinEDA_PlotFrame
::
OnClose
(
wxCloseEvent
&
event
)
/****************************************************/
/****************************************************/
/* Called when WinEDA_PlotFrame is closed
/* Called when WinEDA_PlotFrame is closed
*/
*/
{
{
EndModal
(
0
);
EndModal
(
0
);
}
}
/*********************************************************/
/*********************************************************/
void
WinEDA_PlotFrame
::
CreateDrillFile
(
wxCommandEvent
&
event
)
void
WinEDA_PlotFrame
::
CreateDrillFile
(
wxCommandEvent
&
event
)
/*********************************************************/
/*********************************************************/
/* Create the board drill file used with gerber documents
/* Create the board drill file used with gerber documents
*/
*/
{
{
((
WinEDA_PcbFrame
*
)
m_Parent
)
->
InstallDrillFrame
(
event
);
(
(
WinEDA_PcbFrame
*
)
m_Parent
)
->
InstallDrillFrame
(
event
);
}
}
/*********************************************************/
/*********************************************************/
void
WinEDA_PlotFrame
::
SetCommands
(
wxCommandEvent
&
event
)
void
WinEDA_PlotFrame
::
SetCommands
(
wxCommandEvent
&
event
)
/*********************************************************/
/*********************************************************/
/* active ou dsactive les diffrents menus d'option selon le standard choisi
/* active ou dsactive les diffrents menus d'option selon le standard choisi
*/
*/
{
{
int
format
;
int
format
;
int
format_list
[]
=
{
PLOT_FORMAT_HPGL
,
PLOT_FORMAT_GERBER
,
PLOT_FORMAT_POST
,
PLOT_FORMAT_POST_A4
static
const
int
format_list
[]
=
{
};
PLOT_FORMAT_HPGL
,
PLOT_FORMAT_GERBER
,
PLOT_FORMAT_POST
,
PLOT_FORMAT_POST_A4
format
=
format_list
[
m_PlotFormatOpt
->
GetSelection
()];
};
switch
(
format
)
format
=
format_list
[
m_PlotFormatOpt
->
GetSelection
()];
{
case
PLOT_FORMAT_POST_A4
:
switch
(
format
)
case
PLOT_FORMAT_POST
:
{
default
:
case
PLOT_FORMAT_POST_A4
:
m_Drill_Shape_Opt
->
Enable
(
true
);
case
PLOT_FORMAT_POST
:
m_PlotModeOpt
->
Enable
(
true
);
default
:
m_PlotMirorOpt
->
Enable
(
true
);
m_Drill_Shape_Opt
->
Enable
(
true
);
m_GerbSpotSizeMinOpt
->
Enable
(
false
);
m_PlotModeOpt
->
Enable
(
true
);
m_Choice_Plot_Offset
->
Enable
(
false
);
m_PlotMirorOpt
->
Enable
(
true
);
m_LinesWidth
->
Enable
(
true
);
m_GerbSpotSizeMinOpt
->
Enable
(
false
);
m_HPGLPenSizeOpt
->
Enable
(
false
);
m_Choice_Plot_Offset
->
Enable
(
false
);
m_HPGLPenSpeedOpt
->
Enable
(
false
);
m_LinesWidth
->
Enable
(
true
);
m_HPGLPenOverlayOpt
->
Enable
(
false
);
m_HPGLPenSizeOpt
->
Enable
(
false
);
m_HPGL_PlotCenter_Opt
->
Enable
(
false
);
m_HPGLPenSpeedOpt
->
Enable
(
false
);
m_Exclude_Edges_Pcb
->
Enable
(
false
);
m_HPGLPenOverlayOpt
->
Enable
(
false
);
m_Plot_Sheet_Ref
->
Enable
(
true
);
m_HPGL_PlotCenter_Opt
->
Enable
(
false
);
m_Scale_Opt
->
Enable
(
true
);
m_Exclude_Edges_Pcb
->
Enable
(
false
);
m_FineAdjustXscaleOpt
->
Enable
(
true
);
m_Plot_Sheet_Ref
->
Enable
(
true
);
m_FineAdjustYscaleOpt
->
Enable
(
true
);
m_Scale_Opt
->
Enable
(
true
);
m_PlotFormat
=
PLOT_FORMAT_POST
;
m_FineAdjustXscaleOpt
->
Enable
(
true
);
g_ForcePlotPS_On_A4
=
(
format
==
PLOT_FORMAT_POST_A4
);
m_FineAdjustYscaleOpt
->
Enable
(
true
);
m_Plot_PS_Negative
->
Enable
(
true
);
m_PlotFormat
=
PLOT_FORMAT_POST
;
break
;
g_ForcePlotPS_On_A4
=
(
format
==
PLOT_FORMAT_POST_A4
);
m_Plot_PS_Negative
->
Enable
(
true
);
case
PLOT_FORMAT_GERBER
:
break
;
m_Drill_Shape_Opt
->
Enable
(
false
);
m_PlotModeOpt
->
Enable
(
false
);
case
PLOT_FORMAT_GERBER
:
m_PlotMirorOpt
->
Enable
(
false
);
m_Drill_Shape_Opt
->
Enable
(
false
);
m_GerbSpotSizeMinOpt
->
Enable
(
true
);
m_PlotModeOpt
->
Enable
(
false
);
m_Choice_Plot_Offset
->
Enable
(
true
);
m_PlotMirorOpt
->
Enable
(
false
);
m_LinesWidth
->
Enable
(
true
);
m_GerbSpotSizeMinOpt
->
Enable
(
true
);
m_HPGLPenSizeOpt
->
Enable
(
false
);
m_Choice_Plot_Offset
->
Enable
(
true
);
m_HPGLPenSpeedOpt
->
Enable
(
false
);
m_LinesWidth
->
Enable
(
true
);
m_HPGLPenOverlayOpt
->
Enable
(
false
);
m_HPGLPenSizeOpt
->
Enable
(
false
);
m_HPGL_PlotCenter_Opt
->
Enable
(
false
);
m_HPGLPenSpeedOpt
->
Enable
(
false
);
m_Exclude_Edges_Pcb
->
Enable
(
true
);
m_HPGLPenOverlayOpt
->
Enable
(
false
);
m_Plot_Sheet_Ref
->
Enable
(
false
);
m_HPGL_PlotCenter_Opt
->
Enable
(
false
);
m_Scale_Opt
->
Enable
(
false
);
m_Exclude_Edges_Pcb
->
Enable
(
true
);
m_FineAdjustXscaleOpt
->
Enable
(
false
);
m_Plot_Sheet_Ref
->
Enable
(
false
);
m_FineAdjustYscaleOpt
->
Enable
(
false
);
m_Scale_Opt
->
Enable
(
false
);
m_PlotFormat
=
PLOT_FORMAT_GERBER
;
m_FineAdjustXscaleOpt
->
Enable
(
false
);
m_Plot_PS_Negative
->
Enable
(
false
);
m_FineAdjustYscaleOpt
->
Enable
(
false
);
break
;
m_PlotFormat
=
PLOT_FORMAT_GERBER
;
m_Plot_PS_Negative
->
Enable
(
false
);
case
PLOT_FORMAT_HPGL
:
break
;
m_PlotMirorOpt
->
Enable
(
true
);
m_Drill_Shape_Opt
->
Enable
(
false
);
case
PLOT_FORMAT_HPGL
:
m_PlotModeOpt
->
Enable
(
true
);
m_PlotMirorOpt
->
Enable
(
true
);
m_GerbSpotSizeMinOpt
->
Enable
(
false
);
m_Drill_Shape_Opt
->
Enable
(
false
);
m_Choice_Plot_Offset
->
Enable
(
false
);
m_PlotModeOpt
->
Enable
(
true
);
m_LinesWidth
->
Enable
(
false
);
m_GerbSpotSizeMinOpt
->
Enable
(
false
);
m_HPGLPenSizeOpt
->
Enable
(
true
);
m_Choice_Plot_Offset
->
Enable
(
false
);
m_HPGLPenSpeedOpt
->
Enable
(
true
);
m_LinesWidth
->
Enable
(
false
);
m_HPGLPenOverlayOpt
->
Enable
(
true
);
m_HPGLPenSizeOpt
->
Enable
(
true
);
m_HPGL_PlotCenter_Opt
->
Enable
(
true
);
m_HPGLPenSpeedOpt
->
Enable
(
true
);
m_Exclude_Edges_Pcb
->
Enable
(
false
);
m_HPGLPenOverlayOpt
->
Enable
(
true
);
m_Plot_Sheet_Ref
->
Enable
(
true
);
m_HPGL_PlotCenter_Opt
->
Enable
(
true
);
m_Scale_Opt
->
Enable
(
true
);
m_Exclude_Edges_Pcb
->
Enable
(
false
);
m_FineAdjustXscaleOpt
->
Enable
(
false
);
m_Plot_Sheet_Ref
->
Enable
(
true
);
m_FineAdjustYscaleOpt
->
Enable
(
false
);
m_Scale_Opt
->
Enable
(
true
);
m_PlotFormat
=
PLOT_FORMAT_HPGL
;
m_FineAdjustXscaleOpt
->
Enable
(
false
);
m_Plot_PS_Negative
->
Enable
(
false
);
m_FineAdjustYscaleOpt
->
Enable
(
false
);
break
;
m_PlotFormat
=
PLOT_FORMAT_HPGL
;
}
m_Plot_PS_Negative
->
Enable
(
false
);
format_plot
=
m_PlotFormat
;
break
;
}
format_plot
=
m_PlotFormat
;
}
}
/*********************************************************/
/*********************************************************/
void
WinEDA_PlotFrame
::
SaveOptPlot
(
wxCommandEvent
&
event
)
void
WinEDA_PlotFrame
::
SaveOptPlot
(
wxCommandEvent
&
event
)
/*********************************************************/
/*********************************************************/
{
{
g_Exclude_Edges_Pcb
=
m_Exclude_Edges_Pcb
->
GetValue
();
g_Exclude_Edges_Pcb
=
m_Exclude_Edges_Pcb
->
GetValue
();
if
(
m_Plot_Sheet_Ref
)
if
(
m_Plot_Sheet_Ref
)
Plot_Sheet_Ref
=
m_Plot_Sheet_Ref
->
GetValue
();
Plot_Sheet_Ref
=
m_Plot_Sheet_Ref
->
GetValue
();
PlotPadsOnSilkLayer
=
m_Plot_Pads_on_Silkscreen
->
GetValue
();
PlotPadsOnSilkLayer
=
m_Plot_Pads_on_Silkscreen
->
GetValue
();
Plot_Pads_All_Layers
=
m_Force_Plot_Pads
->
GetValue
();
Plot_Pads_All_Layers
=
m_Force_Plot_Pads
->
GetValue
();
s_PlotOriginIsAuxAxis
=
(
m_Choice_Plot_Offset
->
GetSelection
()
==
0
)
?
FALSE
:
TRUE
;
s_PlotOriginIsAuxAxis
=
(
m_Choice_Plot_Offset
->
GetSelection
()
==
0
)
?
FALSE
:
TRUE
;
Sel_Texte_Valeur
=
m_Plot_Text_Value
->
GetValue
();
Sel_Texte_Valeur
=
m_Plot_Text_Value
->
GetValue
();
Sel_Texte_Reference
=
m_Plot_Text_Ref
->
GetValue
();
Sel_Texte_Reference
=
m_Plot_Text_Ref
->
GetValue
();
Sel_Texte_Divers
=
m_Plot_Text_Div
->
GetValue
();
Sel_Texte_Divers
=
m_Plot_Text_Div
->
GetValue
();
Sel_Texte_Invisible
=
m_Plot_Invisible_Text
->
GetValue
();
Sel_Texte_Invisible
=
m_Plot_Invisible_Text
->
GetValue
();
g_PlotScaleOpt
=
m_Scale_Opt
->
GetSelection
();
g_PlotScaleOpt
=
m_Scale_Opt
->
GetSelection
();
g_DrillShapeOpt
=
m_Drill_Shape_Opt
->
GetSelection
();
g_DrillShapeOpt
=
m_Drill_Shape_Opt
->
GetSelection
();
Plot_Set_MIROIR
=
m_PlotMirorOpt
->
GetValue
();
Plot_Set_MIROIR
=
m_PlotMirorOpt
->
GetValue
();
if
(
Plot_Set_MIROIR
)
if
(
Plot_Set_MIROIR
)
g_PlotOrient
=
PLOT_MIROIR
;
g_PlotOrient
=
PLOT_MIROIR
;
else
else
g_PlotOrient
=
0
;
g_PlotOrient
=
0
;
Plot_Mode
=
m_PlotModeOpt
->
GetSelection
();
Plot_Mode
=
m_PlotModeOpt
->
GetSelection
();
g_DrawViaOnMaskLayer
=
m_PlotNoViaOnMaskOpt
->
GetValue
();
g_DrawViaOnMaskLayer
=
m_PlotNoViaOnMaskOpt
->
GetValue
();
spot_mini
=
m_GerbSpotSizeMinOpt
->
GetValue
();
spot_mini
=
m_GerbSpotSizeMinOpt
->
GetValue
();
g_HPGL_Pen_Diam
=
m_HPGLPenSizeOpt
->
GetValue
();
g_HPGL_Pen_Diam
=
m_HPGLPenSizeOpt
->
GetValue
();
g_HPGL_Pen_Speed
=
m_HPGLPenSpeedOpt
->
GetValue
();
g_HPGL_Pen_Speed
=
m_HPGLPenSpeedOpt
->
GetValue
();
g_HPGL_Pen_Recouvrement
=
m_HPGLPenOverlayOpt
->
GetValue
();
g_HPGL_Pen_Recouvrement
=
m_HPGLPenOverlayOpt
->
GetValue
();
HPGL_Org_Centre
=
m_HPGL_PlotCenter_Opt
->
GetValue
();
HPGL_Org_Centre
=
m_HPGL_PlotCenter_Opt
->
GetValue
();
g_PlotLine_Width
=
m_LinesWidth
->
GetValue
();
g_PlotLine_Width
=
m_LinesWidth
->
GetValue
();
m_XScaleAdjust
=
m_FineAdjustXscaleOpt
->
GetValue
();
m_XScaleAdjust
=
m_FineAdjustXscaleOpt
->
GetValue
();
m_YScaleAdjust
=
m_FineAdjustYscaleOpt
->
GetValue
();
m_YScaleAdjust
=
m_FineAdjustYscaleOpt
->
GetValue
();
if
(
m_Parent
->
m_Parent
->
m_EDA_Config
)
if
(
m_Parent
->
m_Parent
->
m_EDA_Config
)
{
{
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
EDGELAYER_GERBER_OPT_KEY
,
g_Exclude_Edges_Pcb
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
EDGELAYER_GERBER_OPT_KEY
,
g_Exclude_Edges_Pcb
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
PLOT_XFINESCALE_ADJ_KEY
,
m_XScaleAdjust
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
PLOT_XFINESCALE_ADJ_KEY
,
m_XScaleAdjust
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
PLOT_YFINESCALE_ADJ_KEY
,
m_YScaleAdjust
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Write
(
PLOT_YFINESCALE_ADJ_KEY
,
m_YScaleAdjust
);
}
}
g_Plot_PS_Negative
=
m_Plot_PS_Negative
->
GetValue
();
g_Plot_PS_Negative
=
m_Plot_PS_Negative
->
GetValue
();
}
}
/***************************************************/
/***************************************************/
void
WinEDA_PlotFrame
::
Plot
(
wxCommandEvent
&
event
)
void
WinEDA_PlotFrame
::
Plot
(
wxCommandEvent
&
event
)
/***************************************************/
/***************************************************/
{
{
int
layer_to_plot
;
int
layer_to_plot
;
wxString
FullFileName
,
BaseFileName
;
wxString
FullFileName
,
BaseFileName
;
wxString
ext
;
wxString
ext
;
SaveOptPlot
(
event
);
BOARD
*
board
=
m_Parent
->
m_Pcb
;
switch
(
g_PlotScaleOpt
)
SaveOptPlot
(
event
);
{
default
:
switch
(
g_PlotScaleOpt
)
Scale_X
=
Scale_Y
=
1
;
{
break
;
default
:
Scale_X
=
Scale_Y
=
1
;
case
2
:
break
;
Scale_X
=
Scale_Y
=
1.5
;
break
;
case
2
:
Scale_X
=
Scale_Y
=
1.5
;
case
3
:
break
;
Scale_X
=
Scale_Y
=
2
;
break
;
case
3
:
Scale_X
=
Scale_Y
=
2
;
case
4
:
break
;
Scale_X
=
Scale_Y
=
3
;
break
;
case
4
:
}
Scale_X
=
Scale_Y
=
3
;
break
;
Scale_X
*=
m_XScaleAdjust
;
}
Scale_Y
*=
m_YScaleAdjust
;
Scale_X
*=
m_XScaleAdjust
;
BaseFileName
=
m_Parent
->
GetScreen
()
->
m_FileName
;
Scale_Y
*=
m_YScaleAdjust
;
ChangeFileNameExt
(
BaseFileName
,
wxT
(
"-"
)
);
BaseFileName
=
m_Parent
->
GetScreen
()
->
m_FileName
;
switch
(
m_PlotFormat
)
ChangeFileNameExt
(
BaseFileName
,
wxT
(
"-"
)
);
{
case
PLOT_FORMAT_POST
:
switch
(
m_PlotFormat
)
ext
=
wxT
(
".ps"
);
{
break
;
case
PLOT_FORMAT_POST
:
ext
=
wxT
(
".ps"
);
case
PLOT_FORMAT_GERBER
:
break
;
ext
=
wxT
(
".pho"
);
break
;
case
PLOT_FORMAT_GERBER
:
ext
=
wxT
(
".pho"
);
case
PLOT_FORMAT_HPGL
:
break
;
ext
=
wxT
(
".plt"
);
break
;
case
PLOT_FORMAT_HPGL
:
}
ext
=
wxT
(
".plt"
);
break
;
int
mask
=
1
;
}
s_SelectedLayers
=
0
;
int
mask
=
1
;
for
(
layer_to_plot
=
0
;
layer_to_plot
<
NB_LAYERS
;
layer_to_plot
++
,
mask
<<=
1
)
s_SelectedLayers
=
0
;
{
if
(
m_BoxSelecLayer
[
layer_to_plot
]
->
GetValue
()
)
for
(
layer_to_plot
=
0
;
layer_to_plot
<
NB_LAYERS
;
layer_to_plot
++
,
mask
<<=
1
)
{
{
s_SelectedLayers
|=
mask
;
if
(
m_BoxSelecLayer
[
layer_to_plot
]
->
GetValue
()
)
// Calcul du nom du fichier
{
FullFileName
=
BaseFileName
+
ReturnPcbLayerName
(
layer_to_plot
,
true
)
+
ext
;
s_SelectedLayers
|=
mask
;
switch
(
m_PlotFormat
)
{
// Calcul du nom du fichier
case
PLOT_FORMAT_POST
:
FullFileName
=
BaseFileName
+
board
->
GetLayerName
(
layer_to_plot
)
+
ext
;
m_Parent
->
Genere_PS
(
FullFileName
,
layer_to_plot
);
break
;
switch
(
m_PlotFormat
)
{
case
PLOT_FORMAT_GERBER
:
case
PLOT_FORMAT_POST
:
m_Parent
->
Genere_GERBER
(
FullFileName
,
layer_to_plot
,
s_PlotOriginIsAuxAxis
);
m_Parent
->
Genere_PS
(
FullFileName
,
layer_to_plot
);
break
;
break
;
case
PLOT_FORMAT_HPGL
:
case
PLOT_FORMAT_GERBER
:
m_Parent
->
Genere_HPGL
(
FullFileName
,
layer_to_plot
);
m_Parent
->
Genere_GERBER
(
FullFileName
,
layer_to_plot
,
s_PlotOriginIsAuxAxis
);
break
;
break
;
}
}
case
PLOT_FORMAT_HPGL
:
}
m_Parent
->
Genere_HPGL
(
FullFileName
,
layer_to_plot
);
break
;
}
}
}
// Close(true);
// Close(true);
}
}
/**************************************************************/
/**************************************************************/
void
WinEDA_BasePcbFrame
::
ToPlotter
(
wxCommandEvent
&
event
)
void
WinEDA_BasePcbFrame
::
ToPlotter
(
wxCommandEvent
&
event
)
/***************************************************************/
/***************************************************************/
{
{
WinEDA_PlotFrame
*
frame
=
new
WinEDA_PlotFrame
(
this
);
WinEDA_PlotFrame
*
frame
=
new
WinEDA_PlotFrame
(
this
);
frame
->
ShowModal
();
frame
->
Destroy
();
}
frame
->
ShowModal
();
frame
->
Destroy
();
}
pcbnew/pcbtexte.cpp
View file @
10e13ae5
...
@@ -89,9 +89,12 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p
...
@@ -89,9 +89,12 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p
DIALOG_STYLE
)
DIALOG_STYLE
)
/************************************************************************************/
/************************************************************************************/
{
{
wxButton
*
Button
;
wxButton
*
Button
;
BOARD
*
board
=
parent
->
m_Pcb
;
m_Parent
=
parent
;
m_Parent
=
parent
;
SetFont
(
*
g_DialogFont
);
SetFont
(
*
g_DialogFont
);
m_DC
=
DC
;
m_DC
=
DC
;
Centre
();
Centre
();
...
@@ -139,16 +142,17 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p
...
@@ -139,16 +142,17 @@ WinEDA_TextPCBPropertiesFrame::WinEDA_TextPCBPropertiesFrame( WinEDA_PcbFrame* p
wxDefaultPosition
,
wxDefaultSize
);
wxDefaultPosition
,
wxDefaultSize
);
MiddleBoxSizer
->
Add
(
m_SelLayerBox
,
0
,
wxGROW
|
wxALL
,
5
);
MiddleBoxSizer
->
Add
(
m_SelLayerBox
,
0
,
wxGROW
|
wxALL
,
5
);
int
ii
;
for
(
int
layer
=
0
;
layer
<
NB_LAYERS
;
++
layer
)
for
(
ii
=
0
;
ii
<
NB_LAYERS
;
ii
++
)
{
{
m_SelLayerBox
->
Append
(
ReturnPcbLayerName
(
ii
)
);
m_SelLayerBox
->
Append
(
board
->
GetLayerName
(
layer
)
);
}
}
m_SelLayerBox
->
SetSelection
(
TextPCB
->
GetLayer
()
);
m_SelLayerBox
->
SetSelection
(
TextPCB
->
GetLayer
()
);
wxString
orient_msg
[
4
]
=
{
wxT
(
"0"
),
wxT
(
"90"
),
wxT
(
"180"
),
wxT
(
"-90"
)
};
static
const
wxString
orient_msg
[
4
]
=
{
wxT
(
"0"
),
wxT
(
"90"
),
wxT
(
"180"
),
wxT
(
"-90"
)
};
m_Orient
=
new
wxRadioBox
(
this
,
-
1
,
_
(
"Orientation"
),
m_Orient
=
new
wxRadioBox
(
this
,
-
1
,
_
(
"Orientation"
),
wxDefaultPosition
,
wxSize
(
-
1
,
-
1
),
4
,
orient_msg
,
wxDefaultPosition
,
wxSize
(
-
1
,
-
1
),
4
,
orient_msg
,
1
,
wxRA_SPECIFY_COLS
);
1
,
wxRA_SPECIFY_COLS
);
...
...
pcbnew/protos.h
View file @
10e13ae5
...
@@ -71,12 +71,8 @@ void Trace_Pads_Only( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module, int ox,
...
@@ -71,12 +71,8 @@ void Trace_Pads_Only( WinEDA_DrawPanel* panel, wxDC* DC, MODULE* Module, int ox,
/* LOCATE.CPP : */
/* LOCATE.CPP : */
/****************/
/****************/
MODULE
*
ReturnModule
(
BOARD
*
Pcb
,
const
wxString
&
name
);
/* Recherche d'une empreinte par son nom */
/* Recherche d'une empreinte par son nom */
D_PAD
*
ReturnPad
(
MODULE
*
Module
,
const
wxString
&
name
);
/* Recherche d'un pad par son nom, pour le module Module */
/* Recherche d'un pad par son nom, pour le module Module */
TRACK
*
Locate_Via
(
BOARD
*
Pcb
,
const
wxPoint
&
pos
,
int
layer
=
-
1
);
TRACK
*
Locate_Via
(
BOARD
*
Pcb
,
const
wxPoint
&
pos
,
int
layer
=
-
1
);
...
@@ -417,7 +413,7 @@ MODULE* ListAndSelectModuleName( COMMAND* Cmd );
...
@@ -417,7 +413,7 @@ MODULE* ListAndSelectModuleName( COMMAND* Cmd );
/*****************/
/*****************/
/* SET_COLOR.CPP */
/* SET_COLOR.CPP */
/*****************/
/*****************/
void
DisplayColorSetupFrame
(
WinEDA_
Draw
Frame
*
parent
,
void
DisplayColorSetupFrame
(
WinEDA_
Pcb
Frame
*
parent
,
const
wxPoint
&
framepos
);
const
wxPoint
&
framepos
);
...
...
pcbnew/sel_layer.cpp
View file @
10e13ae5
...
@@ -40,15 +40,15 @@ public:
...
@@ -40,15 +40,15 @@ public:
private
:
private
:
void
Sel_Layer
(
wxCommandEvent
&
event
);
void
Sel_Layer
(
wxCommandEvent
&
event
);
void
OnCancelClick
(
wxCommandEvent
&
event
);
void
OnCancelClick
(
wxCommandEvent
&
event
);
DECLARE_EVENT_TABLE
()
DECLARE_EVENT_TABLE
()
};
};
/* Table des evenements pour WinEDA_SelLayerFrame */
/* Table des evenements pour WinEDA_SelLayerFrame */
BEGIN_EVENT_TABLE
(
WinEDA_SelLayerFrame
,
wxDialog
)
BEGIN_EVENT_TABLE
(
WinEDA_SelLayerFrame
,
wxDialog
)
EVT_BUTTON
(
wxID_OK
,
WinEDA_SelLayerFrame
::
Sel_Layer
)
EVT_BUTTON
(
wxID_OK
,
WinEDA_SelLayerFrame
::
Sel_Layer
)
EVT_BUTTON
(
wxID_CANCEL
,
WinEDA_SelLayerFrame
::
OnCancelClick
)
EVT_BUTTON
(
wxID_CANCEL
,
WinEDA_SelLayerFrame
::
OnCancelClick
)
EVT_RADIOBOX
(
ID_LAYER_SELECT
,
WinEDA_SelLayerFrame
::
Sel_Layer
)
EVT_RADIOBOX
(
ID_LAYER_SELECT
,
WinEDA_SelLayerFrame
::
Sel_Layer
)
END_EVENT_TABLE
()
END_EVENT_TABLE
()
...
@@ -101,6 +101,7 @@ WinEDA_SelLayerFrame::WinEDA_SelLayerFrame( WinEDA_BasePcbFrame* parent,
...
@@ -101,6 +101,7 @@ WinEDA_SelLayerFrame::WinEDA_SelLayerFrame( WinEDA_BasePcbFrame* parent,
* to the right of that radiobox.
* to the right of that radiobox.
*/
*/
{
{
BOARD
*
board
=
parent
->
m_Pcb
;
wxButton
*
Button
;
wxButton
*
Button
;
int
ii
;
int
ii
;
wxString
LayerList
[
NB_LAYERS
+
1
];
// One extra element for "(Deselect)" radiobutton
wxString
LayerList
[
NB_LAYERS
+
1
];
// One extra element for "(Deselect)" radiobutton
...
@@ -123,7 +124,7 @@ WinEDA_SelLayerFrame::WinEDA_SelLayerFrame( WinEDA_BasePcbFrame* parent,
...
@@ -123,7 +124,7 @@ WinEDA_SelLayerFrame::WinEDA_SelLayerFrame( WinEDA_BasePcbFrame* parent,
if
(
(
max_layer
>=
0
)
&&
(
max_layer
<
ii
)
)
if
(
(
max_layer
>=
0
)
&&
(
max_layer
<
ii
)
)
break
;
break
;
LayerList
[
LayerCount
]
=
ReturnPcb
LayerName
(
ii
);
LayerList
[
LayerCount
]
=
board
->
Get
LayerName
(
ii
);
if
(
ii
==
default_layer
)
if
(
ii
==
default_layer
)
LayerSelect
=
LayerCount
;
LayerSelect
=
LayerCount
;
...
@@ -207,8 +208,8 @@ public:
...
@@ -207,8 +208,8 @@ public:
~
WinEDA_SelLayerPairFrame
()
{
};
~
WinEDA_SelLayerPairFrame
()
{
};
private
:
private
:
void
OnOkClick
(
wxCommandEvent
&
event
);
void
OnOkClick
(
wxCommandEvent
&
event
);
void
OnCancelClick
(
wxCommandEvent
&
event
);
void
OnCancelClick
(
wxCommandEvent
&
event
);
DECLARE_EVENT_TABLE
()
DECLARE_EVENT_TABLE
()
};
};
...
@@ -216,8 +217,8 @@ private:
...
@@ -216,8 +217,8 @@ private:
/* Table des evenements pour WinEDA_SelLayerPairFrame */
/* Table des evenements pour WinEDA_SelLayerPairFrame */
BEGIN_EVENT_TABLE
(
WinEDA_SelLayerPairFrame
,
wxDialog
)
BEGIN_EVENT_TABLE
(
WinEDA_SelLayerPairFrame
,
wxDialog
)
EVT_BUTTON
(
wxID_OK
,
WinEDA_SelLayerPairFrame
::
OnOkClick
)
EVT_BUTTON
(
wxID_OK
,
WinEDA_SelLayerPairFrame
::
OnOkClick
)
EVT_BUTTON
(
wxID_CANCEL
,
WinEDA_SelLayerPairFrame
::
OnCancelClick
)
EVT_BUTTON
(
wxID_CANCEL
,
WinEDA_SelLayerPairFrame
::
OnCancelClick
)
END_EVENT_TABLE
()
END_EVENT_TABLE
()
...
@@ -249,8 +250,8 @@ void WinEDA_BasePcbFrame::SelectLayerPair()
...
@@ -249,8 +250,8 @@ void WinEDA_BasePcbFrame::SelectLayerPair()
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
SetToolbars
();
SetToolbars
();
// if user changed colors and we are in high contrast mode, then redraw
// if user changed colors and we are in high contrast mode, then redraw
// because the PAD_SMD pads may change color.
// because the PAD_SMD pads may change color.
if
(
result
>=
0
&&
DisplayOpt
.
ContrastModeDisplay
)
if
(
result
>=
0
&&
DisplayOpt
.
ContrastModeDisplay
)
{
{
ReDrawPanel
();
ReDrawPanel
();
...
@@ -264,6 +265,7 @@ WinEDA_SelLayerPairFrame::WinEDA_SelLayerPairFrame( WinEDA_BasePcbFrame* parent
...
@@ -264,6 +265,7 @@ WinEDA_SelLayerPairFrame::WinEDA_SelLayerPairFrame( WinEDA_BasePcbFrame* parent
wxSize
(
470
,
250
),
DIALOG_STYLE
)
wxSize
(
470
,
250
),
DIALOG_STYLE
)
/*******************************************************************************/
/*******************************************************************************/
{
{
BOARD
*
board
=
parent
->
m_Pcb
;
wxButton
*
Button
;
wxButton
*
Button
;
int
ii
,
LayerCount
;
int
ii
,
LayerCount
;
wxString
LayerList
[
NB_COPPER_LAYERS
];
wxString
LayerList
[
NB_COPPER_LAYERS
];
...
@@ -281,7 +283,7 @@ WinEDA_SelLayerPairFrame::WinEDA_SelLayerPairFrame( WinEDA_BasePcbFrame* parent
...
@@ -281,7 +283,7 @@ WinEDA_SelLayerPairFrame::WinEDA_SelLayerPairFrame( WinEDA_BasePcbFrame* parent
m_LayerId
[
ii
]
=
0
;
m_LayerId
[
ii
]
=
0
;
if
(
(
g_TabOneLayerMask
[
ii
]
&
Masque_Layer
)
)
if
(
(
g_TabOneLayerMask
[
ii
]
&
Masque_Layer
)
)
{
{
LayerList
[
LayerCount
]
=
ReturnPcb
LayerName
(
ii
);
LayerList
[
LayerCount
]
=
board
->
Get
LayerName
(
ii
);
if
(
ii
==
screen
->
m_Route_Layer_TOP
)
if
(
ii
==
screen
->
m_Route_Layer_TOP
)
LayerTopSelect
=
LayerCount
;
LayerTopSelect
=
LayerCount
;
if
(
ii
==
screen
->
m_Route_Layer_BOTTOM
)
if
(
ii
==
screen
->
m_Route_Layer_BOTTOM
)
...
...
pcbnew/set_color.cpp
View file @
10e13ae5
...
@@ -51,7 +51,7 @@ END_EVENT_TABLE()
...
@@ -51,7 +51,7 @@ END_EVENT_TABLE()
/*****************************************************/
/*****************************************************/
void
DisplayColorSetupFrame
(
WinEDA_
Draw
Frame
*
parent
,
void
DisplayColorSetupFrame
(
WinEDA_
Pcb
Frame
*
parent
,
const
wxPoint
&
framepos
)
const
wxPoint
&
framepos
)
/*****************************************************/
/*****************************************************/
{
{
...
@@ -72,7 +72,7 @@ WinEDA_SetColorsFrame::WinEDA_SetColorsFrame()
...
@@ -72,7 +72,7 @@ WinEDA_SetColorsFrame::WinEDA_SetColorsFrame()
// Standard Constructor
// Standard Constructor
WinEDA_SetColorsFrame
::
WinEDA_SetColorsFrame
(
WinEDA_
Draw
Frame
*
parent
,
WinEDA_SetColorsFrame
::
WinEDA_SetColorsFrame
(
WinEDA_
Pcb
Frame
*
parent
,
const
wxPoint
&
framepos
)
const
wxPoint
&
framepos
)
{
{
m_Parent
=
parent
;
m_Parent
=
parent
;
...
@@ -225,7 +225,7 @@ void WinEDA_SetColorsFrame::CreateControls()
...
@@ -225,7 +225,7 @@ void WinEDA_SetColorsFrame::CreateControls()
if
(
laytool_list
[
lyr
]
->
m_Title
==
wxT
(
"*"
)
)
if
(
laytool_list
[
lyr
]
->
m_Title
==
wxT
(
"*"
)
)
msg
=
g_ViaType_Name
[
laytool_list
[
lyr
]
->
m_LayerNumber
];
msg
=
g_ViaType_Name
[
laytool_list
[
lyr
]
->
m_LayerNumber
];
else
else
msg
=
ReturnPcb
LayerName
(
laytool_list
[
lyr
]
->
m_LayerNumber
);
msg
=
m_Parent
->
m_Pcb
->
Get
LayerName
(
laytool_list
[
lyr
]
->
m_LayerNumber
);
}
}
else
else
msg
=
wxGetTranslation
(
laytool_list
[
lyr
]
->
m_Title
.
GetData
()
);
msg
=
wxGetTranslation
(
laytool_list
[
lyr
]
->
m_Title
.
GetData
()
);
...
...
pcbnew/set_color.h
View file @
10e13ae5
...
@@ -492,7 +492,7 @@ static ColorButton* laytool_list[] = {
...
@@ -492,7 +492,7 @@ static ColorButton* laytool_list[] = {
&
VIA_THROUGH_Butt
,
&
VIA_THROUGH_Butt
,
&
VIA_BLIND_BURIED_Butt
,
&
VIA_BLIND_BURIED_Butt
,
&
MICRO_VIA_Butt
,
&
MICRO_VIA_Butt
,
&
Ratsnest_Butt
,
&
Ratsnest_Butt
,
&
Pad_Cu_Butt
,
&
Pad_Cu_Butt
,
&
Pad_Cmp_Butt
,
&
Pad_Cmp_Butt
,
...
@@ -526,7 +526,7 @@ private:
...
@@ -526,7 +526,7 @@ private:
DECLARE_DYNAMIC_CLASS
(
WinEDA_SetColorsFrame
)
DECLARE_DYNAMIC_CLASS
(
WinEDA_SetColorsFrame
)
DECLARE_EVENT_TABLE
()
DECLARE_EVENT_TABLE
()
WinEDA_
DrawFrame
*
m_Parent
;
WinEDA_
PcbFrame
*
m_Parent
;
wxBoxSizer
*
OuterBoxSizer
;
wxBoxSizer
*
OuterBoxSizer
;
wxBoxSizer
*
MainBoxSizer
;
wxBoxSizer
*
MainBoxSizer
;
wxFlexGridSizer
*
FlexColumnBoxSizer
;
wxFlexGridSizer
*
FlexColumnBoxSizer
;
...
@@ -566,7 +566,7 @@ private:
...
@@ -566,7 +566,7 @@ private:
public
:
public
:
// Constructors and destructor
// Constructors and destructor
WinEDA_SetColorsFrame
();
WinEDA_SetColorsFrame
();
WinEDA_SetColorsFrame
(
WinEDA_
Draw
Frame
*
parent
,
const
wxPoint
&
framepos
);
WinEDA_SetColorsFrame
(
WinEDA_
Pcb
Frame
*
parent
,
const
wxPoint
&
framepos
);
~
WinEDA_SetColorsFrame
();
~
WinEDA_SetColorsFrame
();
};
};
...
...
pcbnew/specctra_export.cpp
View file @
10e13ae5
...
@@ -826,6 +826,17 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
...
@@ -826,6 +826,17 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
layer
->
name
=
layerIds
[
pcbNdx
];
layer
->
name
=
layerIds
[
pcbNdx
];
DSN_T
layerType
;
switch
(
aBoard
->
GetLayerType
(
pcbLayer2kicad
[
pcbNdx
]
)
)
{
default
:
case
LT_SIGNAL
:
layerType
=
T_signal
;
break
;
case
LT_POWER
:
layerType
=
T_power
;
break
;
case
LT_MIXED
:
layerType
=
T_mixed
;
break
;
}
layer
->
layer_type
=
layerType
;
layer
->
properties
.
push_back
(
PROPERTY
()
);
layer
->
properties
.
push_back
(
PROPERTY
()
);
PROPERTY
*
property
=
&
layer
->
properties
.
back
();
PROPERTY
*
property
=
&
layer
->
properties
.
back
();
property
->
name
=
"index"
;
property
->
name
=
"index"
;
...
...
pcbnew/swap_layers.cpp
View file @
10e13ae5
...
@@ -71,6 +71,8 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) :
...
@@ -71,6 +71,8 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) :
wxDefaultSize
,
wxDEFAULT_DIALOG_STYLE
|
MAYBE_RESIZE_BORDER
)
wxDefaultSize
,
wxDEFAULT_DIALOG_STYLE
|
MAYBE_RESIZE_BORDER
)
/*************************************************************************/
/*************************************************************************/
{
{
BOARD
*
board
=
parent
->
m_Pcb
;
OuterBoxSizer
=
NULL
;
OuterBoxSizer
=
NULL
;
MainBoxSizer
=
NULL
;
MainBoxSizer
=
NULL
;
FlexColumnBoxSizer
=
NULL
;
FlexColumnBoxSizer
=
NULL
;
...
@@ -154,7 +156,8 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) :
...
@@ -154,7 +156,8 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) :
}
}
// Provide a text string to identify this layer (with trailing spaces within that string being purged)
// Provide a text string to identify this layer (with trailing spaces within that string being purged)
label
=
new
wxStaticText
(
this
,
wxID_STATIC
,
ReturnPcbLayerName
(
ii
).
Trim
(),
wxDefaultPosition
,
wxDefaultSize
,
wxALIGN_RIGHT
);
label
=
new
wxStaticText
(
this
,
wxID_STATIC
,
board
->
GetLayerName
(
ii
),
wxDefaultPosition
,
wxDefaultSize
,
wxALIGN_RIGHT
);
FlexColumnBoxSizer
->
Add
(
label
,
0
,
wxALIGN_RIGHT
|
wxALIGN_CENTER_VERTICAL
|
wxLEFT
|
wxBOTTOM
,
5
);
FlexColumnBoxSizer
->
Add
(
label
,
0
,
wxALIGN_RIGHT
|
wxALIGN_CENTER_VERTICAL
|
wxLEFT
|
wxBOTTOM
,
5
);
// Provide a button for this layer (which will invoke a child dialog box)
// Provide a button for this layer (which will invoke a child dialog box)
...
@@ -177,11 +180,11 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) :
...
@@ -177,11 +180,11 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame( WinEDA_BasePcbFrame* parent ) :
// strings to be truncated after different layers are selected.)
// strings to be truncated after different layers are selected.)
if
(
ii
==
0
)
if
(
ii
==
0
)
{
{
text
=
new
wxStaticText
(
this
,
item_ID
,
ReturnPcb
LayerName
(
0
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
text
=
new
wxStaticText
(
this
,
item_ID
,
board
->
Get
LayerName
(
0
),
wxDefaultPosition
,
wxDefaultSize
,
0
);
goodSize
=
text
->
GetSize
();
goodSize
=
text
->
GetSize
();
for
(
int
jj
=
1
;
jj
<
NB_LAYERS
;
jj
++
)
for
(
int
jj
=
1
;
jj
<
NB_LAYERS
;
jj
++
)
{
{
text
->
SetLabel
(
ReturnPcb
LayerName
(
jj
)
);
text
->
SetLabel
(
board
->
Get
LayerName
(
jj
)
);
if
(
goodSize
.
x
<
text
->
GetSize
().
x
)
if
(
goodSize
.
x
<
text
->
GetSize
().
x
)
goodSize
.
x
=
text
->
GetSize
().
x
;
goodSize
.
x
=
text
->
GetSize
().
x
;
}
}
...
@@ -252,7 +255,7 @@ void WinEDA_SwapLayerFrame::Sel_Layer( wxCommandEvent& event )
...
@@ -252,7 +255,7 @@ void WinEDA_SwapLayerFrame::Sel_Layer( wxCommandEvent& event )
if
(
(
jj
<
0
)
||
(
jj
>
NB_LAYERS
)
)
if
(
(
jj
<
0
)
||
(
jj
>
NB_LAYERS
)
)
jj
=
LAYER_NO_CHANGE
;
// (Defaults to "No Change".)
jj
=
LAYER_NO_CHANGE
;
// (Defaults to "No Change".)
jj
=
m_Parent
->
SelectLayer
(
jj
,
-
1
,
-
1
,
true
);
jj
=
m_Parent
->
SelectLayer
(
jj
,
-
1
,
-
1
,
true
);
if
(
(
jj
<
0
)
||
(
jj
>
NB_LAYERS
)
)
if
(
(
jj
<
0
)
||
(
jj
>
NB_LAYERS
)
)
return
;
return
;
...
@@ -280,7 +283,7 @@ void WinEDA_SwapLayerFrame::Sel_Layer( wxCommandEvent& event )
...
@@ -280,7 +283,7 @@ void WinEDA_SwapLayerFrame::Sel_Layer( wxCommandEvent& event )
}
}
else
else
{
{
layer_list
[
ii
]
->
SetLabel
(
ReturnPcb
LayerName
(
jj
)
);
layer_list
[
ii
]
->
SetLabel
(
m_Parent
->
m_Pcb
->
Get
LayerName
(
jj
)
);
// Change the text color to fushia (to highlight
// Change the text color to fushia (to highlight
// that this layer *is* being swapped)
// that this layer *is* being swapped)
layer_list
[
ii
]
->
SetForegroundColour
(
wxColour
(
255
,
0
,
128
)
);
layer_list
[
ii
]
->
SetForegroundColour
(
wxColour
(
255
,
0
,
128
)
);
...
...
pcbnew/tool_pcb.cpp
View file @
10e13ae5
...
@@ -691,7 +691,7 @@ WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
...
@@ -691,7 +691,7 @@ WinEDAChoiceBox* WinEDA_PcbFrame::ReCreateLayerBox( WinEDA_Toolbar* parent )
if
(
(
g_TabOneLayerMask
[
ii
]
&
Masque_Layer
)
)
if
(
(
g_TabOneLayerMask
[
ii
]
&
Masque_Layer
)
)
{
{
wxString
msg
=
ReturnPcbLayerName
(
ii
,
false
);
wxString
msg
=
m_Pcb
->
GetLayerName
(
ii
);
msg
=
AddHotkeyName
(
msg
,
s_Board_Editor_Hokeys_Descr
,
HK_SwitchLayer
[
ii
]
);
msg
=
AddHotkeyName
(
msg
,
s_Board_Editor_Hokeys_Descr
,
HK_SwitchLayer
[
ii
]
);
m_SelLayerBox
->
Append
(
msg
);
m_SelLayerBox
->
Append
(
msg
);
m_SelLayerBox
->
SetClientData
(
jj
,
(
void
*
)
ii
);
m_SelLayerBox
->
SetClientData
(
jj
,
(
void
*
)
ii
);
...
...
share/wxprint.cpp
View file @
10e13ae5
...
@@ -51,11 +51,11 @@
...
@@ -51,11 +51,11 @@
#ifdef PCBNEW
#ifdef PCBNEW
#include "pcbnew.h"
#include "pcbnew.h"
extern
float
Scale_X
,
Scale_Y
;
extern
float
Scale_X
,
Scale_Y
;
static
long
s_SelectedLayers
=
CUIVRE_LAYER
|
CMP_LAYER
|
static
long
s_SelectedLayers
=
CUIVRE_LAYER
|
CMP_LAYER
|
SILKSCREEN_LAYER_CMP
|
SILKSCREEN_LAYER_CU
;
SILKSCREEN_LAYER_CMP
|
SILKSCREEN_LAYER_CU
;
static
double
s_ScaleList
[]
=
static
double
s_ScaleList
[]
=
{
0
,
0.5
,
0.7
,
0.999
,
1.0
,
1.4
,
2.0
,
3.0
,
4.0
};
{
0
,
0.5
,
0.7
,
0.999
,
1.0
,
1.4
,
2.0
,
3.0
,
4.0
};
#endif
#endif
#include "protos.h"
#include "protos.h"
...
@@ -70,91 +70,97 @@ static double s_ScaleList[] =
...
@@ -70,91 +70,97 @@ static double s_ScaleList[] =
#define WIDTH_MIN_VALUE 1
#define WIDTH_MIN_VALUE 1
// static print data and page setup data, to remember settings during the session
// static print data and page setup data, to remember settings during the session
static
wxPrintData
*
g_PrintData
;
static
wxPrintData
*
g_PrintData
;
// Variables locales
// Variables locales
static
int
s_PrintPenMinWidth
=
6
;
/* Minimum pen width (in internal units) for printing */
static
int
s_PrintPenMinWidth
=
6
;
/* Minimum pen width (in internal units) for printing */
static
int
s_PrintMaskLayer
;
static
int
s_PrintMaskLayer
;
static
int
s_OptionPrintPage
=
0
;
static
int
s_OptionPrintPage
=
0
;
static
int
s_Print_Black_and_White
=
TRUE
;
static
int
s_Print_Black_and_White
=
TRUE
;
static
int
s_Scale_Select
=
3
;
// default selected scale = ScaleList[3] = 1
static
int
s_Scale_Select
=
3
;
// default selected scale = ScaleList[3] = 1
static
bool
s_PrintMirror
;
static
bool
s_PrintMirror
;
static
bool
s_Print_Sheet_Ref
=
TRUE
;
static
bool
s_Print_Sheet_Ref
=
TRUE
;
/****************************************************************/
/****************************************************************/
/* frame de Preparation de l'impression (options, selections... */
/* frame de Preparation de l'impression (options, selections... */
/****************************************************************/
/****************************************************************/
#include "dialog_print.cpp"
#include "dialog_print.cpp"
/***************************/
/***************************/
/* Gestion de l'impression */
/* Gestion de l'impression */
/***************************/
/***************************/
class
EDA_Printout
:
public
wxPrintout
class
EDA_Printout
:
public
wxPrintout
{
{
public
:
public
:
bool
m_Print_Sheet_Ref
;
bool
m_Print_Sheet_Ref
;
public
:
public
:
WinEDA_DrawFrame
*
m_Parent
;
WinEDA_DrawFrame
*
m_Parent
;
WinEDA_PrintFrame
*
m_PrintFrame
;
WinEDA_PrintFrame
*
m_PrintFrame
;
EDA_Printout
(
WinEDA_PrintFrame
*
print_frame
,
WinEDA_DrawFrame
*
parent
,
const
wxString
&
title
,
bool
print_ref
)
:
EDA_Printout
(
WinEDA_PrintFrame
*
print_frame
,
wxPrintout
(
title
)
WinEDA_DrawFrame
*
parent
,
{
const
wxString
&
title
,
m_PrintFrame
=
print_frame
;
bool
print_ref
)
:
m_Parent
=
parent
;
wxPrintout
(
title
)
{
s_PrintMaskLayer
=
0xFFFFFFFF
;
m_PrintFrame
=
print_frame
;
m_Print_Sheet_Ref
=
print_ref
;
m_Parent
=
parent
;
}
s_PrintMaskLayer
=
0xFFFFFFFF
;
m_Print_Sheet_Ref
=
print_ref
;
bool
OnPrintPage
(
int
page
);
}
bool
HasPage
(
int
page
);
bool
OnBeginDocument
(
int
startPage
,
int
endPage
);
bool
OnPrintPage
(
int
page
);
void
GetPageInfo
(
int
*
minPage
,
int
*
maxPage
,
int
*
selPageFrom
,
int
*
selPageTo
);
bool
HasPage
(
int
page
);
bool
OnBeginDocument
(
int
startPage
,
int
endPage
);
void
DrawPage
();
void
GetPageInfo
(
int
*
minPage
,
int
*
maxPage
,
int
*
selPageFrom
,
int
*
selPageTo
);
void
DrawPage
();
};
};
/*******************************************************/
/*******************************************************/
void
WinEDA_DrawFrame
::
ToPrinter
(
wxCommandEvent
&
event
)
void
WinEDA_DrawFrame
::
ToPrinter
(
wxCommandEvent
&
event
)
/*******************************************************/
/*******************************************************/
/* Prepare les structures de donn�es de gestion de l'impression
/* Prepare les structures de donn�es de gestion de l'impression
et affiche la fenetre de dialogue de gestion de l'impression des feuilles
*
et affiche la fenetre de dialogue de gestion de l'impression des feuilles
*/
*/
{
{
wxPoint
pos
=
GetPosition
();
wxPoint
pos
=
GetPosition
();
bool
PrinterError
=
FALSE
;
bool
PrinterError
=
FALSE
;
// Stop the pending comand (if any...)
// Stop the pending comand (if any...)
if
(
DrawPanel
->
ManageCurseur
&&
DrawPanel
->
ForceCloseManageCurseur
)
if
(
DrawPanel
->
ManageCurseur
&&
DrawPanel
->
ForceCloseManageCurseur
)
{
{
wxClientDC
dc
(
DrawPanel
);
wxClientDC
dc
(
DrawPanel
);
DrawPanel
->
PrepareDC
(
dc
);
DrawPanel
->
ForceCloseManageCurseur
(
DrawPanel
,
&
dc
);
DrawPanel
->
PrepareDC
(
dc
);
}
DrawPanel
->
ForceCloseManageCurseur
(
DrawPanel
,
&
dc
);
SetToolID
(
0
,
wxCURSOR_ARROW
,
wxEmptyString
);
}
SetToolID
(
0
,
wxCURSOR_ARROW
,
wxEmptyString
);
if
(
g_PrintData
==
NULL
)
// First print
{
if
(
g_PrintData
==
NULL
)
// First print
{
g_PrintData
=
new
wxPrintData
();
g_PrintData
=
new
wxPrintData
();
if
(
!
g_PrintData
->
Ok
()
)
{
if
(
!
g_PrintData
->
Ok
()
)
{
PrinterError
=
TRUE
;
PrinterError
=
TRUE
;
DisplayError
(
this
,
_
(
"Error Init Printer info"
)
);
DisplayError
(
this
,
_
(
"Error Init Printer info"
)
);
}
}
g_PrintData
->
SetQuality
(
wxPRINT_QUALITY_HIGH
);
// Default resolution = HIGHT;
g_PrintData
->
SetQuality
(
wxPRINT_QUALITY_HIGH
);
// Default resolution = HIGHT;
g_PrintData
->
SetOrientation
(
DEFAULT_ORIENTATION_PAPER
);
g_PrintData
->
SetOrientation
(
DEFAULT_ORIENTATION_PAPER
);
}
}
pos
.
x
+=
10
;
pos
.
y
+=
10
;
pos
.
x
+=
10
;
pos
.
y
+=
10
;
WinEDA_PrintFrame
*
frame
=
new
WinEDA_PrintFrame
(
this
);
WinEDA_PrintFrame
*
frame
=
new
WinEDA_PrintFrame
(
this
);
frame
->
ShowModal
();
frame
->
Destroy
();
frame
->
ShowModal
();
frame
->
Destroy
();
#ifdef EESCHEMA
#ifdef EESCHEMA
g_PrintFillMask
=
0
;
g_PrintFillMask
=
0
;
#endif
#endif
}
}
...
@@ -164,594 +170,641 @@ void WinEDA_PrintFrame::SetOthersDatas()
...
@@ -164,594 +170,641 @@ void WinEDA_PrintFrame::SetOthersDatas()
/*******************************************/
/*******************************************/
{
{
#ifndef PCBNEW
#ifndef PCBNEW
m_Print_Mirror
->
Enable
(
false
);
m_Print_Mirror
->
Enable
(
false
);
#endif
#endif
m_FineAdjustXscaleOpt
->
SetToolTip
(
_
(
"Set X scale adjust for exact scale plotting"
));
m_FineAdjustXscaleOpt
->
SetToolTip
(
_
(
"Set X scale adjust for exact scale plotting"
)
);
m_FineAdjustYscaleOpt
->
SetToolTip
(
_
(
"Set Y scale adjust for exact scale plotting"
));
m_FineAdjustYscaleOpt
->
SetToolTip
(
_
(
"Set Y scale adjust for exact scale plotting"
)
);
if
(
s_Print_Black_and_White
)
m_ColorOption
->
SetSelection
(
1
);
if
(
s_Print_Black_and_White
)
m_ColorOption
->
SetSelection
(
1
);
#ifdef PCBNEW
#ifdef PCBNEW
m_PagesOptionEeschema
->
Show
(
false
);
m_PagesOptionEeschema
->
Show
(
false
);
m_PagesOption
=
m_PagesOptionPcb
;
m_PagesOption
=
m_PagesOptionPcb
;
/* Create layer list */
int
mask
=
1
,
ii
;
/* Create layer list */
for
(
ii
=
0
;
ii
<
NB_LAYERS
;
ii
++
,
mask
<<=
1
)
int
mask
=
1
,
ii
;
{
for
(
ii
=
0
;
ii
<
NB_LAYERS
;
ii
++
,
mask
<<=
1
)
m_BoxSelecLayer
[
ii
]
=
new
wxCheckBox
(
this
,
-
1
,
{
ReturnPcbLayerName
(
ii
));
m_BoxSelecLayer
[
ii
]
=
new
wxCheckBox
(
this
,
-
1
,
if
(
mask
&
s_SelectedLayers
)
m_BoxSelecLayer
[
ii
]
->
SetValue
(
TRUE
);
#if defined(PCBNEW)
if
(
ii
<
16
)
((
WinEDA_PcbFrame
*
)
m_Parent
)
->
m_Pcb
->
GetLayerName
(
ii
)
);
m_CopperLayersBoxSizer
->
Add
(
m_BoxSelecLayer
[
ii
],
#else
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxTOP
|
wxADJUST_MINSIZE
);
ReturnLayerName
(
ii
)
);
else
#endif
m_TechLayersBoxSizer
->
Add
(
m_BoxSelecLayer
[
ii
],
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxTOP
|
wxADJUST_MINSIZE
);
if
(
mask
&
s_SelectedLayers
)
}
m_BoxSelecLayer
[
ii
]
->
SetValue
(
TRUE
);
// Read the scale adjust option
if
(
ii
<
16
)
if
(
m_Parent
->
m_Parent
->
m_EDA_Config
)
m_CopperLayersBoxSizer
->
Add
(
m_BoxSelecLayer
[
ii
],
{
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxTOP
|
wxADJUST_MINSIZE
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
wxT
(
"PrintXFineScaleAdj"
),
&
m_XScaleAdjust
);
else
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
wxT
(
"PrintYFineScaleAdj"
),
&
m_YScaleAdjust
);
m_TechLayersBoxSizer
->
Add
(
m_BoxSelecLayer
[
ii
],
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
wxT
(
"PrintScale"
),
&
s_Scale_Select
);
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxTOP
|
wxADJUST_MINSIZE
);
}
}
m_ScaleOption
->
SetSelection
(
s_Scale_Select
);
// Read the scale adjust option
if
(
m_Parent
->
m_Parent
->
m_EDA_Config
)
// Create scale adjust option
{
wxString
msg
;
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
wxT
(
"PrintXFineScaleAdj"
),
&
m_XScaleAdjust
);
msg
.
Printf
(
wxT
(
"%lf"
),
m_XScaleAdjust
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
wxT
(
"PrintYFineScaleAdj"
),
&
m_YScaleAdjust
);
m_FineAdjustXscaleOpt
->
SetValue
(
msg
);
m_Parent
->
m_Parent
->
m_EDA_Config
->
Read
(
wxT
(
"PrintScale"
),
&
s_Scale_Select
);
msg
.
Printf
(
wxT
(
"%lf"
),
m_YScaleAdjust
);
}
m_FineAdjustYscaleOpt
->
SetValue
(
msg
);
m_ScaleOption
->
SetSelection
(
s_Scale_Select
);
// Create scale adjust option
wxString
msg
;
msg
.
Printf
(
wxT
(
"%lf"
),
m_XScaleAdjust
);
m_FineAdjustXscaleOpt
->
SetValue
(
msg
);
msg
.
Printf
(
wxT
(
"%lf"
),
m_YScaleAdjust
);
m_FineAdjustYscaleOpt
->
SetValue
(
msg
);
#else
#else
m_PagesOption
=
m_PagesOptionEeschema
;
m_PagesOption
=
m_PagesOptionEeschema
;
m_PagesOptionPcb
->
Show
(
false
);
m_PagesOptionPcb
->
Show
(
false
);
m_ScaleOption
->
Show
(
false
);
m_ScaleOption
->
Show
(
false
);
m_FineAdjustXscaleTitle
->
Show
(
false
);
m_FineAdjustXscaleTitle
->
Show
(
false
);
m_FineAdjustXscaleOpt
->
Show
(
false
);
m_FineAdjustXscaleOpt
->
Show
(
false
);
m_FineAdjustYscaleTitle
->
Show
(
false
);
m_FineAdjustYscaleTitle
->
Show
(
false
);
m_FineAdjustYscaleOpt
->
Show
(
false
);
m_FineAdjustYscaleOpt
->
Show
(
false
);
#endif
#endif
}
}
/**********************************************************/
/**********************************************************/
int
WinEDA_PrintFrame
::
SetLayerMaskFromListSelection
()
int
WinEDA_PrintFrame
::
SetLayerMaskFromListSelection
()
/**********************************************************/
/**********************************************************/
{
{
int
page_count
;
int
page_count
;
s_PrintMaskLayer
=
0
;
s_PrintMaskLayer
=
0
;
#ifdef PCBNEW
#ifdef PCBNEW
int
ii
;
int
ii
;
for
(
ii
=
0
,
page_count
=
0
;
ii
<
NB_LAYERS
;
ii
++
)
for
(
ii
=
0
,
page_count
=
0
;
ii
<
NB_LAYERS
;
ii
++
)
{
{
if
(
m_BoxSelecLayer
[
ii
]
->
IsChecked
()
)
if
(
m_BoxSelecLayer
[
ii
]
->
IsChecked
()
)
{
{
page_count
++
;
page_count
++
;
s_PrintMaskLayer
|=
1
<<
ii
;
s_PrintMaskLayer
|=
1
<<
ii
;
}
}
}
}
#else
#else
page_count
=
1
;
page_count
=
1
;
#endif
#endif
return
page_count
;
return
page_count
;
}
}
/************************************************************/
/************************************************************/
void
WinEDA_PrintFrame
::
SetColorOrBlack
(
wxCommandEvent
&
event
)
void
WinEDA_PrintFrame
::
SetColorOrBlack
(
wxCommandEvent
&
event
)
/************************************************************/
/************************************************************/
{
{
s_Print_Black_and_White
=
m_ColorOption
->
GetSelection
();
s_Print_Black_and_White
=
m_ColorOption
->
GetSelection
();
}
}
/****************************************************/
/****************************************************/
void
WinEDA_PrintFrame
::
OnClosePrintDialog
()
void
WinEDA_PrintFrame
::
OnClosePrintDialog
()
/****************************************************/
/****************************************************/
/* called when WinEDA_PrintFrame is closed
/* called when WinEDA_PrintFrame is closed
*/
*/
{
{
wxConfig
*
Config
=
m_Parent
->
m_Parent
->
m_EDA_Config
;
wxConfig
*
Config
=
m_Parent
->
m_Parent
->
m_EDA_Config
;
if
(
Config
)
{
if
(
Config
)
Config
->
Write
(
wxT
(
"PrintPenWidth"
),
s_PrintPenMinWidth
);
{
}
Config
->
Write
(
wxT
(
"PrintPenWidth"
),
s_PrintPenMinWidth
);
}
if
(
m_FineAdjustXscaleOpt
)
m_FineAdjustXscaleOpt
->
GetValue
().
ToDouble
(
&
m_XScaleAdjust
);
if
(
m_FineAdjustXscaleOpt
)
if
(
m_FineAdjustYscaleOpt
)
m_FineAdjustXscaleOpt
->
GetValue
().
ToDouble
(
&
m_XScaleAdjust
);
m_FineAdjustYscaleOpt
->
GetValue
().
ToDouble
(
&
m_YScaleAdjust
);
if
(
m_FineAdjustYscaleOpt
)
SetPenWidth
();
m_FineAdjustYscaleOpt
->
GetValue
().
ToDouble
(
&
m_YScaleAdjust
);
SetPenWidth
();
#ifdef PCBNEW
#ifdef PCBNEW
if
(
Config
)
if
(
Config
)
{
{
Config
->
Write
(
wxT
(
"PrintXFineScaleAdj"
),
m_XScaleAdjust
);
Config
->
Write
(
wxT
(
"PrintXFineScaleAdj"
),
m_XScaleAdjust
);
Config
->
Write
(
wxT
(
"PrintYFineScaleAdj"
),
m_YScaleAdjust
);
Config
->
Write
(
wxT
(
"PrintYFineScaleAdj"
),
m_YScaleAdjust
);
Config
->
Write
(
wxT
(
"PrintScale"
),
s_Scale_Select
);
Config
->
Write
(
wxT
(
"PrintScale"
),
s_Scale_Select
);
}
}
#endif
#endif
EndModal
(
0
);
EndModal
(
0
);
}
}
/************************************************/
/************************************************/
wxString
WinEDA_PrintFrame
::
BuildPrintTitle
()
wxString
WinEDA_PrintFrame
::
BuildPrintTitle
()
/************************************************/
/************************************************/
/* return a valid filename to create a print file
/* return a valid filename to create a print file
*/
*/
{
{
wxString
name
,
ext
;
wxString
name
,
ext
;
wxFileName
::
SplitPath
(
m_Parent
->
GetScreen
()
->
m_FileName
,
wxFileName
::
SplitPath
(
m_Parent
->
GetScreen
()
->
m_FileName
,
(
wxString
*
)
NULL
,
&
name
,
&
ext
);
(
wxString
*
)
NULL
,
&
name
,
&
ext
);
name
+=
wxT
(
"-"
)
+
ext
;
name
+=
wxT
(
"-"
)
+
ext
;
return
name
;
return
name
;
}
}
/******************************************************/
/******************************************************/
void
WinEDA_PrintFrame
::
SetScale
(
wxCommandEvent
&
event
)
void
WinEDA_PrintFrame
::
SetScale
(
wxCommandEvent
&
event
)
/******************************************************/
/******************************************************/
{
{
#ifdef PCBNEW
#ifdef PCBNEW
s_Scale_Select
=
m_ScaleOption
->
GetSelection
();
s_Scale_Select
=
m_ScaleOption
->
GetSelection
();
Scale_X
=
Scale_Y
=
s_ScaleList
[
s_Scale_Select
];
Scale_X
=
Scale_Y
=
s_ScaleList
[
s_Scale_Select
];
if
(
m_FineAdjustXscaleOpt
)
if
(
m_FineAdjustXscaleOpt
)
m_FineAdjustXscaleOpt
->
GetValue
().
ToDouble
(
&
m_XScaleAdjust
);
m_FineAdjustXscaleOpt
->
GetValue
().
ToDouble
(
&
m_XScaleAdjust
);
if
(
m_FineAdjustYscaleOpt
)
if
(
m_FineAdjustYscaleOpt
)
m_FineAdjustYscaleOpt
->
GetValue
().
ToDouble
(
&
m_YScaleAdjust
);
m_FineAdjustYscaleOpt
->
GetValue
().
ToDouble
(
&
m_YScaleAdjust
);
Scale_X
*=
m_XScaleAdjust
;
Scale_X
*=
m_XScaleAdjust
;
Scale_Y
*=
m_YScaleAdjust
;
Scale_Y
*=
m_YScaleAdjust
;
#endif
#endif
}
}
/****************************************/
/****************************************/
void
WinEDA_PrintFrame
::
SetPenWidth
()
void
WinEDA_PrintFrame
::
SetPenWidth
()
/****************************************/
/****************************************/
/* Get the new pen width value, and verify min et max value
/* Get the new pen width value, and verify min et max value
NOTE: s_PrintPenMinWidth is in internal units
*
NOTE: s_PrintPenMinWidth is in internal units
*/
*/
{
{
s_PrintPenMinWidth
=
m_DialogPenWidth
->
GetValue
();
s_PrintPenMinWidth
=
m_DialogPenWidth
->
GetValue
();
if
(
s_PrintPenMinWidth
>
WIDTH_MAX_VALUE
)
if
(
s_PrintPenMinWidth
>
WIDTH_MAX_VALUE
)
{
{
s_PrintPenMinWidth
=
WIDTH_MAX_VALUE
;
s_PrintPenMinWidth
=
WIDTH_MAX_VALUE
;
}
}
if
(
s_PrintPenMinWidth
<
WIDTH_MIN_VALUE
)
if
(
s_PrintPenMinWidth
<
WIDTH_MIN_VALUE
)
{
{
s_PrintPenMinWidth
=
WIDTH_MIN_VALUE
;
s_PrintPenMinWidth
=
WIDTH_MIN_VALUE
;
}
}
m_DialogPenWidth
->
SetValue
(
s_PrintPenMinWidth
);
m_DialogPenWidth
->
SetValue
(
s_PrintPenMinWidth
);
}
}
/**********************************************************/
/**********************************************************/
void
WinEDA_PrintFrame
::
OnPrintSetup
(
wxCommandEvent
&
event
)
void
WinEDA_PrintFrame
::
OnPrintSetup
(
wxCommandEvent
&
event
)
/**********************************************************/
/**********************************************************/
/* Open a dialog box for printer setup (printer options, page size ...)
/* Open a dialog box for printer setup (printer options, page size ...)
*/
*/
{
{
wxPrintDialogData
printDialogData
(
*
g_PrintData
);
wxPrintDialogData
printDialogData
(
*
g_PrintData
);
if
(
printDialogData
.
Ok
()
)
{
wxPrintDialog
printerDialog
(
this
,
&
printDialogData
);
printerDialog
.
ShowModal
();
*
g_PrintData
=
printerDialog
.
GetPrintDialogData
().
GetPrintData
();
if
(
printDialogData
.
Ok
()
)
}
{
else
DisplayError
(
this
,
_
(
"Printer Problem!"
)
);
wxPrintDialog
printerDialog
(
this
,
&
printDialogData
);
printerDialog
.
ShowModal
();
*
g_PrintData
=
printerDialog
.
GetPrintDialogData
().
GetPrintData
();
}
else
DisplayError
(
this
,
_
(
"Printer Problem!"
)
);
}
}
/************************************************************/
/************************************************************/
void
WinEDA_PrintFrame
::
OnPrintPreview
(
wxCommandEvent
&
event
)
void
WinEDA_PrintFrame
::
OnPrintPreview
(
wxCommandEvent
&
event
)
/************************************************************/
/************************************************************/
/* Open and display a previewer frame for printing
/* Open and display a previewer frame for printing
*/
*/
{
{
wxSize
WSize
;
wxSize
WSize
;
wxPoint
WPos
;
wxPoint
WPos
;
int
x
,
y
;
int
x
,
y
;
bool
print_ref
=
TRUE
;
bool
print_ref
=
TRUE
;
SetScale
(
event
);
SetScale
(
event
);
SetPenWidth
();
SetPenWidth
();
if
(
m_PagesOption
)
if
(
m_PagesOption
)
s_OptionPrintPage
=
m_PagesOption
->
GetSelection
();
s_OptionPrintPage
=
m_PagesOption
->
GetSelection
();
if
(
(
m_Print_Sheet_Ref
==
NULL
)
||
(
m_Print_Sheet_Ref
->
GetValue
()
==
FALSE
)
)
if
(
(
m_Print_Sheet_Ref
==
NULL
)
||
(
m_Print_Sheet_Ref
->
GetValue
()
==
FALSE
)
)
print_ref
=
FALSE
;
print_ref
=
FALSE
;
// Pass two printout objects: for preview, and possible printing.
// Pass two printout objects: for preview, and possible printing.
wxString
title
=
BuildPrintTitle
();
wxString
title
=
BuildPrintTitle
();
wxPrintPreview
*
preview
=
wxPrintPreview
*
preview
=
new
wxPrintPreview
(
new
EDA_Printout
(
this
,
m_Parent
,
title
,
print_ref
),
new
wxPrintPreview
(
new
EDA_Printout
(
this
,
m_Parent
,
title
,
print_ref
),
new
EDA_Printout
(
this
,
m_Parent
,
title
,
print_ref
),
g_PrintData
);
new
EDA_Printout
(
this
,
m_Parent
,
title
,
print_ref
),
g_PrintData
);
if
(
preview
==
NULL
)
{
if
(
preview
==
NULL
)
DisplayError
(
this
,
_
(
"There was a problem previewing"
));
{
return
;
DisplayError
(
this
,
_
(
"There was a problem previewing"
)
);
}
return
;
}
#ifdef PCBNEW
#ifdef PCBNEW
if
(
s_OptionPrintPage
)
SetLayerMaskFromListSelection
();
if
(
s_OptionPrintPage
)
SetLayerMaskFromListSelection
();
#endif
#endif
m_Parent
->
GetPosition
(
&
x
,
&
y
);
m_Parent
->
GetPosition
(
&
x
,
&
y
);
WPos
.
x
=
x
+
4
;
WPos
.
x
=
x
+
4
;
WPos
.
y
=
y
+
25
;
WPos
.
y
=
y
+
25
;
WSize
=
m_Parent
->
GetSize
();
WSize
=
m_Parent
->
GetSize
();
WSize
.
x
-=
3
;
WSize
.
x
-=
3
;
WSize
.
y
+=
6
;
WSize
.
y
+=
6
;
wxPreviewFrame
*
frame
=
new
wxPreviewFrame
(
preview
,
this
,
wxPreviewFrame
*
frame
=
new
wxPreviewFrame
(
preview
,
this
,
title
,
WPos
,
WSize
);
title
,
WPos
,
WSize
);
frame
->
Initialize
();
frame
->
Show
(
TRUE
);
frame
->
Initialize
();
frame
->
Show
(
TRUE
);
}
}
/**********************************************************/
/**********************************************************/
void
WinEDA_PrintFrame
::
EDA_PrintPage
(
wxCommandEvent
&
event
)
void
WinEDA_PrintFrame
::
EDA_PrintPage
(
wxCommandEvent
&
event
)
/**********************************************************/
/**********************************************************/
/* Called on activate "Print CURRENT" button
/* Called on activate "Print CURRENT" button
*/
*/
{
{
bool
print_ref
=
TRUE
;
bool
print_ref
=
TRUE
;
SetScale
(
event
);
SetScale
(
event
);
s_OptionPrintPage
=
0
;
s_OptionPrintPage
=
0
;
if
(
m_PagesOption
)
if
(
m_PagesOption
)
s_OptionPrintPage
=
m_PagesOption
->
GetSelection
();
s_OptionPrintPage
=
m_PagesOption
->
GetSelection
();
if
(
(
m_Print_Sheet_Ref
==
NULL
)
||
(
m_Print_Sheet_Ref
->
GetValue
()
==
FALSE
)
)
if
(
(
m_Print_Sheet_Ref
==
NULL
)
||
(
m_Print_Sheet_Ref
->
GetValue
()
==
FALSE
)
)
print_ref
=
FALSE
;
print_ref
=
FALSE
;
#ifdef PCBNEW
#ifdef PCBNEW
if
(
s_OptionPrintPage
)
SetLayerMaskFromListSelection
();
if
(
s_OptionPrintPage
)
SetLayerMaskFromListSelection
();
#endif
#endif
SetPenWidth
();
SetPenWidth
();
wxPrintDialogData
printDialogData
(
*
g_PrintData
);
wxPrintDialogData
printDialogData
(
*
g_PrintData
);
wxPrinter
printer
(
&
printDialogData
);
wxPrinter
printer
(
&
printDialogData
);
wxString
title
=
BuildPrintTitle
();
wxString
title
=
BuildPrintTitle
();
EDA_Printout
printout
(
this
,
m_Parent
,
title
,
print_ref
);
EDA_Printout
printout
(
this
,
m_Parent
,
title
,
print_ref
);
#ifndef __WINDOWS__
#ifndef __WINDOWS__
wxDC
*
dc
=
printout
.
GetDC
();
wxDC
*
dc
=
printout
.
GetDC
();
((
wxPostScriptDC
*
)
dc
)
->
SetResolution
(
600
);
// Postscript DC resolution is 600 ppi
(
(
wxPostScriptDC
*
)
dc
)
->
SetResolution
(
600
);
// Postscript DC resolution is 600 ppi
#endif
#endif
if
(
!
printer
.
Print
(
this
,
&
printout
,
TRUE
)
)
if
(
!
printer
.
Print
(
this
,
&
printout
,
TRUE
)
)
{
{
if
(
wxPrinter
::
GetLastError
()
==
wxPRINTER_ERROR
)
if
(
wxPrinter
::
GetLastError
()
==
wxPRINTER_ERROR
)
DisplayError
(
this
,
_
(
"There was a problem printing"
)
);
DisplayError
(
this
,
_
(
"There was a problem printing"
)
);
return
;
return
;
}
}
else
else
{
{
*
g_PrintData
=
printer
.
GetPrintDialogData
().
GetPrintData
();
*
g_PrintData
=
printer
.
GetPrintDialogData
().
GetPrintData
();
}
}
}
}
/***************************************/
/***************************************/
bool
EDA_Printout
::
OnPrintPage
(
int
page
)
bool
EDA_Printout
::
OnPrintPage
(
int
page
)
/***************************************/
/***************************************/
{
{
wxString
msg
;
wxString
msg
;
msg
.
Printf
(
_
(
"Print page %d"
),
page
);
msg
.
Printf
(
_
(
"Print page %d"
),
page
);
m_Parent
->
Affiche_Message
(
msg
);
m_Parent
->
Affiche_Message
(
msg
);
#ifdef EESCHEMA
#ifdef EESCHEMA
BASE_SCREEN
*
screen
=
m_Parent
->
GetScreen
();
BASE_SCREEN
*
screen
=
m_Parent
->
GetScreen
();
BASE_SCREEN
*
oldscreen
=
screen
;
BASE_SCREEN
*
oldscreen
=
screen
;
if
(
s_OptionPrintPage
==
1
)
if
(
s_OptionPrintPage
==
1
)
{
{
EDA_ScreenList
ScreenList
;
EDA_ScreenList
ScreenList
;
screen
=
ScreenList
.
GetScreen
(
page
-
1
);
screen
=
ScreenList
.
GetScreen
(
page
-
1
);
}
}
if
(
screen
==
NULL
)
return
FALSE
;
if
(
screen
==
NULL
)
ActiveScreen
=
(
SCH_SCREEN
*
)
screen
;
return
FALSE
;
DrawPage
();
ActiveScreen
=
(
SCH_SCREEN
*
)
screen
;
ActiveScreen
=
(
SCH_SCREEN
*
)
oldscreen
;
DrawPage
();
ActiveScreen
=
(
SCH_SCREEN
*
)
oldscreen
;
#endif
#endif
#ifdef PCBNEW
#ifdef PCBNEW
if
(
(
m_Parent
->
m_Ident
==
PCB_FRAME
)
||
(
m_Parent
->
m_Ident
==
GERBER_FRAME
)
)
if
(
(
m_Parent
->
m_Ident
==
PCB_FRAME
)
||
(
m_Parent
->
m_Ident
==
GERBER_FRAME
)
)
{
{
m_PrintFrame
->
SetLayerMaskFromListSelection
();
m_PrintFrame
->
SetLayerMaskFromListSelection
();
if
(
s_OptionPrintPage
==
0
)
if
(
s_OptionPrintPage
==
0
)
{
{
// compute layer mask from page number
// compute layer mask from page number
int
ii
,
jj
,
mask
=
1
;
int
ii
,
jj
,
mask
=
1
;
for
(
ii
=
0
,
jj
=
0
;
ii
<
NB_LAYERS
;
ii
++
)
for
(
ii
=
0
,
jj
=
0
;
ii
<
NB_LAYERS
;
ii
++
)
{
{
if
(
s_PrintMaskLayer
&
mask
)
jj
++
;
if
(
s_PrintMaskLayer
&
mask
)
if
(
jj
==
page
)
jj
++
;
{
if
(
jj
==
page
)
s_PrintMaskLayer
=
mask
;
{
break
;
s_PrintMaskLayer
=
mask
;
}
break
;
mask
<<=
1
;
}
}
mask
<<=
1
;
if
(
ii
==
NB_LAYERS
)
return
FALSE
;
}
}
}
if
(
ii
==
NB_LAYERS
)
DrawPage
();
return
FALSE
;
}
}
DrawPage
();
#endif
#endif
return
TRUE
;
return
TRUE
;
}
}
/*********************************************************/
/*********************************************************/
void
EDA_Printout
::
GetPageInfo
(
int
*
minPage
,
int
*
maxPage
,
void
EDA_Printout
::
GetPageInfo
(
int
*
minPage
,
int
*
maxPage
,
int
*
selPageFrom
,
int
*
selPageTo
)
int
*
selPageFrom
,
int
*
selPageTo
)
/*********************************************************/
/*********************************************************/
{
{
int
ii
=
1
;
int
ii
=
1
;
*
minPage
=
1
;
*
selPageFrom
=
1
;
*
minPage
=
1
;
*
selPageFrom
=
1
;
#ifdef EESCHEMA
#ifdef EESCHEMA
if
(
s_OptionPrintPage
==
1
)
if
(
s_OptionPrintPage
==
1
)
{
{
EDA_ScreenList
ScreenList
;
EDA_ScreenList
ScreenList
;
ii
=
ScreenList
.
GetCount
();
ii
=
ScreenList
.
GetCount
();
}
}
#endif
#endif
#ifdef PCBNEW
#ifdef PCBNEW
switch
(
s_OptionPrintPage
)
{
switch
(
s_OptionPrintPage
)
case
0
:
ii
=
m_PrintFrame
->
SetLayerMaskFromListSelection
();
{
break
;
case
0
:
ii
=
m_PrintFrame
->
SetLayerMaskFromListSelection
();
case
1
:
break
;
ii
=
1
;
break
;
case
1
:
}
ii
=
1
;
break
;
}
#endif
#endif
*
maxPage
=
ii
;
*
maxPage
=
ii
;
*
selPageTo
=
ii
;
*
selPageTo
=
ii
;
}
}
/**************************************/
/**************************************/
bool
EDA_Printout
::
HasPage
(
int
pageNum
)
bool
EDA_Printout
::
HasPage
(
int
pageNum
)
/**************************************/
/**************************************/
{
{
#ifdef EESCHEMA
#ifdef EESCHEMA
int
PageCount
;
int
PageCount
;
EDA_ScreenList
ScreenList
;
EDA_ScreenList
ScreenList
;
PageCount
=
ScreenList
.
GetCount
();
PageCount
=
ScreenList
.
GetCount
();
if
(
PageCount
>=
pageNum
)
return
TRUE
;
if
(
PageCount
>=
pageNum
)
return
TRUE
;
return
FALSE
;
return
FALSE
;
#endif
#endif
#ifdef PCBNEW
#ifdef PCBNEW
return
TRUE
;
return
TRUE
;
#endif
#endif
}
}
/*************************************************************/
/*************************************************************/
bool
EDA_Printout
::
OnBeginDocument
(
int
startPage
,
int
endPage
)
bool
EDA_Printout
::
OnBeginDocument
(
int
startPage
,
int
endPage
)
/*************************************************************/
/*************************************************************/
{
{
if
(
!
wxPrintout
::
OnBeginDocument
(
startPage
,
endPage
)
)
if
(
!
wxPrintout
::
OnBeginDocument
(
startPage
,
endPage
)
)
return
FALSE
;
return
FALSE
;
return
TRUE
;
return
TRUE
;
}
}
/********************************/
/********************************/
void
EDA_Printout
::
DrawPage
()
void
EDA_Printout
::
DrawPage
()
/********************************/
/********************************/
/*
/*
This is the real print function: print the active screen
*
This is the real print function: print the active screen
*/
*/
{
{
int
tmpzoom
;
int
tmpzoom
;
wxPoint
tmp_startvisu
;
wxPoint
tmp_startvisu
;
wxSize
PageSize_in_mm
;
wxSize
PageSize_in_mm
;
wxSize
SheetSize
;
// Page size in internal units
wxSize
SheetSize
;
// Page size in internal units
wxSize
PlotAreaSize
;
// plot area size in pixels
wxSize
PlotAreaSize
;
// plot area size in pixels
double
scaleX
,
scaleY
,
scale
;
double
scaleX
,
scaleY
,
scale
;
wxPoint
old_org
;
wxPoint
old_org
;
wxPoint
DrawOffset
;
// Offset de trace
wxPoint
DrawOffset
;
// Offset de trace
double
userscale
;
double
userscale
;
int
DrawZoom
=
1
;
int
DrawZoom
=
1
;
wxDC
*
dc
=
GetDC
();
wxDC
*
dc
=
GetDC
();
s_PrintMirror
=
m_PrintFrame
->
m_Print_Mirror
->
GetValue
();
s_PrintMirror
=
m_PrintFrame
->
m_Print_Mirror
->
GetValue
();
wxBusyCursor
dummy
;
wxBusyCursor
dummy
;
GetPageSizeMM
(
&
PageSize_in_mm
.
x
,
&
PageSize_in_mm
.
y
);
GetPageSizeMM
(
&
PageSize_in_mm
.
x
,
&
PageSize_in_mm
.
y
);
/* Save old draw scale and draw offset */
/* Save old draw scale and draw offset */
tmp_startvisu
=
ActiveScreen
->
m_StartVisu
;
tmp_startvisu
=
ActiveScreen
->
m_StartVisu
;
tmpzoom
=
ActiveScreen
->
GetZoom
();
tmpzoom
=
ActiveScreen
->
GetZoom
();
old_org
=
ActiveScreen
->
m_DrawOrg
;
old_org
=
ActiveScreen
->
m_DrawOrg
;
/* Change draw scale and offset to draw the whole page */
/* Change draw scale and offset to draw the whole page */
ActiveScreen
->
SetZoom
(
DrawZoom
);
ActiveScreen
->
SetZoom
(
DrawZoom
);
ActiveScreen
->
m_DrawOrg
.
x
=
ActiveScreen
->
m_DrawOrg
.
y
=
0
;
ActiveScreen
->
m_DrawOrg
.
x
=
ActiveScreen
->
m_DrawOrg
.
y
=
0
;
ActiveScreen
->
m_StartVisu
.
x
=
ActiveScreen
->
m_StartVisu
.
y
=
0
;
ActiveScreen
->
m_StartVisu
.
x
=
ActiveScreen
->
m_StartVisu
.
y
=
0
;
SheetSize
=
ActiveScreen
->
m_CurrentSheetDesc
->
m_Size
;
// size in 1/1000 inch
SheetSize
=
ActiveScreen
->
m_CurrentSheetDesc
->
m_Size
;
// size in 1/1000 inch
SheetSize
.
x
*=
m_Parent
->
m_InternalUnits
/
1000
;
SheetSize
.
x
*=
m_Parent
->
m_InternalUnits
/
1000
;
SheetSize
.
y
*=
m_Parent
->
m_InternalUnits
/
1000
;
// size in pixels
SheetSize
.
y
*=
m_Parent
->
m_InternalUnits
/
1000
;
// size in pixels
// Get the size of the DC in pixels
// Get the size of the DC in pixels
dc
->
GetSize
(
&
PlotAreaSize
.
x
,
&
PlotAreaSize
.
y
);
dc
->
GetSize
(
&
PlotAreaSize
.
x
,
&
PlotAreaSize
.
y
);
#ifdef PCBNEW
#ifdef PCBNEW
WinEDA_BasePcbFrame
*
pcbframe
=
(
WinEDA_BasePcbFrame
*
)
m_Parent
;
WinEDA_BasePcbFrame
*
pcbframe
=
(
WinEDA_BasePcbFrame
*
)
m_Parent
;
pcbframe
->
m_Pcb
->
ComputeBoundaryBox
();
pcbframe
->
m_Pcb
->
ComputeBoundaryBox
();
/* Compute the PCB size in internal units*/
/* Compute the PCB size in internal units*/
userscale
=
s_ScaleList
[
s_Scale_Select
];
userscale
=
s_ScaleList
[
s_Scale_Select
];
if
(
userscale
==
0
)
// fit in page
if
(
userscale
==
0
)
// fit in page
{
{
int
extra_margin
=
8000
;
// Margin = 8000/2 units pcb = 0,4 inch
int
extra_margin
=
8000
;
// Margin = 8000/2 units pcb = 0,4 inch
SheetSize
.
x
=
pcbframe
->
m_Pcb
->
m_BoundaryBox
.
GetWidth
()
+
extra_margin
;
SheetSize
.
x
=
pcbframe
->
m_Pcb
->
m_BoundaryBox
.
GetWidth
()
+
extra_margin
;
SheetSize
.
y
=
pcbframe
->
m_Pcb
->
m_BoundaryBox
.
GetHeight
()
+
extra_margin
;
SheetSize
.
y
=
pcbframe
->
m_Pcb
->
m_BoundaryBox
.
GetHeight
()
+
extra_margin
;
userscale
=
0.99
;
userscale
=
0.99
;
}
}
if
(
(
s_ScaleList
[
s_Scale_Select
]
>
1.0
)
||
// scale > 1 -> Recadrage
if
(
(
s_ScaleList
[
s_Scale_Select
]
>
1.0
)
// scale > 1 -> Recadrage
(
s_ScaleList
[
s_Scale_Select
]
==
0
)
)
// fit in page
||
(
s_ScaleList
[
s_Scale_Select
]
==
0
)
)
// fit in page
{
{
DrawOffset
.
x
+=
pcbframe
->
m_Pcb
->
m_BoundaryBox
.
Centre
().
x
;
DrawOffset
.
x
+=
pcbframe
->
m_Pcb
->
m_BoundaryBox
.
Centre
().
x
;
DrawOffset
.
y
+=
pcbframe
->
m_Pcb
->
m_BoundaryBox
.
Centre
().
y
;
DrawOffset
.
y
+=
pcbframe
->
m_Pcb
->
m_BoundaryBox
.
Centre
().
y
;
}
}
#else
#else
userscale
=
1
;
userscale
=
1
;
#endif
#endif
// Calculate a suitable scaling factor
// Calculate a suitable scaling factor
scaleX
=
(
double
)
SheetSize
.
x
/
PlotAreaSize
.
x
;
scaleX
=
(
double
)
SheetSize
.
x
/
PlotAreaSize
.
x
;
scaleY
=
(
double
)
SheetSize
.
y
/
PlotAreaSize
.
y
;
scaleY
=
(
double
)
SheetSize
.
y
/
PlotAreaSize
.
y
;
scale
=
wxMax
(
scaleX
,
scaleY
)
/
userscale
;
// Use x or y scaling factor, whichever fits on the DC
scale
=
wxMax
(
scaleX
,
scaleY
)
/
userscale
;
// Use x or y scaling factor, whichever fits on the DC
// ajust the real draw scale
// ajust the real draw scale
#ifdef PCBNEW
#ifdef PCBNEW
double
accurate_Xscale
,
accurate_Yscale
;
double
accurate_Xscale
,
accurate_Yscale
;
dc
->
SetUserScale
(
DrawZoom
/
scale
*
m_PrintFrame
->
m_XScaleAdjust
,
dc
->
SetUserScale
(
DrawZoom
/
scale
*
m_PrintFrame
->
m_XScaleAdjust
,
DrawZoom
/
scale
*
m_PrintFrame
->
m_YScaleAdjust
);
DrawZoom
/
scale
*
m_PrintFrame
->
m_YScaleAdjust
);
// Compute Accurate scale 1
{
// Compute Accurate scale 1
int
w
,
h
;
{
GetPPIPrinter
(
&
w
,
&
h
);
int
w
,
h
;
accurate_Xscale
=
((
double
)(
DrawZoom
*
w
))
/
PCB_INTERNAL_UNIT
;
GetPPIPrinter
(
&
w
,
&
h
);
accurate_Yscale
=
((
double
)(
DrawZoom
*
h
))
/
PCB_INTERNAL_UNIT
;
accurate_Xscale
=
(
(
double
)
(
DrawZoom
*
w
)
)
/
PCB_INTERNAL_UNIT
;
if
(
IsPreview
()
)
// Scale must take in account the DC size in Preview
accurate_Yscale
=
(
(
double
)
(
DrawZoom
*
h
)
)
/
PCB_INTERNAL_UNIT
;
{
if
(
IsPreview
()
)
// Scale must take in account the DC size in Preview
// Get the size of the DC in pixels
{
dc
->
GetSize
(
&
PlotAreaSize
.
x
,
&
PlotAreaSize
.
y
);
// Get the size of the DC in pixels
GetPageSizePixels
(
&
w
,
&
h
);
dc
->
GetSize
(
&
PlotAreaSize
.
x
,
&
PlotAreaSize
.
y
);
accurate_Xscale
*=
PlotAreaSize
.
x
;
accurate_Xscale
/=
w
;
GetPageSizePixels
(
&
w
,
&
h
);
accurate_Yscale
*=
PlotAreaSize
.
y
;
accurate_Yscale
/=
h
;
accurate_Xscale
*=
PlotAreaSize
.
x
;
accurate_Xscale
/=
w
;
}
accurate_Yscale
*=
PlotAreaSize
.
y
;
accurate_Yscale
/=
h
;
accurate_Xscale
*=
m_PrintFrame
->
m_XScaleAdjust
;
}
accurate_Yscale
*=
m_PrintFrame
->
m_YScaleAdjust
;
accurate_Xscale
*=
m_PrintFrame
->
m_XScaleAdjust
;
}
accurate_Yscale
*=
m_PrintFrame
->
m_YScaleAdjust
;
}
#else
#else
dc
->
SetUserScale
(
DrawZoom
/
scale
,
DrawZoom
/
scale
);
dc
->
SetUserScale
(
DrawZoom
/
scale
,
DrawZoom
/
scale
);
#endif
#endif
#ifdef PCBNEW
#ifdef PCBNEW
if
(
(
s_ScaleList
[
s_Scale_Select
]
>
1.0
)
||
// scale > 1 -> Recadrage
if
(
(
s_ScaleList
[
s_Scale_Select
]
>
1.0
)
// scale > 1 -> Recadrage
(
s_ScaleList
[
s_Scale_Select
]
==
0
)
)
// fit in page
||
(
s_ScaleList
[
s_Scale_Select
]
==
0
)
)
// fit in page
{
{
DrawOffset
.
x
-=
(
int
)(
(
PlotAreaSize
.
x
/
2
)
*
scale
);
DrawOffset
.
x
-=
(
int
)
(
(
PlotAreaSize
.
x
/
2
)
*
scale
);
DrawOffset
.
y
-=
(
int
)(
(
PlotAreaSize
.
y
/
3
)
*
scale
);
DrawOffset
.
y
-=
(
int
)
(
(
PlotAreaSize
.
y
/
3
)
*
scale
);
}
}
DrawOffset
.
x
+=
(
int
)(
(
SheetSize
.
x
/
2
)
*
(
m_PrintFrame
->
m_XScaleAdjust
-
1.0
)
);
DrawOffset
.
x
+=
(
int
)
(
(
SheetSize
.
x
/
2
)
*
(
m_PrintFrame
->
m_XScaleAdjust
-
1.0
)
);
DrawOffset
.
y
+=
(
int
)(
(
SheetSize
.
y
/
2
)
*
(
m_PrintFrame
->
m_YScaleAdjust
-
1.0
)
);
DrawOffset
.
y
+=
(
int
)
(
(
SheetSize
.
y
/
2
)
*
(
m_PrintFrame
->
m_YScaleAdjust
-
1.0
)
);
#endif
#endif
ActiveScreen
->
m_DrawOrg
=
DrawOffset
;
ActiveScreen
->
m_DrawOrg
=
DrawOffset
;
GRResetPenAndBrush
(
dc
);
GRResetPenAndBrush
(
dc
);
if
(
s_Print_Black_and_White
)
GRForceBlackPen
(
TRUE
);
if
(
s_Print_Black_and_White
)
GRForceBlackPen
(
TRUE
);
#ifdef EESCHEMA
#ifdef EESCHEMA
/* set Pen min width */
/* set Pen min width */
double
ftmp
,
xdcscale
,
ydcscale
;
double
ftmp
,
xdcscale
,
ydcscale
;
// s_PrintPenMinWidth is in internal units ( 1/1000 inch), and must be converted in pixels
ftmp
=
(
float
)
s_PrintPenMinWidth
*
25.4
/
EESCHEMA_INTERNAL_UNIT
;
// ftmp est en mm
// s_PrintPenMinWidth is in internal units ( 1/1000 inch), and must be converted in pixels
ftmp
*=
(
float
)
PlotAreaSize
.
x
/
PageSize_in_mm
.
x
;
/* ftmp is in pixels */
ftmp
=
(
float
)
s_PrintPenMinWidth
*
25.4
/
EESCHEMA_INTERNAL_UNIT
;
// ftmp est en mm
/* because the pen size will be scaled by the dc scale, we modify the size
ftmp
*=
(
float
)
PlotAreaSize
.
x
/
PageSize_in_mm
.
x
;
/* ftmp is in pixels */
in order to keep the requested value */
dc
->
GetUserScale
(
&
xdcscale
,
&
ydcscale
);
/* because the pen size will be scaled by the dc scale, we modify the size
ftmp
/=
xdcscale
;
* in order to keep the requested value */
SetPenMinWidth
((
int
)
round
(
ftmp
));
dc
->
GetUserScale
(
&
xdcscale
,
&
ydcscale
);
ftmp
/=
xdcscale
;
SetPenMinWidth
(
(
int
)
round
(
ftmp
)
);
#else
#else
SetPenMinWidth
(
1
);
// min width = 1 pixel
SetPenMinWidth
(
1
);
// min width = 1 pixel
#endif
#endif
WinEDA_DrawPanel
*
panel
=
m_Parent
->
DrawPanel
;
WinEDA_DrawPanel
*
panel
=
m_Parent
->
DrawPanel
;
EDA_Rect
tmp
=
panel
->
m_ClipBox
;
EDA_Rect
tmp
=
panel
->
m_ClipBox
;
panel
->
m_ClipBox
.
SetOrigin
(
wxPoint
(
0
,
0
)
);
panel
->
m_ClipBox
.
SetOrigin
(
wxPoint
(
0
,
0
)
);
panel
->
m_ClipBox
.
SetSize
(
wxSize
(
0x7FFFFF0
,
0x7FFFFF0
)
);
panel
->
m_ClipBox
.
SetSize
(
wxSize
(
0x7FFFFF0
,
0x7FFFFF0
)
);
g_IsPrinting
=
TRUE
;
g_IsPrinting
=
TRUE
;
#ifdef EESCHEMA
#ifdef EESCHEMA
if
(
s_Print_Black_and_White
)
if
(
s_Print_Black_and_White
)
g_PrintFillMask
=
FILLED_WITH_BG_BODYCOLOR
;
g_PrintFillMask
=
FILLED_WITH_BG_BODYCOLOR
;
#endif
#endif
#ifdef PCBNEW
#ifdef PCBNEW
if
(
m_Print_Sheet_Ref
)
if
(
m_Print_Sheet_Ref
)
m_Parent
->
TraceWorkSheet
(
dc
,
ActiveScreen
,
0
);
m_Parent
->
TraceWorkSheet
(
dc
,
ActiveScreen
,
0
);
if
(
userscale
==
1.0
)
// Draw the Sheet refs at optimum scale, and board at 1.0 scale
if
(
userscale
==
1.0
)
// Draw the Sheet refs at optimum scale, and board at 1.0 scale
{
{
m_Print_Sheet_Ref
=
FALSE
;
m_Print_Sheet_Ref
=
FALSE
;
dc
->
SetUserScale
(
accurate_Yscale
,
accurate_Yscale
);
dc
->
SetUserScale
(
accurate_Yscale
,
accurate_Yscale
);
}
}
if
(
s_PrintMirror
)
if
(
s_PrintMirror
)
{
// To plot mirror, we revere the y axis, and modify the plot y origin
{
// To plot mirror, we revere the y axis, and modify the plot y origin
double
sx
,
sy
;
double
sx
,
sy
;
dc
->
GetUserScale
(
&
sx
,
&
sy
);
dc
->
GetUserScale
(
&
sx
,
&
sy
);
dc
->
SetAxisOrientation
(
TRUE
,
TRUE
);
dc
->
SetAxisOrientation
(
TRUE
,
TRUE
);
if
(
userscale
<
1.0
)
sy
/=
userscale
;
if
(
userscale
<
1.0
)
/* Plot offset y is moved by the y plot area size in order to have
sy
/=
userscale
;
the old draw area in the new draw area, because the draw origin has not moved
(this is the upper left corner) but the Y axis is reversed, therefore the plotting area
/* Plot offset y is moved by the y plot area size in order to have
is the y coordinate values from - PlotAreaSize.y to 0 */
* the old draw area in the new draw area, because the draw origin has not moved
int
ysize
=
(
int
)(
PlotAreaSize
.
y
/
sy
);
* (this is the upper left corner) but the Y axis is reversed, therefore the plotting area
DrawOffset
.
y
+=
ysize
;
* is the y coordinate values from - PlotAreaSize.y to 0 */
/* in order to keep the board position in the sheet
int
ysize
=
(
int
)
(
PlotAreaSize
.
y
/
sy
);
(when user scale <= 1) the y offset in moved by the distance between
DrawOffset
.
y
+=
ysize
;
the middle of the page and the middle of the board
This is equivalent to put the mirror axis to the board centre
/* in order to keep the board position in the sheet
for scales > 1, the DrawOffset was already computed to have the board centre
* (when user scale <= 1) the y offset in moved by the distance between
to the middle of the page.
* the middle of the page and the middle of the board
*/
* This is equivalent to put the mirror axis to the board centre
wxPoint
pcb_centre
=
pcbframe
->
m_Pcb
->
m_BoundaryBox
.
Centre
();
* for scales > 1, the DrawOffset was already computed to have the board centre
if
(
userscale
<=
1.0
)
* to the middle of the page.
DrawOffset
.
y
+=
pcb_centre
.
y
-
(
ysize
/
2
);
*/
ActiveScreen
->
m_DrawOrg
=
DrawOffset
;
wxPoint
pcb_centre
=
pcbframe
->
m_Pcb
->
m_BoundaryBox
.
Centre
();
panel
->
m_ClipBox
.
SetOrigin
(
wxPoint
(
-
0x7FFFFF
,
-
0x7FFFFF
));
if
(
userscale
<=
1.0
)
}
DrawOffset
.
y
+=
pcb_centre
.
y
-
(
ysize
/
2
);
ActiveScreen
->
m_DrawOrg
=
DrawOffset
;
panel
->
PrintPage
(
dc
,
0
,
s_PrintMaskLayer
);
panel
->
m_ClipBox
.
SetOrigin
(
wxPoint
(
-
0x7FFFFF
,
-
0x7FFFFF
)
);
}
panel
->
PrintPage
(
dc
,
0
,
s_PrintMaskLayer
);
#else
#else
panel
->
PrintPage
(
dc
,
m_Print_Sheet_Ref
,
s_PrintMaskLayer
);
panel
->
PrintPage
(
dc
,
m_Print_Sheet_Ref
,
s_PrintMaskLayer
);
#endif
#endif
#ifdef EESCHEMA
#ifdef EESCHEMA
g_PrintFillMask
=
0
;
g_PrintFillMask
=
0
;
#endif
#endif
g_IsPrinting
=
FALSE
;
g_IsPrinting
=
FALSE
;
panel
->
m_ClipBox
=
tmp
;
panel
->
m_ClipBox
=
tmp
;
SetPenMinWidth
(
1
);
SetPenMinWidth
(
1
);
GRForceBlackPen
(
FALSE
);
GRForceBlackPen
(
FALSE
);
ActiveScreen
->
m_StartVisu
=
tmp_startvisu
;
ActiveScreen
->
m_StartVisu
=
tmp_startvisu
;
ActiveScreen
->
m_DrawOrg
=
old_org
;
ActiveScreen
->
m_DrawOrg
=
old_org
;
ActiveScreen
->
SetZoom
(
tmpzoom
);
ActiveScreen
->
SetZoom
(
tmpzoom
);
}
}
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