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
dd141c17
Commit
dd141c17
authored
Feb 09, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more amazing free specctra software
parent
d47823c1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
8 deletions
+24
-8
specctra_export.cpp
pcbnew/specctra_export.cpp
+11
-2
specctra_import.cpp
pcbnew/specctra_import.cpp
+13
-6
No files found.
pcbnew/specctra_export.cpp
View file @
dd141c17
...
...
@@ -913,7 +913,12 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
int
curTrackWidth
=
aBoard
->
m_BoardSettings
->
m_CurrentTrackWidth
;
int
curTrackClear
=
aBoard
->
m_BoardSettings
->
m_TrackClearence
;
double
clearance
=
scale
(
curTrackClear
);
// The +5 is to give freerouter a little extra room, this is 0.5 mils.
// If we export without this, then on import freerouter violates our
// DRC checks with track to via spacing.
double
clearance
=
scale
(
curTrackClear
+
5
);
STRINGS
&
rules
=
pcb
->
structure
->
rules
->
rules
;
sprintf
(
rule
,
"(width %.6g)"
,
scale
(
curTrackWidth
)
);
...
...
@@ -943,7 +948,11 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
sprintf
(
rule
,
"(clearance %.6g (type smd_pin))"
,
clearance
);
rules
.
push_back
(
rule
);
sprintf
(
rule
,
"(clearance %.6g (type smd_smd))"
,
clearance
/
4
);
// well, the user is going to text edit these in the DSN file anyway,
// at least until we have an export dialog.
clearance
=
scale
(
curTrackClear
)
/
4
;
sprintf
(
rule
,
"(clearance %.6g (type smd_smd))"
,
clearance
);
rules
.
push_back
(
rule
);
}
...
...
pcbnew/specctra_import.cpp
View file @
dd141c17
...
...
@@ -146,7 +146,8 @@ static int scale( double distance, UNIT_RES* aResolution )
// used within Kicad.
factor
*=
10.0
;
return
(
int
)
round
(
factor
*
distance
/
resValue
);
int
ret
=
(
int
)
round
(
factor
*
distance
/
resValue
);
return
ret
;
}
static
wxPoint
mapPt
(
const
POINT
&
aPoint
,
UNIT_RES
*
aResolution
)
...
...
@@ -202,8 +203,15 @@ SEGVIA* SPECCTRA_DB::makeVIA( PADSTACK* aPadstack, const POINT& aPoint, int aNet
int
drillEndNdx
=
aPadstack
->
padstack_id
.
rfind
(
'_'
);
if
(
drillEndNdx
!=
-
1
)
{
std
::
string
drillDiam
(
aPadstack
->
padstack_id
,
drillStartNdx
,
drillEndNdx
-
drillStartNdx
-
1
);
drillDiam
=
atoi
(
drillDiam
.
c_str
()
);
std
::
string
diamTxt
(
aPadstack
->
padstack_id
,
drillStartNdx
+
1
,
drillEndNdx
-
drillStartNdx
-
1
);
const
char
*
sdiamTxt
=
diamTxt
.
c_str
();
double
drillMils
=
strtod
(
sdiamTxt
,
0
);
// drillMils is not in the session units, but actual mils so we don't use scale()
drillDiam
=
drillMils
*
10
;
if
(
drillDiam
==
g_DesignSettings
.
m_ViaDrill
)
// default
drillDiam
=
-
1
;
// import as default
}
}
...
...
@@ -312,7 +320,6 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IOError )
{
// convert from degrees to tenths of degrees used in Kicad.
int
orientation
=
(
int
)
(
place
->
rotation
*
10.0
);
if
(
module
->
GetLayer
()
!=
CMP_N
)
{
// module is on copper layer (back)
...
...
@@ -332,8 +339,8 @@ void SPECCTRA_DB::FromSESSION( BOARD* aBoard ) throw( IOError )
}
else
{
// as I write this, the
LEX
ER *is* catching this, so we should never see below:
wxFAIL_MSG
(
wxT
(
"DSN::
LEX
ER did not catch an illegal side := 'back|front'"
)
);
// as I write this, the
PARS
ER *is* catching this, so we should never see below:
wxFAIL_MSG
(
wxT
(
"DSN::
PARS
ER did not catch an illegal side := 'back|front'"
)
);
}
}
}
...
...
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