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
7559e134
Commit
7559e134
authored
Feb 22, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
specctra_export: add support for dsn outline
parent
923ece9c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
134 additions
and
37 deletions
+134
-37
change_log.txt
change_log.txt
+19
-11
class_edge_mod.cpp
pcbnew/class_edge_mod.cpp
+19
-9
class_edge_mod.h
pcbnew/class_edge_mod.h
+21
-13
specctra.h
pcbnew/specctra.h
+10
-0
specctra_export.cpp
pcbnew/specctra_export.cpp
+65
-4
No files found.
change_log.txt
View file @
7559e134
...
@@ -5,6 +5,15 @@ Started 2007-June-11
...
@@ -5,6 +5,15 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.
2008-Feb-22 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew
specctra_export.cpp: added DSN 'outline' support from EDGE_MODULEs.
lines and circles, not arcs.
factored out EDGE_MODULE::ShowShape() from EDGE_MODULE::Show().
2008-Feb-21 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2008-Feb-21 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
================================================================================
+eeschema
+eeschema
...
@@ -18,7 +27,6 @@ email address.
...
@@ -18,7 +27,6 @@ email address.
- incorrect annotation in complex hierarchy with multi parts per package (duplicates created).
- incorrect annotation in complex hierarchy with multi parts per package (duplicates created).
2008-Feb-20 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
2008-Feb-20 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
================================================================================
+eeschema
+eeschema
...
...
pcbnew/class_edge_mod.cpp
View file @
7559e134
...
@@ -540,18 +540,13 @@ bool EDGE_MODULE::HitTest( const wxPoint& ref_pos )
...
@@ -540,18 +540,13 @@ bool EDGE_MODULE::HitTest( const wxPoint& ref_pos )
#if defined(DEBUG)
#if defined(DEBUG)
/**
* Function Show
* is used to output the object tree, currently for debugging only.
const
char
*
EDGE_MODULE
::
ShowShape
(
int
aShape
)
* @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree.
* @param os The ostream& to output to.
*/
void
EDGE_MODULE
::
Show
(
int
nestLevel
,
std
::
ostream
&
os
)
{
{
const
char
*
cp
;
const
char
*
cp
;
switch
(
m_
Shape
)
switch
(
a
Shape
)
{
{
case
S_SEGMENT
:
cp
=
"line"
;
break
;
case
S_SEGMENT
:
cp
=
"line"
;
break
;
case
S_RECT
:
cp
=
"rect"
;
break
;
case
S_RECT
:
cp
=
"rect"
;
break
;
...
@@ -565,6 +560,21 @@ void EDGE_MODULE::Show( int nestLevel, std::ostream& os )
...
@@ -565,6 +560,21 @@ void EDGE_MODULE::Show( int nestLevel, std::ostream& os )
default
:
cp
=
"??EDGE??"
;
break
;
default
:
cp
=
"??EDGE??"
;
break
;
}
}
return
cp
;
}
/**
* Function Show
* is used to output the object tree, currently for debugging only.
* @param nestLevel An aid to prettier tree indenting, and is the level
* of nesting of this object within the overall tree.
* @param os The ostream& to output to.
*/
void
EDGE_MODULE
::
Show
(
int
nestLevel
,
std
::
ostream
&
os
)
{
const
char
*
cp
=
ShowShape
(
m_Shape
);
// for now, make it look like XML:
// for now, make it look like XML:
NestedSpace
(
nestLevel
,
os
)
<<
'<'
<<
GetClass
().
Lower
().
mb_str
()
<<
NestedSpace
(
nestLevel
,
os
)
<<
'<'
<<
GetClass
().
Lower
().
mb_str
()
<<
" type=
\"
"
<<
cp
<<
"
\"
>"
;
" type=
\"
"
<<
cp
<<
"
\"
>"
;
...
...
pcbnew/class_edge_mod.h
View file @
7559e134
...
@@ -103,5 +103,13 @@ public:
...
@@ -103,5 +103,13 @@ public:
* @param os The ostream& to output to.
* @param os The ostream& to output to.
*/
*/
virtual
void
Show
(
int
nestLevel
,
std
::
ostream
&
os
);
virtual
void
Show
(
int
nestLevel
,
std
::
ostream
&
os
);
/**
* Function ShowShape
* converts the enum Track_Shapes integer value to a C string.
*/
static
const
char
*
ShowShape
(
int
aShape
);
#endif
#endif
};
};
pcbnew/specctra.h
View file @
7559e134
...
@@ -693,6 +693,11 @@ public:
...
@@ -693,6 +693,11 @@ public:
layer_id
=
aLayerId
;
layer_id
=
aLayerId
;
}
}
void
SetAperture
(
double
aWidth
)
{
aperture_width
=
aWidth
;
}
void
Format
(
OUTPUTFORMATTER
*
out
,
int
nestLevel
)
throw
(
IOError
)
void
Format
(
OUTPUTFORMATTER
*
out
,
int
nestLevel
)
throw
(
IOError
)
{
{
const
char
*
newline
=
nestLevel
?
"
\n
"
:
""
;
const
char
*
newline
=
nestLevel
?
"
\n
"
:
""
;
...
@@ -1883,6 +1888,11 @@ class SHAPE : public WINDOW
...
@@ -1883,6 +1888,11 @@ class SHAPE : public WINDOW
WINDOWS
windows
;
WINDOWS
windows
;
public
:
public
:
/**
* Constructor SHAPE
* alternatively takes a DSN_T aType of T_outline
*/
SHAPE
(
ELEM
*
aParent
,
DSN_T
aType
=
T_shape
)
:
SHAPE
(
ELEM
*
aParent
,
DSN_T
aType
=
T_shape
)
:
WINDOW
(
aParent
,
aType
)
WINDOW
(
aParent
,
aType
)
{
{
...
...
pcbnew/specctra_export.cpp
View file @
7559e134
...
@@ -545,21 +545,21 @@ typedef std::map<wxString, int, wxString_less_than> PINMAP;
...
@@ -545,21 +545,21 @@ typedef std::map<wxString, int, wxString_less_than> PINMAP;
IMAGE
*
SPECCTRA_DB
::
makeIMAGE
(
BOARD
*
aBoard
,
MODULE
*
aModule
)
IMAGE
*
SPECCTRA_DB
::
makeIMAGE
(
BOARD
*
aBoard
,
MODULE
*
aModule
)
{
{
PINMAP
pinmap
;
PINMAP
pinmap
;
TYPE_COLLECTOR
pad
s
;
TYPE_COLLECTOR
moduleItem
s
;
wxString
padName
;
wxString
padName
;
// get all the MODULE's pads.
// get all the MODULE's pads.
pad
s
.
Collect
(
aModule
,
scanPADs
);
moduleItem
s
.
Collect
(
aModule
,
scanPADs
);
IMAGE
*
image
=
new
IMAGE
(
0
);
IMAGE
*
image
=
new
IMAGE
(
0
);
image
->
image_id
=
CONV_TO_UTF8
(
aModule
->
m_LibRef
);
image
->
image_id
=
CONV_TO_UTF8
(
aModule
->
m_LibRef
);
// from the pads, and make an IMAGE using collated padstacks.
// from the pads, and make an IMAGE using collated padstacks.
for
(
int
p
=
0
;
p
<
pad
s
.
GetCount
();
++
p
)
for
(
int
p
=
0
;
p
<
moduleItem
s
.
GetCount
();
++
p
)
{
{
D_PAD
*
pad
=
(
D_PAD
*
)
pad
s
[
p
];
D_PAD
*
pad
=
(
D_PAD
*
)
moduleItem
s
[
p
];
// see if this pad is a through hole with no copper on its perimeter
// see if this pad is a through hole with no copper on its perimeter
if
(
isKeepout
(
pad
)
)
if
(
isKeepout
(
pad
)
)
...
@@ -636,6 +636,67 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule )
...
@@ -636,6 +636,67 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule )
}
}
}
}
static
const
KICAD_T
scanEDGEs
[]
=
{
TYPEEDGEMODULE
,
EOT
};
// get all the MODULE's EDGE_MODULEs and convert those to DSN outlines.
moduleItems
.
Collect
(
aModule
,
scanEDGEs
);
for
(
int
i
=
0
;
i
<
moduleItems
.
GetCount
();
++
i
)
{
EDGE_MODULE
*
graphic
=
(
EDGE_MODULE
*
)
moduleItems
[
i
];
SHAPE
*
outline
;
PATH
*
path
;
switch
(
graphic
->
m_Shape
)
{
case
S_SEGMENT
:
outline
=
new
SHAPE
(
image
,
T_outline
);
image
->
Append
(
outline
);
path
=
new
PATH
(
outline
);
outline
->
SetShape
(
path
);
path
->
SetAperture
(
scale
(
graphic
->
m_Width
)
);
path
->
SetLayerId
(
"signal"
);
path
->
AppendPoint
(
mapPt
(
graphic
->
m_Start0
)
);
path
->
AppendPoint
(
mapPt
(
graphic
->
m_End0
)
);
break
;
case
S_CIRCLE
:
{
// this is best done by 4 QARC's but freerouter does not yet support QARCs.
// for now, support by using line segments.
outline
=
new
SHAPE
(
image
,
T_outline
);
image
->
Append
(
outline
);
path
=
new
PATH
(
outline
);
outline
->
SetShape
(
path
);
path
->
SetAperture
(
scale
(
graphic
->
m_Width
)
);
path
->
SetLayerId
(
"signal"
);
double
radius
=
hypot
(
scale
(
graphic
->
m_Start
.
x
-
graphic
->
m_End
.
x
),
scale
(
graphic
->
m_Start
.
y
-
graphic
->
m_End
.
y
)
);
POINT
offset
=
mapPt
(
graphic
->
m_Start0
);
// better if evenly divisible into 360
const
int
DEGREE_INTERVAL
=
18
;
// 18 means 20 line segments
for
(
double
radians
=
0.0
;
radians
<
2
*
M_PI
;
radians
+=
DEGREE_INTERVAL
*
M_PI
/
180.0
)
{
POINT
point
(
radius
*
cos
(
radians
),
radius
*
sin
(
radians
)
);
point
+=
offset
;
path
->
AppendPoint
(
point
);
}
}
break
;
case
S_RECT
:
case
S_ARC
:
default
:
D
(
printf
(
"makeIMAGE(): unsupported shape %s
\n
"
,
EDGE_MODULE
::
ShowShape
(
graphic
->
m_Shape
)
);)
continue
;
}
}
return
image
;
return
image
;
}
}
...
...
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