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
81509a11
Commit
81509a11
authored
Mar 13, 2011
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Plain Diff
Gerbview: code cleanup and a minoe enhancement. Kicad: minor code cleanup
parents
c4948a6c
cb8a0315
Changes
24
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
259 additions
and
361 deletions
+259
-361
basicframe.cpp
common/basicframe.cpp
+31
-0
build_version.cpp
common/build_version.cpp
+1
-1
complex_hierarchy.pro
demos/complex_hierarchy/complex_hierarchy.pro
+31
-68
CMakeLists.txt
gerbview/CMakeLists.txt
+5
-3
block.cpp
gerbview/block.cpp
+20
-47
class_gerbview_layer_widget.cpp
gerbview/class_gerbview_layer_widget.cpp
+0
-1
dcode.cpp
gerbview/dcode.cpp
+3
-3
dialog_print_using_printer.cpp
gerbview/dialogs/dialog_print_using_printer.cpp
+0
-1
edit.cpp
gerbview/edit.cpp
+6
-2
files.cpp
gerbview/files.cpp
+15
-17
gerbview.cpp
gerbview/gerbview.cpp
+0
-1
gerbview.h
gerbview/gerbview.h
+1
-1
gerbview_frame.cpp
gerbview/gerbview_frame.cpp
+2
-0
gerbview_frame.h
gerbview/gerbview_frame.h
+14
-3
gerbview_id.h
gerbview/gerbview_id.h
+1
-0
menubar.cpp
gerbview/menubar.cpp
+8
-1
options.cpp
gerbview/options.cpp
+1
-0
readgerb.cpp
gerbview/readgerb.cpp
+1
-25
wxstruct.h
include/wxstruct.h
+8
-0
kicad.h
kicad/kicad.h
+0
-1
menubar.cpp
kicad/menubar.cpp
+108
-156
preferences.cpp
kicad/preferences.cpp
+0
-27
install.nsi
packaging/windows/nsis/install.nsi
+1
-1
version.txt
version.txt
+2
-2
No files found.
common/basicframe.cpp
View file @
81509a11
...
@@ -278,6 +278,37 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
...
@@ -278,6 +278,37 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
#endif
#endif
}
}
/*
* Function OnSelectPreferredEditor
* Open a dialog to select the preferred editor that will be used in Kicad
* to edit or display files (reports ... )
* The full filename editor is saved in configuration (global params)
*/
void
EDA_BASE_FRAME
::
OnSelectPreferredEditor
(
wxCommandEvent
&
event
)
{
wxFileName
fn
=
wxGetApp
().
m_EditorName
;
wxString
wildcard
(
wxT
(
"*"
)
);
#ifdef __WINDOWS__
wildcard
+=
wxT
(
".exe"
);
#endif
wildcard
=
_
(
"Executable file ("
)
+
wildcard
+
wxT
(
")|"
)
+
wildcard
;
wxFileDialog
dlg
(
this
,
_
(
"Select Prefered Editor"
),
fn
.
GetPath
(),
fn
.
GetFullName
(),
wildcard
,
wxFD_OPEN
|
wxFD_FILE_MUST_EXIST
);
if
(
dlg
.
ShowModal
()
==
wxID_CANCEL
)
return
;
wxASSERT
(
wxGetApp
().
m_EDA_CommonConfig
);
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_CommonConfig
;
wxGetApp
().
m_EditorName
=
dlg
.
GetPath
();
cfg
->
Write
(
wxT
(
"Editor"
),
wxGetApp
().
m_EditorName
);
}
/*
/*
*
*
...
...
common/build_version.cpp
View file @
81509a11
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#endif
#endif
#ifndef KICAD_BUILD_VERSION
#ifndef KICAD_BUILD_VERSION
#define KICAD_BUILD_VERSION "(2011-03-1
1 BZR 2884
)"
#define KICAD_BUILD_VERSION "(2011-03-1
2
)"
#endif
#endif
//#define VERSION_STABILITY "stable"
//#define VERSION_STABILITY "stable"
...
...
demos/complex_hierarchy/complex_hierarchy.pro
View file @
81509a11
update
=
01
/
04
/
2010
16
:
21
:
47
update
=
12
/
03
/
2011
18
:
54
:
54
version
=
1
version
=
1
last_client
=
eeschema
last_client
=
pcbnew
[
cvpcb
]
[
cvpcb
]
version
=
1
version
=
1
NetITyp
=
0
NetITyp
=
0
...
@@ -11,72 +11,6 @@ LibDir=
...
@@ -11,72 +11,6 @@ LibDir=
NetType
=
0
NetType
=
0
[
cvpcb
/
libraries
]
[
cvpcb
/
libraries
]
EquName1
=
devcms
EquName1
=
devcms
[
pcbnew
]
version
=
1
PadDrlX
=
320
PadDimH
=
600
PadDimV
=
600
PadForm
=
1
PadMask
=
14745599
ViaDiam
=
450
ViaDril
=
250
Isol
=
60
Countlayer
=
2
Lpiste
=
170
RouteTo
=
15
RouteBo
=
0
TypeVia
=
3
Segm45
=
1
Racc45
=
1
Unite
=
0
SegFill
=
1
SegAffG
=
0
NewAffG
=
1
PadFill
=
1
PadAffG
=
1
PadSNum
=
1
ModAffC
=
0
ModAffT
=
0
PcbAffT
=
0
SgPcb45
=
1
TxtPcbV
=
800
TxtPcbH
=
600
TxtModV
=
600
TxtModH
=
600
TxtModW
=
120
HPGLnum
=
1
HPGdiam
=
15
HPGLSpd
=
20
HPGLrec
=
2
HPGLorg
=
0
GERBmin
=
15
VEgarde
=
100
DrawLar
=
150
EdgeLar
=
150
TxtLar
=
120
MSegLar
=
150
ForPlot
=
1
WpenSer
=
10
UserGrX
=
0
,
01
UserGrY
=
0
,
01
UserGrU
=
1
DivGrPc
=
1
TimeOut
=
600
MaxLnkS
=
3
ShowRat
=
0
ShowMRa
=
1
[
pcbnew
/
libraries
]
LibDir
=
LibName1
=
sockets
LibName2
=
connect
LibName3
=
discret
LibName4
=
pin_array
LibName5
=
divers
LibName6
=
libcms
LibName7
=
display
LibName8
=
valves
LibName9
=
led
LibName10
=
dip_sockets
[
general
]
[
general
]
version
=
1
version
=
1
[
eeschema
]
[
eeschema
]
...
@@ -123,3 +57,32 @@ LibName5=linear
...
@@ -123,3 +57,32 @@ LibName5=linear
LibName6
=
regul
LibName6
=
regul
LibName7
=
interface
LibName7
=
interface
LibName8
=
special
LibName8
=
special
[
pcbnew
]
version
=
1
PadDrlX
=
320
PadDimH
=
600
PadDimV
=
600
BoardThickness
=
630
TxtPcbV
=
800
TxtPcbH
=
600
TxtModV
=
600
TxtModH
=
600
TxtModW
=
120
VEgarde
=
100
DrawLar
=
150
EdgeLar
=
150
TxtLar
=
120
MSegLar
=
150
LastNetListRead
=
[
pcbnew
/
libraries
]
LibDir
=
LibName1
=
sockets
LibName2
=
connect
LibName3
=
discret
LibName4
=
pin_array
LibName5
=
divers
LibName6
=
libcms
LibName7
=
display
LibName8
=
valves
LibName9
=
led
LibName10
=
dip_sockets
gerbview/CMakeLists.txt
View file @
81509a11
...
@@ -13,6 +13,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
...
@@ -13,6 +13,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
###
###
# Sources
# Sources
###
###
set
(
DIALOGS_SRCS
set
(
DIALOGS_SRCS
dialogs/gerbview_dialog_display_options_frame_base.cpp
dialogs/gerbview_dialog_display_options_frame_base.cpp
dialogs/gerbview_dialog_display_options_frame.cpp
dialogs/gerbview_dialog_display_options_frame.cpp
...
@@ -35,9 +36,9 @@ set(GERBVIEW_SRCS
...
@@ -35,9 +36,9 @@ set(GERBVIEW_SRCS
edit.cpp
edit.cpp
export_to_pcbnew.cpp
export_to_pcbnew.cpp
files.cpp
files.cpp
gerberframe.cpp
gerbview_config.cpp
gerbview.cpp
gerbview.cpp
gerbview_config.cpp
gerbview_frame.cpp
hotkeys.cpp
hotkeys.cpp
initpcb.cpp
initpcb.cpp
locate.cpp
locate.cpp
...
@@ -50,7 +51,8 @@ set(GERBVIEW_SRCS
...
@@ -50,7 +51,8 @@ set(GERBVIEW_SRCS
rs274d.cpp
rs274d.cpp
rs274x.cpp
rs274x.cpp
select_layers_to_pcb.cpp
select_layers_to_pcb.cpp
toolbars_gerber.cpp
)
toolbars_gerber.cpp
)
###
###
# We need some extra sources from pcbnew
# We need some extra sources from pcbnew
...
...
gerbview/block.cpp
View file @
81509a11
/**********************************
************************
/
/**********************************/
/* Block operations: displacement
, rotation, deletion ...
*/
/* Block operations: displacement */
/**********************************
************************
/
/**********************************/
/*
/*
* This program source code file is part of KICAD, a free EDA CAD application.
* This program source code file is part of KICAD, a free EDA CAD application.
...
@@ -28,15 +28,14 @@
...
@@ -28,15 +28,14 @@
#include "fctsys.h"
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "common.h"
#include "class_drawpanel.h"
#include "class_drawpanel.h"
#include "trigo.h"
#include "confirm.h"
#include "confirm.h"
#include "gerbview.h"
#include "gerbview.h"
#include "class_gerber_draw_item.h"
#include "class_gerber_draw_item.h"
#include "wx/debug.h"
#define BLOCK_COLOR BROWN
#define BLOCK_COLOR BROWN
...
@@ -46,6 +45,7 @@ static void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
...
@@ -46,6 +45,7 @@ static void DrawMovingBlockOutlines( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
/* Return the block command (BLOCK_MOVE, BLOCK_COPY...) corresponding to
/* Return the block command (BLOCK_MOVE, BLOCK_COPY...) corresponding to
* the key (ALT, SHIFT ALT ..)
* the key (ALT, SHIFT ALT ..)
* Currently, only block move and block zoom is supported
*/
*/
int
GERBVIEW_FRAME
::
ReturnBlockCommand
(
int
key
)
int
GERBVIEW_FRAME
::
ReturnBlockCommand
(
int
key
)
{
{
...
@@ -62,17 +62,9 @@ int GERBVIEW_FRAME::ReturnBlockCommand( int key )
...
@@ -62,17 +62,9 @@ int GERBVIEW_FRAME::ReturnBlockCommand( int key )
break
;
break
;
case
GR_KB_SHIFT
:
case
GR_KB_SHIFT
:
break
;
case
GR_KB_CTRL
:
case
GR_KB_CTRL
:
break
;
case
GR_KB_SHIFTCTRL
:
case
GR_KB_SHIFTCTRL
:
cmd
=
BLOCK_DELETE
;
break
;
case
GR_KB_ALT
:
case
GR_KB_ALT
:
cmd
=
BLOCK_COPY
;
break
;
break
;
case
MOUSE_MIDDLE
:
case
MOUSE_MIDDLE
:
...
@@ -87,25 +79,13 @@ int GERBVIEW_FRAME::ReturnBlockCommand( int key )
...
@@ -87,25 +79,13 @@ int GERBVIEW_FRAME::ReturnBlockCommand( int key )
/* Routine to handle the BLOCK PLACE command */
/* Routine to handle the BLOCK PLACE command */
void
GERBVIEW_FRAME
::
HandleBlockPlace
(
wxDC
*
DC
)
void
GERBVIEW_FRAME
::
HandleBlockPlace
(
wxDC
*
DC
)
{
{
bool
err
=
false
;
wxASSERT
(
DrawPanel
->
IsMouseCaptured
()
)
;
if
(
!
DrawPanel
->
IsMouseCaptured
()
)
{
err
=
true
;
DisplayError
(
this
,
wxT
(
"Error in HandleBlockPLace : m_mouseCaptureCallback = NULL"
)
);
}
GetScreen
()
->
m_BlockLocate
.
m_State
=
STATE_BLOCK_STOP
;
GetScreen
()
->
m_BlockLocate
.
m_State
=
STATE_BLOCK_STOP
;
switch
(
GetScreen
()
->
m_BlockLocate
.
m_Command
)
switch
(
GetScreen
()
->
m_BlockLocate
.
m_Command
)
{
{
case
BLOCK_IDLE
:
err
=
true
;
break
;
case
BLOCK_DRAG
:
/* Drag */
case
BLOCK_MOVE
:
/* Move */
case
BLOCK_MOVE
:
/* Move */
case
BLOCK_PRESELECT_MOVE
:
/* Move with preselection list*/
if
(
DrawPanel
->
IsMouseCaptured
()
)
if
(
DrawPanel
->
IsMouseCaptured
()
)
DrawPanel
->
m_mouseCaptureCallback
(
DrawPanel
,
DC
,
wxDefaultPosition
,
false
);
DrawPanel
->
m_mouseCaptureCallback
(
DrawPanel
,
DC
,
wxDefaultPosition
,
false
);
...
@@ -122,9 +102,9 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
...
@@ -122,9 +102,9 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
break
;
break
;
case
BLOCK_PASTE
:
case
BLOCK_PASTE
:
break
;
case
BLOCK_DRAG
:
case
BLOCK_PRESELECT_MOVE
:
case
BLOCK_ZOOM
:
// Handle by HandleBlockEnd()
case
BLOCK_ZOOM
:
case
BLOCK_ROTATE
:
case
BLOCK_ROTATE
:
case
BLOCK_FLIP
:
case
BLOCK_FLIP
:
case
BLOCK_DELETE
:
case
BLOCK_DELETE
:
...
@@ -133,6 +113,8 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
...
@@ -133,6 +113,8 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
case
BLOCK_SELECT_ITEMS_ONLY
:
case
BLOCK_SELECT_ITEMS_ONLY
:
case
BLOCK_MIRROR_X
:
case
BLOCK_MIRROR_X
:
case
BLOCK_MIRROR_Y
:
case
BLOCK_MIRROR_Y
:
case
BLOCK_IDLE
:
wxFAIL_MSG
(
wxT
(
"HandleBlockPlace: Unexpected block command"
)
);
break
;
break
;
}
}
...
@@ -142,11 +124,7 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
...
@@ -142,11 +124,7 @@ void GERBVIEW_FRAME::HandleBlockPlace( wxDC* DC )
GetScreen
()
->
SetModify
();
GetScreen
()
->
SetModify
();
GetScreen
()
->
ClearBlockCommand
();
GetScreen
()
->
ClearBlockCommand
();
if
(
GetScreen
()
->
m_BlockLocate
.
GetCount
()
)
wxASSERT
(
GetScreen
()
->
m_BlockLocate
.
GetCount
()
==
0
);
{
DisplayError
(
this
,
wxT
(
"HandleBlockPLace error: some items left"
)
);
GetScreen
()
->
m_BlockLocate
.
ClearItemsList
();
}
DisplayToolMsg
(
wxEmptyString
);
DisplayToolMsg
(
wxEmptyString
);
}
}
...
@@ -171,15 +149,8 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
...
@@ -171,15 +149,8 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
switch
(
GetScreen
()
->
m_BlockLocate
.
m_Command
)
switch
(
GetScreen
()
->
m_BlockLocate
.
m_Command
)
{
{
case
BLOCK_IDLE
:
DisplayError
(
this
,
wxT
(
"Error in HandleBlockPLace"
)
);
break
;
case
BLOCK_DRAG
:
/* Drag (not used, for future
* enhancements) */
case
BLOCK_MOVE
:
/* Move */
case
BLOCK_MOVE
:
/* Move */
case
BLOCK_COPY
:
/* Copy */
case
BLOCK_COPY
:
/* Copy */
case
BLOCK_PRESELECT_MOVE
:
/* Move with preselection list */
GetScreen
()
->
m_BlockLocate
.
m_State
=
STATE_BLOCK_MOVE
;
GetScreen
()
->
m_BlockLocate
.
m_State
=
STATE_BLOCK_MOVE
;
nextcmd
=
true
;
nextcmd
=
true
;
DrawPanel
->
m_mouseCaptureCallback
(
DrawPanel
,
DC
,
wxDefaultPosition
,
false
);
DrawPanel
->
m_mouseCaptureCallback
(
DrawPanel
,
DC
,
wxDefaultPosition
,
false
);
...
@@ -193,20 +164,22 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
...
@@ -193,20 +164,22 @@ bool GERBVIEW_FRAME::HandleBlockEnd( wxDC* DC )
Block_Delete
(
DC
);
Block_Delete
(
DC
);
break
;
break
;
case
BLOCK_ZOOM
:
/* Window Zoom */
zoom_command
=
true
;
break
;
case
BLOCK_PRESELECT_MOVE
:
/* Move with preselection list */
case
BLOCK_DRAG
:
case
BLOCK_IDLE
:
case
BLOCK_MIRROR_X
:
/* Mirror, unused*/
case
BLOCK_MIRROR_X
:
/* Mirror, unused*/
case
BLOCK_ROTATE
:
/* Unused */
case
BLOCK_ROTATE
:
/* Unused */
case
BLOCK_FLIP
:
/* Flip, unused */
case
BLOCK_FLIP
:
/* Flip, unused */
case
BLOCK_SAVE
:
/* Save (not used)*/
case
BLOCK_SAVE
:
/* Save (not used)*/
case
BLOCK_PASTE
:
case
BLOCK_PASTE
:
break
;
case
BLOCK_ZOOM
:
/* Window Zoom */
zoom_command
=
true
;
break
;
case
BLOCK_ABORT
:
case
BLOCK_ABORT
:
case
BLOCK_SELECT_ITEMS_ONLY
:
case
BLOCK_SELECT_ITEMS_ONLY
:
case
BLOCK_MIRROR_Y
:
case
BLOCK_MIRROR_Y
:
wxFAIL_MSG
(
wxT
(
"HandleBlockEnd: Unexpected block command"
)
);
break
;
break
;
}
}
...
...
gerbview/class_gerbview_layer_widget.cpp
View file @
81509a11
...
@@ -33,7 +33,6 @@
...
@@ -33,7 +33,6 @@
#include "class_drawpanel.h"
#include "class_drawpanel.h"
#include "pcbstruct.h"
#include "pcbstruct.h"
#include "gerbview.h"
#include "gerbview.h"
#include "wxGerberFrame.h"
#include "layer_widget.h"
#include "layer_widget.h"
#include "class_gerbview_layer_widget.h"
#include "class_gerbview_layer_widget.h"
...
...
gerbview/dcode.cpp
View file @
81509a11
...
@@ -137,17 +137,17 @@ int D_CODE::GetShapeDim( GERBER_DRAW_ITEM* aParent )
...
@@ -137,17 +137,17 @@ int D_CODE::GetShapeDim( GERBER_DRAW_ITEM* aParent )
/*
/*
* Function Read
_D_Code_
File
* Function Read
DCodeDefinition
File
* Can be useful only with old RS274D Gerber file format.
* Can be useful only with old RS274D Gerber file format.
* Is not needed with RS274X files format.
* Is not needed with RS274X files format.
* These files need an auxiliary DCode file description. There is no defined file format for this.
* These files need an auxiliary DCode file description. There is no defined file format for this.
* This function read a file format I needed a long time ago.
* This function read a file format I needed a long time ago.
* reads in a dcode file assuming ALSPCB file format with ';' indicating comments.
* reads in a dcode file assuming ALSPCB file format with ';' indicating comments.
* Format is like CSV but with optional ';' delineated comments:
* Format is like CSV but with optional ';' delineated comments:
* tool, Horiz, Vert, drill,
vitesse, acc
. ,Type ; [DCODE (commentaire)]
* tool, Horiz, Vert, drill,
speed, accel
. ,Type ; [DCODE (commentaire)]
* ex: 1, 12, 12, 0, 0, 0, 3 ; D10
* ex: 1, 12, 12, 0, 0, 0, 3 ; D10
*/
*/
int
GERBVIEW_FRAME
::
Read
_D_Code_
File
(
const
wxString
&
D_Code_FullFileName
)
int
GERBVIEW_FRAME
::
Read
DCodeDefinition
File
(
const
wxString
&
D_Code_FullFileName
)
{
{
int
current_Dcode
,
ii
,
dcode_scale
;
int
current_Dcode
,
ii
,
dcode_scale
;
char
*
ptcar
;
char
*
ptcar
;
...
...
gerbview/dialogs/dialog_print_using_printer.cpp
View file @
81509a11
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
#include "printout_controler.h"
#include "printout_controler.h"
#include "gerbview.h"
#include "gerbview.h"
#include "wxGerberFrame.h"
#include "pcbplot.h"
#include "pcbplot.h"
#include "class_board_design_settings.h"
#include "class_board_design_settings.h"
...
...
gerbview/edit.cpp
View file @
81509a11
...
@@ -118,11 +118,11 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
...
@@ -118,11 +118,11 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
switch
(
id
)
switch
(
id
)
{
{
case
ID_EXIT
:
case
ID_EXIT
:
Close
(
TRUE
);
Close
(
true
);
break
;
break
;
case
ID_GERBVIEW_GLOBAL_DELETE
:
case
ID_GERBVIEW_GLOBAL_DELETE
:
Erase_Current_Layer
(
TRUE
);
Erase_Current_Layer
(
true
);
ClearMsgPanel
();
ClearMsgPanel
();
break
;
break
;
...
@@ -171,6 +171,10 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
...
@@ -171,6 +171,10 @@ void GERBVIEW_FRAME::Process_Special_Functions( wxCommandEvent& event )
wxFileName
fn
(
gerber_layer
->
m_FileName
);
wxFileName
fn
(
gerber_layer
->
m_FileName
);
ExecuteFile
(
this
,
editorname
,
QuoteFullPath
(
fn
)
);
ExecuteFile
(
this
,
editorname
,
QuoteFullPath
(
fn
)
);
}
}
else
{
wxMessageBox
(
_
(
"No editor defined. Please select one"
)
);
}
}
}
break
;
break
;
...
...
gerbview/files.cpp
View file @
81509a11
...
@@ -10,9 +10,6 @@
...
@@ -10,9 +10,6 @@
#include "gerbview.h"
#include "gerbview.h"
static
void
LoadDCodeFile
(
GERBVIEW_FRAME
*
frame
,
const
wxString
&
FullFileName
);
/* Load a Gerber file selected from history list on current layer
/* Load a Gerber file selected from history list on current layer
* Previous data is deleted
* Previous data is deleted
...
@@ -79,11 +76,12 @@ clear an existing layer to load any new layers." ), NB_LAYERS );
...
@@ -79,11 +76,12 @@ clear an existing layer to load any new layers." ), NB_LAYERS );
break
;
break
;
case
ID_GERBVIEW_LOAD_DCODE_FILE
:
case
ID_GERBVIEW_LOAD_DCODE_FILE
:
LoadDCodeFile
(
this
,
wxEmptyString
);
LoadDCodeFile
(
wxEmptyString
);
DrawPanel
->
Refresh
();
break
;
break
;
default
:
default
:
DisplayError
(
this
,
wxT
(
"File_io Internal Error
"
)
);
wxFAIL_MSG
(
wxT
(
"File_io: unexpected command id
"
)
);
break
;
break
;
}
}
}
}
...
@@ -199,33 +197,33 @@ bool GERBVIEW_FRAME::LoadGerberFiles( const wxString& aFullFileName )
...
@@ -199,33 +197,33 @@ bool GERBVIEW_FRAME::LoadGerberFiles( const wxString& aFullFileName )
/*
/*
* Read a DCode file (not used with RX274X files , just with RS274D old files).
* Read a DCode file (not used with RX274X files , just with RS274D old files).
* Note: there is no standard for DCode file.
* Note: there is no standard for DCode file
s
.
* Just read a file format created by early versions of Pcbnew.
* Just read a file format created by early versions of Pcbnew.
* Returns:
* Returns:
*
0
if file not read (cancellation of order ...)
*
false
if file not read (cancellation of order ...)
*
1
if OK
*
true
if OK
*/
*/
static
void
LoadDCodeFile
(
GERBVIEW_FRAME
*
frame
,
const
wxString
&
FullFileName
)
bool
GERBVIEW_FRAME
::
LoadDCodeFile
(
const
wxString
&
a
FullFileName
)
{
{
wxString
wildcard
;
wxString
wildcard
;
wxFileName
fn
=
FullFileName
;
wxFileName
fn
=
a
FullFileName
;
if
(
!
fn
.
IsOk
()
)
if
(
!
fn
.
IsOk
()
)
{
{
wildcard
=
_
(
"Gerber DCODE files"
);
wildcard
=
_
(
"Gerber DCODE files"
);
wildcard
+=
AllFilesWildcard
;
wildcard
+=
wxT
(
" "
)
+
AllFilesWildcard
;
fn
=
frame
->
GetScreen
()
->
GetFileName
();
fn
=
GetScreen
()
->
GetFileName
();
wxFileDialog
dlg
(
(
wxWindow
*
)
frame
,
_
(
"Load GERBER DCODE File"
),
wxFileDialog
dlg
(
this
,
_
(
"Load GERBER DCODE File"
),
fn
.
GetPath
(),
fn
.
GetFullName
(),
wildcard
,
fn
.
GetPath
(),
fn
.
GetFullName
(),
wildcard
,
wxFD_OPEN
|
wxFD_FILE_MUST_EXIST
);
wxFD_OPEN
|
wxFD_FILE_MUST_EXIST
);
if
(
dlg
.
ShowModal
()
==
wxID_CANCEL
)
if
(
dlg
.
ShowModal
()
==
wxID_CANCEL
)
return
;
return
false
;
fn
=
dlg
.
GetPath
();
fn
=
dlg
.
GetPath
();
}
}
frame
->
Read_D_Code_
File
(
fn
.
GetFullPath
()
);
ReadDCodeDefinition
File
(
fn
.
GetFullPath
()
);
frame
->
CopyDCodesSizeToItems
();
CopyDCodesSizeToItems
();
frame
->
Refresh
()
;
return
true
;
}
}
gerbview/gerbview.cpp
View file @
81509a11
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
#include "gerbview.h"
#include "gerbview.h"
#include "gerbview_id.h"
#include "gerbview_id.h"
#include "wxGerberFrame.h"
#include "pcbplot.h"
#include "pcbplot.h"
#include "bitmaps.h"
#include "bitmaps.h"
#include "zones.h"
#include "zones.h"
...
...
gerbview/gerbview.h
View file @
81509a11
...
@@ -108,6 +108,6 @@ bool GetEndOfBlock( char buff[GERBER_BUFZ], char*& text, FILE* gerber_file );
...
@@ -108,6 +108,6 @@ bool GetEndOfBlock( char buff[GERBER_BUFZ], char*& text, FILE* gerber_file );
extern
GERBER_IMAGE
*
g_GERBER_List
[
32
];
extern
GERBER_IMAGE
*
g_GERBER_List
[
32
];
#include "pcbcommon.h"
#include "pcbcommon.h"
#include "
wxGerberF
rame.h"
#include "
gerbview_f
rame.h"
#endif // ifndef GERBVIEW_H
#endif // ifndef GERBVIEW_H
gerbview/gerb
er
frame.cpp
→
gerbview/gerb
view_
frame.cpp
View file @
81509a11
...
@@ -64,6 +64,8 @@ BEGIN_EVENT_TABLE( GERBVIEW_FRAME, PCB_BASE_FRAME )
...
@@ -64,6 +64,8 @@ BEGIN_EVENT_TABLE( GERBVIEW_FRAME, PCB_BASE_FRAME )
EVT_MENU
(
ID_GERBVIEW_SHOW_LIST_DCODES
,
GERBVIEW_FRAME
::
Process_Special_Functions
)
EVT_MENU
(
ID_GERBVIEW_SHOW_LIST_DCODES
,
GERBVIEW_FRAME
::
Process_Special_Functions
)
EVT_MENU
(
ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS
,
GERBVIEW_FRAME
::
Process_Special_Functions
)
EVT_MENU
(
ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS
,
GERBVIEW_FRAME
::
Process_Special_Functions
)
EVT_MENU
(
ID_GERBVIEW_SHOW_SOURCE
,
GERBVIEW_FRAME
::
Process_Special_Functions
)
EVT_MENU
(
ID_GERBVIEW_SHOW_SOURCE
,
GERBVIEW_FRAME
::
Process_Special_Functions
)
EVT_MENU
(
ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR
,
EDA_BASE_FRAME
::
OnSelectPreferredEditor
)
// menu Miscellaneous
// menu Miscellaneous
EVT_MENU
(
ID_GERBVIEW_GLOBAL_DELETE
,
GERBVIEW_FRAME
::
Process_Special_Functions
)
EVT_MENU
(
ID_GERBVIEW_GLOBAL_DELETE
,
GERBVIEW_FRAME
::
Process_Special_Functions
)
...
...
gerbview/
wxGerberF
rame.h
→
gerbview/
gerbview_f
rame.h
View file @
81509a11
...
@@ -406,7 +406,18 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title,
...
@@ -406,7 +406,18 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title,
void
GeneralControl
(
wxDC
*
aDC
,
const
wxPoint
&
aPosition
,
int
aHotKey
=
0
);
void
GeneralControl
(
wxDC
*
aDC
,
const
wxPoint
&
aPosition
,
int
aHotKey
=
0
);
/**
/**
* Function Read_D_Code_File
* Read a DCode file (not used with RX274X files , just with RS274D old files).
* Note: there is no standard for DCode file.
* Just read a file format created by early versions of Pcbnew.
* @return false if file not read (cancellation)
* true if OK
* @ aparm aFullFileName = name of file to load.
* if empty, or if the file does not exist, a file dialog is opened
*/
bool
LoadDCodeFile
(
const
wxString
&
aFullFileName
);
/**
* Function ReadDCodeDefinitionFile
* reads in a dcode file assuming ALSPCB file format with ';' indicating
* reads in a dcode file assuming ALSPCB file format with ';' indicating
* comments.
* comments.
* <p>
* <p>
...
@@ -418,7 +429,7 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title,
...
@@ -418,7 +429,7 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title,
* Ver, Hor, Type, Tool [,Drill]<br>
* Ver, Hor, Type, Tool [,Drill]<br>
* example: 0.012, 0.012, L , D10<br>
* example: 0.012, 0.012, L , D10<br>
*
*
*
Categorize
all found dcodes into a table of D_CODE instantiations.
*
Load
all found dcodes into a table of D_CODE instantiations.
* @param D_Code_FullFileName The name of the file to read from.
* @param D_Code_FullFileName The name of the file to read from.
* @return int - <br>
* @return int - <br>
* -1 = file not found<br>
* -1 = file not found<br>
...
@@ -428,7 +439,7 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title,
...
@@ -428,7 +439,7 @@ public: GERBVIEW_FRAME( wxWindow* father, const wxString& title,
* g_GERBER_List[]<br>
* g_GERBER_List[]<br>
* 1 = read OK<br>
* 1 = read OK<br>
*/
*/
int
Read
_D_Code_
File
(
const
wxString
&
D_Code_FullFileName
);
int
Read
DCodeDefinition
File
(
const
wxString
&
D_Code_FullFileName
);
void
CopyDCodesSizeToItems
();
void
CopyDCodesSizeToItems
();
void
Liste_D_Codes
();
void
Liste_D_Codes
();
...
...
gerbview/gerbview_id.h
View file @
81509a11
...
@@ -16,6 +16,7 @@ enum gerbview_ids
...
@@ -16,6 +16,7 @@ enum gerbview_ids
ID_MAIN_MENUBAR
=
ID_END_LIST
,
ID_MAIN_MENUBAR
=
ID_END_LIST
,
ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG
,
ID_MENU_GERBVIEW_SHOW_HIDE_LAYERS_MANAGER_DIALOG
,
ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR
,
ID_TOOLBARH_GERBVIEW_SELECT_LAYER
,
ID_TOOLBARH_GERBVIEW_SELECT_LAYER
,
ID_GERBVIEW_GLOBAL_DELETE
,
ID_GERBVIEW_GLOBAL_DELETE
,
...
...
gerbview/menubar.cpp
View file @
81509a11
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#include "appl_wxstruct.h"
#include "appl_wxstruct.h"
#include "common.h"
#include "common.h"
#include "macros.h"
//
#include "macros.h"
#include "gerbview.h"
#include "gerbview.h"
#include "bitmaps.h"
#include "bitmaps.h"
#include "gerbview_id.h"
#include "gerbview_id.h"
...
@@ -91,6 +91,13 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
...
@@ -91,6 +91,13 @@ void GERBVIEW_FRAME::ReCreateMenuBar( void )
_
(
"&Clear Layer"
),
_
(
"&Clear Layer"
),
_
(
"Clear current layer"
),
general_deletions_xpm
);
_
(
"Clear current layer"
),
general_deletions_xpm
);
miscellaneous_menu
->
AppendSeparator
();
ADD_MENUITEM_WITH_HELP
(
miscellaneous_menu
,
ID_MENU_GERBVIEW_SELECT_PREFERED_EDITOR
,
_
(
"&Text Editor"
),
_
(
"Select your preferred text editor"
),
editor_xpm
);
// Menu Help:
// Menu Help:
wxMenu
*
helpMenu
=
new
wxMenu
;
wxMenu
*
helpMenu
=
new
wxMenu
;
AddHelpVersionInfoMenuEntry
(
helpMenu
);
AddHelpVersionInfoMenuEntry
(
helpMenu
);
...
...
gerbview/options.cpp
View file @
81509a11
...
@@ -88,3 +88,4 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
...
@@ -88,3 +88,4 @@ void GERBVIEW_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
break
;
break
;
}
}
}
}
gerbview/readgerb.cpp
View file @
81509a11
...
@@ -165,31 +165,7 @@ bool GERBVIEW_FRAME::Read_GERBER_File( const wxString& GERBER_FullFileName,
...
@@ -165,31 +165,7 @@ bool GERBVIEW_FRAME::Read_GERBER_File( const wxString& GERBER_FullFileName,
*/
*/
if
(
!
gerber
->
m_Has_DCode
)
if
(
!
gerber
->
m_Has_DCode
)
{
{
wxFileName
fn
;
return
LoadDCodeFile
(
D_Code_FullFileName
);
if
(
D_Code_FullFileName
.
IsEmpty
()
)
{
wxString
wildcard
;
fn
=
GERBER_FullFileName
;
fn
.
SetExt
(
wxEmptyString
);
wildcard
=
_
(
"Gerber DCODE files"
);
wildcard
+=
AllFilesWildcard
;
wxFileDialog
dlg
(
this
,
_
(
"Load GERBER DCODE File"
),
wxEmptyString
,
fn
.
GetFullName
(),
wildcard
,
wxFD_OPEN
|
wxFD_FILE_MUST_EXIST
);
}
else
fn
=
D_Code_FullFileName
;
if
(
fn
.
IsOk
()
)
{
Read_D_Code_File
(
fn
.
GetFullPath
()
);
CopyDCodesSizeToItems
();
}
else
return
false
;
}
}
return
true
;
return
true
;
...
...
include/wxstruct.h
View file @
81509a11
...
@@ -127,6 +127,14 @@ public:
...
@@ -127,6 +127,14 @@ public:
virtual
void
LoadSettings
();
virtual
void
LoadSettings
();
virtual
void
SaveSettings
();
virtual
void
SaveSettings
();
/**
* Function OnSelectPreferredEditor
* Open a dialog to select the editor that will used in Kicad
* to edit or display files (reports ... )
* The full filename editor is saved in configuration (global params)
*/
virtual
void
OnSelectPreferredEditor
(
wxCommandEvent
&
event
);
// Read/Save and Import/export hotkeys config
// Read/Save and Import/export hotkeys config
/**
/**
...
...
kicad/kicad.h
View file @
81509a11
...
@@ -109,7 +109,6 @@ public:
...
@@ -109,7 +109,6 @@ public:
void
OnRefresh
(
wxCommandEvent
&
event
);
void
OnRefresh
(
wxCommandEvent
&
event
);
void
OnSelectDefaultPdfBrowser
(
wxCommandEvent
&
event
);
void
OnSelectDefaultPdfBrowser
(
wxCommandEvent
&
event
);
void
OnSelectPreferredPdfBrowser
(
wxCommandEvent
&
event
);
void
OnSelectPreferredPdfBrowser
(
wxCommandEvent
&
event
);
void
OnSelectPreferredEditor
(
wxCommandEvent
&
event
);
void
OnUpdateDefaultPdfBrowser
(
wxUpdateUIEvent
&
event
);
void
OnUpdateDefaultPdfBrowser
(
wxUpdateUIEvent
&
event
);
void
OnUpdatePreferredPdfBrowser
(
wxUpdateUIEvent
&
event
);
void
OnUpdatePreferredPdfBrowser
(
wxUpdateUIEvent
&
event
);
...
...
kicad/menubar.cpp
View file @
81509a11
This diff is collapsed.
Click to expand it.
kicad/preferences.cpp
View file @
81509a11
...
@@ -69,33 +69,6 @@ void WinEDA_MainFrame::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
...
@@ -69,33 +69,6 @@ void WinEDA_MainFrame::OnSelectPreferredPdfBrowser( wxCommandEvent& event )
wxGetApp
().
WritePdfBrowserInfos
();
wxGetApp
().
WritePdfBrowserInfos
();
}
}
void
WinEDA_MainFrame
::
OnSelectPreferredEditor
(
wxCommandEvent
&
event
)
{
wxFileName
fn
=
wxGetApp
().
m_EditorName
;
wxString
wildcard
(
wxT
(
"*"
)
);
#ifdef __WINDOWS__
wildcard
+=
wxT
(
".exe"
);
#endif
wildcard
=
_
(
"Executable file ("
)
+
wildcard
+
wxT
(
")|"
)
+
wildcard
;
wxFileDialog
dlg
(
this
,
_
(
"Select Prefered Editor"
),
fn
.
GetPath
(),
fn
.
GetFullName
(),
wildcard
,
wxFD_OPEN
|
wxFD_FILE_MUST_EXIST
);
if
(
dlg
.
ShowModal
()
==
wxID_CANCEL
)
return
;
wxASSERT
(
wxGetApp
().
m_EDA_CommonConfig
);
wxConfig
*
cfg
=
wxGetApp
().
m_EDA_CommonConfig
;
wxGetApp
().
m_EditorName
=
dlg
.
GetPath
();
cfg
->
Write
(
wxT
(
"Editor"
),
wxGetApp
().
m_EditorName
);
}
void
WinEDA_MainFrame
::
SetLanguage
(
wxCommandEvent
&
event
)
void
WinEDA_MainFrame
::
SetLanguage
(
wxCommandEvent
&
event
)
{
{
EDA_BASE_FRAME
::
SetLanguage
(
event
);
EDA_BASE_FRAME
::
SetLanguage
(
event
);
...
...
packaging/windows/nsis/install.nsi
View file @
81509a11
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
; General Product Description Definitions
; General Product Description Definitions
!define PRODUCT_NAME "KiCad"
!define PRODUCT_NAME "KiCad"
!define PRODUCT_VERSION "2011.03.1
1
"
!define PRODUCT_VERSION "2011.03.1
2
"
!define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/"
!define PRODUCT_WEB_SITE "http://iut-tice.ujf-grenoble.fr/kicad/"
!define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/"
!define SOURCEFORGE_WEB_SITE "http://kicad.sourceforge.net/"
!define COMPANY_NAME ""
!define COMPANY_NAME ""
...
...
version.txt
View file @
81509a11
release version:
release version:
2011 mar 1
1
2011 mar 1
2
files (.zip,.tgz):
files (.zip,.tgz):
kicad-2011-03-1
1
kicad-2011-03-1
2
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