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
a2a02496
Commit
a2a02496
authored
Nov 07, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gerber viewer cleanups
parent
e6e50f3c
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
146 additions
and
145 deletions
+146
-145
gerbview.h
gerbview/gerbview.h
+40
-6
protos.h
gerbview/protos.h
+0
-13
readgerb.cpp
gerbview/readgerb.cpp
+5
-5
rs274x.cpp
gerbview/rs274x.cpp
+101
-121
No files found.
gerbview/gerbview.h
View file @
a2a02496
...
...
@@ -92,7 +92,10 @@ enum Gerb_Analyse_Cmd {
class
D_CODE
;
/* Structure de Description d'option d'une layer GERBER : */
/**
* Class GERBER_Descr
* holds the data for one gerber file or layer
*/
class
GERBER_Descr
{
public
:
...
...
@@ -152,14 +155,32 @@ public:
bool
Execute_G_Command
(
char
*&
text
,
int
G_commande
);
bool
Execute_DCODE_Command
(
WinEDA_GerberFrame
*
frame
,
wxDC
*
DC
,
char
*&
text
,
int
D_commande
);
/**
* size of single line of a text line 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
,
wxDC
*
DC
,
char
*
buff
,
char
*&
text
);
bool
ExecuteRS274XCommand
(
int
command
,
char
*
buff
,
char
*&
text
);
};
char
aBuff
[
GERBER_BUFZ
],
char
*&
text
);
/**
* Function ExecuteRS274XCommand
* executes 1 commande
*/
bool
ExecuteRS274XCommand
(
int
command
,
char
aBuff
[
GERBER_BUFZ
],
char
*&
text
);
};
/* Structure de Description d'un D_CODE GERBER : */
/**
* Class D_CODE
* holds a gerber DCODE definition.
*/
class
D_CODE
{
public
:
...
...
@@ -178,10 +199,23 @@ public:
void
Clear_D_CODE_Data
();
};
/**************/
/* rs274x.cpp */
/**************/
bool
GetEndOfBlock
(
char
buff
[
GERBER_BUFZ
],
char
*&
text
,
FILE
*
gerber_file
);
/*************/
/* dcode.cpp */
/*************/
D_CODE
*
ReturnToolDescr
(
int
layer
,
int
Dcode
,
int
*
index
=
NULL
);
eda_global
const
wxChar
*
g_GERBER_Tool_Type
[
6
]
#ifdef MAIN
=
{
wxT
(
"????"
),
wxT
(
"Rond"
),
wxT
(
"Rect"
),
wxT
(
"Line"
),
wxT
(
"Oval"
),
wxT
(
"Macro"
)
wxT
(
"????"
),
wxT
(
"Ro
u
nd"
),
wxT
(
"Rect"
),
wxT
(
"Line"
),
wxT
(
"Oval"
),
wxT
(
"Macro"
)
}
...
...
gerbview/protos.h
View file @
a2a02496
...
...
@@ -124,16 +124,3 @@ void Trace_1_texte_pcb(WinEDA_DrawPanel * panel, wxDC * DC,
void
Affiche_DCodes_Pistes
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
BOARD
*
Pcb
,
int
drawmode
);
/*************/
/* dcode.cpp */
/*************/
class
D_CODE
;
D_CODE
*
ReturnToolDescr
(
int
layer
,
int
Dcode
,
int
*
index
=
NULL
);
/**************/
/* rs274x.cpp */
/**************/
bool
GetEndOfBlock
(
char
*
buff
,
char
*
&
text
,
FILE
*
gerber_file
);
gerbview/readgerb.cpp
View file @
a2a02496
...
...
@@ -115,10 +115,10 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC,
*/
{
int
G_commande
=
0
,
D_commande
=
0
;
/* command number for G et D commands (like G04 or D02) */
char
Line
[
4000
];
/* Buffer to read 1 line of the gerber file
* warning: some files can have very long lines, so the buffer must be large
*/
D_commande
=
0
;
/* command number for G et D commands (like G04 or D02) */
char
Line
[
GERBER_BUFZ
];
wxString
msg
;
char
*
text
;
int
layer
;
/* current layer used in gerbview */
...
...
@@ -158,7 +158,7 @@ bool WinEDA_GerberFrame::Read_GERBER_File( wxDC* DC,
while
(
TRUE
)
{
if
(
fgets
(
Line
,
sizeof
(
Line
)
-
1
,
gerber_layer
->
m_Current_File
)
==
NULL
)
// E.O.F
if
(
fgets
(
Line
,
sizeof
(
Line
),
gerber_layer
->
m_Current_File
)
==
NULL
)
// E.O.F
{
if
(
gerber_layer
->
m_FilesPtr
==
0
)
break
;
...
...
gerbview/rs274x.cpp
View file @
a2a02496
This diff is collapsed.
Click to expand it.
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