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
035979d3
Commit
035979d3
authored
Oct 06, 2010
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More work on Gerbview: code cleaning and cosmetic enhancements.
parent
0687921f
Changes
30
Show whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
320 additions
and
266 deletions
+320
-266
CMakeLists.txt
gerbview/CMakeLists.txt
+1
-1
block.cpp
gerbview/block.cpp
+0
-1
class_GERBER.cpp
gerbview/class_GERBER.cpp
+29
-26
class_GERBER.h
gerbview/class_GERBER.h
+157
-0
class_gerber_draw_item.cpp
gerbview/class_gerber_draw_item.cpp
+1
-0
controle.cpp
gerbview/controle.cpp
+0
-2
dcode.cpp
gerbview/dcode.cpp
+1
-0
deltrack.cpp
gerbview/deltrack.cpp
+0
-1
dialog_gerber_config.cpp
gerbview/dialog_gerber_config.cpp
+3
-5
edit.cpp
gerbview/edit.cpp
+1
-1
export_to_pcbnew.cpp
gerbview/export_to_pcbnew.cpp
+1
-2
files.cpp
gerbview/files.cpp
+0
-1
gerberframe.cpp
gerbview/gerberframe.cpp
+44
-1
gerbview.cpp
gerbview/gerbview.cpp
+1
-3
gerbview.h
gerbview/gerbview.h
+10
-151
gerbview_config.h
gerbview/gerbview_config.h
+0
-18
initpcb.cpp
gerbview/initpcb.cpp
+7
-1
locate.cpp
gerbview/locate.cpp
+1
-1
menubar.cpp
gerbview/menubar.cpp
+3
-5
onrightclick.cpp
gerbview/onrightclick.cpp
+0
-2
options.cpp
gerbview/options.cpp
+0
-1
pcbplot.cpp
gerbview/pcbplot.cpp
+0
-1
protos.h
gerbview/protos.h
+0
-4
readgerb.cpp
gerbview/readgerb.cpp
+1
-2
rs274d.cpp
gerbview/rs274d.cpp
+7
-8
rs274x.cpp
gerbview/rs274x.cpp
+15
-11
select_layers_to_pcb.cpp
gerbview/select_layers_to_pcb.cpp
+3
-4
toolbars_gerber.cpp
gerbview/toolbars_gerber.cpp
+9
-6
tracepcb.cpp
gerbview/tracepcb.cpp
+5
-7
wxGerberFrame.h
gerbview/wxGerberFrame.h
+20
-0
No files found.
gerbview/CMakeLists.txt
View file @
035979d3
...
...
@@ -22,6 +22,7 @@ set(GERBVIEW_SRCS
controle.cpp
dcode.cpp
deltrack.cpp
dialog_gerber_config.cpp
dialog_print_using_printer.cpp
dialog_print_using_printer_base.cpp
dummy_functions.cpp
...
...
@@ -41,7 +42,6 @@ set(GERBVIEW_SRCS
options.cpp
pcbplot.cpp
readgerb.cpp
reglage.cpp
rs274d.cpp
rs274x.cpp
select_layers_to_pcb.cpp
...
...
gerbview/block.cpp
View file @
035979d3
...
...
@@ -36,7 +36,6 @@
#include "gerbview.h"
#include "class_gerber_draw_item.h"
#include "protos.h"
#define BLOCK_COLOR BROWN
...
...
gerbview/class_GERBER.cpp
View file @
035979d3
...
...
@@ -33,6 +33,7 @@
#include "macros.h"
#include "gerbview.h"
#include "class_GERBER.h"
/* Format Gerber: NOTES:
* Tools and D_CODES
...
...
@@ -53,7 +54,7 @@
*/
GERBER
::
GERBER
(
WinEDA_GerberFrame
*
aParent
,
int
aLayer
)
GERBER
::
GERBER
(
WinEDA_GerberFrame
*
aParent
,
int
aLayer
)
{
m_Parent
=
aParent
;
m_Layer
=
aLayer
;
// Layer Number
...
...
@@ -118,7 +119,8 @@ APERTURE_MACRO* GERBER::FindApertureMacro( const APERTURE_MACRO& aLookup )
void
GERBER
::
ResetDefaultValues
()
{
m_FileName
.
Empty
();
m_Name
=
wxT
(
"no name"
);
// Layer name
m_ImageName
=
wxT
(
"no image name"
);
// Image name from the IN command
m_LayerName
=
wxT
(
"no layer name"
);
// Layer name from the LN command
m_LayerNegative
=
FALSE
;
// TRUE = Negative Layer
m_ImageNegative
=
FALSE
;
// TRUE = Negative image
m_GerbMetric
=
FALSE
;
// FALSE = Inches, TRUE = metric
...
...
@@ -127,9 +129,9 @@ void GERBER::ResetDefaultValues()
m_NoTrailingZeros
=
FALSE
;
// True: trailing zeros deleted
m_MirorA
=
FALSE
;
// True: miror / axe A (X)
m_MirorB
=
FALSE
;
// True: miror / axe B (Y)
m_Has_DCode
=
FALSE
;
// TRUE = DCodes in file (FALSE = no
//
DCode->
//
separate DCode file
m_Has_DCode
=
FALSE
;
// TRUE = DCodes in file
// FALSE = no
DCode->
// search for
separate DCode file
m_FmtScale
.
x
=
m_FmtScale
.
y
=
g_Default_GERBER_Format
%
10
;
m_FmtLen
.
x
=
m_FmtLen
.
y
=
m_FmtScale
.
x
+
(
g_Default_GERBER_Format
/
10
);
...
...
@@ -186,22 +188,23 @@ void GERBER::InitToolTable()
m_aperture_macros
.
clear
();
}
/** function ReportMessage
* Add a message (a string) in message list
* for instance when reading a Gerber file
* @param aMessage = the straing to add in list
*/
void
GERBER
::
ReportMessage
(
const
wxString
aMessage
)
void
GERBER
::
ReportMessage
(
const
wxString
aMessage
)
{
m_Parent
->
ReportMessage
(
aMessage
);
}
/** function ClearMessageList
* Clear the message list
* Call it before reading a Gerber file
*/
void
GERBER
::
ClearMessageList
(
)
void
GERBER
::
ClearMessageList
()
{
m_Parent
->
ClearMessageList
(
);
m_Parent
->
ClearMessageList
();
}
gerbview/class_GERBER.h
0 → 100644
View file @
035979d3
/******************/
/* class_GERBER.h */
/******************/
#ifndef _CLASS_GERBER_H_
#define _CLASS_GERBER_H_
#include <vector>
#include <set>
#include "dcode.h"
#include "class_gerber_draw_item.h"
#include "class_aperture_macro.h"
class
WinEDA_GerberFrame
;
class
BOARD
;
class
D_CODE
;
/**
* Class GERBER
* holds the data for one gerber file or layer
*/
class
GERBER
{
WinEDA_GerberFrame
*
m_Parent
;
// the parent WinEDA_GerberFrame (used to display messages...)
D_CODE
*
m_Aperture_List
[
TOOLS_MAX_COUNT
];
///< Dcode (Aperture) List for this layer
bool
m_Exposure
;
///< whether an aperture macro tool is flashed on or off
BOARD
*
m_Pcb
;
public
:
wxString
m_FileName
;
// Full File Name for this layer
wxString
m_ImageName
;
// Image name, from IN <name>* command
wxString
m_LayerName
;
// Layer name, from LN <name>* command
int
m_Layer
;
// Layer Number
bool
m_LayerNegative
;
// TRUE = Negative Layer
bool
m_GerbMetric
;
// FALSE = Inches, TRUE = metric
bool
m_Relative
;
// FALSE = absolute Coord, RUE = relative Coord
bool
m_NoTrailingZeros
;
// True: remove tailing zeros.
bool
m_MirorA
;
// True: miror / axe A (X)
bool
m_MirorB
;
// True: miror / axe B (Y)
bool
m_Has_DCode
;
// TRUE = DCodes in file
// (FALSE = no DCode -> separate DCode file
wxPoint
m_Offset
;
// Coord Offset
wxSize
m_FmtScale
;
// Fmt 2.3: m_FmtScale = 3, fmt 3.4: m_FmtScale = 4
wxSize
m_FmtLen
;
// Nb chars per coord. ex fmt 2.3, m_FmtLen = 5
wxRealPoint
m_LayerScale
;
// scale (X and Y) of layer.
int
m_Rotation
;
int
m_Iterpolation
;
// Linear, 90 arc, Circ.
bool
m_ImageNegative
;
// TRUE = Negative image
int
m_Current_Tool
;
// Current Tool (Dcode) number selected
int
m_Last_Pen_Command
;
// Current or last pen state (0..9, set by Dn option with n <10
int
m_CommandState
;
// state of gerber analysis command.
wxPoint
m_CurrentPos
;
// current specified coord for plot
wxPoint
m_PreviousPos
;
// old current specified coord for plot
wxPoint
m_IJPos
;
// IJ coord (for arcs & circles )
FILE
*
m_Current_File
;
// Current file to read
#define INCLUDE_FILES_COUNT_MAX 10
FILE
*
m_FilesList
[
INCLUDE_FILES_COUNT_MAX
+
2
];
// Included files list
int
m_FilesPtr
;
// Stack pointer for files list
int
m_Selected_Tool
;
// Pour editions: Tool (Dcode) selectionn�
bool
m_360Arc_enbl
;
// Enbl 360 deg circular interpolation
bool
m_PolygonFillMode
;
// Enbl polygon mode (read coord as a polygon descr)
int
m_PolygonFillModeState
;
// In polygon mode: 0 = first segm, 1 = next segm
APERTURE_MACRO_SET
m_aperture_macros
;
///< a collection of APERTURE_MACROS, sorted by name
public
:
GERBER
(
WinEDA_GerberFrame
*
aParent
,
int
layer
);
~
GERBER
();
void
Clear_GERBER
();
int
ReturnUsedDcodeNumber
();
void
ResetDefaultValues
();
/** function ReportMessage
* Add a message (a string) in message list
* for instance when reading a Gerber file
* @param aMessage = the straing to add in list
*/
void
ReportMessage
(
const
wxString
aMessage
);
/** function ClearMessageList
* Clear the message list
* Call it before reading a Gerber file
*/
void
ClearMessageList
();
/**
* Function InitToolTable
*/
void
InitToolTable
();
wxPoint
ReadXYCoord
(
char
*&
Text
);
wxPoint
ReadIJCoord
(
char
*&
Text
);
int
ReturnGCodeNumber
(
char
*&
Text
);
int
ReturnDCodeNumber
(
char
*&
Text
);
bool
Execute_G_Command
(
char
*&
text
,
int
G_commande
);
bool
Execute_DCODE_Command
(
WinEDA_GerberFrame
*
frame
,
char
*&
text
,
int
D_commande
);
/**
* Function ReadRS274XCommand
* reads a single RS274X command terminated with a %
*/
bool
ReadRS274XCommand
(
WinEDA_GerberFrame
*
frame
,
char
aBuff
[
GERBER_BUFZ
],
char
*
&
text
);
/**
* Function ExecuteRS274XCommand
* executes 1 command
*/
bool
ExecuteRS274XCommand
(
int
command
,
char
aBuff
[
GERBER_BUFZ
],
char
*
&
text
);
/**
* Function ReadApertureMacro
* reads in an aperture macro and saves it in m_aperture_macros.
* @param aBuff a character buffer at least GERBER_BUFZ long that can be
* used to read successive lines from the gerber file.
* @param text A reference to a character pointer which gives the initial
* text to read from.
* @param gerber_file Which file to read from for continuation.
* @return bool - true if a macro was read in successfully, else false.
*/
bool
ReadApertureMacro
(
char
aBuff
[
GERBER_BUFZ
],
char
*
&
text
,
FILE
*
gerber_file
);
/**
* Function GetDCODE
* returns a pointer to the D_CODE within this GERBER for the given
* \a aDCODE.
* @param aDCODE The numeric value of the D_CODE to look up.
* @param createIfNoExist If true, then create the D_CODE if it does not
* exist.
* @return D_CODE* - the one implied by the given \a aDCODE, or NULL
* if the requested \a aDCODE is out of range.
*/
D_CODE
*
GetDCODE
(
int
aDCODE
,
bool
createIfNoExist
=
true
);
/**
* Function FindApertureMacro
* looks up a previously read in aperture macro.
* @param aLookup A dummy APERTURE_MACRO with [only] the name field set.
* @return APERTURE_MACRO* - the one with a matching name, or NULL if
* not found.
*/
APERTURE_MACRO
*
FindApertureMacro
(
const
APERTURE_MACRO
&
aLookup
);
};
#endif // ifndef _CLASS_GERBER_H_
gerbview/class_gerber_draw_item.cpp
View file @
035979d3
...
...
@@ -38,6 +38,7 @@
#include "class_board_design_settings.h"
#include "colors_selection.h"
#include "class_gerber_draw_item.h"
#include "class_GERBER.h"
/**********************************************************/
...
...
gerbview/controle.cpp
View file @
035979d3
...
...
@@ -8,8 +8,6 @@
#include "pcbnew.h"
#include "gerbview.h"
#include "protos.h"
BOARD_ITEM
*
WinEDA_GerberFrame
::
GerberGeneralLocateAndDisplay
()
{
...
...
gerbview/dcode.cpp
View file @
035979d3
...
...
@@ -11,6 +11,7 @@
#include "gerbview.h"
#include "class_gerber_draw_item.h"
#include "class_GERBER.h"
#define DEFAULT_SIZE 100
...
...
gerbview/deltrack.cpp
View file @
035979d3
...
...
@@ -4,7 +4,6 @@
#include "fctsys.h"
#include "common.h"
//#include "class_drawpanel.h"
#include "gerbview.h"
#include "class_gerber_draw_item.h"
...
...
gerbview/
reglage
.cpp
→
gerbview/
dialog_gerber_config
.cpp
View file @
035979d3
/***************/
/*
reglage
.cpp */
/***************/
/***************
**************
/
/*
dialog_gerber_config
.cpp */
/***************
*************
/
/*
* Options for file extensions
...
...
@@ -11,8 +11,6 @@
#include "appl_wxstruct.h"
#include "common.h"
#include "gerbview.h"
#include "pcbplot.h"
#include "protos.h"
enum
...
...
gerbview/edit.cpp
View file @
035979d3
...
...
@@ -11,9 +11,9 @@
#include "gerbview.h"
#include "pcbplot.h"
#include "protos.h"
#include "kicad_device_context.h"
#include "gerbview_id.h"
#include "class_GERBER.h"
/* Process the command triggered by the left button of the mouse when a tool
...
...
gerbview/export_to_pcbnew.cpp
View file @
035979d3
...
...
@@ -14,7 +14,6 @@
#include "gerbview.h"
#include "class_board_design_settings.h"
#include "class_gerber_draw_item.h"
#include "protos.h"
static
int
SavePcbFormatAscii
(
WinEDA_GerberFrame
*
frame
,
FILE
*
File
,
int
*
LayerLookUpTable
);
...
...
@@ -62,7 +61,7 @@ void WinEDA_GerberFrame::ExportDataInPcbnewFormat( wxCommandEvent& event )
return
;
int
*
LayerLookUpTable
;
if
(
(
LayerLookUpTable
=
InstallDialogLayerPairChoice
(
this
)
)
!=
NULL
)
if
(
(
LayerLookUpTable
=
InstallDialogLayerPairChoice
(
)
)
!=
NULL
)
{
if
(
wxFileExists
(
FullFileName
)
)
{
...
...
gerbview/files.cpp
View file @
035979d3
...
...
@@ -10,7 +10,6 @@
#include "gerbview.h"
#include "pcbplot.h"
#include "protos.h"
static
void
LoadDCodeFile
(
WinEDA_GerberFrame
*
frame
,
...
...
gerbview/gerberframe.cpp
View file @
035979d3
...
...
@@ -16,9 +16,11 @@
#include "class_gerber_draw_item.h"
#include "pcbplot.h"
#include "bitmaps.h"
#include "protos.h"
#include "gerbview_id.h"
#include "hotkeys.h"
#include "class_GERBER.h"
#include "build_version.h"
/****************************************/
...
...
@@ -367,6 +369,7 @@ void WinEDA_GerberFrame::SetGridColor(int aColor)
GetBoard
()
->
SetVisibleElementColor
(
GERBER_GRID_VISIBLE
,
aColor
);
}
/**
* Function SetElementVisibility
* changes the visibility of an element category
...
...
@@ -384,6 +387,7 @@ void WinEDA_GerberFrame::SetElementVisibility( int aGERBER_VISIBLE, bool aNewSta
void
WinEDA_GerberFrame
::
syncLayerWidget
(
)
{
m_LayersManager
->
SelectLayer
(
getActiveLayer
()
);
UpdateTitleAndInfo
();
}
/**
...
...
@@ -395,6 +399,7 @@ void WinEDA_GerberFrame::syncLayerWidget( )
void
WinEDA_GerberFrame
::
syncLayerBox
()
{
m_SelLayerBox
->
SetSelection
(
getActiveLayer
()
);
UpdateTitleAndInfo
();
}
/** function SetLanguage
...
...
@@ -473,3 +478,41 @@ void WinEDA_GerberFrame::Liste_D_Codes( )
if
(
ii
<
0
)
return
;
}
/** function UpdateTitleAndInfo
* displays the short filename (if exists) of the selected layer
* on the caption of the main gerbview window
* and the name of the layer (found in the gerber file: LN <name> command)
* in the status bar
*/
void
WinEDA_GerberFrame
::
UpdateTitleAndInfo
()
{
GERBER
*
gerber
=
g_GERBER_List
[
GetScreen
()
->
m_Active_Layer
];
wxString
text
;
// Display the gerber filename
if
(
gerber
==
NULL
)
{
text
=
wxGetApp
().
GetAppName
()
+
wxT
(
" "
)
+
GetBuildVersion
();
SetStatusText
(
wxEmptyString
,
0
);
m_TextInfo
->
Clear
();
SetTitle
(
text
);
return
;
}
text
=
_
(
"File:"
);
text
<<
wxT
(
" "
)
<<
gerber
->
m_FileName
;
// Display Image Name and Layer Name (from the current gerber data):
text
.
Printf
(
_
(
"Image name:
\"
%s
\"
Layer name
\"
%s
\"
"
),
GetChars
(
gerber
->
m_ImageName
),
GetChars
(
gerber
->
m_LayerName
)
);
SetStatusText
(
text
,
0
);
// Display data format like fmt in X3.4Y3.4 or fmt mm X2.3 Y3.5
text
.
Printf
(
wxT
(
"fmt %s X%d.%d Y%d.%d"
),
gerber
->
m_GerbMetric
?
wxT
(
"mm"
)
:
wxT
(
"in"
),
gerber
->
m_FmtLen
.
x
-
gerber
->
m_FmtScale
.
x
,
gerber
->
m_FmtScale
.
x
,
gerber
->
m_FmtLen
.
y
-
gerber
->
m_FmtScale
.
y
,
gerber
->
m_FmtScale
.
y
);
m_TextInfo
->
SetValue
(
text
);
}
gerbview/gerbview.cpp
View file @
035979d3
...
...
@@ -13,7 +13,6 @@
#include "wxGerberFrame.h"
#include "pcbplot.h"
#include "bitmaps.h"
#include "protos.h"
#include "zones.h"
#include "class_board_design_settings.h"
#include "colors_selection.h"
...
...
@@ -24,6 +23,7 @@
#include <wx/file.h>
#include <wx/snglinst.h>
extern
bool
Read_Config
();
wxString
g_PhotoFilenameExt
;
wxString
g_DrillFilenameExt
;
...
...
@@ -33,10 +33,8 @@ wxString g_PenFilenameExt;
COLORS_DESIGN_SETTINGS
g_ColorsSettings
;
int
g_Default_GERBER_Format
;
int
g_Plot_Spot_Mini
;
/* Diameter of the opening mini-track for GERBER. */
int
g_DisplayPolygonsModeSketch
;
const
wxString
GerbviewProjectFileExt
(
wxT
(
"cnf"
)
);
const
wxString
GerbviewProjectFileWildcard
(
_
(
"GerbView project files (.cnf)|*.cnf"
)
);
...
...
gerbview/gerbview.h
View file @
035979d3
...
...
@@ -13,7 +13,9 @@
#include "class_aperture_macro.h"
class
WinEDA_GerberFrame
;
class
BOARD
;
//class BOARD;
class
GERBER
;
// Type of photoplotter action:
#define GERB_ACTIVE_DRAW 1 // Activate light (lower pen)
...
...
@@ -39,14 +41,18 @@ enum GERBER_VISIBLE
END_GERBER_VISIBLE_LIST
// sentinel
};
/**
* size of single line of a text from a gerber file.
* warning: some files can have very long lines, so the buffer must be large.
*/
#define GERBER_BUFZ 4000
extern
wxString
g_PhotoFilenameExt
;
extern
wxString
g_DrillFilenameExt
;
extern
wxString
g_PenFilenameExt
;
extern
int
g_Default_GERBER_Format
;
extern
int
g_Plot_Spot_Mini
;
/* Diameter of the opening mini-track for
* GERBER */
extern
int
g_DisplayPolygonsModeSketch
;
extern
const
wxString
GerbviewProjectFileExt
;
extern
const
wxString
GerbviewProjectFileWildcard
;
...
...
@@ -100,160 +106,13 @@ enum Gerb_Analyse_Cmd
ENTER_RS274X_CMD
};
class
D_CODE
;
/**
* Class GERBER
* holds the data for one gerber file or layer
*/
class
GERBER
{
WinEDA_GerberFrame
*
m_Parent
;
// the parent WinEDA_GerberFrame (used to display messages...)
D_CODE
*
m_Aperture_List
[
TOOLS_MAX_COUNT
];
///< Dcode (Aperture) List for this layer
bool
m_Exposure
;
///< whether an aperture macro tool is flashed on or off
BOARD
*
m_Pcb
;
public
:
wxString
m_FileName
;
// Full File Name for this layer
wxString
m_Name
;
// Layer name
int
m_Layer
;
// Layer Number
bool
m_LayerNegative
;
// TRUE = Negative Layer
bool
m_GerbMetric
;
// FALSE = Inches, TRUE = metric
bool
m_Relative
;
// FALSE = absolute Coord, RUE = relative Coord
bool
m_NoTrailingZeros
;
// True: remove tailing zeros.
bool
m_MirorA
;
// True: miror / axe A (X)
bool
m_MirorB
;
// True: miror / axe B (Y)
bool
m_Has_DCode
;
// TRUE = DCodes in file (FALSE = no DCode->
// separate DCode file
wxPoint
m_Offset
;
// Coord Offset
wxSize
m_FmtScale
;
// Fmt 2.3: m_FmtScale = 3, fmt 3.4: m_FmtScale = 4
wxSize
m_FmtLen
;
// Nb chars per coord. ex fmt 2.3, m_FmtLen = 5
wxRealPoint
m_LayerScale
;
// scale (X and Y) of layer.
int
m_Rotation
;
int
m_Iterpolation
;
// Linear, 90 arc, Circ.
bool
m_ImageNegative
;
// TRUE = Negative image
int
m_Current_Tool
;
// Current Tool (Dcode) number selected
int
m_Last_Pen_Command
;
// Current or last pen state (0..9, set by Dn option with n <10
int
m_CommandState
;
// state of gerber analysis command.
wxPoint
m_CurrentPos
;
// current specified coord for plot
wxPoint
m_PreviousPos
;
// old current specified coord for plot
wxPoint
m_IJPos
;
// IJ coord (for arcs & circles )
FILE
*
m_Current_File
;
// Current file to read
FILE
*
m_FilesList
[
12
];
// Files list
int
m_FilesPtr
;
// Stack pointer for files list
int
m_Selected_Tool
;
// Pour editions: Tool (Dcode) selectionn�
bool
m_360Arc_enbl
;
// Enbl 360 deg circular interpolation
bool
m_PolygonFillMode
;
// Enbl polygon mode (read coord as a polygon descr)
int
m_PolygonFillModeState
;
// In polygon mode: 0 = first segm, 1 = next segm
APERTURE_MACRO_SET
m_aperture_macros
;
///< a collection of APERTURE_MACROS, sorted by name
public
:
GERBER
(
WinEDA_GerberFrame
*
aParent
,
int
layer
);
~
GERBER
();
void
Clear_GERBER
();
int
ReturnUsedDcodeNumber
();
void
ResetDefaultValues
();
/** function ReportMessage
* Add a message (a string) in message list
* for instance when reading a Gerber file
* @param aMessage = the straing to add in list
*/
void
ReportMessage
(
const
wxString
aMessage
);
/** function ClearMessageList
* Clear the message list
* Call it before reading a Gerber file
*/
void
ClearMessageList
(
);
/**
* Function InitToolTable
*/
void
InitToolTable
();
wxPoint
ReadXYCoord
(
char
*&
Text
);
wxPoint
ReadIJCoord
(
char
*&
Text
);
int
ReturnGCodeNumber
(
char
*&
Text
);
int
ReturnDCodeNumber
(
char
*&
Text
);
bool
Execute_G_Command
(
char
*&
text
,
int
G_commande
);
bool
Execute_DCODE_Command
(
WinEDA_GerberFrame
*
frame
,
char
*&
text
,
int
D_commande
);
/**
* size of single line of a text from a gerber file.
* warning: some files can have very long lines, so the buffer must be large.
*/
#define GERBER_BUFZ 4000
/**
* Function ReadRS274XCommand
* reads a single RS274X command terminated with a %
*/
bool
ReadRS274XCommand
(
WinEDA_GerberFrame
*
frame
,
char
aBuff
[
GERBER_BUFZ
],
char
*&
text
);
/**
* Function ExecuteRS274XCommand
* executes 1 command
*/
bool
ExecuteRS274XCommand
(
int
command
,
char
aBuff
[
GERBER_BUFZ
],
char
*&
text
);
/**
* Function ReadApertureMacro
* reads in an aperture macro and saves it in m_aperture_macros.
* @param aBuff a character buffer at least GERBER_BUFZ long that can be
* used to read successive lines from the gerber file.
* @param text A reference to a character pointer which gives the initial
* text to read from.
* @param gerber_file Which file to read from for continuation.
* @return bool - true if a macro was read in successfully, else false.
*/
bool
ReadApertureMacro
(
char
aBuff
[
GERBER_BUFZ
],
char
*&
text
,
FILE
*
gerber_file
);
/**
* Function GetDCODE
* returns a pointer to the D_CODE within this GERBER for the given
* \a aDCODE.
* @param aDCODE The numeric value of the D_CODE to look up.
* @param createIfNoExist If true, then create the D_CODE if it does not
* exist.
* @return D_CODE* - the one implied by the given \a aDCODE, or NULL
* if the requested \a aDCODE is out of range.
*/
D_CODE
*
GetDCODE
(
int
aDCODE
,
bool
createIfNoExist
=
true
);
/**
* Function FindApertureMacro
* looks up a previously read in aperture macro.
* @param aLookup A dummy APERTURE_MACRO with [only] the name field set.
* @return APERTURE_MACRO* - the one with a matching name, or NULL if
* not found.
*/
APERTURE_MACRO
*
FindApertureMacro
(
const
APERTURE_MACRO
&
aLookup
);
};
/**************/
/* rs274x.cpp */
/**************/
bool
GetEndOfBlock
(
char
buff
[
GERBER_BUFZ
],
char
*&
text
,
FILE
*
gerber_file
);
extern
GERBER
*
g_GERBER_List
[
32
];
extern
int
g_DisplayPolygonsModeSketch
;
#include "pcbcommon.h"
#include "wxGerberFrame.h"
...
...
gerbview/gerbview_config.h
View file @
035979d3
...
...
@@ -337,22 +337,6 @@ static PARAM_CFG_SETCOLOR ColorDCodesCfg
WHITE
);
static
PARAM_CFG_INT
GERBERSpotMiniCfg
(
wxT
(
"GERBmin"
),
&
g_Plot_Spot_Mini
,
15
,
2
,
0xFFFF
);
static
PARAM_CFG_INT
TimeOutCfg
(
wxT
(
"TimeOut"
),
&
g_TimeOut
,
600
,
0
,
60000
);
static
PARAM_CFG_BOOL
DisplPolairCfg
(
INSETUP
,
...
...
@@ -404,8 +388,6 @@ PARAM_CFG_BASE * ParamCfgList[] =
&
ColorLayer30Cfg
,
&
ColorLayer31Cfg
,
&
ColorDCodesCfg
,
&
GERBERSpotMiniCfg
,
&
TimeOutCfg
,
&
DisplPolairCfg
,
NULL
};
gerbview/initpcb.cpp
View file @
035979d3
...
...
@@ -10,7 +10,7 @@
#include "gerbview.h"
#include "class_gerber_draw_item.h"
//#include "protos
.h"
#include "class_GERBER
.h"
bool
WinEDA_GerberFrame
::
Clear_Pcb
(
bool
query
)
...
...
@@ -30,7 +30,10 @@ bool WinEDA_GerberFrame::Clear_Pcb( bool query )
for
(
layer
=
0
;
layer
<
32
;
layer
++
)
{
if
(
g_GERBER_List
[
layer
]
)
{
g_GERBER_List
[
layer
]
->
InitToolTable
();
g_GERBER_List
[
layer
]
->
ResetDefaultValues
();
}
}
GetBoard
()
->
m_BoundaryBox
.
SetOrigin
(
0
,
0
);
...
...
@@ -68,7 +71,10 @@ void WinEDA_GerberFrame::Erase_Current_Layer( bool query )
}
if
(
g_GERBER_List
[
layer
]
)
{
g_GERBER_List
[
layer
]
->
InitToolTable
();
g_GERBER_List
[
layer
]
->
ResetDefaultValues
();
}
ScreenPcb
->
SetModify
();
ScreenPcb
->
SetRefreshReq
();
...
...
gerbview/locate.cpp
View file @
035979d3
...
...
@@ -9,7 +9,6 @@
#include "pcbnew.h"
#include "gerbview.h"
#include "trigo.h"
#include "protos.h"
/* Display the character of the localized STRUCTURE and return a pointer
...
...
@@ -17,6 +16,7 @@
*/
BOARD_ITEM
*
WinEDA_GerberFrame
::
Locate
(
int
typeloc
)
{
// TODO
MsgPanel
->
EraseMsgBox
();
return
NULL
;
}
...
...
gerbview/menubar.cpp
View file @
035979d3
/*************************************
**************
/
/*
tool_gerber.cpp: Build tool bars and
main menu */
/*************************************
**************
/
/*************************************/
/*
menubar.cpp: Build the
main menu */
/*************************************/
#include "fctsys.h"
#include "wx/wupdlock.h"
...
...
@@ -9,8 +9,6 @@
#include "common.h"
#include "macros.h"
#include "gerbview.h"
#include "pcbplot.h"
#include "protos.h"
#include "bitmaps.h"
#include "gerbview_id.h"
#include "hotkeys.h"
...
...
gerbview/onrightclick.cpp
View file @
035979d3
...
...
@@ -8,8 +8,6 @@
#include "confirm.h"
#include "gerbview.h"
#include "pcbplot.h"
#include "protos.h"
/* Prepare the right-click pullup menu.
...
...
gerbview/options.cpp
View file @
035979d3
...
...
@@ -14,7 +14,6 @@
#include "pcbplot.h"
#include "gerbview.h"
#include "protos.h"
#include "gerbview_id.h"
...
...
gerbview/pcbplot.cpp
View file @
035979d3
...
...
@@ -7,7 +7,6 @@
#include "gerbview.h"
#include "pcbplot.h"
#include "protos.h"
...
...
gerbview/protos.h
deleted
100644 → 0
View file @
0687921f
/* declarations prototype */
int
*
InstallDialogLayerPairChoice
(
WinEDA_GerberFrame
*
parent
);
bool
Read_Config
();
gerbview/readgerb.cpp
View file @
035979d3
...
...
@@ -8,8 +8,7 @@
#include "kicad_string.h"
#include "gestfich.h"
#include "gerbview.h"
#include "pcbplot.h"
#include "protos.h"
#include "class_GERBER.h"
#include "dialog_load_error.h"
...
...
gerbview/rs274d.cpp
View file @
035979d3
...
...
@@ -3,15 +3,14 @@
/********************/
#include "fctsys.h"
#include "polygons_defs.h"
//
#include "polygons_defs.h"
#include "common.h"
#include "confirm.h"
#include "macros.h"
//
#include "confirm.h"
//
#include "macros.h"
#include "gerbview.h"
#include "pcbplot.h"
#include "trigo.h"
#include "protos.h"
#include "class_gerber_draw_item.h"
#include "class_GERBER.h"
#include <math.h>
...
...
@@ -776,9 +775,9 @@ bool GERBER::Execute_G_Command( char*& text, int G_commande )
case
GC_MOVE
:
// Non existent
default
:
{
wxString
msg
;
msg
.
Printf
(
wxT
(
"G%0.2d command not handled"
),
G_commande
);
DisplayError
(
NULL
,
msg
);
wxString
msg
;
msg
.
Printf
(
wxT
(
"G%0.2d command not handled"
),
G_commande
);
ReportMessage
(
msg
);
return
false
;
}
}
...
...
gerbview/rs274x.cpp
View file @
035979d3
...
...
@@ -4,11 +4,9 @@
#include "fctsys.h"
#include "common.h"
#include "confirm.h"
#include "macros.h"
//#include "macros.h"
#include "gerbview.h"
#include "pcbplot.h"
#include "protos.h"
#include "class_GERBER.h"
#define CODE( x, y ) ( ( (x) << 8 ) + (y) )
...
...
@@ -291,7 +289,6 @@ bool GERBER::ExecuteRS274XCommand( int command,
case
IMAGE_ROTATION
:
case
IMAGE_OFFSET
:
case
PLOTTER_FILM
:
case
LAYER_NAME
:
case
KNOCKOUT
:
case
STEP_AND_REPEAT
:
case
ROTATE
:
...
...
@@ -303,12 +300,19 @@ bool GERBER::ExecuteRS274XCommand( int command,
break
;
case
IMAGE_NAME
:
m_Name
.
Empty
();
m_
Image
Name
.
Empty
();
while
(
*
text
!=
'*'
)
{
m_Name
.
Append
(
*
text
++
);
m_
Image
Name
.
Append
(
*
text
++
);
}
break
;
case
LAYER_NAME
:
m_LayerName
.
Empty
();
while
(
*
text
!=
'*'
)
{
m_LayerName
.
Append
(
*
text
++
);
}
break
;
case
IMAGE_POLARITY
:
...
...
@@ -330,10 +334,10 @@ bool GERBER::ExecuteRS274XCommand( int command,
break
;
case
INCLUDE_FILE
:
if
(
m_FilesPtr
>=
10
)
if
(
m_FilesPtr
>=
INCLUDE_FILES_COUNT_MAX
)
{
ok
=
FALSE
;
DisplayError
(
NULL
,
_
(
"Too many include files!!"
)
);
ReportMessage
(
_
(
"Too many include files!!"
)
);
break
;
}
strcpy
(
line
,
text
);
...
...
@@ -343,8 +347,8 @@ bool GERBER::ExecuteRS274XCommand( int command,
m_Current_File
=
fopen
(
line
,
"rt"
);
if
(
m_Current_File
==
0
)
{
msg
.
Printf
(
wxT
(
"file <%s> not found."
),
line
);
DisplayError
(
NULL
,
msg
,
10
);
msg
.
Printf
(
wxT
(
"
include
file <%s> not found."
),
line
);
ReportMessage
(
msg
);
ok
=
FALSE
;
m_Current_File
=
m_FilesList
[
m_FilesPtr
];
break
;
...
...
gerbview/select_layers_to_pcb.cpp
View file @
035979d3
...
...
@@ -8,8 +8,7 @@
#include "common.h"
#include "gerbview.h"
#include "class_board_design_settings.h"
#include "protos.h"
#include "class_GERBER.h"
#include "wx/statline.h"
...
...
@@ -66,9 +65,9 @@ END_EVENT_TABLE()
* between gerber layers and pcbnew layers
* return the "lookup table" if ok, or NULL
*/
int
*
InstallDialogLayerPairChoice
(
WinEDA_GerberFrame
*
parent
)
int
*
WinEDA_GerberFrame
::
InstallDialogLayerPairChoice
(
)
{
WinEDA_SwapLayerFrame
*
frame
=
new
WinEDA_SwapLayerFrame
(
parent
);
WinEDA_SwapLayerFrame
*
frame
=
new
WinEDA_SwapLayerFrame
(
this
);
int
ii
=
frame
->
ShowModal
();
...
...
gerbview/toolbars_gerber.cpp
View file @
035979d3
/*************************************
**************
/
/* tool_gerber.cpp: Build tool bars
and main menu
*/
/*************************************
**************
/
/*************************************/
/* tool_gerber.cpp: Build tool bars */
/*************************************/
#include "fctsys.h"
#include "wx/wupdlock.h"
#include "appl_wxstruct.h"
//
#include "appl_wxstruct.h"
#include "common.h"
#include "macros.h"
#include "gerbview.h"
#include "pcbplot.h"
#include "protos.h"
#include "bitmaps.h"
#include "gerbview_id.h"
#include "hotkeys.h"
#include "class_GERBER.h"
void
WinEDA_GerberFrame
::
ReCreateHToolbar
(
void
)
...
...
@@ -121,6 +120,10 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
choices
);
m_HToolBar
->
AddControl
(
m_SelLayerTool
);
m_TextInfo
=
new
wxTextCtrl
(
m_HToolBar
,
wxID_ANY
,
wxEmptyString
,
wxDefaultPosition
,
wxSize
(
150
,
-
1
),
wxTE_READONLY
);
m_HToolBar
->
AddControl
(
m_TextInfo
);
// after adding the buttons to the toolbar, must call Realize() to reflect
// the changes
...
...
gerbview/tracepcb.cpp
View file @
035979d3
...
...
@@ -7,22 +7,16 @@
*/
#include "fctsys.h"
#include "polygons_defs.h"
#include "gr_basic.h"
#include "common.h"
#include "class_drawpanel.h"
#include "drawtxt.h"
#include "gerbview.h"
#include "pcbplot.h"
#include "protos.h"
#include "class_board_design_settings.h"
#include "colors_selection.h"
#include "class_gerber_draw_item.h"
/***************/
/* tracepcb.cpp */
/***************/
#include "class_GERBER.h"
static
void
Show_Items_DCode_Value
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
BOARD
*
Pcb
,
int
drawmode
);
...
...
@@ -94,6 +88,10 @@ void WinEDA_GerberFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
DrawPanel
->
ManageCurseur
(
DrawPanel
,
DC
,
FALSE
);
DrawPanel
->
DrawCursor
(
DC
);
// Display the filename and the layer name (found in the gerber files, if any)
// relative to the active layer
UpdateTitleAndInfo
();
}
/********************************************************************/
...
...
gerbview/wxGerberFrame.h
View file @
035979d3
...
...
@@ -46,6 +46,8 @@ protected:
public
:
WinEDAChoiceBox
*
m_SelLayerBox
;
WinEDAChoiceBox
*
m_SelLayerTool
;
wxTextCtrl
*
m_TextInfo
;
// a wxTextCtrl used to display some info about
// gerber data (format..)
private
:
bool
m_show_layer_manager_tools
;
...
...
@@ -176,6 +178,16 @@ public:
*/
void
syncLayerBox
();
/** function UpdateTitleAndInfo
* displays the short filename (if exists) of the selected layer
* on the caption of the main gerbview window
* and some other parameters
* Name of the layer (found in the gerber file: LN <name> command) in the status bar
* Name of the Image (found in the gerber file: IN <name> command) in the status bar
* and other data in toolbar
*/
void
UpdateTitleAndInfo
();
/**
* Load applications settings specific to the PCBNew.
*
...
...
@@ -389,6 +401,14 @@ public:
int
aPrintMask
,
bool
aPrintMirrorMode
,
void
*
aData
=
NULL
);
/** InstallDialogLayerPairChoice
* Install a dialog frame to choose the equivalence
* between gerber layers and pcbnew layers
* @return the "lookup table" if ok, or NULL
*/
int
*
InstallDialogLayerPairChoice
(
);
DECLARE_EVENT_TABLE
()
};
...
...
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