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
7457789d
Commit
7457789d
authored
Nov 10, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more aperture macro work
parent
1771bf20
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
12 deletions
+56
-12
gerbview.h
gerbview/gerbview.h
+5
-4
rs274d.cpp
gerbview/rs274d.cpp
+51
-8
No files found.
gerbview/gerbview.h
View file @
7457789d
...
...
@@ -177,8 +177,8 @@ typedef std::vector<DCODE_PARAM> DCODE_PARAMS;
*/
struct
AM_PRIMITIVE
{
AM_PRIMITIVE_ID
primitive_id
;
DCODE_PARAMS
params
;
AM_PRIMITIVE_ID
primitive_id
;
///< The primitive type
DCODE_PARAMS
params
;
///< A sequence of parameters used by the primitive
};
...
...
@@ -190,8 +190,8 @@ typedef std::vector<AM_PRIMITIVE> AM_PRIMITIVES;
*/
struct
APERTURE_MACRO
{
wxString
name
;
AM_PRIMITIVES
primitives
;
wxString
name
;
///< The name of the aperture macro
AM_PRIMITIVES
primitives
;
///< A sequence of AM_PRIMITIVEs
};
...
...
@@ -260,6 +260,7 @@ public:
{
m_Macro
=
aMacro
;
}
APERTURE_MACRO
*
GetMacro
()
{
return
m_Macro
;
}
/**
* Function ShowApertureType
...
...
gerbview/rs274d.cpp
View file @
7457789d
...
...
@@ -330,7 +330,8 @@ wxPoint GERBER::ReadXYCoord( char*& Text )
{
type_coord
=
*
Text
;
Text
++
;
text
=
line
;
nbchar
=
0
;
text
=
line
;
nbchar
=
0
;
while
(
IsNumber
(
*
Text
)
)
{
if
(
*
Text
==
'.'
)
...
...
@@ -356,7 +357,8 @@ wxPoint GERBER::ReadXYCoord( char*& Text )
int
min_digit
=
(
type_coord
==
'X'
)
?
m_FmtLen
.
x
:
m_FmtLen
.
y
;
while
(
nbchar
<
min_digit
)
{
*
(
text
++
)
=
'0'
;
nbchar
++
;
*
(
text
++
)
=
'0'
;
nbchar
++
;
}
*
text
=
0
;
...
...
@@ -408,12 +410,15 @@ wxPoint GERBER::ReadXYCoord( char*& Text )
if
(
m_GerbMetric
)
real_scale
=
real_scale
/
25.4
;
current_coord
=
(
int
)
round
(
current_coord
*
real_scale
);
}
if
(
type_coord
==
'X'
)
pos
.
x
=
current_coord
;
else
if
(
type_coord
==
'Y'
)
pos
.
y
=
current_coord
;
continue
;
}
else
...
...
@@ -715,10 +720,12 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
{
if
(
D_commande
>
(
MAX_TOOLS
-
1
)
)
D_commande
=
MAX_TOOLS
-
1
;
m_Current_Tool
=
D_commande
;
D_CODE
*
pt_Dcode
=
GetDCODE
(
D_commande
,
false
);
if
(
pt_Dcode
)
pt_Dcode
->
m_InUse
=
TRUE
;
return
TRUE
;
}
else
// D_commande = 0..9: this is a pen command (usualy D1, D2 or D3)
...
...
@@ -730,7 +737,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
{
switch
(
D_commande
)
{
case
1
:
//code D01 Draw line, exposure ON
case
1
:
//
code D01 Draw line, exposure ON
{
SEGZONE
*
edge_poly
,
*
last
;
...
...
@@ -755,7 +762,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
break
;
}
case
2
:
//code D2: exposure OFF (i.e. "move to")
case
2
:
//
code D2: exposure OFF (i.e. "move to")
m_PreviousPos
=
m_CurrentPos
;
m_PolygonFillModeState
=
0
;
break
;
...
...
@@ -767,7 +774,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
else
switch
(
D_commande
)
{
case
1
:
//
code D01 Draw line, exposure ON
case
1
:
//
code D01 Draw line, exposure ON
pt_Tool
=
GetDCODE
(
m_Current_Tool
,
false
);
if
(
pt_Tool
)
{
...
...
@@ -815,7 +822,7 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
m_PreviousPos
=
m_CurrentPos
;
break
;
case
2
:
//
code D2: exposure OFF (i.e. "move to")
case
2
:
//
code D2: exposure OFF (i.e. "move to")
m_PreviousPos
=
m_CurrentPos
;
break
;
...
...
@@ -852,7 +859,43 @@ bool GERBER::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
PAD_RECT
);
break
;
default
:
// Special (Macro) : Non implant�
case
APT_MACRO
:
{
APERTURE_MACRO
*
macro
=
pt_Tool
->
GetMacro
();
wxASSERT
(
macro
);
// split the macro primitives up into multiple normal TRACK elements
for
(
AM_PRIMITIVES
::
iterator
i
=
macro
->
primitives
.
begin
();
i
!=
macro
->
primitives
.
end
();
++
i
)
{
switch
(
i
->
primitive_id
)
{
case
AMP_CIRCLE
:
/*
Append_1_Flash_ROND_GERBER( dcode,
frame, DC,
m_CurrentPos,
size.x );
*/
break
;
case
AMP_LINE2
:
case
AMP_LINE20
:
break
;
case
AMP_LINE_CENTER
:
case
AMP_LINE_LOWER_LEFT
:
case
AMP_EOF
:
case
AMP_OUTLINE
:
case
AMP_POLYGON
:
case
AMP_MOIRE
:
case
AMP_THERMAL
:
default
:
break
;
}
}
}
break
;
default
:
break
;
}
...
...
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