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
7fbeb899
Commit
7fbeb899
authored
May 11, 2010
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial work on Bug 578577, partial fix
parent
74cc5a75
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
266 additions
and
223 deletions
+266
-223
rs274d.cpp
gerbview/rs274d.cpp
+233
-212
rs274x.cpp
gerbview/rs274x.cpp
+33
-11
No files found.
gerbview/rs274d.cpp
View file @
7fbeb899
This diff is collapsed.
Click to expand it.
gerbview/rs274x.cpp
View file @
7fbeb899
...
@@ -535,6 +535,26 @@ bool GetEndOfBlock( char buff[GERBER_BUFZ], char*& text, FILE* gerber_file )
...
@@ -535,6 +535,26 @@ bool GetEndOfBlock( char buff[GERBER_BUFZ], char*& text, FILE* gerber_file )
}
}
static
bool
CheckForLineEnd
(
char
buff
[
GERBER_BUFZ
],
char
*&
text
,
FILE
*
fp
)
{
while
(
*
text
==
'\n'
||
!*
text
)
{
if
(
*
text
==
'\n'
)
++
text
;
if
(
!*
text
)
{
if
(
fgets
(
buff
,
GERBER_BUFZ
,
fp
)
==
NULL
)
return
false
;
text
=
buff
;
}
}
return
true
;
}
bool
GERBER
::
ReadApertureMacro
(
char
buff
[
GERBER_BUFZ
],
bool
GERBER
::
ReadApertureMacro
(
char
buff
[
GERBER_BUFZ
],
char
*&
text
,
char
*&
text
,
FILE
*
gerber_file
)
FILE
*
gerber_file
)
...
@@ -563,15 +583,8 @@ bool GERBER::ReadApertureMacro( char buff[GERBER_BUFZ],
...
@@ -563,15 +583,8 @@ bool GERBER::ReadApertureMacro( char buff[GERBER_BUFZ],
if
(
*
text
==
'*'
)
if
(
*
text
==
'*'
)
++
text
;
++
text
;
if
(
*
text
==
'\n'
)
if
(
!
CheckForLineEnd
(
buff
,
text
,
gerber_file
)
)
++
text
;
return
false
;
if
(
!*
text
)
{
text
=
buff
;
if
(
fgets
(
buff
,
GERBER_BUFZ
,
gerber_file
)
==
NULL
)
return
false
;
}
if
(
*
text
==
'%'
)
if
(
*
text
==
'%'
)
break
;
// exit with text still pointing at %
break
;
// exit with text still pointing at %
...
@@ -625,12 +638,15 @@ bool GERBER::ReadApertureMacro( char buff[GERBER_BUFZ],
...
@@ -625,12 +638,15 @@ bool GERBER::ReadApertureMacro( char buff[GERBER_BUFZ],
}
}
int
i
;
int
i
;
for
(
i
=
0
;
i
<
paramCount
&&
*
text
&&
*
text
!=
'*'
;
++
i
)
for
(
i
=
0
;
i
<
paramCount
&&
*
text
!=
'*'
;
++
i
)
{
{
prim
.
params
.
push_back
(
DCODE_PARAM
()
);
prim
.
params
.
push_back
(
DCODE_PARAM
()
);
DCODE_PARAM
&
param
=
prim
.
params
.
back
();
DCODE_PARAM
&
param
=
prim
.
params
.
back
();
if
(
!
CheckForLineEnd
(
buff
,
text
,
gerber_file
)
)
return
false
;
if
(
*
text
==
'$'
)
if
(
*
text
==
'$'
)
{
{
++
text
;
++
text
;
...
@@ -647,18 +663,24 @@ bool GERBER::ReadApertureMacro( char buff[GERBER_BUFZ],
...
@@ -647,18 +663,24 @@ bool GERBER::ReadApertureMacro( char buff[GERBER_BUFZ],
// there are more parameters to read if this is an AMP_OUTLINE
// there are more parameters to read if this is an AMP_OUTLINE
if
(
prim
.
primitive_id
==
AMP_OUTLINE
)
if
(
prim
.
primitive_id
==
AMP_OUTLINE
)
{
{
// so far we have read [0]:exposure, [1]:#points, [2]:X start, [3]: Y start
// Now read all the points, plus trailing rotation in degrees.
// params[1] is a count of polygon points, so it must be given
// params[1] is a count of polygon points, so it must be given
// in advance, i.e. be immediate.
// in advance, i.e. be immediate.
wxASSERT
(
prim
.
params
[
1
].
IsImmediate
()
);
wxASSERT
(
prim
.
params
[
1
].
IsImmediate
()
);
paramCount
=
(
int
)
prim
.
params
[
1
].
GetValue
(
0
)
*
2
+
1
;
paramCount
=
(
int
)
prim
.
params
[
1
].
GetValue
(
0
)
*
2
+
1
;
for
(
int
i
=
0
;
i
<
paramCount
&&
*
text
&&
*
text
!=
'*'
;
++
i
)
for
(
int
i
=
0
;
i
<
paramCount
&&
*
text
!=
'*'
;
++
i
)
{
{
prim
.
params
.
push_back
(
DCODE_PARAM
()
);
prim
.
params
.
push_back
(
DCODE_PARAM
()
);
DCODE_PARAM
&
param
=
prim
.
params
.
back
();
DCODE_PARAM
&
param
=
prim
.
params
.
back
();
if
(
!
CheckForLineEnd
(
buff
,
text
,
gerber_file
)
)
return
false
;
if
(
*
text
==
'$'
)
if
(
*
text
==
'$'
)
{
{
++
text
;
++
text
;
...
...
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