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
9086e68d
Commit
9086e68d
authored
Feb 20, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
specctra_export fix for pads with offsets
parent
708a394c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
64 deletions
+76
-64
change_log.txt
change_log.txt
+9
-0
specctra_export.cpp
pcbnew/specctra_export.cpp
+59
-57
specctra_import.cpp
pcbnew/specctra_import.cpp
+8
-7
No files found.
change_log.txt
View file @
9086e68d
...
@@ -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-20 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew
specctra_export.cpp fixed the offset problem with freerouter.net.
http://tech.groups.yahoo.com/group/kicad-devel/message/1076
2008-Feb-19 UPDATE Dick Hollenbeck <dick@softplc.com>
2008-Feb-19 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
+pcbnew
+pcbnew
...
...
pcbnew/specctra_export.cpp
View file @
9086e68d
...
@@ -298,17 +298,6 @@ static bool isKeepout( D_PAD* aPad )
...
@@ -298,17 +298,6 @@ static bool isKeepout( D_PAD* aPad )
}
}
/*
static int Pad_list_Sort_by_Shapes( const void* refptr, const void* objptr )
{
const D_PAD* padref = *(D_PAD**)refptr;
const D_PAD* padcmp = *(D_PAD**)objptr;
return D_PAD::Compare( padref, padcmp );
}
*/
/**
/**
* Function makePath
* Function makePath
* creates a PATH element with a single straight line, a pair of vertices.
* creates a PATH element with a single straight line, a pair of vertices.
...
@@ -325,13 +314,13 @@ static PATH* makePath( const POINT& aStart, const POINT& aEnd, const std::string
...
@@ -325,13 +314,13 @@ static PATH* makePath( const POINT& aStart, const POINT& aEnd, const std::string
/**
/**
* Struct wxString_less_than
_
* Struct wxString_less_than
* is used the std:set<> and std::map<> instantiations below.
* is used
by
the std:set<> and std::map<> instantiations below.
* See STRINGSET typedef and PINMAP typedef below.
* See STRINGSET typedef and PINMAP typedef below.
*/
*/
struct
wxString_less_than
struct
wxString_less_than
{
{
// a "less than" test on two wxStrings
, by pointer.
// a "less than" test on two wxStrings
bool
operator
()(
const
wxString
&
s1
,
const
wxString
&
s2
)
const
bool
operator
()(
const
wxString
&
s1
,
const
wxString
&
s2
)
const
{
{
return
s1
.
Cmp
(
s2
)
<
0
;
// case specific wxString compare
return
s1
.
Cmp
(
s2
)
<
0
;
// case specific wxString compare
...
@@ -356,9 +345,8 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, D_PAD* aPad )
...
@@ -356,9 +345,8 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, D_PAD* aPad )
aPad
->
IsOnLayer
(
COPPER_LAYER_N
)
aPad
->
IsOnLayer
(
COPPER_LAYER_N
)
};
};
// caller must do th
is screen
before calling here.
// caller must do th
ese checks
before calling here.
wxASSERT
(
!
isKeepout
(
aPad
)
);
wxASSERT
(
!
isKeepout
(
aPad
)
);
wxASSERT
(
doLayer
[
0
]
||
doLayer
[
1
]
);
wxASSERT
(
doLayer
[
0
]
||
doLayer
[
1
]
);
PADSTACK
*
padstack
=
new
PADSTACK
();
PADSTACK
*
padstack
=
new
PADSTACK
();
...
@@ -366,6 +354,7 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, D_PAD* aPad )
...
@@ -366,6 +354,7 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, D_PAD* aPad )
int
reportedLayers
=
0
;
// how many in reported padstack
int
reportedLayers
=
0
;
// how many in reported padstack
const
char
*
layerName
[
NB_COPPER_LAYERS
];
const
char
*
layerName
[
NB_COPPER_LAYERS
];
if
(
aPad
->
m_Attribut
==
PAD_SMD
||
aPad
->
m_Attribut
==
PAD_CONN
)
if
(
aPad
->
m_Attribut
==
PAD_SMD
||
aPad
->
m_Attribut
==
PAD_CONN
)
{
{
// PAD_SMD and PAD_CONN are reported on each layer for which
// PAD_SMD and PAD_CONN are reported on each layer for which
...
@@ -400,7 +389,7 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, D_PAD* aPad )
...
@@ -400,7 +389,7 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, D_PAD* aPad )
*/
*/
reportedLayers = 1;
reportedLayers = 1;
layerName[0] =
signal
;
layerName[0] =
"signal"
;
uniqifier = "[A]"; // A for all
uniqifier = "[A]"; // A for all
#else
#else
...
@@ -415,6 +404,23 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, D_PAD* aPad )
...
@@ -415,6 +404,23 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, D_PAD* aPad )
#endif
#endif
}
}
POINT
dsnOffset
;
if
(
aPad
->
m_Offset
.
x
||
aPad
->
m_Offset
.
y
)
{
char
offsetTxt
[
32
];
wxPoint
offset
(
aPad
->
m_Offset
.
x
,
aPad
->
m_Offset
.
y
);
dsnOffset
=
mapPt
(
offset
);
// using '(' or ')' would cause padstack name to be quote wrapped,
// so use other brackets, and {} locks freerouter.
sprintf
(
offsetTxt
,
"[%.6g,%.6g]"
,
dsnOffset
.
x
,
dsnOffset
.
y
);
uniqifier
+=
offsetTxt
;
}
switch
(
aPad
->
m_PadShape
)
switch
(
aPad
->
m_PadShape
)
{
{
default
:
default
:
...
@@ -432,11 +438,13 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, D_PAD* aPad )
...
@@ -432,11 +438,13 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, D_PAD* aPad )
circle
->
SetLayerId
(
layerName
[
ndx
]
);
circle
->
SetLayerId
(
layerName
[
ndx
]
);
circle
->
SetDiameter
(
diameter
);
circle
->
SetDiameter
(
diameter
);
circle
->
SetVertex
(
dsnOffset
);
}
}
snprintf
(
name
,
sizeof
(
name
),
"Round%sPad_%.6g_mil"
,
snprintf
(
name
,
sizeof
(
name
),
"Round%sPad_%.6g_mil"
,
uniqifier
.
c_str
(),
scale
(
aPad
->
m_Size
.
x
)
);
uniqifier
.
c_str
(),
scale
(
aPad
->
m_Size
.
x
)
);
name
[
sizeof
(
name
)
-
1
]
=
0
;
name
[
sizeof
(
name
)
-
1
]
=
0
;
padstack
->
SetPadstackId
(
name
);
padstack
->
SetPadstackId
(
name
);
}
}
break
;
break
;
...
@@ -449,6 +457,9 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, D_PAD* aPad )
...
@@ -449,6 +457,9 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, D_PAD* aPad )
POINT
lowerLeft
(
-
dx
,
-
dy
);
POINT
lowerLeft
(
-
dx
,
-
dy
);
POINT
upperRight
(
dx
,
dy
);
POINT
upperRight
(
dx
,
dy
);
lowerLeft
+=
dsnOffset
;
upperRight
+=
dsnOffset
;
for
(
int
ndx
=
0
;
ndx
<
reportedLayers
;
++
ndx
)
for
(
int
ndx
=
0
;
ndx
<
reportedLayers
;
++
ndx
)
{
{
SHAPE
*
shape
=
new
SHAPE
(
padstack
);
SHAPE
*
shape
=
new
SHAPE
(
padstack
);
...
@@ -471,43 +482,42 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, D_PAD* aPad )
...
@@ -471,43 +482,42 @@ PADSTACK* SPECCTRA_DB::makePADSTACK( BOARD* aBoard, D_PAD* aPad )
case
PAD_OVAL
:
case
PAD_OVAL
:
{
{
double
dx
=
scale
(
aPad
->
m_Size
.
x
)
/
2.0
;
double
dx
=
scale
(
aPad
->
m_Size
.
x
)
/
2.0
;
double
dy
=
scale
(
aPad
->
m_Size
.
y
)
/
2.0
;
double
dy
=
scale
(
aPad
->
m_Size
.
y
)
/
2.0
;
double
dr
=
dx
-
dy
;
double
dr
=
dx
-
dy
;
double
radius
;
POINT
start
;
POINT
stop
;
if
(
dr
>=
0
)
// oval is horizontal
if
(
dr
>=
0
)
// oval is horizontal
{
{
double
radius
=
dy
;
radius
=
dy
;
for
(
int
ndx
=
0
;
ndx
<
reportedLayers
;
++
ndx
)
start
=
POINT
(
-
dr
,
0.0
);
{
stop
=
POINT
(
dr
,
0.0
);
SHAPE
*
shape
;
PATH
*
path
;
// see http://www.freerouting.net/usren/viewtopic.php?f=3&t=317#p408
shape
=
new
SHAPE
(
padstack
);
padstack
->
Append
(
shape
);
path
=
makePath
(
POINT
(
-
dr
,
0.0
),
POINT
(
dr
,
0.0
),
layerName
[
ndx
]
);
shape
->
SetShape
(
path
);
path
->
aperture_width
=
2.0
*
radius
;
}
}
}
else
// oval is vertical
else
// oval is vertical
{
{
double
radius
=
dx
;
radius
=
dx
;
dr
=
-
dr
;
dr
=
-
dr
;
for
(
int
ndx
=
0
;
ndx
<
reportedLayers
;
++
ndx
)
start
=
POINT
(
0.0
,
-
dr
);
{
stop
=
POINT
(
0.0
,
dr
);
SHAPE
*
shape
;
}
PATH
*
path
;
// see http://www.freerouting.net/usren/viewtopic.php?f=3&t=317#p408
start
+=
dsnOffset
;
shape
=
new
SHAPE
(
padstack
);
stop
+=
dsnOffset
;
padstack
->
Append
(
shape
);
path
=
makePath
(
POINT
(
0.0
,
-
dr
),
POINT
(
0.0
,
dr
),
layerName
[
ndx
]
);
for
(
int
ndx
=
0
;
ndx
<
reportedLayers
;
++
ndx
)
shape
->
SetShape
(
path
);
{
path
->
aperture_width
=
2.0
*
radius
;
SHAPE
*
shape
;
}
PATH
*
path
;
// see http://www.freerouting.net/usren/viewtopic.php?f=3&t=317#p408
shape
=
new
SHAPE
(
padstack
);
padstack
->
Append
(
shape
);
path
=
makePath
(
start
,
stop
,
layerName
[
ndx
]
);
shape
->
SetShape
(
path
);
path
->
aperture_width
=
2.0
*
radius
;
}
}
snprintf
(
name
,
sizeof
(
name
),
"Oval%sPad_%.6gx%.6g_mil"
,
snprintf
(
name
,
sizeof
(
name
),
"Oval%sPad_%.6gx%.6g_mil"
,
...
@@ -563,7 +573,7 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule )
...
@@ -563,7 +573,7 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule )
KEEPOUT
*
keepout
=
new
KEEPOUT
(
image
,
T_keepout
);
KEEPOUT
*
keepout
=
new
KEEPOUT
(
image
,
T_keepout
);
image
->
keepouts
.
push_back
(
keepout
);
image
->
keepouts
.
push_back
(
keepout
);
CIRCLE
*
circle
=
new
CIRCLE
(
keepout
);
CIRCLE
*
circle
=
new
CIRCLE
(
keepout
);
keepout
->
SetShape
(
circle
);
keepout
->
SetShape
(
circle
);
circle
->
SetDiameter
(
diameter
);
circle
->
SetDiameter
(
diameter
);
...
@@ -580,7 +590,7 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule )
...
@@ -580,7 +590,7 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule )
{
{
// padstack is a duplicate, delete it and use the original
// padstack is a duplicate, delete it and use the original
delete
padstack
;
delete
padstack
;
padstack
=
(
PADSTACK
*
)
*
iter
.
base
();
// folk
lore, be careful here
padstack
=
(
PADSTACK
*
)
*
iter
.
base
();
// folklore, be careful here
}
}
else
else
{
{
...
@@ -596,7 +606,7 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule )
...
@@ -596,7 +606,7 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule )
{
{
pinmap
[
padName
]
=
0
;
pinmap
[
padName
]
=
0
;
}
}
else
else
// pad name is a duplicate within this module
{
{
char
buf
[
32
];
char
buf
[
32
];
...
@@ -613,22 +623,14 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule )
...
@@ -613,22 +623,14 @@ IMAGE* SPECCTRA_DB::makeIMAGE( BOARD* aBoard, MODULE* aModule )
pin
->
padstack_id
=
padstack
->
padstack_id
;
pin
->
padstack_id
=
padstack
->
padstack_id
;
wxPoint
pos
(
pad
->
m_Pos0
);
wxPoint
offset
(
pad
->
m_Offset
.
x
,
pad
->
m_Offset
.
y
);
int
angle
=
pad
->
m_Orient
-
aModule
->
m_Orient
;
// tenths of degrees
int
angle
=
pad
->
m_Orient
-
aModule
->
m_Orient
;
// tenths of degrees
if
(
angle
)
if
(
angle
)
{
{
NORMALIZE_ANGLE_POS
(
angle
);
NORMALIZE_ANGLE_POS
(
angle
);
pin
->
SetRotation
(
angle
/
10.0
);
pin
->
SetRotation
(
angle
/
10.0
);
if
(
pad
->
m_Offset
.
x
||
pad
->
m_Offset
.
y
)
{
RotatePoint
(
&
offset
,
angle
);
}
}
}
pos
+=
offset
;
wxPoint
pos
(
pad
->
m_Pos0
)
;
pin
->
SetVertex
(
mapPt
(
pos
)
);
pin
->
SetVertex
(
mapPt
(
pos
)
);
}
}
...
...
pcbnew/specctra_import.cpp
View file @
9086e68d
...
@@ -72,13 +72,14 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event )
...
@@ -72,13 +72,14 @@ void WinEDA_PcbFrame::ImportSpecctraSession( wxCommandEvent& event )
name
+=
sessionExt
;
name
+=
sessionExt
;
fullFileName
=
EDA_FileSelector
(
_
(
"Merge Specctra Session file:"
),
fullFileName
=
EDA_FileSelector
(
_
(
"Merge Specctra Session file:"
),
path
,
path
,
name
,
// name.ext without path!
name
,
sessionExt
,
sessionExt
,
mask
,
mask
,
this
,
this
,
wxFD_OPEN
,
wxFD_OPEN
,
FALSE
);
FALSE
);
if
(
fullFileName
==
wxEmptyString
)
if
(
fullFileName
==
wxEmptyString
)
return
;
return
;
...
...
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