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
36554e68
Commit
36554e68
authored
Feb 21, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
on export, test via for netcode == 0
parent
acf03b7d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
9 deletions
+31
-9
specctra.h
pcbnew/specctra.h
+14
-5
specctra_export.cpp
pcbnew/specctra_export.cpp
+17
-4
No files found.
pcbnew/specctra.h
View file @
36554e68
...
@@ -2413,20 +2413,17 @@ public:
...
@@ -2413,20 +2413,17 @@ public:
* Class PIN_REF
* Class PIN_REF
* corresponds to the <pin_reference> definition in the specctra dsn spec.
* corresponds to the <pin_reference> definition in the specctra dsn spec.
*/
*/
class
PIN_REF
:
public
ELEM
struct
PIN_REF
:
public
ELEM
{
{
friend
class
SPECCTRA_DB
;
std
::
string
component_id
;
std
::
string
component_id
;
std
::
string
pin_id
;
std
::
string
pin_id
;
public
:
PIN_REF
(
ELEM
*
aParent
)
:
PIN_REF
(
ELEM
*
aParent
)
:
ELEM
(
T_pin
,
aParent
)
ELEM
(
T_pin
,
aParent
)
{
{
}
}
/**
/**
* Function FormatIt
* Function FormatIt
* is like Format() but is not virual and returns the number of characters
* is like Format() but is not virual and returns the number of characters
...
@@ -2607,6 +2604,18 @@ public:
...
@@ -2607,6 +2604,18 @@ public:
delete
comp_order
;
delete
comp_order
;
}
}
int
FindPIN_REF
(
const
std
::
string
&
aComponent
)
{
for
(
unsigned
i
=
0
;
i
<
pins
.
size
();
++
i
)
{
if
(
0
==
aComponent
.
compare
(
pins
[
i
].
component_id
)
)
return
int
(
i
);
}
return
-
1
;
}
void
Format
(
OUTPUTFORMATTER
*
out
,
int
nestLevel
)
throw
(
IOError
)
void
Format
(
OUTPUTFORMATTER
*
out
,
int
nestLevel
)
throw
(
IOError
)
{
{
const
char
*
quote
=
out
->
GetQuoteChar
(
net_id
.
c_str
()
);
const
char
*
quote
=
out
->
GetQuoteChar
(
net_id
.
c_str
()
);
...
...
pcbnew/specctra_export.cpp
View file @
36554e68
...
@@ -1054,11 +1054,21 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
...
@@ -1054,11 +1054,21 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
pcb
->
library
->
AddPadstack
(
padstack
);
pcb
->
library
->
AddPadstack
(
padstack
);
}
}
D
(
std
::
string
component
=
"U1"
;)
// copy our SPECCTRA_DB::nets to the pcb->network
// copy our SPECCTRA_DB::nets to the pcb->network
for
(
unsigned
n
=
1
;
n
<
nets
.
size
();
++
n
)
for
(
unsigned
n
=
1
;
n
<
nets
.
size
();
++
n
)
{
{
NET
*
net
=
nets
[
n
];
NET
*
net
=
nets
[
n
];
if
(
net
->
pins
.
size
()
)
if
(
net
->
pins
.
size
()
#if defined(DEBUG)
// experimenting with exporting a subset of all the nets
// and with incremental, iterative autorouting.
&&
net
->
FindPIN_REF
(
component
)
>=
0
#endif
)
{
{
// give ownership to pcb->network
// give ownership to pcb->network
pcb
->
network
->
nets
.
push_back
(
net
);
pcb
->
network
->
nets
.
push_back
(
net
);
...
@@ -1149,7 +1159,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
...
@@ -1149,7 +1159,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
wiring
->
wires
.
push_back
(
wire
);
wiring
->
wires
.
push_back
(
wire
);
wire
->
net_id
=
netname
;
wire
->
net_id
=
netname
;
wire
->
wire_type
=
T_
normal
;
// @todo, this should be configurable
wire
->
wire_type
=
T_
protect
;
// @todo, this should be configurable
int
kiLayer
=
track
->
GetLayer
();
int
kiLayer
=
track
->
GetLayer
();
int
pcbLayer
=
kicadLayer2pcb
[
kiLayer
];
int
pcbLayer
=
kicadLayer2pcb
[
kiLayer
];
...
@@ -1181,6 +1191,10 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
...
@@ -1181,6 +1191,10 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
SEGVIA
*
via
=
(
SEGVIA
*
)
items
[
i
];
SEGVIA
*
via
=
(
SEGVIA
*
)
items
[
i
];
wxASSERT
(
via
->
Type
()
==
TYPEVIA
);
wxASSERT
(
via
->
Type
()
==
TYPEVIA
);
int
netcode
=
via
->
GetNet
();
if
(
netcode
==
0
)
continue
;
PADSTACK
*
padstack
=
makeVia
(
via
);
PADSTACK
*
padstack
=
makeVia
(
via
);
PADSTACK
*
registered
=
pcb
->
library
->
LookupVia
(
padstack
);
PADSTACK
*
registered
=
pcb
->
library
->
LookupVia
(
padstack
);
if
(
padstack
!=
registered
)
if
(
padstack
!=
registered
)
...
@@ -1194,13 +1208,12 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
...
@@ -1194,13 +1208,12 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
dsnVia
->
padstack_id
=
registered
->
padstack_id
;
dsnVia
->
padstack_id
=
registered
->
padstack_id
;
dsnVia
->
vertexes
.
push_back
(
mapPt
(
via
->
GetPosition
()
)
);
dsnVia
->
vertexes
.
push_back
(
mapPt
(
via
->
GetPosition
()
)
);
int
netcode
=
via
->
GetNet
();
EQUIPOT
*
equipot
=
aBoard
->
FindNet
(
netcode
);
EQUIPOT
*
equipot
=
aBoard
->
FindNet
(
netcode
);
wxASSERT
(
equipot
);
wxASSERT
(
equipot
);
dsnVia
->
net_id
=
CONV_TO_UTF8
(
equipot
->
m_Netname
);
dsnVia
->
net_id
=
CONV_TO_UTF8
(
equipot
->
m_Netname
);
dsnVia
->
via_type
=
T_
normal
;
// @todo, this should be configurable
dsnVia
->
via_type
=
T_
protect
;
// @todo, this should be configurable
}
}
}
}
...
...
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