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
3cd47555
Commit
3cd47555
authored
Oct 13, 2007
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
see 2007-Oct-12 change_log.txt
parent
0abcf450
Changes
58
Hide whitespace changes
Inline
Side-by-side
Showing
58 changed files
with
1257 additions
and
988 deletions
+1257
-988
change_log.txt
change_log.txt
+34
-0
common.cpp
common/common.cpp
+3
-1
erc.cpp
eeschema/erc.cpp
+5
-5
netform.cpp
eeschema/netform.cpp
+8
-8
netlist.cpp
eeschema/netlist.cpp
+40
-40
netlist.h
eeschema/netlist.h
+5
-1
affiche.cpp
gerbview/affiche.cpp
+1
-1
block.cpp
gerbview/block.cpp
+2
-2
dcode.cpp
gerbview/dcode.cpp
+1
-1
deltrack.cpp
gerbview/deltrack.cpp
+1
-1
readgerb.cpp
gerbview/readgerb.cpp
+1
-1
rs274d.cpp
gerbview/rs274d.cpp
+9
-7
tracepcb.cpp
gerbview/tracepcb.cpp
+1
-1
trpiste.cpp
gerbview/trpiste.cpp
+4
-4
undelete.cpp
gerbview/undelete.cpp
+1
-1
common.h
include/common.h
+1
-1
affiche.cpp
pcbnew/affiche.cpp
+2
-2
attribut.cpp
pcbnew/attribut.cpp
+2
-2
autoplac.cpp
pcbnew/autoplac.cpp
+2
-2
autorout.cpp
pcbnew/autorout.cpp
+202
-186
autorout.h
pcbnew/autorout.h
+99
-89
block.cpp
pcbnew/block.cpp
+7
-2
board.cpp
pcbnew/board.cpp
+6
-6
class_board.cpp
pcbnew/class_board.cpp
+1
-1
class_board_item.cpp
pcbnew/class_board_item.cpp
+16
-10
class_equipot.cpp
pcbnew/class_equipot.cpp
+4
-4
class_equipot.h
pcbnew/class_equipot.h
+11
-1
class_pad.cpp
pcbnew/class_pad.cpp
+8
-5
class_pad.h
pcbnew/class_pad.h
+12
-1
class_track.cpp
pcbnew/class_track.cpp
+42
-21
class_track.h
pcbnew/class_track.h
+28
-4
clean.cpp
pcbnew/clean.cpp
+7
-7
connect.cpp
pcbnew/connect.cpp
+87
-66
controle.cpp
pcbnew/controle.cpp
+5
-0
cross-probing.cpp
pcbnew/cross-probing.cpp
+1
-1
deltrack.cpp
pcbnew/deltrack.cpp
+4
-4
dragsegm.cpp
pcbnew/dragsegm.cpp
+3
-3
drc.cpp
pcbnew/drc.cpp
+45
-26
edit.cpp
pcbnew/edit.cpp
+3
-3
edit_track_width.cpp
pcbnew/edit_track_width.cpp
+1
-1
editpads.cpp
pcbnew/editpads.cpp
+438
-364
editrack-part2.cpp
pcbnew/editrack-part2.cpp
+4
-4
editrack.cpp
pcbnew/editrack.cpp
+5
-5
editrout.cpp
pcbnew/editrout.cpp
+1
-1
export_gencad.cpp
pcbnew/export_gencad.cpp
+6
-6
ioascii.cpp
pcbnew/ioascii.cpp
+3
-2
modules.cpp
pcbnew/modules.cpp
+2
-0
move_copy_track.cpp
pcbnew/move_copy_track.cpp
+3
-3
move_or_drag_track.cpp
pcbnew/move_or_drag_track.cpp
+7
-7
ratsnest.cpp
pcbnew/ratsnest.cpp
+40
-41
router.cpp
pcbnew/router.cpp
+8
-8
solve.cpp
pcbnew/solve.cpp
+4
-4
surbrill.cpp
pcbnew/surbrill.cpp
+6
-6
tr_modif.cpp
pcbnew/tr_modif.cpp
+2
-2
undelete.cpp
pcbnew/undelete.cpp
+1
-1
xchgmod.cpp
pcbnew/xchgmod.cpp
+2
-2
zones.cpp
pcbnew/zones.cpp
+9
-9
drawpanel.cpp
share/drawpanel.cpp
+1
-1
No files found.
change_log.txt
View file @
3cd47555
...
@@ -19,6 +19,40 @@ email address.
...
@@ -19,6 +19,40 @@ email address.
with genliste.cpp.notused
with genliste.cpp.notused
2007-Oct-12 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+ all
* m_NetCode is now private or protected throughout.
added SetNet() and GetNet() to all classes which have this member name.
ditto for m_Sous_NetCode, for which there is now SetSubNet() and GetSubNet().
+ pcbnew
added more disambiguating text to the PcbGeneralLocateAndDisplay() popup
menu for tracks. We need all the info we can get there I found after using
the software for many hours.
Jean-Pierre:
I never thought I would find a greater problem in using Kicad than having to
lay down all the ground and power tracks, rather that just linking vias into
pre-established zones or "tagged layers".
But I have, hundreds of my tracks and vias are showing
unconnected under my BGA, (where say the track or via is NetCode==0) and it
should not be, because the damn track ties the BGA pad to a nearby via.
How can the software be made to think these three items are on the same net,
without re-entering all the damn tracks?
This issue has been coming up for months on the user list, it must be dealt with now.
There is always the same lame answer, "make sure your tracks go to the center of the pads".
Nonsense, the software picked the track end points, not me, and grid was on when it did it.
There are bugs here.
Does Recalcule_all_net_connexion() work, and why is not called from anywhere?
2007-Oct-11 UPDATE Dick Hollenbeck <dick@softplc.com>
2007-Oct-11 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
+ pcbnew
+ pcbnew
...
...
common/common.cpp
View file @
3cd47555
...
@@ -427,7 +427,7 @@ int GetTimeStamp()
...
@@ -427,7 +427,7 @@ int GetTimeStamp()
/*************************************************/
/*************************************************/
void
valeur_param
(
int
valeur
,
wxString
&
buf_texte
)
const
wxString
&
valeur_param
(
int
valeur
,
wxString
&
buf_texte
)
/*************************************************/
/*************************************************/
/* Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies
/* Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies
...
@@ -444,4 +444,6 @@ void valeur_param( int valeur, wxString& buf_texte )
...
@@ -444,4 +444,6 @@ void valeur_param( int valeur, wxString& buf_texte )
{
{
buf_texte
.
Printf
(
wxT
(
"%2.4f
\"
"
),
valeur
*
0.0001
);
buf_texte
.
Printf
(
wxT
(
"%2.4f
\"
"
),
valeur
*
0.0001
);
}
}
return
buf_texte
;
}
}
eeschema/erc.cpp
View file @
3cd47555
...
@@ -343,7 +343,7 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event )
...
@@ -343,7 +343,7 @@ void WinEDA_ErcFrame::TestErc( wxCommandEvent& event )
for
(
;
NetItemRef
<
Lim
;
NetItemRef
++
)
for
(
;
NetItemRef
<
Lim
;
NetItemRef
++
)
{
{
/* Tst changement de net */
/* Tst changement de net */
if
(
OldItem
->
m_NetCode
!=
NetItemRef
->
m_NetCode
)
if
(
OldItem
->
GetNet
()
!=
NetItemRef
->
GetNet
()
)
{
{
MinConn
=
NOC
;
MinConn
=
NOC
;
NetNbItems
=
0
;
NetNbItems
=
0
;
...
@@ -581,7 +581,7 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC,
...
@@ -581,7 +581,7 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC,
{
{
Marker
->
m_Comment
.
Printf
(
Marker
->
m_Comment
.
Printf
(
_
(
"Warning Pin %s not driven (Net %d)"
),
_
(
"Warning Pin %s not driven (Net %d)"
),
MsgPinElectricType
[
ii
],
NetItemRef
->
m_NetCode
);
MsgPinElectricType
[
ii
],
NetItemRef
->
GetNet
()
);
if
(
screen
==
panel
->
GetScreen
()
)
if
(
screen
==
panel
->
GetScreen
()
)
RedrawOneStruct
(
panel
,
DC
,
Marker
,
GR_COPY
);
RedrawOneStruct
(
panel
,
DC
,
Marker
,
GR_COPY
);
return
;
return
;
...
@@ -612,7 +612,7 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC,
...
@@ -612,7 +612,7 @@ static void Diagnose( WinEDA_DrawPanel* panel, wxDC* DC,
"%s: Pin %s connected to Pin %s (net %d)"
),
"%s: Pin %s connected to Pin %s (net %d)"
),
DiagLevel
.
GetData
(),
DiagLevel
.
GetData
(),
MsgPinElectricType
[
ii
],
MsgPinElectricType
[
ii
],
MsgPinElectricType
[
jj
],
NetItemRef
->
m_NetCode
);
MsgPinElectricType
[
jj
],
NetItemRef
->
GetNet
()
);
if
(
screen
==
panel
->
GetScreen
()
)
if
(
screen
==
panel
->
GetScreen
()
)
RedrawOneStruct
(
panel
,
DC
,
Marker
,
GR_COPY
);
RedrawOneStruct
(
panel
,
DC
,
Marker
,
GR_COPY
);
...
@@ -653,7 +653,7 @@ static void TestOthersItems( WinEDA_DrawPanel* panel, wxDC* DC,
...
@@ -653,7 +653,7 @@ static void TestOthersItems( WinEDA_DrawPanel* panel, wxDC* DC,
/* Est - on toujours dans le meme net ? */
/* Est - on toujours dans le meme net ? */
if
(
(
NetItemTst
>=
Lim
)
// fin de liste (donc fin de net)
if
(
(
NetItemTst
>=
Lim
)
// fin de liste (donc fin de net)
||
(
NetItemRef
->
m_NetCode
!=
NetItemTst
->
m_NetCode
)
)
// fin de net
||
(
NetItemRef
->
GetNet
()
!=
NetItemTst
->
GetNet
()
)
)
// fin de net
{
/* Fin de netcode trouve: Tst connexion minimum */
{
/* Fin de netcode trouve: Tst connexion minimum */
if
(
(
*
MinConnexion
<
NET_NC
)
if
(
(
*
MinConnexion
<
NET_NC
)
&&
(
local_minconn
<
NET_NC
)
)
/* pin non connecte ou non pilotee */
&&
(
local_minconn
<
NET_NC
)
)
/* pin non connecte ou non pilotee */
...
@@ -796,7 +796,7 @@ void TestLabel( WinEDA_DrawPanel* panel, wxDC* DC,
...
@@ -796,7 +796,7 @@ void TestLabel( WinEDA_DrawPanel* panel, wxDC* DC,
/* Est - on toujours dans le meme net ? */
/* Est - on toujours dans le meme net ? */
if
(
(
NetItemTst
==
Lim
)
if
(
(
NetItemTst
==
Lim
)
||
(
NetItemRef
->
m_NetCode
!=
NetItemTst
->
m_NetCode
)
)
||
(
NetItemRef
->
GetNet
()
!=
NetItemTst
->
GetNet
()
)
)
{
{
/* Fin de netcode trouve */
/* Fin de netcode trouve */
if
(
erc
)
if
(
erc
)
...
...
eeschema/netform.cpp
View file @
3cd47555
...
@@ -192,7 +192,7 @@ static wxString ReturnPinNetName( ObjetNetListStruct* Pin,
...
@@ -192,7 +192,7 @@ static wxString ReturnPinNetName( ObjetNetListStruct* Pin,
* "netname_sheetnumber" for the usual nets
* "netname_sheetnumber" for the usual nets
*/
*/
{
{
int
netcode
=
Pin
->
m_NetCode
;
int
netcode
=
Pin
->
GetNet
()
;
wxString
NetName
;
wxString
NetName
;
if
(
(
netcode
==
0
)
||
(
Pin
->
m_FlagOfConnection
!=
CONNECT
)
)
if
(
(
netcode
==
0
)
||
(
Pin
->
m_FlagOfConnection
!=
CONNECT
)
)
...
@@ -204,7 +204,7 @@ static wxString ReturnPinNetName( ObjetNetListStruct* Pin,
...
@@ -204,7 +204,7 @@ static wxString ReturnPinNetName( ObjetNetListStruct* Pin,
int
jj
;
int
jj
;
for
(
jj
=
0
;
jj
<
g_NbrObjNet
;
jj
++
)
for
(
jj
=
0
;
jj
<
g_NbrObjNet
;
jj
++
)
{
{
if
(
g_TabObjNet
[
jj
].
m_NetCode
!=
netcode
)
if
(
g_TabObjNet
[
jj
].
GetNet
()
!=
netcode
)
continue
;
continue
;
if
(
(
g_TabObjNet
[
jj
].
m_Type
!=
NET_GLOBLABEL
)
if
(
(
g_TabObjNet
[
jj
].
m_Type
!=
NET_GLOBLABEL
)
&&
(
g_TabObjNet
[
jj
].
m_Type
!=
NET_LABEL
)
&&
(
g_TabObjNet
[
jj
].
m_Type
!=
NET_LABEL
)
...
@@ -481,7 +481,7 @@ static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f,
...
@@ -481,7 +481,7 @@ static void WriteNetListPspice( WinEDA_SchematicFrame* frame, FILE* f,
if
(
NetName
==
wxT
(
"0"
)
||
NetName
==
wxT
(
"GND"
)
)
if
(
NetName
==
wxT
(
"0"
)
||
NetName
==
wxT
(
"GND"
)
)
fprintf
(
f
,
" 0"
);
fprintf
(
f
,
" 0"
);
else
else
fprintf
(
f
,
" %d"
,
Pin
->
m_NetCode
);
fprintf
(
f
,
" %d"
,
Pin
->
GetNet
()
);
}
}
}
}
...
@@ -834,13 +834,13 @@ static void WriteGENERICListOfNets( FILE* f, ObjetNetListStruct* ObjNet )
...
@@ -834,13 +834,13 @@ static void WriteGENERICListOfNets( FILE* f, ObjetNetListStruct* ObjNet )
for
(
ii
=
0
;
ii
<
g_NbrObjNet
;
ii
++
)
for
(
ii
=
0
;
ii
<
g_NbrObjNet
;
ii
++
)
{
{
if
(
(
NetCode
=
ObjNet
[
ii
].
m_NetCode
)
!=
LastNetCode
)
// New net found, write net id;
if
(
(
NetCode
=
ObjNet
[
ii
].
GetNet
()
)
!=
LastNetCode
)
// New net found, write net id;
{
{
SameNetcodeCount
=
0
;
// Items count for this net
SameNetcodeCount
=
0
;
// Items count for this net
NetName
.
Empty
();
NetName
.
Empty
();
for
(
jj
=
0
;
jj
<
g_NbrObjNet
;
jj
++
)
// Find a label (if exists) for this net
for
(
jj
=
0
;
jj
<
g_NbrObjNet
;
jj
++
)
// Find a label (if exists) for this net
{
{
if
(
ObjNet
[
jj
].
m_NetCode
!=
NetCode
)
if
(
ObjNet
[
jj
].
GetNet
()
!=
NetCode
)
continue
;
continue
;
if
(
(
ObjNet
[
jj
].
m_Type
!=
NET_GLOBLABEL
)
if
(
(
ObjNet
[
jj
].
m_Type
!=
NET_GLOBLABEL
)
&&
(
ObjNet
[
jj
].
m_Type
!=
NET_LABEL
)
&&
(
ObjNet
[
jj
].
m_Type
!=
NET_LABEL
)
...
@@ -1010,12 +1010,12 @@ static void WriteListOfNetsCADSTAR( FILE* f, ObjetNetListStruct* ObjNet )
...
@@ -1010,12 +1010,12 @@ static void WriteListOfNetsCADSTAR( FILE* f, ObjetNetListStruct* ObjNet )
for
(
ii
=
0
;
ii
<
g_NbrObjNet
;
ii
++
)
for
(
ii
=
0
;
ii
<
g_NbrObjNet
;
ii
++
)
{
{
// Get the NetName of the current net :
// Get the NetName of the current net :
if
(
(
NetCode
=
ObjNet
[
ii
].
m_NetCode
)
!=
LastNetCode
)
if
(
(
NetCode
=
ObjNet
[
ii
].
GetNet
()
)
!=
LastNetCode
)
{
{
NetName
.
Empty
();
NetName
.
Empty
();
for
(
jj
=
0
;
jj
<
g_NbrObjNet
;
jj
++
)
for
(
jj
=
0
;
jj
<
g_NbrObjNet
;
jj
++
)
{
{
if
(
ObjNet
[
jj
].
m_NetCode
!=
NetCode
)
if
(
ObjNet
[
jj
].
GetNet
()
!=
NetCode
)
continue
;
continue
;
if
(
(
ObjNet
[
jj
].
m_Type
!=
NET_GLOBLABEL
)
if
(
(
ObjNet
[
jj
].
m_Type
!=
NET_GLOBLABEL
)
&&
(
ObjNet
[
jj
].
m_Type
!=
NET_LABEL
)
&&
(
ObjNet
[
jj
].
m_Type
!=
NET_LABEL
)
...
@@ -1089,7 +1089,7 @@ static void WriteListOfNetsCADSTAR( FILE* f, ObjetNetListStruct* ObjNet )
...
@@ -1089,7 +1089,7 @@ static void WriteListOfNetsCADSTAR( FILE* f, ObjetNetListStruct* ObjNet )
// pour ne pas generer plusieurs fois la connexion
// pour ne pas generer plusieurs fois la connexion
for
(
jj
=
ii
+
1
;
jj
<
g_NbrObjNet
;
jj
++
)
for
(
jj
=
ii
+
1
;
jj
<
g_NbrObjNet
;
jj
++
)
{
{
if
(
ObjNet
[
jj
].
m_NetCode
!=
NetCode
)
if
(
ObjNet
[
jj
].
GetNet
()
!=
NetCode
)
break
;
break
;
if
(
ObjNet
[
jj
].
m_Type
!=
NET_PIN
)
if
(
ObjNet
[
jj
].
m_Type
!=
NET_PIN
)
continue
;
continue
;
...
...
eeschema/netlist.cpp
View file @
3cd47555
...
@@ -66,7 +66,7 @@ void ObjetNetListStruct::Show( std::ostream& out, int ndx )
...
@@ -66,7 +66,7 @@ void ObjetNetListStruct::Show( std::ostream& out, int ndx )
{
{
out
<<
"<netItem ndx=
\"
"
<<
ndx
<<
'"'
<<
out
<<
"<netItem ndx=
\"
"
<<
ndx
<<
'"'
<<
" type=
\"
"
<<
ShowType
(
m_Type
)
<<
'"'
<<
" type=
\"
"
<<
ShowType
(
m_Type
)
<<
'"'
<<
" netCode=
\"
"
<<
m_NetCode
<<
'"'
<<
" netCode=
\"
"
<<
GetNet
()
<<
'"'
<<
" sheet=
\"
"
<<
m_SheetNumber
<<
'"'
<<
" sheet=
\"
"
<<
m_SheetNumber
<<
'"'
<<
">
\n
"
;
">
\n
"
;
...
@@ -226,14 +226,14 @@ void* WinEDA_SchematicFrame::BuildNetListBase()
...
@@ -226,14 +226,14 @@ void* WinEDA_SchematicFrame::BuildNetListBase()
case
NET_PINLABEL
:
case
NET_PINLABEL
:
case
NET_SHEETLABEL
:
case
NET_SHEETLABEL
:
case
NET_NOCONNECT
:
case
NET_NOCONNECT
:
if
(
g_TabObjNet
[
i
].
m_NetCode
!=
0
)
if
(
g_TabObjNet
[
i
].
GetNet
()
!=
0
)
break
;
/* Deja connecte */
break
;
/* Deja connecte */
case
NET_SEGMENT
:
case
NET_SEGMENT
:
/* Controle des connexions type point a point ( Sans BUS ) */
/* Controle des connexions type point a point ( Sans BUS ) */
if
(
g_TabObjNet
[
i
].
m_NetCode
==
0
)
if
(
g_TabObjNet
[
i
].
GetNet
()
==
0
)
{
{
g_TabObjNet
[
i
].
m_NetCode
=
LastNetCode
;
g_TabObjNet
[
i
].
SetNet
(
LastNetCode
)
;
LastNetCode
++
;
LastNetCode
++
;
}
}
PointToPointConnect
(
g_TabObjNet
+
i
,
0
,
istart
);
PointToPointConnect
(
g_TabObjNet
+
i
,
0
,
istart
);
...
@@ -241,9 +241,9 @@ void* WinEDA_SchematicFrame::BuildNetListBase()
...
@@ -241,9 +241,9 @@ void* WinEDA_SchematicFrame::BuildNetListBase()
case
NET_JONCTION
:
case
NET_JONCTION
:
/* Controle des jonction , hors BUS */
/* Controle des jonction , hors BUS */
if
(
g_TabObjNet
[
i
].
m_NetCode
==
0
)
if
(
g_TabObjNet
[
i
].
GetNet
()
==
0
)
{
{
g_TabObjNet
[
i
].
m_NetCode
=
LastNetCode
;
g_TabObjNet
[
i
].
SetNet
(
LastNetCode
)
;
LastNetCode
++
;
LastNetCode
++
;
}
}
SegmentToPointConnect
(
g_TabObjNet
+
i
,
0
,
istart
);
SegmentToPointConnect
(
g_TabObjNet
+
i
,
0
,
istart
);
...
@@ -260,9 +260,9 @@ void* WinEDA_SchematicFrame::BuildNetListBase()
...
@@ -260,9 +260,9 @@ void* WinEDA_SchematicFrame::BuildNetListBase()
case
NET_LABEL
:
case
NET_LABEL
:
case
NET_GLOBLABEL
:
case
NET_GLOBLABEL
:
/* Controle des connexions type jonction ( Sans BUS ) */
/* Controle des connexions type jonction ( Sans BUS ) */
if
(
g_TabObjNet
[
i
].
m_NetCode
==
0
)
if
(
g_TabObjNet
[
i
].
GetNet
()
==
0
)
{
{
g_TabObjNet
[
i
].
m_NetCode
=
LastNetCode
;
g_TabObjNet
[
i
].
SetNet
(
LastNetCode
)
;
LastNetCode
++
;
LastNetCode
++
;
}
}
SegmentToPointConnect
(
g_TabObjNet
+
i
,
0
,
istart
);
SegmentToPointConnect
(
g_TabObjNet
+
i
,
0
,
istart
);
...
@@ -285,7 +285,7 @@ void* WinEDA_SchematicFrame::BuildNetListBase()
...
@@ -285,7 +285,7 @@ void* WinEDA_SchematicFrame::BuildNetListBase()
case
NET_BUSLABELMEMBER
:
case
NET_BUSLABELMEMBER
:
case
NET_GLOBBUSLABELMEMBER
:
case
NET_GLOBBUSLABELMEMBER
:
/* Controle des connexions semblables a des sur BUS */
/* Controle des connexions semblables a des sur BUS */
if
(
g_TabObjNet
[
i
].
m_NetCode
==
0
)
if
(
g_TabObjNet
[
i
].
GetNet
()
==
0
)
{
{
g_TabObjNet
[
i
].
m_BusNetCode
=
LastBusNetCode
;
g_TabObjNet
[
i
].
m_BusNetCode
=
LastBusNetCode
;
LastBusNetCode
++
;
LastBusNetCode
++
;
...
@@ -368,12 +368,12 @@ void* WinEDA_SchematicFrame::BuildNetListBase()
...
@@ -368,12 +368,12 @@ void* WinEDA_SchematicFrame::BuildNetListBase()
LastNetCode
=
NetCode
=
0
;
LastNetCode
=
NetCode
=
0
;
for
(
i
=
0
;
i
<
g_NbrObjNet
;
i
++
)
for
(
i
=
0
;
i
<
g_NbrObjNet
;
i
++
)
{
{
if
(
g_TabObjNet
[
i
].
m_NetCode
!=
LastNetCode
)
if
(
g_TabObjNet
[
i
].
GetNet
()
!=
LastNetCode
)
{
{
NetCode
++
;
NetCode
++
;
LastNetCode
=
g_TabObjNet
[
i
].
m_NetCode
;
LastNetCode
=
g_TabObjNet
[
i
].
GetNet
()
;
}
}
g_TabObjNet
[
i
].
m_NetCode
=
NetCode
;
g_TabObjNet
[
i
].
SetNet
(
NetCode
)
;
}
}
Affiche_1_Parametre
(
this
,
-
1
,
wxEmptyString
,
_
(
"Done"
),
GREEN
);
Affiche_1_Parametre
(
this
,
-
1
,
wxEmptyString
,
_
(
"Done"
),
GREEN
);
...
@@ -393,7 +393,7 @@ static void SheetLabelConnection( ObjetNetListStruct* SheetLabel )
...
@@ -393,7 +393,7 @@ static void SheetLabelConnection( ObjetNetListStruct* SheetLabel )
int
i
;
int
i
;
ObjetNetListStruct
*
ObjetNet
;
ObjetNetListStruct
*
ObjetNet
;
if
(
SheetLabel
->
m_NetCode
==
0
)
if
(
SheetLabel
->
GetNet
()
==
0
)
return
;
return
;
/* Calcul du numero de sous feuille correspondante au sheetlabel */
/* Calcul du numero de sous feuille correspondante au sheetlabel */
...
@@ -409,17 +409,17 @@ static void SheetLabelConnection( ObjetNetListStruct* SheetLabel )
...
@@ -409,17 +409,17 @@ static void SheetLabelConnection( ObjetNetListStruct* SheetLabel )
&&
(
ObjetNet
[
i
].
m_Type
!=
NET_GLOBBUSLABELMEMBER
)
)
&&
(
ObjetNet
[
i
].
m_Type
!=
NET_GLOBBUSLABELMEMBER
)
)
continue
;
continue
;
if
(
ObjetNet
[
i
].
m_NetCode
==
SheetLabel
->
m_NetCode
)
if
(
ObjetNet
[
i
].
GetNet
()
==
SheetLabel
->
GetNet
()
)
continue
;
continue
;
if
(
ObjetNet
[
i
].
m_Label
->
CmpNoCase
(
*
SheetLabel
->
m_Label
)
!=
0
)
if
(
ObjetNet
[
i
].
m_Label
->
CmpNoCase
(
*
SheetLabel
->
m_Label
)
!=
0
)
continue
;
continue
;
/* Propagation du Netcode a tous les Objets de meme NetCode */
/* Propagation du Netcode a tous les Objets de meme NetCode */
if
(
ObjetNet
[
i
].
m_NetCode
)
if
(
ObjetNet
[
i
].
GetNet
()
)
PropageNetCode
(
ObjetNet
[
i
].
m_NetCode
,
SheetLabel
->
m_NetCode
,
0
);
PropageNetCode
(
ObjetNet
[
i
].
GetNet
(),
SheetLabel
->
GetNet
()
,
0
);
else
else
ObjetNet
[
i
].
m_NetCode
=
SheetLabel
->
m_NetCode
;
ObjetNet
[
i
].
SetNet
(
SheetLabel
->
GetNet
()
)
;
}
}
}
}
...
@@ -714,9 +714,9 @@ static void ConnectBusLabels( ObjetNetListStruct* Label, int NbItems )
...
@@ -714,9 +714,9 @@ static void ConnectBusLabels( ObjetNetListStruct* Label, int NbItems )
||
(
Label
->
m_Type
==
NET_BUSLABELMEMBER
)
||
(
Label
->
m_Type
==
NET_BUSLABELMEMBER
)
||
(
Label
->
m_Type
==
NET_GLOBBUSLABELMEMBER
)
)
||
(
Label
->
m_Type
==
NET_GLOBBUSLABELMEMBER
)
)
{
{
if
(
Label
->
m_NetCode
==
0
)
if
(
Label
->
GetNet
()
==
0
)
{
{
Label
->
m_NetCode
=
LastNetCode
;
Label
->
SetNet
(
LastNetCode
)
;
LastNetCode
++
;
LastNetCode
++
;
}
}
...
@@ -732,10 +732,10 @@ static void ConnectBusLabels( ObjetNetListStruct* Label, int NbItems )
...
@@ -732,10 +732,10 @@ static void ConnectBusLabels( ObjetNetListStruct* Label, int NbItems )
if
(
LabelInTst
->
m_Member
!=
Label
->
m_Member
)
if
(
LabelInTst
->
m_Member
!=
Label
->
m_Member
)
continue
;
continue
;
if
(
LabelInTst
->
m_NetCode
==
0
)
if
(
LabelInTst
->
GetNet
()
==
0
)
LabelInTst
->
m_NetCode
=
Label
->
m_NetCode
;
LabelInTst
->
SetNet
(
Label
->
GetNet
()
)
;
else
else
PropageNetCode
(
LabelInTst
->
m_NetCode
,
Label
->
m_NetCode
,
0
);
PropageNetCode
(
LabelInTst
->
GetNet
(),
Label
->
GetNet
()
,
0
);
}
}
}
}
}
}
...
@@ -886,9 +886,9 @@ static void PropageNetCode( int OldNetCode, int NewNetCode, int IsBus )
...
@@ -886,9 +886,9 @@ static void PropageNetCode( int OldNetCode, int NewNetCode, int IsBus )
{
{
for
(
jj
=
0
;
jj
<
g_NbrObjNet
;
jj
++
,
Objet
++
)
for
(
jj
=
0
;
jj
<
g_NbrObjNet
;
jj
++
,
Objet
++
)
{
{
if
(
Objet
->
m_NetCode
==
OldNetCode
)
if
(
Objet
->
GetNet
()
==
OldNetCode
)
{
{
Objet
->
m_NetCode
=
NewNetCode
;
Objet
->
SetNet
(
NewNetCode
)
;
}
}
}
}
}
}
...
@@ -933,7 +933,7 @@ static void PointToPointConnect( ObjetNetListStruct* Ref, int IsBus, int start )
...
@@ -933,7 +933,7 @@ static void PointToPointConnect( ObjetNetListStruct* Ref, int IsBus, int start )
if
(
IsBus
==
0
)
/* Objets autres que BUS et BUSLABELS */
if
(
IsBus
==
0
)
/* Objets autres que BUS et BUSLABELS */
{
{
netCode
=
Ref
->
m_NetCode
;
netCode
=
Ref
->
GetNet
()
;
for
(
i
=
start
;
i
<
g_NbrObjNet
;
i
++
)
for
(
i
=
start
;
i
<
g_NbrObjNet
;
i
++
)
{
{
if
(
netTable
[
i
].
m_SheetNumber
>
Ref
->
m_SheetNumber
)
if
(
netTable
[
i
].
m_SheetNumber
>
Ref
->
m_SheetNumber
)
...
@@ -954,10 +954,10 @@ static void PointToPointConnect( ObjetNetListStruct* Ref, int IsBus, int start )
...
@@ -954,10 +954,10 @@ static void PointToPointConnect( ObjetNetListStruct* Ref, int IsBus, int start )
||
Ref
->
m_End
==
netTable
[
i
].
m_Start
||
Ref
->
m_End
==
netTable
[
i
].
m_Start
||
Ref
->
m_End
==
netTable
[
i
].
m_End
)
||
Ref
->
m_End
==
netTable
[
i
].
m_End
)
{
{
if
(
netTable
[
i
].
m_NetCode
==
0
)
if
(
netTable
[
i
].
GetNet
()
==
0
)
netTable
[
i
].
m_NetCode
=
netCode
;
netTable
[
i
].
SetNet
(
netCode
)
;
else
else
PropageNetCode
(
netTable
[
i
].
m_NetCode
,
netCode
,
0
);
PropageNetCode
(
netTable
[
i
].
GetNet
()
,
netCode
,
0
);
}
}
break
;
break
;
...
@@ -1052,11 +1052,11 @@ static void SegmentToPointConnect( ObjetNetListStruct* Jonction,
...
@@ -1052,11 +1052,11 @@ static void SegmentToPointConnect( ObjetNetListStruct* Jonction,
/* Propagation du Netcode a tous les Objets de meme NetCode */
/* Propagation du Netcode a tous les Objets de meme NetCode */
if
(
IsBus
==
0
)
if
(
IsBus
==
0
)
{
{
if
(
Segment
[
i
].
m_NetCode
)
if
(
Segment
[
i
].
GetNet
()
)
PropageNetCode
(
Segment
[
i
].
m_NetCode
,
PropageNetCode
(
Segment
[
i
].
GetNet
()
,
Jonction
->
m_NetCode
,
IsBus
);
Jonction
->
GetNet
()
,
IsBus
);
else
else
Segment
[
i
].
m_NetCode
=
Jonction
->
m_NetCode
;
Segment
[
i
].
SetNet
(
Jonction
->
GetNet
()
)
;
}
}
else
else
{
{
...
@@ -1076,14 +1076,14 @@ static void SegmentToPointConnect( ObjetNetListStruct* Jonction,
...
@@ -1076,14 +1076,14 @@ static void SegmentToPointConnect( ObjetNetListStruct* Jonction,
*******************************************************************/
*******************************************************************/
static
void
LabelConnection
(
ObjetNetListStruct
*
LabelRef
)
static
void
LabelConnection
(
ObjetNetListStruct
*
LabelRef
)
{
{
if
(
LabelRef
->
m_NetCode
==
0
)
if
(
LabelRef
->
GetNet
()
==
0
)
return
;
return
;
ObjetNetListStruct
*
netTable
=
g_TabObjNet
;
ObjetNetListStruct
*
netTable
=
g_TabObjNet
;
for
(
int
i
=
0
;
i
<
g_NbrObjNet
;
i
++
)
for
(
int
i
=
0
;
i
<
g_NbrObjNet
;
i
++
)
{
{
if
(
netTable
[
i
].
m_NetCode
==
LabelRef
->
m_NetCode
)
if
(
netTable
[
i
].
GetNet
()
==
LabelRef
->
GetNet
()
)
continue
;
continue
;
if
(
netTable
[
i
].
m_SheetNumber
!=
LabelRef
->
m_SheetNumber
)
if
(
netTable
[
i
].
m_SheetNumber
!=
LabelRef
->
m_SheetNumber
)
...
@@ -1104,10 +1104,10 @@ static void LabelConnection( ObjetNetListStruct* LabelRef )
...
@@ -1104,10 +1104,10 @@ static void LabelConnection( ObjetNetListStruct* LabelRef )
/* Ici 2 labels identiques */
/* Ici 2 labels identiques */
/* Propagation du Netcode a tous les Objets de meme NetCode */
/* Propagation du Netcode a tous les Objets de meme NetCode */
if
(
netTable
[
i
].
m_NetCode
)
if
(
netTable
[
i
].
GetNet
()
)
PropageNetCode
(
netTable
[
i
].
m_NetCode
,
LabelRef
->
m_NetCode
,
0
);
PropageNetCode
(
netTable
[
i
].
GetNet
(),
LabelRef
->
GetNet
()
,
0
);
else
else
netTable
[
i
].
m_NetCode
=
LabelRef
->
m_NetCode
;
netTable
[
i
].
SetNet
(
LabelRef
->
GetNet
()
)
;
}
}
}
}
}
}
...
@@ -1124,7 +1124,7 @@ static int TriNetCode( const void* o1, const void* o2 )
...
@@ -1124,7 +1124,7 @@ static int TriNetCode( const void* o1, const void* o2 )
ObjetNetListStruct
*
Objet1
=
(
ObjetNetListStruct
*
)
o1
;
ObjetNetListStruct
*
Objet1
=
(
ObjetNetListStruct
*
)
o1
;
ObjetNetListStruct
*
Objet2
=
(
ObjetNetListStruct
*
)
o2
;
ObjetNetListStruct
*
Objet2
=
(
ObjetNetListStruct
*
)
o2
;
return
Objet1
->
m_NetCode
-
Objet2
->
m_NetCode
;
return
Objet1
->
GetNet
()
-
Objet2
->
GetNet
()
;
}
}
...
@@ -1173,7 +1173,7 @@ static void SetUnconnectedFlag( ObjetNetListStruct* ListObj, int NbItems )
...
@@ -1173,7 +1173,7 @@ static void SetUnconnectedFlag( ObjetNetListStruct* ListObj, int NbItems )
NetItemTst
=
NetItemRef
+
1
;
NetItemTst
=
NetItemRef
+
1
;
if
(
(
NetItemTst
>=
Lim
)
if
(
(
NetItemTst
>=
Lim
)
||
(
NetItemRef
->
m_NetCode
!=
NetItemTst
->
m_NetCode
)
)
||
(
NetItemRef
->
GetNet
()
!=
NetItemTst
->
GetNet
()
)
)
{
{
/* Net analyse: mise a jour de m_FlagOfConnection */
/* Net analyse: mise a jour de m_FlagOfConnection */
NetEnd
=
NetItemTst
;
NetEnd
=
NetItemTst
;
...
@@ -1195,7 +1195,7 @@ static void SetUnconnectedFlag( ObjetNetListStruct* ListObj, int NbItems )
...
@@ -1195,7 +1195,7 @@ static void SetUnconnectedFlag( ObjetNetListStruct* ListObj, int NbItems )
for
(
;
;
NetItemTst
++
)
for
(
;
;
NetItemTst
++
)
{
{
if
(
(
NetItemTst
>=
Lim
)
if
(
(
NetItemTst
>=
Lim
)
||
(
NetItemRef
->
m_NetCode
!=
NetItemTst
->
m_NetCode
)
)
||
(
NetItemRef
->
GetNet
()
!=
NetItemTst
->
GetNet
()
)
)
break
;
break
;
switch
(
NetItemTst
->
m_Type
)
switch
(
NetItemTst
->
m_Type
)
...
...
eeschema/netlist.h
View file @
3cd47555
...
@@ -70,7 +70,9 @@ public:
...
@@ -70,7 +70,9 @@ public:
SCH_SCREEN
*
m_Screen
;
/* Ecran d'appartenance */
SCH_SCREEN
*
m_Screen
;
/* Ecran d'appartenance */
NetObjetType
m_Type
;
NetObjetType
m_Type
;
int
m_ElectricalType
;
/* Pour Pins et sheet labels: type electrique */
int
m_ElectricalType
;
/* Pour Pins et sheet labels: type electrique */
private
:
int
m_NetCode
;
/* pour elements simples */
int
m_NetCode
;
/* pour elements simples */
public
:
int
m_BusNetCode
;
/* pour connexions type bus */
int
m_BusNetCode
;
/* pour connexions type bus */
int
m_Member
;
/* pour les labels type BUSWIRE ( labels de bus eclate )
int
m_Member
;
/* pour les labels type BUSWIRE ( labels de bus eclate )
* numero de membre */
* numero de membre */
...
@@ -84,7 +86,9 @@ public:
...
@@ -84,7 +86,9 @@ public:
#if defined(DEBUG)
#if defined(DEBUG)
void
Show
(
std
::
ostream
&
out
,
int
ndx
);
void
Show
(
std
::
ostream
&
out
,
int
ndx
);
#endif
#endif
void
SetNet
(
int
aNetCode
)
{
m_NetCode
=
aNetCode
;
}
int
GetNet
()
const
{
return
m_NetCode
;
}
};
};
...
...
gerbview/affiche.cpp
View file @
3cd47555
...
@@ -71,7 +71,7 @@ void Affiche_Infos_Piste( WinEDA_BasePcbFrame* frame, TRACK* pt_piste )
...
@@ -71,7 +71,7 @@ void Affiche_Infos_Piste( WinEDA_BasePcbFrame* frame, TRACK* pt_piste )
frame
->
MsgPanel
->
EraseMsgBox
();
frame
->
MsgPanel
->
EraseMsgBox
();
d_index
=
pt_piste
->
m_NetCode
;
d_index
=
pt_piste
->
GetNet
()
;
pt_D_code
=
ReturnToolDescr
(
layer
,
d_index
,
&
ii
);
pt_D_code
=
ReturnToolDescr
(
layer
,
d_index
,
&
ii
);
switch
(
pt_piste
->
Type
()
)
switch
(
pt_piste
->
Type
()
)
...
...
gerbview/block.cpp
View file @
3cd47555
...
@@ -334,7 +334,7 @@ void WinEDA_BasePcbFrame::Block_Move( wxDC* DC )
...
@@ -334,7 +334,7 @@ void WinEDA_BasePcbFrame::Block_Move( wxDC* DC )
track
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
// erase the display
track
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
// erase the display
track
->
m_Start
.
x
+=
deltaX
;
track
->
m_Start
.
y
+=
deltaY
;
track
->
m_Start
.
x
+=
deltaX
;
track
->
m_Start
.
y
+=
deltaY
;
track
->
m_End
.
x
+=
deltaX
;
track
->
m_End
.
y
+=
deltaY
;
track
->
m_End
.
x
+=
deltaX
;
track
->
m_End
.
y
+=
deltaY
;
track
->
m_Param
+=
deltaX
;
track
->
m_Sous_Netcode
+=
deltaY
;
track
->
m_Param
+=
deltaX
;
track
->
SetSubNet
(
track
->
GetSubNet
()
+
deltaY
)
;
track
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
// redraw the moved track
track
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
// redraw the moved track
}
}
track
=
track
->
Next
();
track
=
track
->
Next
();
...
@@ -349,7 +349,7 @@ void WinEDA_BasePcbFrame::Block_Move( wxDC* DC )
...
@@ -349,7 +349,7 @@ void WinEDA_BasePcbFrame::Block_Move( wxDC* DC )
zsegment
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
// erase the display
zsegment
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
// erase the display
zsegment
->
m_Start
.
x
+=
deltaX
;
track
->
m_Start
.
y
+=
deltaY
;
zsegment
->
m_Start
.
x
+=
deltaX
;
track
->
m_Start
.
y
+=
deltaY
;
zsegment
->
m_End
.
x
+=
deltaX
;
track
->
m_End
.
y
+=
deltaY
;
zsegment
->
m_End
.
x
+=
deltaX
;
track
->
m_End
.
y
+=
deltaY
;
zsegment
->
m_Param
+=
deltaX
;
track
->
m_Sous_Netcode
+=
deltaY
;
zsegment
->
m_Param
+=
deltaX
;
track
->
SetSubNet
(
track
->
GetSubNet
()
+
deltaY
)
;
zsegment
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
// redraw the moved zone zegment
zsegment
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
// redraw the moved zone zegment
}
}
zsegment
=
zsegment
->
Next
();
zsegment
=
zsegment
->
Next
();
...
...
gerbview/dcode.cpp
View file @
3cd47555
...
@@ -340,7 +340,7 @@ D_CODE * pt_Dcode; /* Pointeur sur le D code*/
...
@@ -340,7 +340,7 @@ D_CODE * pt_Dcode; /* Pointeur sur le D code*/
track
=
m_Pcb
->
m_Track
;
track
=
m_Pcb
->
m_Track
;
for
(
;
track
!=
NULL
;
track
=
(
TRACK
*
)
track
->
Pnext
)
for
(
;
track
!=
NULL
;
track
=
(
TRACK
*
)
track
->
Pnext
)
{
{
pt_Dcode
=
ReturnToolDescr
(
track
->
GetLayer
(),
track
->
m_NetCode
);
pt_Dcode
=
ReturnToolDescr
(
track
->
GetLayer
(),
track
->
GetNet
()
);
pt_Dcode
->
m_InUse
=
TRUE
;
pt_Dcode
->
m_InUse
=
TRUE
;
if
(
// Line Item
if
(
// Line Item
...
...
gerbview/deltrack.cpp
View file @
3cd47555
...
@@ -28,7 +28,7 @@ void WinEDA_GerberFrame::Delete_DCode_Items( wxDC* DC, int dcode_value, int laye
...
@@ -28,7 +28,7 @@ void WinEDA_GerberFrame::Delete_DCode_Items( wxDC* DC, int dcode_value, int laye
for
(
;
track
!=
NULL
;
track
=
next_track
)
for
(
;
track
!=
NULL
;
track
=
next_track
)
{
{
next_track
=
track
->
Next
();
next_track
=
track
->
Next
();
if
(
dcode_value
!=
track
->
m_NetCode
)
if
(
dcode_value
!=
track
->
GetNet
()
)
continue
;
continue
;
if
(
layer_number
>=
0
&&
layer_number
!=
track
->
GetLayer
()
)
if
(
layer_number
>=
0
&&
layer_number
!=
track
->
GetLayer
()
)
continue
;
continue
;
...
...
gerbview/readgerb.cpp
View file @
3cd47555
...
@@ -95,7 +95,7 @@
...
@@ -95,7 +95,7 @@
* Les Flash sont représentées par des DRAWSEGMENTS
* Les Flash sont représentées par des DRAWSEGMENTS
* - ronds ou ovales: DRAWSEGMENTS
* - ronds ou ovales: DRAWSEGMENTS
* - rectangles: DRAWSEGMENTS
* - rectangles: DRAWSEGMENTS
* la reference aux D-CODES est placée dans le membre
m_NetCode
* la reference aux D-CODES est placée dans le membre
GetNet()
*/
*/
...
...
gerbview/rs274d.cpp
View file @
3cd47555
...
@@ -112,7 +112,7 @@ static void Append_1_Flash_ROND_GERBER( int Dcode_tool,
...
@@ -112,7 +112,7 @@ static void Append_1_Flash_ROND_GERBER( int Dcode_tool,
track
->
m_Start
=
track
->
m_End
=
pos
;
track
->
m_Start
=
track
->
m_End
=
pos
;
NEGATE
(
track
->
m_Start
.
y
);
NEGATE
(
track
->
m_Start
.
y
);
NEGATE
(
track
->
m_End
.
y
);
NEGATE
(
track
->
m_End
.
y
);
track
->
m_NetCode
=
Dcode_tool
;
track
->
SetNet
(
Dcode_tool
)
;
track
->
m_Shape
=
S_SPOT_CIRCLE
;
track
->
m_Shape
=
S_SPOT_CIRCLE
;
Trace_Segment
(
frame
->
DrawPanel
,
DC
,
track
,
GR_OR
);
Trace_Segment
(
frame
->
DrawPanel
,
DC
,
track
,
GR_OR
);
...
@@ -145,7 +145,7 @@ static void Append_1_Flash_GERBER( int Dcode_index,
...
@@ -145,7 +145,7 @@ static void Append_1_Flash_GERBER( int Dcode_index,
track
->
m_Start
=
track
->
m_End
=
pos
;
track
->
m_Start
=
track
->
m_End
=
pos
;
NEGATE
(
track
->
m_Start
.
y
);
NEGATE
(
track
->
m_Start
.
y
);
NEGATE
(
track
->
m_End
.
y
);
NEGATE
(
track
->
m_End
.
y
);
track
->
m_NetCode
=
Dcode_index
;
track
->
SetNet
(
Dcode_index
)
;
if
(
forme
==
OVALE
)
if
(
forme
==
OVALE
)
track
->
m_Shape
=
S_SPOT_OVALE
;
track
->
m_Shape
=
S_SPOT_OVALE
;
...
@@ -187,7 +187,7 @@ static void Append_1_Line_GERBER( int Dcode_index,
...
@@ -187,7 +187,7 @@ static void Append_1_Line_GERBER( int Dcode_index,
NEGATE
(
track
->
m_Start
.
y
);
NEGATE
(
track
->
m_Start
.
y
);
track
->
m_End
=
endpoint
;
track
->
m_End
=
endpoint
;
NEGATE
(
track
->
m_End
.
y
);
NEGATE
(
track
->
m_End
.
y
);
track
->
m_NetCode
=
Dcode_index
;
track
->
SetNet
(
Dcode_index
)
;
Trace_Segment
(
frame
->
DrawPanel
,
DC
,
track
,
GR_OR
);
Trace_Segment
(
frame
->
DrawPanel
,
DC
,
track
,
GR_OR
);
}
}
...
@@ -279,13 +279,15 @@ static void Append_1_SEG_ARC_GERBER( int Dcode_index,
...
@@ -279,13 +279,15 @@ static void Append_1_SEG_ARC_GERBER( int Dcode_index,
}
}
}
}
track
->
m_NetCode
=
Dcode_index
;
track
->
SetNet
(
Dcode_index
)
;
track
->
m_Param
=
center
.
x
;
track
->
m_Param
=
center
.
x
;
track
->
m_Sous_Netcode
=
center
.
y
;
track
->
SetSubNet
(
center
.
y
)
;
NEGATE
(
track
->
m_Start
.
y
);
NEGATE
(
track
->
m_Start
.
y
);
NEGATE
(
track
->
m_End
.
y
);
NEGATE
(
track
->
m_End
.
y
);
NEGATE
(
track
->
m_Sous_Netcode
);
//NEGATE( track->GetSubNet() );
track
->
SetSubNet
(
-
track
->
GetSubNet
()
);
Trace_Segment
(
frame
->
DrawPanel
,
DC
,
track
,
GR_OR
);
Trace_Segment
(
frame
->
DrawPanel
,
DC
,
track
,
GR_OR
);
}
}
...
@@ -745,7 +747,7 @@ bool GERBER_Descr::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
...
@@ -745,7 +747,7 @@ bool GERBER_Descr::Execute_DCODE_Command( WinEDA_GerberFrame* frame, wxDC* DC,
NEGATE
(
edge_poly
->
m_Start
.
y
);
NEGATE
(
edge_poly
->
m_Start
.
y
);
edge_poly
->
m_End
=
m_CurrentPos
;
edge_poly
->
m_End
=
m_CurrentPos
;
NEGATE
(
edge_poly
->
m_End
.
y
);
NEGATE
(
edge_poly
->
m_End
.
y
);
edge_poly
->
m_NetCode
=
m_PolygonFillModeState
;
edge_poly
->
SetNet
(
m_PolygonFillModeState
)
;
m_PreviousPos
=
m_CurrentPos
;
m_PreviousPos
=
m_CurrentPos
;
m_PolygonFillModeState
=
1
;
m_PolygonFillModeState
=
1
;
break
;
break
;
...
...
gerbview/tracepcb.cpp
View file @
3cd47555
...
@@ -112,7 +112,7 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklay
...
@@ -112,7 +112,7 @@ void WinEDA_GerberFrame::Trace_Gerber( wxDC* DC, int draw_mode, int printmasklay
if
(
printmasklayer
!=
-
1
)
if
(
printmasklayer
!=
-
1
)
if
(
(
track
->
ReturnMaskLayer
()
&
printmasklayer
)
==
0
)
continue
;
if
(
(
track
->
ReturnMaskLayer
()
&
printmasklayer
)
==
0
)
continue
;
if
(
track
->
m_NetCode
==
0
)
// StartPoint
if
(
track
->
GetNet
()
==
0
)
// StartPoint
{
{
if
(
nbpoints
)
if
(
nbpoints
)
{
{
...
...
gerbview/trpiste.cpp
View file @
3cd47555
...
@@ -44,7 +44,7 @@ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int draw_
...
@@ -44,7 +44,7 @@ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int draw_
if
(
(
Track
->
ReturnMaskLayer
()
&
printmasklayer
)
==
0
)
if
(
(
Track
->
ReturnMaskLayer
()
&
printmasklayer
)
==
0
)
continue
;
continue
;
if
(
(
dcode_hightlight
==
Track
->
m_NetCode
)
if
(
(
dcode_hightlight
==
Track
->
GetNet
()
)
&&
(
Track
->
GetLayer
()
==
layer
)
)
&&
(
Track
->
GetLayer
()
==
layer
)
)
Trace_Segment
(
panel
,
DC
,
Track
,
draw_mode
|
GR_SURBRILL
);
Trace_Segment
(
panel
,
DC
,
Track
,
draw_mode
|
GR_SURBRILL
);
else
else
...
@@ -122,13 +122,13 @@ void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track, int draw_mo
...
@@ -122,13 +122,13 @@ void Trace_Segment( WinEDA_DrawPanel* panel, wxDC* DC, TRACK* track, int draw_mo
{
{
GRArc1
(
&
panel
->
m_ClipBox
,
DC
,
track
->
m_Start
.
x
,
track
->
m_Start
.
y
,
GRArc1
(
&
panel
->
m_ClipBox
,
DC
,
track
->
m_Start
.
x
,
track
->
m_Start
.
y
,
track
->
m_End
.
x
,
track
->
m_End
.
y
,
track
->
m_End
.
x
,
track
->
m_End
.
y
,
track
->
m_Param
,
track
->
m_Sous_Netcode
,
0
,
color
);
track
->
m_Param
,
track
->
GetSubNet
()
,
0
,
color
);
}
}
else
else
{
{
GRArc1
(
&
panel
->
m_ClipBox
,
DC
,
track
->
m_Start
.
x
,
track
->
m_Start
.
y
,
GRArc1
(
&
panel
->
m_ClipBox
,
DC
,
track
->
m_Start
.
x
,
track
->
m_Start
.
y
,
track
->
m_End
.
x
,
track
->
m_End
.
y
,
track
->
m_End
.
x
,
track
->
m_End
.
y
,
track
->
m_Param
,
track
->
m_Sous_Netcode
,
track
->
m_Param
,
track
->
GetSubNet
()
,
track
->
m_Width
,
color
);
track
->
m_Width
,
color
);
}
}
}
}
...
@@ -344,7 +344,7 @@ void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int d
...
@@ -344,7 +344,7 @@ void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int d
pos
.
x
=
(
track
->
m_Start
.
x
+
track
->
m_End
.
x
)
/
2
;
pos
.
x
=
(
track
->
m_Start
.
x
+
track
->
m_End
.
x
)
/
2
;
pos
.
y
=
(
track
->
m_Start
.
y
+
track
->
m_End
.
y
)
/
2
;
pos
.
y
=
(
track
->
m_Start
.
y
+
track
->
m_End
.
y
)
/
2
;
}
}
Line
.
Printf
(
wxT
(
"D%d"
),
track
->
m_NetCode
);
Line
.
Printf
(
wxT
(
"D%d"
),
track
->
GetNet
()
);
width
=
track
->
m_Width
;
width
=
track
->
m_Width
;
orient
=
TEXT_ORIENT_HORIZ
;
orient
=
TEXT_ORIENT_HORIZ
;
if
(
track
->
m_Shape
>=
S_SPOT_CIRCLE
)
// forme flash
if
(
track
->
m_Shape
>=
S_SPOT_CIRCLE
)
// forme flash
...
...
gerbview/undelete.cpp
View file @
3cd47555
...
@@ -44,7 +44,7 @@ void WinEDA_GerberFrame::UnDeleteItem( wxDC* DC )
...
@@ -44,7 +44,7 @@ void WinEDA_GerberFrame::UnDeleteItem( wxDC* DC )
}
}
PtStruct
=
g_UnDeleteStack
[
g_UnDeleteStackPtr
];
PtStruct
=
g_UnDeleteStack
[
g_UnDeleteStackPtr
];
net_code
=
(
(
TRACK
*
)
PtStruct
)
->
m_NetCode
;
net_code
=
(
(
TRACK
*
)
PtStruct
)
->
GetNet
()
;
pt_track
=
(
(
TRACK
*
)
PtStruct
)
->
GetBestInsertPoint
(
m_Pcb
);
pt_track
=
(
(
TRACK
*
)
PtStruct
)
->
GetBestInsertPoint
(
m_Pcb
);
(
(
TRACK
*
)
PtStruct
)
->
Insert
(
m_Pcb
,
pt_track
);
(
(
TRACK
*
)
PtStruct
)
->
Insert
(
m_Pcb
,
pt_track
);
...
...
include/common.h
View file @
3cd47555
...
@@ -588,7 +588,7 @@ int GetCommandOptions( const int argc, const char** argv, const char* st
...
@@ -588,7 +588,7 @@ int GetCommandOptions( const int argc, const char** argv, const char* st
const
char
**
optarg
,
int
*
optind
);
const
char
**
optarg
,
int
*
optind
);
void
valeur_param
(
int
valeur
,
wxString
&
buf_texte
);
const
wxString
&
valeur_param
(
int
valeur
,
wxString
&
buf_texte
);
/* Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies
/* Retourne pour affichage la valeur d'un parametre, selon type d'unites choisies
* entree : valeur en mils , buffer de texte
* entree : valeur en mils , buffer de texte
...
...
pcbnew/affiche.cpp
View file @
3cd47555
...
@@ -43,7 +43,7 @@ void Affiche_Infos_Equipot( int netcode, WinEDA_BasePcbFrame* frame )
...
@@ -43,7 +43,7 @@ void Affiche_Infos_Equipot( int netcode, WinEDA_BasePcbFrame* frame )
{
{
for
(
pad
=
module
->
m_Pads
;
pad
!=
0
;
pad
=
(
D_PAD
*
)
pad
->
Pnext
)
for
(
pad
=
module
->
m_Pads
;
pad
!=
0
;
pad
=
(
D_PAD
*
)
pad
->
Pnext
)
{
{
if
(
pad
->
m_NetCode
==
netcode
)
if
(
pad
->
GetNet
()
==
netcode
)
ii
++
;
ii
++
;
}
}
}
}
...
@@ -55,7 +55,7 @@ void Affiche_Infos_Equipot( int netcode, WinEDA_BasePcbFrame* frame )
...
@@ -55,7 +55,7 @@ void Affiche_Infos_Equipot( int netcode, WinEDA_BasePcbFrame* frame )
{
{
ii
++
;
ii
++
;
if
(
Struct
->
Type
()
==
TYPEVIA
)
if
(
Struct
->
Type
()
==
TYPEVIA
)
if
(
(
(
SEGVIA
*
)
Struct
)
->
m_NetCode
==
netcode
)
if
(
(
(
SEGVIA
*
)
Struct
)
->
GetNet
()
==
netcode
)
nb_vias
++
;
nb_vias
++
;
}
}
...
...
pcbnew/attribut.cpp
View file @
3cd47555
...
@@ -76,7 +76,7 @@ void WinEDA_PcbFrame::Attribut_net( wxDC* DC, int net_code, bool Flag_On )
...
@@ -76,7 +76,7 @@ void WinEDA_PcbFrame::Attribut_net( wxDC* DC, int net_code, bool Flag_On )
{
{
for
(
;
Track
!=
NULL
;
Track
=
(
TRACK
*
)
Track
->
Pnext
)
for
(
;
Track
!=
NULL
;
Track
=
(
TRACK
*
)
Track
->
Pnext
)
{
{
if
(
net_code
==
Track
->
m_NetCode
)
if
(
net_code
==
Track
->
GetNet
()
)
break
;
break
;
}
}
}
}
...
@@ -84,7 +84,7 @@ void WinEDA_PcbFrame::Attribut_net( wxDC* DC, int net_code, bool Flag_On )
...
@@ -84,7 +84,7 @@ void WinEDA_PcbFrame::Attribut_net( wxDC* DC, int net_code, bool Flag_On )
DrawPanel
->
CursorOff
(
DC
);
// Erase cursor shape
DrawPanel
->
CursorOff
(
DC
);
// Erase cursor shape
while
(
Track
)
/* Flag change */
while
(
Track
)
/* Flag change */
{
{
if
(
(
net_code
>=
0
)
&&
(
net_code
!=
Track
->
m_NetCode
)
)
if
(
(
net_code
>=
0
)
&&
(
net_code
!=
Track
->
GetNet
()
)
)
break
;
break
;
GetScreen
()
->
SetModify
();
GetScreen
()
->
SetModify
();
Track
->
SetState
(
SEGM_FIXE
,
Flag_On
);
Track
->
SetState
(
SEGM_FIXE
,
Flag_On
);
...
...
pcbnew/autoplac.cpp
View file @
3cd47555
...
@@ -449,7 +449,7 @@ int WinEDA_PcbFrame::GenPlaceBoard()
...
@@ -449,7 +449,7 @@ int WinEDA_PcbFrame::GenPlaceBoard()
TRACK
TmpSegm
(
NULL
);
TRACK
TmpSegm
(
NULL
);
TmpSegm
.
SetLayer
(
-
1
);
TmpSegm
.
SetLayer
(
-
1
);
TmpSegm
.
m_NetCode
=
-
1
;
TmpSegm
.
SetNet
(
-
1
)
;
TmpSegm
.
m_Width
=
g_GridRoutingSize
/
2
;
TmpSegm
.
m_Width
=
g_GridRoutingSize
/
2
;
for
(
;
PtStruct
!=
NULL
;
PtStruct
=
PtStruct
->
Pnext
)
for
(
;
PtStruct
!=
NULL
;
PtStruct
=
PtStruct
->
Pnext
)
{
{
...
@@ -970,7 +970,7 @@ void Build_PlacedPads_List( BOARD* Pcb )
...
@@ -970,7 +970,7 @@ void Build_PlacedPads_List( BOARD* Pcb )
PtPad
->
m_physical_connexion
=
0
;
PtPad
->
m_physical_connexion
=
0
;
PtPad
->
m_logical_connexion
=
0
;
PtPad
->
m_logical_connexion
=
0
;
PtPad
->
m_Parent
=
Module
;
PtPad
->
m_Parent
=
Module
;
if
(
PtPad
->
m_NetCode
)
if
(
PtPad
->
GetNet
()
)
Pcb
->
m_NbNodes
++
;
Pcb
->
m_NbNodes
++
;
pt_liste_pad
++
;
pt_liste_pad
++
;
}
}
...
...
pcbnew/autorout.cpp
View file @
3cd47555
/***************************************/
/***************************************/
/* PCBNEW: Autorouting command control */
/* PCBNEW: Autorouting command control */
/***************************************/
/***************************************/
#include "fctsys.h"
#include "fctsys.h"
#include "gr_basic.h"
#include "gr_basic.h"
...
@@ -16,204 +16,220 @@
...
@@ -16,204 +16,220 @@
/* Variables locales */
/* Variables locales */
/********************************************************/
/********************************************************/
void
WinEDA_PcbFrame
::
Autoroute
(
wxDC
*
DC
,
int
mode
)
void
WinEDA_PcbFrame
::
Autoroute
(
wxDC
*
DC
,
int
mode
)
/********************************************************/
/********************************************************/
/* init board, route traces*/
/* init board, route traces*/
{
{
int
ii
,
start
,
stop
;
int
ii
,
start
,
stop
;
CHEVELU
*
ptmp
;
CHEVELU
*
ptmp
;
MODULE
*
Module
=
NULL
;
MODULE
*
Module
=
NULL
;
D_PAD
*
Pad
=
NULL
;
D_PAD
*
Pad
=
NULL
;
int
autoroute_net_code
=
-
1
;
int
autoroute_net_code
=
-
1
;
wxString
msg
;
wxString
msg
;
if
(
g_DesignSettings
.
m_CopperLayerCount
>
1
)
if
(
g_DesignSettings
.
m_CopperLayerCount
>
1
)
{
{
Route_Layer_TOP
=
GetScreen
()
->
m_Route_Layer_TOP
;
Route_Layer_TOP
=
GetScreen
()
->
m_Route_Layer_TOP
;
Route_Layer_BOTTOM
=
GetScreen
()
->
m_Route_Layer_BOTTOM
;
Route_Layer_BOTTOM
=
GetScreen
()
->
m_Route_Layer_BOTTOM
;
}
}
else
else
{
{
Route_Layer_TOP
=
Route_Layer_TOP
=
Route_Layer_BOTTOM
=
COPPER_LAYER_N
;
Route_Layer_BOTTOM
=
COPPER_LAYER_N
;
}
}
switch
(
mode
)
switch
(
mode
)
{
{
case
ROUTE_NET
:
case
ROUTE_NET
:
if
(
GetScreen
()
->
GetCurItem
()
)
if
(
GetScreen
()
->
GetCurItem
()
)
{
{
switch
(
GetScreen
()
->
GetCurItem
()
->
Type
()
)
switch
(
GetScreen
()
->
GetCurItem
()
->
Type
()
)
{
{
case
TYPEPAD
:
case
TYPEPAD
:
Pad
=
(
D_PAD
*
)
GetScreen
()
->
GetCurItem
();
Pad
=
(
D_PAD
*
)
GetScreen
()
->
GetCurItem
();
autoroute_net_code
=
Pad
->
m_NetCode
;
autoroute_net_code
=
Pad
->
GetNet
();
break
;
break
;
default
:
default
:
break
;
break
;
}
}
}
}
if
(
autoroute_net_code
<=
0
)
if
(
autoroute_net_code
<=
0
)
{
{
DisplayError
(
this
,
_
(
"Net not selected"
));
return
;
DisplayError
(
this
,
_
(
"Net not selected"
)
);
return
;
}
}
break
;
break
;
case
ROUTE_MODULE
:
case
ROUTE_MODULE
:
Module
=
(
MODULE
*
)
GetScreen
()
->
GetCurItem
();
Module
=
(
MODULE
*
)
GetScreen
()
->
GetCurItem
();
if
(
(
Module
==
NULL
)
||
(
Module
->
Type
()
!=
TYPEMODULE
)
)
if
(
(
Module
==
NULL
)
||
(
Module
->
Type
()
!=
TYPEMODULE
)
)
{
{
DisplayError
(
this
,
_
(
"Module not selected"
)
);
return
;
DisplayError
(
this
,
_
(
"Module not selected"
)
);
return
;
}
}
break
;
break
;
case
ROUTE_PAD
:
case
ROUTE_PAD
:
Pad
=
(
D_PAD
*
)
GetScreen
()
->
GetCurItem
();
Pad
=
(
D_PAD
*
)
GetScreen
()
->
GetCurItem
();
if
(
(
Pad
==
NULL
)
||
(
Pad
->
Type
()
!=
TYPEPAD
)
)
if
(
(
Pad
==
NULL
)
||
(
Pad
->
Type
()
!=
TYPEPAD
)
)
{
{
DisplayError
(
this
,
_
(
"Pad not selected"
)
);
return
;
DisplayError
(
this
,
_
(
"Pad not selected"
)
);
return
;
}
}
break
;
break
;
}
}
if
(
(
m_Pcb
->
m_Status_Pcb
&
LISTE_CHEVELU_OK
)
==
0
)
if
(
(
m_Pcb
->
m_Status_Pcb
&
LISTE_CHEVELU_OK
)
==
0
)
Compile_Ratsnest
(
DC
,
TRUE
);
Compile_Ratsnest
(
DC
,
TRUE
);
/* Placement du flag CH_ROUTE_REQ sur les chevelus demandes */
/* Placement du flag CH_ROUTE_REQ sur les chevelus demandes */
ptmp
=
(
CHEVELU
*
)
m_Pcb
->
m_Ratsnest
;
ptmp
=
(
CHEVELU
*
)
m_Pcb
->
m_Ratsnest
;
for
(
ii
=
m_Pcb
->
GetNumRatsnests
();
ii
>
0
;
ii
--
,
ptmp
++
)
for
(
ii
=
m_Pcb
->
GetNumRatsnests
();
ii
>
0
;
ii
--
,
ptmp
++
)
{
{
ptmp
->
status
&=
~
CH_ROUTE_REQ
;
ptmp
->
status
&=
~
CH_ROUTE_REQ
;
switch
(
mode
)
{
switch
(
mode
)
case
ROUTE_ALL
:
{
ptmp
->
status
|=
CH_ROUTE_REQ
;
break
;
case
ROUTE_ALL
:
ptmp
->
status
|=
CH_ROUTE_REQ
;
break
;
case
ROUTE_NET
:
if
(
autoroute_net_code
==
ptmp
->
m_NetCode
)
case
ROUTE_NET
:
ptmp
->
status
|=
CH_ROUTE_REQ
;
if
(
autoroute_net_code
==
ptmp
->
GetNet
()
)
break
;
ptmp
->
status
|=
CH_ROUTE_REQ
;
break
;
case
ROUTE_MODULE
:
{
case
ROUTE_MODULE
:
D_PAD
*
pt_pad
=
(
D_PAD
*
)
Module
->
m_Pads
;
{
for
(
;
pt_pad
!=
NULL
;
pt_pad
=
(
D_PAD
*
)
pt_pad
->
Pnext
)
D_PAD
*
pt_pad
=
(
D_PAD
*
)
Module
->
m_Pads
;
{
for
(
;
pt_pad
!=
NULL
;
pt_pad
=
(
D_PAD
*
)
pt_pad
->
Pnext
)
if
(
ptmp
->
pad_start
==
pt_pad
)
{
ptmp
->
status
|=
CH_ROUTE_REQ
;
if
(
ptmp
->
pad_start
==
pt_pad
)
if
(
ptmp
->
pad_end
==
pt_pad
)
ptmp
->
status
|=
CH_ROUTE_REQ
;
ptmp
->
status
|=
CH_ROUTE_REQ
;
if
(
ptmp
->
pad_end
==
pt_pad
)
}
ptmp
->
status
|=
CH_ROUTE_REQ
;
break
;
}
}
case
ROUTE_PAD
:
break
;
if
(
(
ptmp
->
pad_start
==
Pad
)
||
(
ptmp
->
pad_end
==
Pad
))
}
ptmp
->
status
|=
CH_ROUTE_REQ
;
break
;
case
ROUTE_PAD
:
}
if
(
(
ptmp
->
pad_start
==
Pad
)
||
(
ptmp
->
pad_end
==
Pad
)
)
}
ptmp
->
status
|=
CH_ROUTE_REQ
;
ptmp
=
(
CHEVELU
*
)
m_Pcb
->
m_Ratsnest
;
break
;
}
start
=
time
(
NULL
);
}
/* Calcul du pas de routage fixe a 5 mils et plus */
ptmp
=
(
CHEVELU
*
)
m_Pcb
->
m_Ratsnest
;
g_GridRoutingSize
=
GetScreen
()
->
GetGrid
().
x
;
if
(
g_GridRoutingSize
<
50
)
g_GridRoutingSize
=
50
;
start
=
time
(
NULL
);
E_scale
=
g_GridRoutingSize
/
50
;
if
(
E_scale
<
1
)
E_scale
=
1
;
/* Calcul du pas de routage fixe a 5 mils et plus */
/* calcule de Ncols et Nrow, taille de la matrice de routage */
g_GridRoutingSize
=
GetScreen
()
->
GetGrid
().
x
;
ComputeMatriceSize
(
this
,
g_GridRoutingSize
);
if
(
g_GridRoutingSize
<
50
)
g_GridRoutingSize
=
50
;
MsgPanel
->
EraseMsgBox
();
E_scale
=
g_GridRoutingSize
/
50
;
if
(
E_scale
<
1
)
E_scale
=
1
;
/* Creation du mapping du board */
Nb_Sides
=
ONE_SIDE
;
/* calcule de Ncols et Nrow, taille de la matrice de routage */
if
(
Route_Layer_TOP
!=
Route_Layer_BOTTOM
)
Nb_Sides
=
TWO_SIDES
;
ComputeMatriceSize
(
this
,
g_GridRoutingSize
);
if
(
Board
.
InitBoard
()
<
0
)
MsgPanel
->
EraseMsgBox
();
{
DisplayError
(
this
,
_
(
"No memory for autorouting"
)
);
/* Creation du mapping du board */
Board
.
UnInitBoard
();
/* Libere la memoire BitMap */
Nb_Sides
=
ONE_SIDE
;
return
;
if
(
Route_Layer_TOP
!=
Route_Layer_BOTTOM
)
}
Nb_Sides
=
TWO_SIDES
;
Affiche_Message
(
_
(
"Place Cells"
)
);
if
(
Board
.
InitBoard
()
<
0
)
PlaceCells
(
m_Pcb
,
-
1
,
FORCE_PADS
);
{
DisplayError
(
this
,
_
(
"No memory for autorouting"
)
);
/* Construction de la liste des pistes a router */
Board
.
UnInitBoard
();
/* Libere la memoire BitMap */
Build_Work
(
m_Pcb
,
ptmp
);
return
;
}
// DisplayBoard(DrawPanel, DC);
Affiche_Message
(
_
(
"Place Cells"
)
);
if
(
Nb_Sides
==
TWO_SIDES
)
PlaceCells
(
m_Pcb
,
-
1
,
FORCE_PADS
);
Solve
(
DC
,
TWO_SIDES
);
/* double face */
else
Solve
(
DC
,
ONE_SIDE
);
/* simple face */
/* Construction de la liste des pistes a router */
Build_Work
(
m_Pcb
,
ptmp
);
/* Liberation de la memoire */
FreeQueue
();
/* Libere la memoire de routage */
// DisplayBoard(DrawPanel, DC);
InitWork
();
/* Libere la memoire de la liste des connexions a router */
Board
.
UnInitBoard
();
/* Libere la memoire BitMap */
if
(
Nb_Sides
==
TWO_SIDES
)
stop
=
time
(
NULL
)
-
start
;
Solve
(
DC
,
TWO_SIDES
);
/* double face */
msg
.
Printf
(
wxT
(
"time = %d second%s"
),
stop
,
(
stop
==
1
)
?
wxT
(
""
)
:
wxT
(
"s"
)
);
else
Affiche_Message
(
msg
);
Solve
(
DC
,
ONE_SIDE
);
/* simple face */
/* Liberation de la memoire */
FreeQueue
();
/* Libere la memoire de routage */
InitWork
();
/* Libere la memoire de la liste des connexions a router */
Board
.
UnInitBoard
();
/* Libere la memoire BitMap */
stop
=
time
(
NULL
)
-
start
;
msg
.
Printf
(
wxT
(
"time = %d second%s"
),
stop
,
(
stop
==
1
)
?
wxT
(
""
)
:
wxT
(
"s"
)
);
Affiche_Message
(
msg
);
}
}
/************************************************/
/************************************************/
void
WinEDA_PcbFrame
::
Reset_Noroutable
(
wxDC
*
DC
)
void
WinEDA_PcbFrame
::
Reset_Noroutable
(
wxDC
*
DC
)
/*************************************************/
/*************************************************/
/* Remet a 0 le flag CH_NOROUTABLE qui est positionne a 1 par Solve()
lorsque un chevelu n'a pas ete route.
/* Remet a 0 le flag CH_NOROUTABLE qui est positionne a 1 par Solve()
Si ce flag est a 1 il n'est pas reroute
* lorsque un chevelu n'a pas ete route.
*/
* Si ce flag est a 1 il n'est pas reroute
*/
{
{
int
ii
;
int
ii
;
CHEVELU
*
pt_rats
;
CHEVELU
*
pt_rats
;
if
(
(
m_Pcb
->
m_Status_Pcb
&
LISTE_CHEVELU_OK
)
==
0
)
if
(
(
m_Pcb
->
m_Status_Pcb
&
LISTE_CHEVELU_OK
)
==
0
)
Compile_Ratsnest
(
DC
,
TRUE
);
Compile_Ratsnest
(
DC
,
TRUE
);
pt_rats
=
(
CHEVELU
*
)
m_Pcb
->
m_Ratsnest
;
pt_rats
=
(
CHEVELU
*
)
m_Pcb
->
m_Ratsnest
;
if
(
pt_rats
==
NULL
)
return
;
if
(
pt_rats
==
NULL
)
return
;
for
(
ii
=
m_Pcb
->
GetNumRatsnests
();
ii
>
0
;
ii
--
,
pt_rats
++
)
for
(
ii
=
m_Pcb
->
GetNumRatsnests
();
ii
>
0
;
ii
--
,
pt_rats
++
)
{
{
pt_rats
->
status
&=
~
CH_UNROUTABLE
;
pt_rats
->
status
&=
~
CH_UNROUTABLE
;
}
}
}
}
/*****************************************************/
/*****************************************************/
void
DisplayBoard
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
)
void
DisplayBoard
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
)
/****************************************************/
/****************************************************/
/* Fonction de DEBUG : affiche le remplissage des cellules TOP et BOTTOM */
/* Fonction de DEBUG : affiche le remplissage des cellules TOP et BOTTOM */
{
{
int
row
,
col
,
i
,
j
;
int
row
,
col
,
i
,
j
;
int
dcell0
,
dcell1
=
0
,
color
;
int
dcell0
,
dcell1
=
0
,
color
;
int
maxi
;
int
maxi
;
maxi
=
(
/*ActiveScreen->Lim_XD - 20*/
500
)
/
Ncols
;
maxi
=
(
/*ActiveScreen->Lim_XD - 20*/
500
)
/
Ncols
;
maxi
=
(
maxi
*
3
)
/
4
;
maxi
=
(
maxi
*
3
)
/
4
;
if
(
!
maxi
)
maxi
=
1
;
if
(
!
maxi
)
maxi
=
1
;
for
(
col
=
0
;
col
<
Ncols
;
col
++
)
{
for
(
col
=
0
;
col
<
Ncols
;
col
++
)
for
(
row
=
0
;
row
<
Nrows
;
row
++
)
{
{
for
(
row
=
0
;
row
<
Nrows
;
row
++
)
color
=
0
;
{
dcell0
=
GetCell
(
row
,
col
,
BOTTOM
);
if
(
dcell0
&
HOLE
)
color
=
GREEN
;
color
=
0
;
if
(
Nb_Sides
)
dcell1
=
GetCell
(
row
,
col
,
TOP
);
dcell0
=
GetCell
(
row
,
col
,
BOTTOM
);
if
(
dcell0
&
HOLE
)
if
(
dcell1
&
HOLE
)
color
|=
RED
;
color
=
GREEN
;
dcell0
|=
dcell1
;
if
(
Nb_Sides
)
if
(
!
color
&&
(
dcell0
&
VIA_IMPOSSIBLE
))
color
=
BLUE
;
dcell1
=
GetCell
(
row
,
col
,
TOP
);
if
(
color
)
if
(
dcell1
&
HOLE
)
{
color
|=
RED
;
for
(
i
=
0
;
i
<
maxi
;
i
++
)
dcell0
|=
dcell1
;
for
(
j
=
0
;
j
<
maxi
;
j
++
)
if
(
!
color
&&
(
dcell0
&
VIA_IMPOSSIBLE
)
)
GRSPutPixel
(
&
panel
->
m_ClipBox
,
DC
,
color
=
BLUE
;
(
col
*
maxi
)
+
i
+
10
,(
row
*
maxi
)
+
60
+
j
,
color
);
if
(
color
)
}
{
}
for
(
i
=
0
;
i
<
maxi
;
i
++
)
}
for
(
j
=
0
;
j
<
maxi
;
j
++
)
GRSPutPixel
(
&
panel
->
m_ClipBox
,
DC
,
(
col
*
maxi
)
+
i
+
10
,
(
row
*
maxi
)
+
60
+
j
,
color
);
}
}
}
}
}
pcbnew/autorout.h
View file @
3cd47555
/****************************************************/
/****************************************************/
/* AUTOROUT.H */
/* AUTOROUT.H */
/* d‚clarations communes relative au routage, DRC */
/* d‚clarations communes relative au routage, DRC */
/* et placement automatique des composants */
/* et placement automatique des composants */
/****************************************************/
/****************************************************/
#ifndef AUTOROUT_H
#ifndef AUTOROUT_H
#define AUTOROUT_H
#define AUTOROUT_H
#define TOP 0
#define TOP
0
#define BOTTOM 1
#define BOTTOM 1
#define EMPTY
0
#define EMPTY
0
#define ILLEGAL -1
#define ILLEGAL -1
/*****************************************************/
/*****************************************************/
/* Structures de representation des pads et chevelus */
/* Structures de representation des pads et chevelus */
/* pour etablissement du chevelu general complet */
/* pour etablissement du chevelu general complet */
/*****************************************************/
/*****************************************************/
/***********************************************/
/***********************************************/
/* description d'un segment de chevelu general */
/* description d'un segment de chevelu general */
/***********************************************/
/***********************************************/
/****************************/
/****************************/
/* bits d'etat du chevelu : */
/* bits d'etat du chevelu : */
/****************************/
/****************************/
#define CH_VISIBLE 1
/* affichage permanent demande */
#define CH_VISIBLE 1
/* affichage permanent demande */
#define CH_UNROUTABLE 2
/* non route par l'autorouteur */
#define CH_UNROUTABLE 2
/* non route par l'autorouteur */
#define CH_ROUTE_REQ 4
/* doit etre route par l'autorouteur */
#define CH_ROUTE_REQ 4
/* doit etre route par l'autorouteur */
#define CH_ACTIF 8
/* chevelu non encore routé */
#define CH_ACTIF 8
/* chevelu non encore routé */
#define LOCAL_CHEVELU 0x8000
/* indique un chevelu reliant 2 pins d'un meme
#define LOCAL_CHEVELU 0x8000
/* indique un chevelu reliant 2 pins d'un meme
* module pour le calcul des chevelus relatifs a 1 seul module */
module pour le calcul des chevelus relatifs a 1 seul module */
class
CHEVELU
class
CHEVELU
{
{
private
:
int
m_NetCode
;
// numero de code du net ( = 0.. n , avec 0 si non connecte)
public
:
public
:
int
m_NetCode
;
// numero de code du net ( = 0.. n , avec 0 si non connecte)
int
status
;
// etat: voir defines précédents (CH_ ...)
int
status
;
// etat: voir defines précédents (CH_ ...)
D_PAD
*
pad_start
;
// pointeur sur le pad de depart
D_PAD
*
pad_start
;
// pointeur sur le pad de depart
D_PAD
*
pad_end
;
// pointeur sur le pad de fin
D_PAD
*
pad_end
;
// pointeur sur le pad de fin
int
dist
;
// longeur du chevelu
int
dist
;
// longeur du chevelu
/**
* Function GetNet
* @return int - the net code.
*/
int
GetNet
()
const
{
return
m_NetCode
;
}
void
SetNet
(
int
aNetCode
)
{
m_NetCode
=
aNetCode
;
};
};
};
/****************************************************************/
/****************************************************************/
/* description d'un point de piste pour le suivi des connexions */
/* description d'un point de piste pour le suivi des connexions */
/****************************************************************/
/****************************************************************/
#define START_SUR_PAD 0x10
#define START_SUR_PAD
0x10
#define END_SUR_PAD 0x20
#define END_SUR_PAD
0x20
#define START_SUR_TRACK 0x40
#define START_SUR_TRACK 0x40
#define END_SUR_TRACK 0x80
#define END_SUR_TRACK
0x80
#define START_EQU_VIA 0x10
#define START_EQU_VIA 0x10
#define END_EQU_VIA 0x20
#define END_EQU_VIA
0x20
/* Status bit (OR'ed bits) for class BOARD member .m_Status_Pcb */
/* Status bit (OR'ed bits) for class BOARD member .m_Status_Pcb */
enum
StatusPcbFlags
enum
StatusPcbFlags
{
{
LISTE_PAD_OK
=
1
,
/* Pad list is Ok */
LISTE_PAD_OK
=
1
,
/* Pad list is Ok */
LISTE_CHEVELU_OK
=
2
,
/* General Rastnest is Ok */
LISTE_CHEVELU_OK
=
2
,
/* General Rastnest is Ok */
CHEVELU_LOCAL_OK
=
4
,
/* current MODULE rastnest is Ok */
CHEVELU_LOCAL_OK
=
4
,
/* current MODULE rastnest is Ok */
CONNEXION_OK
=
8
,
/* Bit indicant que la liste des connexions existe */
CONNEXION_OK
=
8
,
/* Bit indicant que la liste des connexions existe */
NET_CODES_OK
=
0x10
,
/* Bit indicant que les netcodes sont OK ( pas de modif
NET_CODES_OK
=
0x10
,
/* Bit indicant que les netcodes sont OK ( pas de modif
* de noms de net */
de noms de net */
DO_NOT_SHOW_GENERAL_RASTNEST
=
0x20
/* Do not display the general rastnest (used in module moves) */
DO_NOT_SHOW_GENERAL_RASTNEST
=
0x20
/* Do not display the general rastnest (used in module moves) */
};
};
#define OK_DRC 0
#define OK_DRC
0
#define BAD_DRC 1
#define BAD_DRC 1
/* Commandes d'autoplacement / autorouage possibles */
/* Commandes d'autoplacement / autorouage possibles */
enum
CommandOpt
enum
CommandOpt
{
{
PLACE_ALL
,
PLACE_ALL
,
PLACE_OUT_OF_BOARD
,
PLACE_OUT_OF_BOARD
,
PLACE_INCREMENTAL
,
PLACE_INCREMENTAL
,
PLACE_1_MODULE
,
PLACE_1_MODULE
,
ROUTE_ALL
,
ROUTE_ALL
,
ROUTE_NET
,
ROUTE_NET
,
ROUTE_MODULE
,
ROUTE_MODULE
,
ROUTE_PAD
ROUTE_PAD
};
};
/* parametre Pas de routage pour routage automatique et generation des zones */
/* parametre Pas de routage pour routage automatique et generation des zones */
#if defined MAIN
#if defined MAIN
int
g_GridRoutingSize
=
250
;
int
g_GridRoutingSize
=
250
;
#else
#else
extern
int
g_GridRoutingSize
;
extern
int
g_GridRoutingSize
;
#endif
#endif
/* Variables et structures d'autoroutage */
/* Variables et structures d'autoroutage */
eda_global
int
E_scale
;
/* facteur d'echelle des tables de distance */
eda_global
int
E_scale
;
/* facteur d'echelle des tables de distance */
#define ONE_SIDE 0
#define ONE_SIDE
0
#define TWO_SIDES 1
#define TWO_SIDES 1
eda_global
int
Nb_Sides
;
/* Nombre de couches pour autoroutage (0 ou 1) */
eda_global
int
Nb_Sides
;
/* Nombre de couches pour autoroutage (0 ou 1) */
/* Bits Flags de gestion de remplissage du BOARD */
/* Bits Flags de gestion de remplissage du BOARD */
#define FORCE_PADS 1
/* pour forcage placement pads quel que soit le netcode */
#define FORCE_PADS 1
/* pour forcage placement pads quel que soit le netcode */
/* board dimensions */
/* board dimensions */
extern
int
Nrows
,
Ncols
;
extern
int
Nrows
,
Ncols
;
#if defined MAIN
#if defined MAIN
int
Nrows
=
ILLEGAL
;
int
Nrows
=
ILLEGAL
;
int
Ncols
=
ILLEGAL
;
int
Ncols
=
ILLEGAL
;
#endif
#endif
eda_global
int
Ntotal
;
eda_global
int
Ntotal
;
/* search statistics */
/* search statistics */
eda_global
int
OpenNodes
;
/* total number of nodes opened */
eda_global
int
OpenNodes
;
/* total number of nodes opened */
eda_global
int
ClosNodes
;
/* total number of nodes closed */
eda_global
int
ClosNodes
;
/* total number of nodes closed */
eda_global
int
MoveNodes
;
/* total number of nodes moved */
eda_global
int
MoveNodes
;
/* total number of nodes moved */
eda_global
int
MaxNodes
;
/* maximum number of nodes opened at one time */
eda_global
int
MaxNodes
;
/* maximum number of nodes opened at one time */
/* Structures utiles a la generation du board en Bit Map */
/* Structures utiles a la generation du board en Bit Map */
typedef
char
BoardCell
;
typedef
char
BoardCell
;
typedef
int
DistCell
;
typedef
int
DistCell
;
class
BOARDHEAD
/* header of blocks of BoardCell */
class
BOARDHEAD
/* header of blocks of BoardCell */
{
{
public
:
public
:
BoardCell
*
m_BoardSide
[
2
];
/* ptr to block of memory: 2-sided board */
BoardCell
*
m_BoardSide
[
2
];
/* ptr to block of memory: 2-sided board */
DistCell
*
m_DistSide
[
2
];
/* ptr to block of memory: path distance to cells */
DistCell
*
m_DistSide
[
2
];
/* ptr to block of memory: path distance to cells */
char
*
m_DirSide
[
2
];
/* header of blocks of chars:pointers back to source */
char
*
m_DirSide
[
2
];
/* header of blocks of chars:pointers back to source */
bool
m_InitBoardDone
;
bool
m_InitBoardDone
;
int
m_Layers
;
int
m_Layers
;
int
m_Nrows
,
m_Ncols
;
int
m_Nrows
,
m_Ncols
;
int
m_MemSize
;
int
m_MemSize
;
public
:
public
:
BOARDHEAD
();
BOARDHEAD
();
~
BOARDHEAD
();
~
BOARDHEAD
();
int
InitBoard
();
int
InitBoard
();
void
UnInitBoard
();
void
UnInitBoard
();
};
};
eda_global
BOARDHEAD
Board
;
/* 2-sided board */
eda_global
BOARDHEAD
Board
;
/* 2-sided board */
/* Constantes utilisees pour le trace des cellules sur le BOARD */
/* Constantes utilisees pour le trace des cellules sur le BOARD */
#define WRITE_CELL
0
#define WRITE_CELL
0
#define WRITE_OR_CELL 1
#define WRITE_OR_CELL
1
#define WRITE_XOR_CELL 2
#define WRITE_XOR_CELL 2
#define WRITE_AND_CELL 3
#define WRITE_AND_CELL 3
#define WRITE_ADD_CELL 4
#define WRITE_ADD_CELL 4
...
@@ -159,5 +170,4 @@ eda_global BOARDHEAD Board ; /* 2-sided board */
...
@@ -159,5 +170,4 @@ eda_global BOARDHEAD Board ; /* 2-sided board */
#include "ar_protos.h"
#include "ar_protos.h"
#endif
/* AUTOROUT_H */
#endif
/* AUTOROUT_H */
pcbnew/block.cpp
View file @
3cd47555
...
@@ -82,8 +82,12 @@ static bool InstallBlockCmdFrame( WinEDA_BasePcbFrame* parent,
...
@@ -82,8 +82,12 @@ static bool InstallBlockCmdFrame( WinEDA_BasePcbFrame* parent,
parent
->
DrawPanel
->
m_IgnoreMouseEvents
=
TRUE
;
parent
->
DrawPanel
->
m_IgnoreMouseEvents
=
TRUE
;
WinEDA_ExecBlockCmdFrame
*
frame
=
new
WinEDA_ExecBlockCmdFrame
(
parent
,
title
);
WinEDA_ExecBlockCmdFrame
*
frame
=
new
WinEDA_ExecBlockCmdFrame
(
parent
,
title
);
nocmd
=
frame
->
ShowModal
();
frame
->
Destroy
();
parent
->
GetScreen
()
->
m_Curseur
=
oldpos
;
nocmd
=
frame
->
ShowModal
();
frame
->
Destroy
();
parent
->
GetScreen
()
->
m_Curseur
=
oldpos
;
parent
->
DrawPanel
->
MouseToCursorSchema
();
parent
->
DrawPanel
->
MouseToCursorSchema
();
parent
->
DrawPanel
->
m_IgnoreMouseEvents
=
FALSE
;
parent
->
DrawPanel
->
m_IgnoreMouseEvents
=
FALSE
;
...
@@ -494,6 +498,7 @@ void WinEDA_BasePcbFrame::Block_Delete( wxDC* DC )
...
@@ -494,6 +498,7 @@ void WinEDA_BasePcbFrame::Block_Delete( wxDC* DC )
masque_layer
=
EDGE_LAYER
;
masque_layer
=
EDGE_LAYER
;
if
(
Block_Include_Draw_Items
)
if
(
Block_Include_Draw_Items
)
masque_layer
=
ALL_LAYERS
;
masque_layer
=
ALL_LAYERS
;
if
(
!
Block_Include_Edges_Items
)
if
(
!
Block_Include_Edges_Items
)
masque_layer
&=
~
EDGE_LAYER
;
masque_layer
&=
~
EDGE_LAYER
;
...
...
pcbnew/board.cpp
View file @
3cd47555
...
@@ -200,7 +200,7 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag )
...
@@ -200,7 +200,7 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag )
ptr
=
(
LISTE_PAD
*
)
Pcb
->
m_Pads
;
ii
=
Pcb
->
m_NbPads
;
ptr
=
(
LISTE_PAD
*
)
Pcb
->
m_Pads
;
ii
=
Pcb
->
m_NbPads
;
for
(
;
ii
>
0
;
ii
--
,
ptr
++
)
for
(
;
ii
>
0
;
ii
--
,
ptr
++
)
{
{
if
(
(
net_code
!=
(
*
ptr
)
->
m_NetCode
)
||
(
flag
&
FORCE_PADS
)
)
if
(
(
net_code
!=
(
*
ptr
)
->
GetNet
()
)
||
(
flag
&
FORCE_PADS
)
)
{
{
Place_1_Pad_Board
(
Pcb
,
*
ptr
,
HOLE
,
marge
,
WRITE_CELL
);
Place_1_Pad_Board
(
Pcb
,
*
ptr
,
HOLE
,
marge
,
WRITE_CELL
);
}
}
...
@@ -230,7 +230,7 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag )
...
@@ -230,7 +230,7 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag )
TmpSegm
->
m_Shape
=
(
(
EDGE_MODULE
*
)
PtModStruct
)
->
m_Shape
;
TmpSegm
->
m_Shape
=
(
(
EDGE_MODULE
*
)
PtModStruct
)
->
m_Shape
;
TmpSegm
->
m_Width
=
(
(
EDGE_MODULE
*
)
PtModStruct
)
->
m_Width
;
TmpSegm
->
m_Width
=
(
(
EDGE_MODULE
*
)
PtModStruct
)
->
m_Width
;
TmpSegm
->
m_Param
=
(
(
EDGE_MODULE
*
)
PtModStruct
)
->
m_Angle
;
TmpSegm
->
m_Param
=
(
(
EDGE_MODULE
*
)
PtModStruct
)
->
m_Angle
;
TmpSegm
->
m_NetCode
=
-
1
;
TmpSegm
->
SetNet
(
-
1
)
;
TraceSegmentPcb
(
Pcb
,
TmpSegm
,
HOLE
,
marge
,
WRITE_CELL
);
TraceSegmentPcb
(
Pcb
,
TmpSegm
,
HOLE
,
marge
,
WRITE_CELL
);
TraceSegmentPcb
(
Pcb
,
TmpSegm
,
VIA_IMPOSSIBLE
,
via_marge
,
TraceSegmentPcb
(
Pcb
,
TmpSegm
,
VIA_IMPOSSIBLE
,
via_marge
,
...
@@ -270,7 +270,7 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag )
...
@@ -270,7 +270,7 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag )
TmpSegm
->
m_Shape
=
DrawSegm
->
m_Shape
;
TmpSegm
->
m_Shape
=
DrawSegm
->
m_Shape
;
TmpSegm
->
m_Width
=
DrawSegm
->
m_Width
;
TmpSegm
->
m_Width
=
DrawSegm
->
m_Width
;
TmpSegm
->
m_Param
=
DrawSegm
->
m_Angle
;
TmpSegm
->
m_Param
=
DrawSegm
->
m_Angle
;
TmpSegm
->
m_NetCode
=
-
1
;
TmpSegm
->
SetNet
(
-
1
)
;
TraceSegmentPcb
(
Pcb
,
TmpSegm
,
type_cell
,
marge
,
WRITE_CELL
);
TraceSegmentPcb
(
Pcb
,
TmpSegm
,
type_cell
,
marge
,
WRITE_CELL
);
...
@@ -313,7 +313,7 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag )
...
@@ -313,7 +313,7 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag )
pt_segm
=
Pcb
->
m_Track
;
pt_segm
=
Pcb
->
m_Track
;
for
(
;
pt_segm
!=
NULL
;
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
)
for
(
;
pt_segm
!=
NULL
;
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
)
{
{
if
(
net_code
==
pt_segm
->
m_NetCode
)
if
(
net_code
==
pt_segm
->
GetNet
()
)
continue
;
continue
;
TraceSegmentPcb
(
Pcb
,
pt_segm
,
HOLE
,
marge
,
WRITE_CELL
);
TraceSegmentPcb
(
Pcb
,
pt_segm
,
HOLE
,
marge
,
WRITE_CELL
);
TraceSegmentPcb
(
Pcb
,
pt_segm
,
VIA_IMPOSSIBLE
,
via_marge
,
WRITE_OR_CELL
);
TraceSegmentPcb
(
Pcb
,
pt_segm
,
VIA_IMPOSSIBLE
,
via_marge
,
WRITE_OR_CELL
);
...
@@ -323,7 +323,7 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag )
...
@@ -323,7 +323,7 @@ void PlaceCells( BOARD* Pcb, int net_code, int flag )
pt_segm
=
(
TRACK
*
)
Pcb
->
m_Zone
;
pt_segm
=
(
TRACK
*
)
Pcb
->
m_Zone
;
for
(
;
pt_segm
!=
NULL
;
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
)
for
(
;
pt_segm
!=
NULL
;
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
)
{
{
if
(
net_code
==
pt_segm
->
m_NetCode
)
if
(
net_code
==
pt_segm
->
GetNet
()
)
continue
;
continue
;
TraceSegmentPcb
(
Pcb
,
pt_segm
,
HOLE
,
marge
,
WRITE_CELL
);
TraceSegmentPcb
(
Pcb
,
pt_segm
,
HOLE
,
marge
,
WRITE_CELL
);
TraceSegmentPcb
(
Pcb
,
pt_segm
,
VIA_IMPOSSIBLE
,
via_marge
,
WRITE_OR_CELL
);
TraceSegmentPcb
(
Pcb
,
pt_segm
,
VIA_IMPOSSIBLE
,
via_marge
,
WRITE_OR_CELL
);
...
@@ -357,7 +357,7 @@ int Build_Work( BOARD* Pcb, CHEVELU* pt_base_chevelu )
...
@@ -357,7 +357,7 @@ int Build_Work( BOARD* Pcb, CHEVELU* pt_base_chevelu )
continue
;
continue
;
pt_pad
=
pt_rats
->
pad_start
;
pt_pad
=
pt_rats
->
pad_start
;
current_net_code
=
pt_pad
->
m_NetCode
;
current_net_code
=
pt_pad
->
GetNet
()
;
pt_ch
=
pt_rats
;
pt_ch
=
pt_rats
;
r1
=
(
pt_pad
->
m_Pos
.
y
-
Pcb
->
m_BoundaryBox
.
m_Pos
.
y
+
demi_pas
)
/
g_GridRoutingSize
;
r1
=
(
pt_pad
->
m_Pos
.
y
-
Pcb
->
m_BoundaryBox
.
m_Pos
.
y
+
demi_pas
)
/
g_GridRoutingSize
;
...
...
pcbnew/class_board.cpp
View file @
3cd47555
...
@@ -568,7 +568,7 @@ EQUIPOT* BOARD::FindNet( int anetcode ) const
...
@@ -568,7 +568,7 @@ EQUIPOT* BOARD::FindNet( int anetcode ) const
EQUIPOT
*
net
=
(
EQUIPOT
*
)
m_Equipots
;
EQUIPOT
*
net
=
(
EQUIPOT
*
)
m_Equipots
;
while
(
net
)
while
(
net
)
{
{
if
(
net
->
m_NetCode
==
anetcode
)
if
(
net
->
GetNet
()
==
anetcode
)
break
;
break
;
net
=
(
EQUIPOT
*
)
net
->
Pnext
;
net
=
(
EQUIPOT
*
)
net
->
Pnext
;
}
}
...
...
pcbnew/class_board_item.cpp
View file @
3cd47555
...
@@ -33,7 +33,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
...
@@ -33,7 +33,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
{
{
case
PCB_EQUIPOT_STRUCT_TYPE
:
case
PCB_EQUIPOT_STRUCT_TYPE
:
text
<<
_
(
"Net"
)
<<
(
(
EQUIPOT
*
)
item
)
->
m_Netname
<<
wxT
(
" "
)
<<
text
<<
_
(
"Net"
)
<<
(
(
EQUIPOT
*
)
item
)
->
m_Netname
<<
wxT
(
" "
)
<<
(
(
EQUIPOT
*
)
item
)
->
m_NetCode
;
(
(
EQUIPOT
*
)
item
)
->
GetNet
()
;
break
;
break
;
case
TYPEMODULE
:
case
TYPEMODULE
:
...
@@ -60,7 +60,6 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
...
@@ -60,7 +60,6 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
break
;
break
;
case
TYPETEXTEMODULE
:
case
TYPETEXTEMODULE
:
switch
(
(
(
TEXTE_MODULE
*
)
item
)
->
m_Type
)
switch
(
(
(
TEXTE_MODULE
*
)
item
)
->
m_Type
)
{
{
case
TEXT_is_REFERENCE
:
case
TEXT_is_REFERENCE
:
...
@@ -78,7 +77,6 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
...
@@ -78,7 +77,6 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
<<
(
(
MODULE
*
)
GetParent
()
)
->
GetReference
();
<<
(
(
MODULE
*
)
GetParent
()
)
->
GetReference
();
break
;
break
;
}
}
break
;
break
;
case
TYPEEDGEMODULE
:
case
TYPEEDGEMODULE
:
...
@@ -124,13 +122,21 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
...
@@ -124,13 +122,21 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
break
;
break
;
case
TYPETRACK
:
case
TYPETRACK
:
text
<<
_
(
"Track"
)
<<
wxT
(
" "
)
<<
((
TRACK
*
)
item
)
->
ShowWidth
();
// deleting tracks requires all the information we can get to
net
=
aPcb
->
FindNet
(
((
TRACK
*
)
item
)
->
m_NetCode
);
// disambiguate all the crap under the cursor!
if
(
net
)
{
{
text
<<
wxT
(
" ["
)
<<
net
->
m_Netname
<<
wxT
(
"]"
);
wxString
txt
;
text
<<
_
(
"Track"
)
<<
wxT
(
" "
)
<<
((
TRACK
*
)
item
)
->
ShowWidth
();
net
=
aPcb
->
FindNet
(
((
TRACK
*
)
item
)
->
GetNet
()
);
if
(
net
)
{
text
<<
wxT
(
" ["
)
<<
net
->
m_Netname
<<
wxT
(
"]"
);
}
text
<<
_
(
" on "
)
<<
ReturnPcbLayerName
(
item
->
GetLayer
()
).
Trim
()
<<
wxT
(
" "
)
<<
_
(
"Net:"
)
<<
((
TRACK
*
)
item
)
->
GetNet
()
<<
wxT
(
" "
)
<<
_
(
"Length:"
)
<<
valeur_param
(
(
int
)
((
TRACK
*
)
item
)
->
GetLength
(),
txt
);
}
}
text
<<
_
(
" on "
)
<<
ReturnPcbLayerName
(
item
->
GetLayer
()
).
Trim
();
break
;
break
;
case
TYPEZONE
:
case
TYPEZONE
:
...
@@ -140,7 +146,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
...
@@ -140,7 +146,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
TimeStampText
.
Printf
(
wxT
(
"(%8.8X)"
),
item
->
m_TimeStamp
);
TimeStampText
.
Printf
(
wxT
(
"(%8.8X)"
),
item
->
m_TimeStamp
);
text
<<
TimeStampText
;
text
<<
TimeStampText
;
}
}
net
=
aPcb
->
FindNet
(
(
(
SEGZONE
*
)
item
)
->
m_NetCode
);
net
=
aPcb
->
FindNet
(
(
(
SEGZONE
*
)
item
)
->
GetNet
()
);
if
(
net
)
if
(
net
)
{
{
text
<<
wxT
(
" ["
)
<<
net
->
m_Netname
<<
wxT
(
"]"
);
text
<<
wxT
(
" ["
)
<<
net
->
m_Netname
<<
wxT
(
"]"
);
...
@@ -160,7 +166,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
...
@@ -160,7 +166,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
text
<<
wxT
(
" "
)
<<
_
(
"Buried"
);
text
<<
wxT
(
" "
)
<<
_
(
"Buried"
);
// else say nothing about normal vias
// else say nothing about normal vias
net
=
aPcb
->
FindNet
(
via
->
m_NetCode
);
net
=
aPcb
->
FindNet
(
via
->
GetNet
()
);
if
(
net
)
if
(
net
)
{
{
text
<<
wxT
(
" ["
)
<<
net
->
m_Netname
<<
wxT
(
"]"
);
text
<<
wxT
(
" ["
)
<<
net
->
m_Netname
<<
wxT
(
"]"
);
...
...
pcbnew/class_equipot.cpp
View file @
3cd47555
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
EQUIPOT
::
EQUIPOT
(
BOARD_ITEM
*
StructFather
)
:
EQUIPOT
::
EQUIPOT
(
BOARD_ITEM
*
StructFather
)
:
BOARD_ITEM
(
StructFather
,
PCB_EQUIPOT_STRUCT_TYPE
)
BOARD_ITEM
(
StructFather
,
PCB_EQUIPOT_STRUCT_TYPE
)
{
{
m_NetCode
=
0
;
SetNet
(
0
)
;
m_NbNodes
=
m_NbLink
=
m_NbNoconn
=
0
;
m_NbNodes
=
m_NbLink
=
m_NbNoconn
=
0
;
m_Masque_Layer
=
0
;
m_Masque_Layer
=
0
;
m_Masque_Plan
=
0
;
m_Masque_Plan
=
0
;
...
@@ -87,7 +87,7 @@ int EQUIPOT:: ReadEquipotDescr( FILE* File, int* LineNum )
...
@@ -87,7 +87,7 @@ int EQUIPOT:: ReadEquipotDescr( FILE* File, int* LineNum )
if
(
strncmp
(
Line
,
"Na"
,
2
)
==
0
)
/* Texte */
if
(
strncmp
(
Line
,
"Na"
,
2
)
==
0
)
/* Texte */
{
{
sscanf
(
Line
+
2
,
" %d"
,
&
tmp
);
sscanf
(
Line
+
2
,
" %d"
,
&
tmp
);
m_NetCode
=
tmp
;
SetNet
(
tmp
)
;
ReadDelimitedText
(
Ltmp
,
Line
+
2
,
sizeof
(
Ltmp
)
);
ReadDelimitedText
(
Ltmp
,
Line
+
2
,
sizeof
(
Ltmp
)
);
m_Netname
=
CONV_FROM_UTF8
(
Ltmp
);
m_Netname
=
CONV_FROM_UTF8
(
Ltmp
);
...
@@ -114,7 +114,7 @@ int EQUIPOT:: WriteEquipotDescr( FILE* File )
...
@@ -114,7 +114,7 @@ int EQUIPOT:: WriteEquipotDescr( FILE* File )
return
0
;
return
0
;
fprintf
(
File
,
"$EQUIPOT
\n
"
);
fprintf
(
File
,
"$EQUIPOT
\n
"
);
fprintf
(
File
,
"Na %d
\"
%.16s
\"\n
"
,
m_NetCode
,
CONV_TO_UTF8
(
m_Netname
)
);
fprintf
(
File
,
"Na %d
\"
%.16s
\"\n
"
,
GetNet
()
,
CONV_TO_UTF8
(
m_Netname
)
);
fprintf
(
File
,
"St %s
\n
"
,
"~"
);
fprintf
(
File
,
"St %s
\n
"
,
"~"
);
if
(
m_ForceWidth
)
if
(
m_ForceWidth
)
fprintf
(
File
,
"Lw %d
\n
"
,
m_ForceWidth
);
fprintf
(
File
,
"Lw %d
\n
"
,
m_ForceWidth
);
...
@@ -135,6 +135,6 @@ void EQUIPOT::Show( int nestLevel, std::ostream& os )
...
@@ -135,6 +135,6 @@ void EQUIPOT::Show( int nestLevel, std::ostream& os )
// 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
()
<<
" name=
\"
"
<<
m_Netname
.
mb_str
()
<<
'"'
<<
" name=
\"
"
<<
m_Netname
.
mb_str
()
<<
'"'
<<
" netcode=
\"
"
<<
m_NetCode
<<
"
\"
/>
\n
"
;
" netcode=
\"
"
<<
GetNet
()
<<
"
\"
/>
\n
"
;
}
}
#endif
#endif
pcbnew/class_equipot.h
View file @
3cd47555
...
@@ -7,10 +7,13 @@
...
@@ -7,10 +7,13 @@
class
EQUIPOT
:
public
BOARD_ITEM
class
EQUIPOT
:
public
BOARD_ITEM
{
{
private
:
int
m_NetCode
;
// numero de code interne du net
public
:
public
:
wxString
m_Netname
;
// nom du net
wxString
m_Netname
;
// nom du net
int
status
;
// no route, hight light...
int
status
;
// no route, hight light...
int
m_NetCode
;
// numero de code interne du net
int
m_NbNodes
;
// nombre de pads appartenant au net
int
m_NbNodes
;
// nombre de pads appartenant au net
int
m_NbLink
;
// nombre de chevelus
int
m_NbLink
;
// nombre de chevelus
int
m_NbNoconn
;
// nombre de chevelus actifs
int
m_NbNoconn
;
// nombre de chevelus actifs
...
@@ -32,6 +35,13 @@ public:
...
@@ -32,6 +35,13 @@ public:
int
ReadEquipotDescr
(
FILE
*
File
,
int
*
LineNum
);
int
ReadEquipotDescr
(
FILE
*
File
,
int
*
LineNum
);
int
WriteEquipotDescr
(
FILE
*
File
);
int
WriteEquipotDescr
(
FILE
*
File
);
/**
* Function GetNet
* @return int - the netcode
*/
int
GetNet
()
const
{
return
m_NetCode
;
}
void
SetNet
(
int
aNetCode
)
{
m_NetCode
=
aNetCode
;
}
/**
/**
* Function GetClass
* Function GetClass
...
...
pcbnew/class_pad.cpp
View file @
3cd47555
...
@@ -31,7 +31,7 @@ D_PAD::D_PAD( MODULE* parent ) :
...
@@ -31,7 +31,7 @@ D_PAD::D_PAD( MODULE* parent ) :
{
{
m_NumPadName
=
0
;
m_NumPadName
=
0
;
m_Masque_Layer
=
CUIVRE_LAYER
;
m_Masque_Layer
=
CUIVRE_LAYER
;
m_NetCode
=
0
;
/* Numero de net pour comparaisons rapides */
SetNet
(
0
);
/* Numero de net pour comparaisons rapides */
m_DrillShape
=
CIRCLE
;
// Drill shape = circle
m_DrillShape
=
CIRCLE
;
// Drill shape = circle
m_Size
.
x
=
m_Size
.
y
=
500
;
m_Size
.
x
=
m_Size
.
y
=
500
;
...
@@ -169,7 +169,7 @@ void D_PAD::Copy( D_PAD* source )
...
@@ -169,7 +169,7 @@ void D_PAD::Copy( D_PAD* source )
m_Masque_Layer
=
source
->
m_Masque_Layer
;
m_Masque_Layer
=
source
->
m_Masque_Layer
;
memcpy
(
m_Padname
,
source
->
m_Padname
,
sizeof
(
m_Padname
)
);
/* nom de la pastille */
memcpy
(
m_Padname
,
source
->
m_Padname
,
sizeof
(
m_Padname
)
);
/* nom de la pastille */
m_NetCode
=
source
->
m_NetCode
;
/* Numero de net pour comparaisons rapides */
SetNet
(
source
->
GetNet
()
);
/* Numero de net pour comparaisons rapides */
m_Drill
=
source
->
m_Drill
;
// Diametre de percage
m_Drill
=
source
->
m_Drill
;
// Diametre de percage
m_DrillShape
=
source
->
m_DrillShape
;
m_DrillShape
=
source
->
m_DrillShape
;
m_Offset
=
source
->
m_Offset
;
// Offset de la forme
m_Offset
=
source
->
m_Offset
;
// Offset de la forme
...
@@ -737,7 +737,10 @@ int D_PAD::ReadDescr( FILE* File, int* LineNum )
...
@@ -737,7 +737,10 @@ int D_PAD::ReadDescr( FILE* File, int* LineNum )
break
;
break
;
case
'N'
:
/* Lecture du netname */
case
'N'
:
/* Lecture du netname */
nn
=
sscanf
(
PtLine
,
"%d"
,
&
m_NetCode
);
int
netcode
;
nn
=
sscanf
(
PtLine
,
"%d"
,
&
netcode
);
SetNet
(
netcode
);
/* Lecture du netname */
/* Lecture du netname */
ReadDelimitedText
(
BufLine
,
PtLine
,
sizeof
(
BufLine
)
);
ReadDelimitedText
(
BufLine
,
PtLine
,
sizeof
(
BufLine
)
);
m_Netname
=
CONV_FROM_UTF8
(
StrPurge
(
BufLine
)
);
m_Netname
=
CONV_FROM_UTF8
(
StrPurge
(
BufLine
)
);
...
@@ -834,7 +837,7 @@ int D_PAD::WriteDescr( FILE* File )
...
@@ -834,7 +837,7 @@ int D_PAD::WriteDescr( FILE* File )
fprintf
(
File
,
"At %s N %8.8X
\n
"
,
texttype
,
m_Masque_Layer
);
fprintf
(
File
,
"At %s N %8.8X
\n
"
,
texttype
,
m_Masque_Layer
);
NbLigne
++
;
NbLigne
++
;
fprintf
(
File
,
"Ne %d
\"
%s
\"\n
"
,
m_NetCode
,
CONV_TO_UTF8
(
m_Netname
)
);
fprintf
(
File
,
"Ne %d
\"
%s
\"\n
"
,
GetNet
()
,
CONV_TO_UTF8
(
m_Netname
)
);
NbLigne
++
;
NbLigne
++
;
fprintf
(
File
,
"Po %d %d
\n
"
,
m_Pos0
.
x
,
m_Pos0
.
y
);
fprintf
(
File
,
"Po %d %d
\n
"
,
m_Pos0
.
x
,
m_Pos0
.
y
);
...
@@ -1095,7 +1098,7 @@ void D_PAD::Show( int nestLevel, std::ostream& os )
...
@@ -1095,7 +1098,7 @@ void D_PAD::Show( int nestLevel, std::ostream& os )
NestedSpace
(
nestLevel
,
os
)
<<
'<'
<<
GetClass
().
Lower
().
mb_str
()
<<
NestedSpace
(
nestLevel
,
os
)
<<
'<'
<<
GetClass
().
Lower
().
mb_str
()
<<
" num=
\"
"
<<
padname
<<
'"'
<<
" num=
\"
"
<<
padname
<<
'"'
<<
" net=
\"
"
<<
m_Netname
.
mb_str
()
<<
'"'
<<
" net=
\"
"
<<
m_Netname
.
mb_str
()
<<
'"'
<<
" netcode=
\"
"
<<
m_NetCode
<<
'"'
<<
" netcode=
\"
"
<<
GetNet
()
<<
'"'
<<
" layerMask=
\"
"
<<
layerMask
<<
'"'
<<
m_Pos
<<
"/>
\n
"
;
" layerMask=
\"
"
<<
layerMask
<<
'"'
<<
m_Pos
<<
"/>
\n
"
;
// NestedSpace( nestLevel+1, os ) << m_Text.mb_str() << '\n';
// NestedSpace( nestLevel+1, os ) << m_Text.mb_str() << '\n';
...
...
pcbnew/class_pad.h
View file @
3cd47555
...
@@ -21,6 +21,9 @@ class Pcb3D_GLCanvas;
...
@@ -21,6 +21,9 @@ class Pcb3D_GLCanvas;
/* Definition type Structure d'un pad */
/* Definition type Structure d'un pad */
class
D_PAD
:
public
BOARD_ITEM
class
D_PAD
:
public
BOARD_ITEM
{
{
private
:
int
m_NetCode
;
// Net number for fast comparisons
public
:
public
:
union
union
{
{
...
@@ -54,7 +57,6 @@ public:
...
@@ -54,7 +57,6 @@ public:
int
m_Attribut
;
// NORMAL, SMD, CONN
int
m_Attribut
;
// NORMAL, SMD, CONN
int
m_Orient
;
// in 1/10 degrees
int
m_Orient
;
// in 1/10 degrees
int
m_NetCode
;
// Net number for fast comparisons
int
m_logical_connexion
;
// variable used in rastnest computations
int
m_logical_connexion
;
// variable used in rastnest computations
// handle block number in ratsnet connection
// handle block number in ratsnet connection
...
@@ -88,6 +90,15 @@ public:
...
@@ -88,6 +90,15 @@ public:
void
ComputeRayon
();
// compute m_Rayon, rayon du cercle exinscrit
void
ComputeRayon
();
// compute m_Rayon, rayon du cercle exinscrit
const
wxPoint
ReturnShapePos
();
// retourne la position
const
wxPoint
ReturnShapePos
();
// retourne la position
/**
* Function GetNet
* @return int - the netcode
*/
int
GetNet
()
const
{
return
m_NetCode
;
}
void
SetNet
(
int
aNetCode
)
{
m_NetCode
=
aNetCode
;
}
/**
/**
* Function Display_Infos
* Function Display_Infos
* has knowledge about the frame and how and where to put status information
* has knowledge about the frame and how and where to put status information
...
...
pcbnew/class_track.cpp
View file @
3cd47555
...
@@ -28,8 +28,8 @@ TRACK::TRACK( BOARD_ITEM* StructFather, KICAD_T idtype ) :
...
@@ -28,8 +28,8 @@ TRACK::TRACK( BOARD_ITEM* StructFather, KICAD_T idtype ) :
m_Width
=
0
;
m_Width
=
0
;
m_Shape
=
S_SEGMENT
;
m_Shape
=
S_SEGMENT
;
start
=
end
=
NULL
;
start
=
end
=
NULL
;
m_NetCode
=
0
;
SetNet
(
0
)
;
m_Sous_Netcode
=
0
;
SetSubNet
(
0
)
;
m_Drill
=
-
1
;
m_Drill
=
-
1
;
m_Param
=
0
;
m_Param
=
0
;
}
}
...
@@ -73,7 +73,7 @@ TRACK::TRACK( const TRACK& Source ) :
...
@@ -73,7 +73,7 @@ TRACK::TRACK( const TRACK& Source ) :
BOARD_ITEM
(
Source
)
BOARD_ITEM
(
Source
)
{
{
m_Shape
=
Source
.
m_Shape
;
m_Shape
=
Source
.
m_Shape
;
m_NetCode
=
Source
.
m_NetCode
;
SetNet
(
Source
.
GetNet
()
)
;
m_Flags
=
Source
.
m_Flags
;
m_Flags
=
Source
.
m_Flags
;
m_TimeStamp
=
Source
.
m_TimeStamp
;
m_TimeStamp
=
Source
.
m_TimeStamp
;
SetStatus
(
Source
.
ReturnStatus
()
);
SetStatus
(
Source
.
ReturnStatus
()
);
...
@@ -81,7 +81,7 @@ TRACK::TRACK( const TRACK& Source ) :
...
@@ -81,7 +81,7 @@ TRACK::TRACK( const TRACK& Source ) :
m_End
=
Source
.
m_End
;
m_End
=
Source
.
m_End
;
m_Width
=
Source
.
m_Width
;
m_Width
=
Source
.
m_Width
;
m_Drill
=
Source
.
m_Drill
;
m_Drill
=
Source
.
m_Drill
;
m_Sous_Netcode
=
Source
.
m_Sous_Netcode
;
SetSubNet
(
Source
.
GetSubNet
()
)
;
m_Param
=
Source
.
m_Param
;
m_Param
=
Source
.
m_Param
;
}
}
...
@@ -121,6 +121,21 @@ bool TRACK::IsNull()
...
@@ -121,6 +121,21 @@ bool TRACK::IsNull()
}
}
/*************************************************************/
double
TRACK
::
GetLength
()
const
/*************************************************************/
{
int
dx
=
m_Start
.
x
-
m_End
.
x
;
int
dy
=
m_Start
.
y
-
m_End
.
y
;
double
dist
=
(
(
double
)
dx
*
dx
)
+
(
(
double
)
dy
*
dy
);
dist
=
sqrt
(
dist
);
return
dist
;
}
/*************************************************************/
/*************************************************************/
int
TRACK
::
IsPointOnEnds
(
const
wxPoint
&
point
,
int
min_dist
)
int
TRACK
::
IsPointOnEnds
(
const
wxPoint
&
point
,
int
min_dist
)
/*************************************************************/
/*************************************************************/
...
@@ -133,14 +148,14 @@ int TRACK::IsPointOnEnds( const wxPoint& point, int min_dist )
...
@@ -133,14 +148,14 @@ int TRACK::IsPointOnEnds( const wxPoint& point, int min_dist )
* if min_dist < 0: min_dist = track_width/2
* if min_dist < 0: min_dist = track_width/2
*/
*/
{
{
int
dx
,
dy
;
int
result
=
0
;
int
result
=
0
;
if
(
min_dist
<
0
)
if
(
min_dist
<
0
)
min_dist
=
m_Width
/
2
;
min_dist
=
m_Width
/
2
;
dx
=
m_Start
.
x
-
point
.
x
;
int
dx
=
m_Start
.
x
-
point
.
x
;
dy
=
m_Start
.
y
-
point
.
y
;
int
dy
=
m_Start
.
y
-
point
.
y
;
if
(
min_dist
==
0
)
if
(
min_dist
==
0
)
{
{
if
(
(
dx
==
0
)
&&
(
dy
==
0
)
)
if
(
(
dx
==
0
)
&&
(
dy
==
0
)
)
...
@@ -410,12 +425,12 @@ TRACK* TRACK::GetBestInsertPoint( BOARD* Pcb )
...
@@ -410,12 +425,12 @@ TRACK* TRACK::GetBestInsertPoint( BOARD* Pcb )
/* Traitement du debut de liste */
/* Traitement du debut de liste */
if
(
track
==
NULL
)
if
(
track
==
NULL
)
return
NULL
;
/* pas de piste ! */
return
NULL
;
/* pas de piste ! */
if
(
m_NetCode
<
track
->
m_NetCode
)
/* insertion en tete de liste */
if
(
GetNet
()
<
track
->
GetNet
()
)
/* insertion en tete de liste */
return
NULL
;
return
NULL
;
while
(
(
NextTrack
=
(
TRACK
*
)
track
->
Pnext
)
!=
NULL
)
while
(
(
NextTrack
=
(
TRACK
*
)
track
->
Pnext
)
!=
NULL
)
{
{
if
(
NextTrack
->
m_NetCode
>
this
->
m_NetCode
)
if
(
NextTrack
->
GetNet
()
>
this
->
GetNet
()
)
break
;
break
;
track
=
NextTrack
;
track
=
NextTrack
;
}
}
...
@@ -436,16 +451,19 @@ TRACK* TRACK::GetStartNetCode( int NetCode )
...
@@ -436,16 +451,19 @@ TRACK* TRACK::GetStartNetCode( int NetCode )
int
ii
=
0
;
int
ii
=
0
;
if
(
NetCode
==
-
1
)
if
(
NetCode
==
-
1
)
NetCode
=
m_NetCode
;
NetCode
=
GetNet
()
;
while
(
Track
!=
NULL
)
while
(
Track
!=
NULL
)
{
{
if
(
Track
->
m_NetCode
>
NetCode
)
if
(
Track
->
GetNet
()
>
NetCode
)
break
;
break
;
if
(
Track
->
m_NetCode
==
NetCode
)
if
(
Track
->
GetNet
()
==
NetCode
)
{
{
ii
++
;
break
;
ii
++
;
break
;
}
}
Track
=
(
TRACK
*
)
Track
->
Pnext
;
Track
=
(
TRACK
*
)
Track
->
Pnext
;
}
}
...
@@ -468,17 +486,20 @@ TRACK* TRACK::GetEndNetCode( int NetCode )
...
@@ -468,17 +486,20 @@ TRACK* TRACK::GetEndNetCode( int NetCode )
return
NULL
;
return
NULL
;
if
(
NetCode
==
-
1
)
if
(
NetCode
==
-
1
)
NetCode
=
m_NetCode
;
NetCode
=
GetNet
()
;
while
(
Track
!=
NULL
)
while
(
Track
!=
NULL
)
{
{
NextS
=
(
TRACK
*
)
Track
->
Pnext
;
NextS
=
(
TRACK
*
)
Track
->
Pnext
;
if
(
Track
->
m_NetCode
==
NetCode
)
if
(
Track
->
GetNet
()
==
NetCode
)
ii
++
;
ii
++
;
if
(
NextS
==
NULL
)
if
(
NextS
==
NULL
)
break
;
break
;
if
(
NextS
->
m_NetCode
>
NetCode
)
if
(
NextS
->
GetNet
()
>
NetCode
)
break
;
break
;
Track
=
NextS
;
Track
=
NextS
;
}
}
...
@@ -539,7 +560,7 @@ bool TRACK::WriteTrackDescr( FILE* File )
...
@@ -539,7 +560,7 @@ bool TRACK::WriteTrackDescr( FILE* File )
m_Start
.
x
,
m_Start
.
y
,
m_End
.
x
,
m_End
.
y
,
m_Width
,
m_Drill
);
m_Start
.
x
,
m_Start
.
y
,
m_End
.
x
,
m_End
.
y
,
m_Width
,
m_Drill
);
fprintf
(
File
,
"De %d %d %d %lX %X
\n
"
,
fprintf
(
File
,
"De %d %d %d %lX %X
\n
"
,
m_Layer
,
type
,
m_NetCode
,
m_Layer
,
type
,
GetNet
()
,
m_TimeStamp
,
ReturnStatus
()
);
m_TimeStamp
,
ReturnStatus
()
);
return
TRUE
;
return
TRUE
;
...
@@ -724,7 +745,7 @@ void TRACK::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -724,7 +745,7 @@ void TRACK::Display_Infos( WinEDA_DrawFrame* frame )
||
Type
()
==
TYPEZONE
||
Type
()
==
TYPEZONE
||
Type
()
==
TYPEVIA
)
||
Type
()
==
TYPEVIA
)
{
{
EQUIPOT
*
equipot
=
((
WinEDA_PcbFrame
*
)
frame
)
->
m_Pcb
->
FindNet
(
m_NetCode
);
EQUIPOT
*
equipot
=
((
WinEDA_PcbFrame
*
)
frame
)
->
m_Pcb
->
FindNet
(
GetNet
()
);
if
(
equipot
)
if
(
equipot
)
msg
=
equipot
->
m_Netname
;
msg
=
equipot
->
m_Netname
;
...
@@ -734,7 +755,7 @@ void TRACK::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -734,7 +755,7 @@ void TRACK::Display_Infos( WinEDA_DrawFrame* frame )
Affiche_1_Parametre
(
frame
,
text_pos
,
_
(
"NetName"
),
msg
,
RED
);
Affiche_1_Parametre
(
frame
,
text_pos
,
_
(
"NetName"
),
msg
,
RED
);
/* Affiche net code :*/
/* Affiche net code :*/
msg
.
Printf
(
wxT
(
"%d .%d"
),
m_NetCode
,
m_Sous_Netcode
);
msg
.
Printf
(
wxT
(
"%d .%d"
),
GetNet
(),
GetSubNet
()
);
text_pos
+=
18
;
text_pos
+=
18
;
Affiche_1_Parametre
(
frame
,
text_pos
,
_
(
"NetCode"
),
msg
,
RED
);
Affiche_1_Parametre
(
frame
,
text_pos
,
_
(
"NetCode"
),
msg
,
RED
);
}
}
...
@@ -861,7 +882,7 @@ void TRACK::Show( int nestLevel, std::ostream& os )
...
@@ -861,7 +882,7 @@ void TRACK::Show( int nestLevel, std::ostream& os )
" layer=
\"
"
<<
m_Layer
<<
'"'
<<
" layer=
\"
"
<<
m_Layer
<<
'"'
<<
" width=
\"
"
<<
m_Width
<<
'"'
<<
" width=
\"
"
<<
m_Width
<<
'"'
<<
// " drill=\"" << m_Drill << '"' <<
// " drill=\"" << m_Drill << '"' <<
" netcode=
\"
"
<<
m_NetCode
<<
"
\"
>"
<<
" netcode=
\"
"
<<
GetNet
()
<<
"
\"
>"
<<
"<start"
<<
m_Start
<<
"/>"
<<
"<start"
<<
m_Start
<<
"/>"
<<
"<end"
<<
m_End
<<
"/>"
;
"<end"
<<
m_End
<<
"/>"
;
...
@@ -900,7 +921,7 @@ void SEGVIA::Show( int nestLevel, std::ostream& os )
...
@@ -900,7 +921,7 @@ void SEGVIA::Show( int nestLevel, std::ostream& os )
<<
ReturnPcbLayerName
(
botLayer
).
Trim
().
mb_str
()
<<
'"'
<<
<<
ReturnPcbLayerName
(
botLayer
).
Trim
().
mb_str
()
<<
'"'
<<
" width=
\"
"
<<
m_Width
<<
'"'
<<
" width=
\"
"
<<
m_Width
<<
'"'
<<
" drill=
\"
"
<<
m_Drill
<<
'"'
<<
" drill=
\"
"
<<
m_Drill
<<
'"'
<<
" netcode=
\"
"
<<
m_NetCode
<<
"
\"
>"
<<
" netcode=
\"
"
<<
GetNet
()
<<
"
\"
>"
<<
"<pos"
<<
m_Start
<<
"/>"
;
"<pos"
<<
m_Start
<<
"/>"
;
os
<<
"</"
<<
GetClass
().
Lower
().
mb_str
()
<<
">
\n
"
;
os
<<
"</"
<<
GetClass
().
Lower
().
mb_str
()
<<
">
\n
"
;
...
...
pcbnew/class_track.h
View file @
3cd47555
...
@@ -32,14 +32,14 @@ public:
...
@@ -32,14 +32,14 @@ public:
BOARD_ITEM
*
start
;
// pointers on a connected item (pad or track)
BOARD_ITEM
*
start
;
// pointers on a connected item (pad or track)
BOARD_ITEM
*
end
;
BOARD_ITEM
*
end
;
int
m_NetCode
;
// Net number
int
m_Sous_Netcode
;
/* In rastnest routines : for the current net,
* block number (number common to the current connected items found) */
// chain = 0 indique une connexion non encore traitee
// chain = 0 indique une connexion non encore traitee
int
m_Param
;
// Auxiliary variable ( used in some computations )
int
m_Param
;
// Auxiliary variable ( used in some computations )
protected
:
protected
:
int
m_NetCode
;
// Net number
int
m_Sous_Netcode
;
/* In rastnest routines : for the current net,
* block number (number common to the current connected items found) */
TRACK
(
const
TRACK
&
track
);
// protected so Copy() is used instead.
TRACK
(
const
TRACK
&
track
);
// protected so Copy() is used instead.
public
:
public
:
...
@@ -90,6 +90,30 @@ public:
...
@@ -90,6 +90,30 @@ public:
/* Recherche de la fin du net */
/* Recherche de la fin du net */
TRACK
*
GetEndNetCode
(
int
NetCode
);
TRACK
*
GetEndNetCode
(
int
NetCode
);
/**
* Function GetNet
* @return int - the net code.
*/
int
GetNet
()
const
{
return
m_NetCode
;
}
void
SetNet
(
int
aNetCode
)
{
m_NetCode
=
aNetCode
;
}
/**
* Function GetSubNet
* @return int - the sub net code.
*/
int
GetSubNet
()
const
{
return
m_Sous_Netcode
;
}
void
SetSubNet
(
int
aSubNetCode
)
{
m_Sous_Netcode
=
aSubNetCode
;
}
/**
* Function GetLength
* returns the length of the track using the hypotenuse calculation.
* @return double - the length of the track
*/
double
GetLength
()
const
;
/* Display on screen: */
/* Display on screen: */
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
int
draw_mode
);
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
int
draw_mode
);
...
...
pcbnew/clean.cpp
View file @
3cd47555
...
@@ -207,9 +207,9 @@ static void suppression_piste_non_connectee( WinEDA_PcbFrame* frame, wxDC* DC )
...
@@ -207,9 +207,9 @@ static void suppression_piste_non_connectee( WinEDA_PcbFrame* frame, wxDC* DC )
if
(
frame
->
DrawPanel
->
m_AbortRequest
)
if
(
frame
->
DrawPanel
->
m_AbortRequest
)
break
;
break
;
if
(
PtSegm
->
m_NetCode
!=
oldnetcode
)
if
(
PtSegm
->
GetNet
()
!=
oldnetcode
)
{
{
PtStartNetCode
=
PtSegm
;
oldnetcode
=
PtSegm
->
m_NetCode
;
PtStartNetCode
=
PtSegm
;
oldnetcode
=
PtSegm
->
GetNet
()
;
}
}
flag_erase
=
0
;
type_end
=
0
;
flag_erase
=
0
;
type_end
=
0
;
...
@@ -381,7 +381,7 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
...
@@ -381,7 +381,7 @@ static int clean_segments( WinEDA_PcbFrame* frame, wxDC* DC )
continue
;
continue
;
if
(
PtSegm
->
GetLayer
()
!=
pt_aux
->
GetLayer
()
)
if
(
PtSegm
->
GetLayer
()
!=
pt_aux
->
GetLayer
()
)
continue
;
continue
;
if
(
PtSegm
->
m_NetCode
!=
pt_aux
->
m_NetCode
)
if
(
PtSegm
->
GetNet
()
!=
pt_aux
->
GetNet
()
)
break
;
break
;
if
(
(
PtSegm
->
m_Start
.
x
==
pt_aux
->
m_Start
.
x
)
if
(
(
PtSegm
->
m_Start
.
x
==
pt_aux
->
m_Start
.
x
)
...
@@ -676,14 +676,14 @@ int Netliste_Controle_piste( WinEDA_PcbFrame* frame, wxDC* DC, int affiche )
...
@@ -676,14 +676,14 @@ int Netliste_Controle_piste( WinEDA_PcbFrame* frame, wxDC* DC, int affiche )
net_code_s
=
-
1
;
net_code_s
=
-
1
;
if
(
(
PtSegm
->
start
!=
NULL
)
if
(
(
PtSegm
->
start
!=
NULL
)
&&
(
(
(
EDA_BaseStruct
*
)
(
PtSegm
->
start
)
)
->
Type
()
==
TYPEPAD
)
)
&&
(
(
(
EDA_BaseStruct
*
)
(
PtSegm
->
start
)
)
->
Type
()
==
TYPEPAD
)
)
net_code_s
=
(
(
D_PAD
*
)
(
PtSegm
->
start
)
)
->
m_NetCode
;
net_code_s
=
(
(
D_PAD
*
)
(
PtSegm
->
start
)
)
->
GetNet
()
;
else
else
{
{
pt_aux
=
Locate_Piste_Connectee
(
PtSegm
,
frame
->
m_Pcb
->
m_Track
,
pt_aux
=
Locate_Piste_Connectee
(
PtSegm
,
frame
->
m_Pcb
->
m_Track
,
NULL
,
START
);
NULL
,
START
);
if
(
pt_aux
)
if
(
pt_aux
)
net_code_s
=
pt_aux
->
m_NetCode
;
net_code_s
=
pt_aux
->
GetNet
()
;
}
}
if
(
net_code_s
<
0
)
if
(
net_code_s
<
0
)
continue
;
/* Extremite en l'air */
continue
;
/* Extremite en l'air */
...
@@ -692,14 +692,14 @@ int Netliste_Controle_piste( WinEDA_PcbFrame* frame, wxDC* DC, int affiche )
...
@@ -692,14 +692,14 @@ int Netliste_Controle_piste( WinEDA_PcbFrame* frame, wxDC* DC, int affiche )
net_code_e
=
-
1
;
net_code_e
=
-
1
;
if
(
(
PtSegm
->
end
!=
NULL
)
if
(
(
PtSegm
->
end
!=
NULL
)
&&
(
(
(
EDA_BaseStruct
*
)
(
PtSegm
->
end
)
)
->
Type
()
==
TYPEPAD
)
)
&&
(
(
(
EDA_BaseStruct
*
)
(
PtSegm
->
end
)
)
->
Type
()
==
TYPEPAD
)
)
net_code_e
=
(
(
D_PAD
*
)
(
PtSegm
->
end
)
)
->
m_NetCode
;
net_code_e
=
(
(
D_PAD
*
)
(
PtSegm
->
end
)
)
->
GetNet
()
;
else
else
{
{
pt_aux
=
Locate_Piste_Connectee
(
PtSegm
,
frame
->
m_Pcb
->
m_Track
,
pt_aux
=
Locate_Piste_Connectee
(
PtSegm
,
frame
->
m_Pcb
->
m_Track
,
NULL
,
END
);
NULL
,
END
);
if
(
pt_aux
)
if
(
pt_aux
)
net_code_e
=
pt_aux
->
m_NetCode
;
net_code_e
=
pt_aux
->
GetNet
()
;
}
}
if
(
net_code_e
<
0
)
if
(
net_code_e
<
0
)
...
...
pcbnew/connect.cpp
View file @
3cd47555
...
@@ -51,7 +51,7 @@ static int change_equipot( TRACK* pt_start_conn, TRACK* pt_end_conn,
...
@@ -51,7 +51,7 @@ static int change_equipot( TRACK* pt_start_conn, TRACK* pt_end_conn,
pt_conn
=
pt_start_conn
;
pt_conn
=
pt_start_conn
;
for
(
;
pt_conn
!=
NULL
;
pt_conn
=
(
TRACK
*
)
pt_conn
->
Pnext
)
for
(
;
pt_conn
!=
NULL
;
pt_conn
=
(
TRACK
*
)
pt_conn
->
Pnext
)
{
{
if
(
pt_conn
->
m_Sous_Netcode
!=
old_val
)
if
(
pt_conn
->
GetSubNet
()
!=
old_val
)
{
{
if
(
pt_conn
==
pt_end_conn
)
if
(
pt_conn
==
pt_end_conn
)
break
;
break
;
...
@@ -59,20 +59,20 @@ static int change_equipot( TRACK* pt_start_conn, TRACK* pt_end_conn,
...
@@ -59,20 +59,20 @@ static int change_equipot( TRACK* pt_start_conn, TRACK* pt_end_conn,
}
}
nb_change
++
;
nb_change
++
;
pt_conn
->
m_Sous_Netcode
=
new_val
;
pt_conn
->
SetSubNet
(
new_val
)
;
if
(
pt_conn
->
start
&&
(
pt_conn
->
start
->
Type
()
==
TYPEPAD
)
)
if
(
pt_conn
->
start
&&
(
pt_conn
->
start
->
Type
()
==
TYPEPAD
)
)
{
{
pt_pad
=
(
D_PAD
*
)
(
pt_conn
->
start
);
pt_pad
=
(
D_PAD
*
)
(
pt_conn
->
start
);
if
(
pt_pad
->
m_physical_connexion
==
old_val
)
if
(
pt_pad
->
m_physical_connexion
==
old_val
)
pt_pad
->
m_physical_connexion
=
pt_conn
->
m_Sous_Netcode
;
pt_pad
->
m_physical_connexion
=
pt_conn
->
GetSubNet
()
;
}
}
if
(
pt_conn
->
end
&&
(
pt_conn
->
end
->
Type
()
==
TYPEPAD
)
)
if
(
pt_conn
->
end
&&
(
pt_conn
->
end
->
Type
()
==
TYPEPAD
)
)
{
{
pt_pad
=
(
D_PAD
*
)
(
pt_conn
->
end
);
pt_pad
=
(
D_PAD
*
)
(
pt_conn
->
end
);
if
(
pt_pad
->
m_physical_connexion
==
old_val
)
if
(
pt_pad
->
m_physical_connexion
==
old_val
)
pt_pad
->
m_physical_connexion
=
pt_conn
->
m_Sous_Netcode
;
pt_pad
->
m_physical_connexion
=
pt_conn
->
GetSubNet
()
;
}
}
if
(
pt_conn
==
pt_end_conn
)
if
(
pt_conn
==
pt_end_conn
)
break
;
break
;
...
@@ -105,7 +105,7 @@ static void propage_equipot( TRACK* pt_start_conn, TRACK* pt_end_conn )
...
@@ -105,7 +105,7 @@ static void propage_equipot( TRACK* pt_start_conn, TRACK* pt_end_conn )
pt_conn
=
pt_start_conn
;
pt_conn
=
pt_start_conn
;
for
(
;
pt_conn
!=
NULL
;
pt_conn
=
(
TRACK
*
)
pt_conn
->
Pnext
)
for
(
;
pt_conn
!=
NULL
;
pt_conn
=
(
TRACK
*
)
pt_conn
->
Pnext
)
{
{
pt_conn
->
m_Sous_Netcode
=
0
;
pt_conn
->
SetSubNet
(
0
)
;
PtStruct
=
pt_conn
->
start
;
PtStruct
=
pt_conn
->
start
;
if
(
PtStruct
&&
(
PtStruct
->
Type
()
==
TYPEPAD
)
)
if
(
PtStruct
&&
(
PtStruct
->
Type
()
==
TYPEPAD
)
)
(
(
D_PAD
*
)
PtStruct
)
->
m_physical_connexion
=
0
;
(
(
D_PAD
*
)
PtStruct
)
->
m_physical_connexion
=
0
;
...
@@ -119,7 +119,7 @@ static void propage_equipot( TRACK* pt_start_conn, TRACK* pt_end_conn )
...
@@ -119,7 +119,7 @@ static void propage_equipot( TRACK* pt_start_conn, TRACK* pt_end_conn )
}
}
sous_net_code
=
1
;
sous_net_code
=
1
;
pt_start_conn
->
m_Sous_Netcode
=
sous_net_code
;
pt_start_conn
->
SetSubNet
(
sous_net_code
)
;
/* debut du calcul de propagation */
/* debut du calcul de propagation */
pt_conn
=
pt_start_conn
;
pt_conn
=
pt_start_conn
;
...
@@ -127,31 +127,32 @@ static void propage_equipot( TRACK* pt_start_conn, TRACK* pt_end_conn )
...
@@ -127,31 +127,32 @@ static void propage_equipot( TRACK* pt_start_conn, TRACK* pt_end_conn )
{
{
/* Traitement des connexions a pads */
/* Traitement des connexions a pads */
PtStruct
=
pt_conn
->
start
;
PtStruct
=
pt_conn
->
start
;
if
(
PtStruct
&&
(
PtStruct
->
Type
()
==
TYPEPAD
)
)
/* la connexion debute sur 1 pad */
/* la connexion debute sur 1 pad */
if
(
PtStruct
&&
(
PtStruct
->
Type
()
==
TYPEPAD
)
)
{
{
pt_pad
=
(
D_PAD
*
)
PtStruct
;
pt_pad
=
(
D_PAD
*
)
PtStruct
;
if
(
pt_conn
->
m_Sous_Netcode
)
/* la connexion fait deja partie d'une chaine */
if
(
pt_conn
->
GetSubNet
()
)
/* la connexion fait deja partie d'une chaine */
{
{
if
(
pt_pad
->
m_physical_connexion
>
0
)
/* le pad fait aussi partie d'une chaine */
if
(
pt_pad
->
m_physical_connexion
>
0
)
/* le pad fait aussi partie d'une chaine */
{
{
change_equipot
(
pt_start_conn
,
pt_end_conn
,
change_equipot
(
pt_start_conn
,
pt_end_conn
,
pt_pad
->
m_physical_connexion
,
pt_conn
->
m_Sous_Netcode
);
pt_pad
->
m_physical_connexion
,
pt_conn
->
GetSubNet
()
);
}
}
else
else
pt_pad
->
m_physical_connexion
=
pt_conn
->
m_Sous_Netcode
;
pt_pad
->
m_physical_connexion
=
pt_conn
->
GetSubNet
()
;
}
}
else
/* la connexion ne fait pas partie encore d'une chaine */
else
/* la connexion ne fait pas partie encore d'une chaine */
{
{
if
(
pt_pad
->
m_physical_connexion
>
0
)
if
(
pt_pad
->
m_physical_connexion
>
0
)
{
{
pt_conn
->
m_Sous_Netcode
=
pt_pad
->
m_physical_connexion
;
pt_conn
->
SetSubNet
(
pt_pad
->
m_physical_connexion
)
;
}
}
else
else
{
{
sous_net_code
++
;
sous_net_code
++
;
pt_conn
->
m_Sous_Netcode
=
sous_net_code
;
pt_conn
->
SetSubNet
(
sous_net_code
)
;
pt_pad
->
m_physical_connexion
=
pt_conn
->
m_Sous_Netcode
;
pt_pad
->
m_physical_connexion
=
pt_conn
->
GetSubNet
()
;
}
}
}
}
}
}
...
@@ -161,26 +162,27 @@ static void propage_equipot( TRACK* pt_start_conn, TRACK* pt_end_conn )
...
@@ -161,26 +162,27 @@ static void propage_equipot( TRACK* pt_start_conn, TRACK* pt_end_conn )
/* la connexion finit sur 1 pad */
/* la connexion finit sur 1 pad */
{
{
pt_pad
=
(
D_PAD
*
)
PtStruct
;
pt_pad
=
(
D_PAD
*
)
PtStruct
;
if
(
pt_conn
->
m_Sous_Netcode
)
if
(
pt_conn
->
GetSubNet
()
)
{
{
if
(
pt_pad
->
m_physical_connexion
>
0
)
if
(
pt_pad
->
m_physical_connexion
>
0
)
{
{
change_equipot
(
pt_start_conn
,
pt_end_conn
,
change_equipot
(
pt_start_conn
,
pt_end_conn
,
pt_pad
->
m_physical_connexion
,
pt_conn
->
m_Sous_Netcode
);
pt_pad
->
m_physical_connexion
,
pt_conn
->
GetSubNet
()
);
}
}
else
else
pt_pad
->
m_physical_connexion
=
pt_conn
->
m_Sous_Netcode
;
pt_pad
->
m_physical_connexion
=
pt_conn
->
GetSubNet
()
;
}
}
else
else
{
{
if
(
pt_pad
->
m_physical_connexion
>
0
)
if
(
pt_pad
->
m_physical_connexion
>
0
)
{
{
pt_conn
->
m_Sous_Netcode
=
pt_pad
->
m_physical_connexion
;
pt_conn
->
SetSubNet
(
pt_pad
->
m_physical_connexion
)
;
}
}
else
else
{
{
sous_net_code
++
;
pt_conn
->
m_Sous_Netcode
=
sous_net_code
;
sous_net_code
++
;
pt_pad
->
m_physical_connexion
=
pt_conn
->
m_Sous_Netcode
;
pt_conn
->
SetSubNet
(
sous_net_code
);
pt_pad
->
m_physical_connexion
=
pt_conn
->
GetSubNet
();
}
}
}
}
}
}
...
@@ -193,28 +195,29 @@ static void propage_equipot( TRACK* pt_start_conn, TRACK* pt_end_conn )
...
@@ -193,28 +195,29 @@ static void propage_equipot( TRACK* pt_start_conn, TRACK* pt_end_conn )
/* debut sur une autre piste */
/* debut sur une autre piste */
pt_autre_piste
=
(
TRACK
*
)
PtStruct
;
pt_autre_piste
=
(
TRACK
*
)
PtStruct
;
if
(
pt_conn
->
m_Sous_Netcode
)
/* La connexion fait deja partie d'un block */
if
(
pt_conn
->
GetSubNet
()
)
/* La connexion fait deja partie d'un block */
{
{
if
(
pt_autre_piste
->
m_Sous_Netcode
)
if
(
pt_autre_piste
->
GetSubNet
()
)
{
{
change_equipot
(
pt_start_conn
,
pt_end_conn
,
change_equipot
(
pt_start_conn
,
pt_end_conn
,
pt_autre_piste
->
m_Sous_Netcode
,
pt_conn
->
m_Sous_Netcode
);
pt_autre_piste
->
GetSubNet
(),
pt_conn
->
GetSubNet
()
);
}
}
else
else
{
{
pt_autre_piste
->
m_Sous_Netcode
=
pt_conn
->
m_Sous_Netcode
;
pt_autre_piste
->
SetSubNet
(
pt_conn
->
GetSubNet
()
)
;
}
}
}
}
else
/* La connexion ne fait partie d'aucun block */
else
/* La connexion ne fait partie d'aucun block */
{
{
if
(
pt_autre_piste
->
m_Sous_Netcode
)
if
(
pt_autre_piste
->
GetSubNet
()
)
{
{
pt_conn
->
m_Sous_Netcode
=
pt_autre_piste
->
m_Sous_Netcode
;
pt_conn
->
SetSubNet
(
pt_autre_piste
->
GetSubNet
()
)
;
}
}
else
else
{
{
sous_net_code
++
;
pt_conn
->
m_Sous_Netcode
=
sous_net_code
;
sous_net_code
++
;
pt_autre_piste
->
m_Sous_Netcode
=
pt_conn
->
m_Sous_Netcode
;
pt_conn
->
SetSubNet
(
sous_net_code
);
pt_autre_piste
->
SetSubNet
(
pt_conn
->
GetSubNet
()
);
}
}
}
}
}
}
...
@@ -225,26 +228,27 @@ static void propage_equipot( TRACK* pt_start_conn, TRACK* pt_end_conn )
...
@@ -225,26 +228,27 @@ static void propage_equipot( TRACK* pt_start_conn, TRACK* pt_end_conn )
/* fin connectee a une autre piste */
/* fin connectee a une autre piste */
pt_autre_piste
=
(
TRACK
*
)
PtStruct
;
pt_autre_piste
=
(
TRACK
*
)
PtStruct
;
if
(
pt_conn
->
m_Sous_Netcode
)
/* La connexion fait deja partie d'un block */
if
(
pt_conn
->
GetSubNet
()
)
/* La connexion fait deja partie d'un block */
{
{
if
(
pt_autre_piste
->
m_Sous_Netcode
)
if
(
pt_autre_piste
->
GetSubNet
()
)
{
{
change_equipot
(
pt_start_conn
,
pt_end_conn
,
change_equipot
(
pt_start_conn
,
pt_end_conn
,
pt_autre_piste
->
m_Sous_Netcode
,
pt_conn
->
m_Sous_Netcode
);
pt_autre_piste
->
GetSubNet
(),
pt_conn
->
GetSubNet
()
);
}
}
else
else
pt_autre_piste
->
m_Sous_Netcode
=
pt_conn
->
m_Sous_Netcode
;
pt_autre_piste
->
SetSubNet
(
pt_conn
->
GetSubNet
()
)
;
}
}
else
/* La connexion ne fait partie d'aucun block */
else
/* La connexion ne fait partie d'aucun block */
{
{
if
(
pt_autre_piste
->
m_Sous_Netcode
)
if
(
pt_autre_piste
->
GetSubNet
()
)
{
{
pt_conn
->
m_Sous_Netcode
=
pt_autre_piste
->
m_Sous_Netcode
;
pt_conn
->
SetSubNet
(
pt_autre_piste
->
GetSubNet
()
)
;
}
}
else
else
{
{
sous_net_code
++
;
pt_conn
->
m_Sous_Netcode
=
sous_net_code
;
sous_net_code
++
;
pt_autre_piste
->
m_Sous_Netcode
=
pt_conn
->
m_Sous_Netcode
;
pt_conn
->
SetSubNet
(
sous_net_code
);
pt_autre_piste
->
SetSubNet
(
pt_conn
->
GetSubNet
()
);
}
}
}
}
}
}
...
@@ -287,7 +291,7 @@ void WinEDA_BasePcbFrame::test_connexions( wxDC* DC )
...
@@ -287,7 +291,7 @@ void WinEDA_BasePcbFrame::test_connexions( wxDC* DC )
pt_start_conn
=
m_Pcb
->
m_Track
;
pt_start_conn
=
m_Pcb
->
m_Track
;
while
(
pt_start_conn
!=
NULL
)
while
(
pt_start_conn
!=
NULL
)
{
{
current_net_code
=
pt_start_conn
->
m_NetCode
;
current_net_code
=
pt_start_conn
->
GetNet
()
;
pt_end_conn
=
pt_start_conn
->
GetEndNetCode
(
current_net_code
);
pt_end_conn
=
pt_start_conn
->
GetEndNetCode
(
current_net_code
);
/* Calcul des connexions type segment du net courant */
/* Calcul des connexions type segment du net courant */
...
@@ -323,7 +327,7 @@ void WinEDA_BasePcbFrame::Recalcule_all_net_connexion( wxDC* DC )
...
@@ -323,7 +327,7 @@ void WinEDA_BasePcbFrame::Recalcule_all_net_connexion( wxDC* DC )
while
(
EndConn
->
Pnext
)
while
(
EndConn
->
Pnext
)
EndConn
=
(
TRACK
*
)
EndConn
->
Pnext
;
EndConn
=
(
TRACK
*
)
EndConn
->
Pnext
;
net_code_max
=
EndConn
->
m_NetCode
;
net_code_max
=
EndConn
->
GetNet
()
;
for
(
net_code
=
0
;
net_code
<=
net_code_max
;
net_code
++
)
for
(
net_code
=
0
;
net_code
<=
net_code_max
;
net_code
++
)
{
{
...
@@ -354,11 +358,13 @@ void WinEDA_BasePcbFrame::test_1_net_connexion( wxDC* DC, int net_code )
...
@@ -354,11 +358,13 @@ void WinEDA_BasePcbFrame::test_1_net_connexion( wxDC* DC, int net_code )
pt_pad
=
(
LISTE_PAD
*
)
m_Pcb
->
m_Pads
;
pt_pad
=
(
LISTE_PAD
*
)
m_Pcb
->
m_Pads
;
for
(
ii
=
0
;
ii
<
m_Pcb
->
m_NbPads
;
ii
++
,
pt_pad
++
)
for
(
ii
=
0
;
ii
<
m_Pcb
->
m_NbPads
;
ii
++
,
pt_pad
++
)
{
{
int
pad_net_code
=
(
*
pt_pad
)
->
m_NetCode
;
int
pad_net_code
=
(
*
pt_pad
)
->
GetNet
()
;
if
(
pad_net_code
<
net_code
)
if
(
pad_net_code
<
net_code
)
continue
;
continue
;
if
(
pad_net_code
>
net_code
)
if
(
pad_net_code
>
net_code
)
break
;
break
;
(
*
pt_pad
)
->
m_physical_connexion
=
0
;
(
*
pt_pad
)
->
m_physical_connexion
=
0
;
}
}
...
@@ -412,10 +418,11 @@ static void calcule_connexite_1_net( TRACK* pt_start_conn, TRACK* pt_end_conn )
...
@@ -412,10 +418,11 @@ static void calcule_connexite_1_net( TRACK* pt_start_conn, TRACK* pt_end_conn )
/* Raz des pointeurs sur pistes */
/* Raz des pointeurs sur pistes */
for
(
Track
=
pt_start_conn
;
Track
!=
NULL
;
Track
=
(
TRACK
*
)
Track
->
Pnext
)
for
(
Track
=
pt_start_conn
;
Track
!=
NULL
;
Track
=
(
TRACK
*
)
Track
->
Pnext
)
{
{
Track
->
m_Sous_Netcode
=
0
;
Track
->
SetSubNet
(
0
)
;
if
(
Track
->
GetState
(
BEGIN_ONPAD
)
==
0
)
if
(
Track
->
GetState
(
BEGIN_ONPAD
)
==
0
)
Track
->
start
=
NULL
;
Track
->
start
=
NULL
;
if
(
Track
->
GetState
(
END_ONPAD
)
==
0
)
if
(
Track
->
GetState
(
END_ONPAD
)
==
0
)
Track
->
end
=
NULL
;
Track
->
end
=
NULL
;
...
@@ -433,11 +440,13 @@ static void calcule_connexite_1_net( TRACK* pt_start_conn, TRACK* pt_end_conn )
...
@@ -433,11 +440,13 @@ static void calcule_connexite_1_net( TRACK* pt_start_conn, TRACK* pt_end_conn )
for
(
pt_segm
=
pt_start_conn
;
pt_segm
!=
NULL
;
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
)
for
(
pt_segm
=
pt_start_conn
;
pt_segm
!=
NULL
;
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
)
{
{
int
curlayermask
=
pt_segm
->
ReturnMaskLayer
();
int
curlayermask
=
pt_segm
->
ReturnMaskLayer
();
if
(
!
pt_segm
->
start
&&
(
pt_segm
->
m_Start
==
Track
->
m_Start
)
if
(
!
pt_segm
->
start
&&
(
pt_segm
->
m_Start
==
Track
->
m_Start
)
&&
(
layermask
&
curlayermask
)
)
&&
(
layermask
&
curlayermask
)
)
{
{
pt_segm
->
start
=
Track
;
pt_segm
->
start
=
Track
;
}
}
if
(
!
pt_segm
->
end
&&
(
pt_segm
->
m_End
==
Track
->
m_Start
)
if
(
!
pt_segm
->
end
&&
(
pt_segm
->
m_End
==
Track
->
m_Start
)
&&
(
layermask
&
curlayermask
)
)
&&
(
layermask
&
curlayermask
)
)
{
{
...
@@ -513,11 +522,15 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste,
...
@@ -513,11 +522,15 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste,
{
{
pad
=
*
ptr_pad
;
pad
=
*
ptr_pad
;
ii
=
nb_pad
;
ii
=
nb_pad
;
nb_pad
>>=
1
;
if
(
(
ii
&
1
)
&&
(
ii
>
1
)
)
nb_pad
>>=
1
;
if
(
(
ii
&
1
)
&&
(
ii
>
1
)
)
nb_pad
++
;
nb_pad
++
;
if
(
pad
->
m_Pos
.
x
<
px
)
/* on doit chercher plus loin */
if
(
pad
->
m_Pos
.
x
<
px
)
/* on doit chercher plus loin */
{
{
ptr_pad
+=
nb_pad
;
if
(
ptr_pad
>
lim
)
ptr_pad
+=
nb_pad
;
if
(
ptr_pad
>
lim
)
ptr_pad
=
lim
;
ptr_pad
=
lim
;
continue
;
continue
;
}
}
...
@@ -547,11 +560,14 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste,
...
@@ -547,11 +560,14 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste,
{
{
if
(
ptr_pad
>
lim
)
if
(
ptr_pad
>
lim
)
return
NULL
;
/* hors zone */
return
NULL
;
/* hors zone */
pad
=
*
ptr_pad
;
pad
=
*
ptr_pad
;
if
(
pad
->
m_Pos
.
x
!=
px
)
if
(
pad
->
m_Pos
.
x
!=
px
)
return
NULL
;
/* hors zone */
return
NULL
;
/* hors zone */
if
(
pad
->
m_Pos
.
y
!=
py
)
if
(
pad
->
m_Pos
.
y
!=
py
)
continue
;
continue
;
/* Pad peut-etre trouve ici: il doit etre sur la bonne couche */
/* Pad peut-etre trouve ici: il doit etre sur la bonne couche */
if
(
pad
->
m_Masque_Layer
&
masque_layer
)
if
(
pad
->
m_Masque_Layer
&
masque_layer
)
return
pad
;
return
pad
;
...
@@ -563,7 +579,7 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste,
...
@@ -563,7 +579,7 @@ static D_PAD* SuperFast_Locate_Pad_Connecte( BOARD* pcb, LISTE_PAD* pt_liste,
}
}
static
int
SortPadsByXCoord
(
void
*
pt_ref
,
void
*
pt_comp
)
static
int
SortPadsByXCoord
(
const
void
*
pt_ref
,
const
void
*
pt_comp
)
/* used to Sort a pad list by x coordinate value
/* used to Sort a pad list by x coordinate value
*/
*/
...
@@ -581,14 +597,13 @@ LISTE_PAD* CreateSortedPadListByXCoord( BOARD* pcb )
...
@@ -581,14 +597,13 @@ LISTE_PAD* CreateSortedPadListByXCoord( BOARD* pcb )
/* Create a sorted list of pointers to pads.
/* Create a sorted list of pointers to pads.
* This list is sorted by X ccordinate value.
* This list is sorted by X ccordinate value.
* The list must be freed b
u
user
* The list must be freed b
y
user
*/
*/
{
{
LISTE_PAD
*
pad_list
=
(
LISTE_PAD
*
)
MyMalloc
(
pcb
->
m_NbPads
*
sizeof
(
D_PAD
*
)
);
LISTE_PAD
*
pad_list
=
(
LISTE_PAD
*
)
MyMalloc
(
pcb
->
m_NbPads
*
sizeof
(
D_PAD
*
)
);
memcpy
(
pad_list
,
pcb
->
m_Pads
,
pcb
->
m_NbPads
*
sizeof
(
D_PAD
*
)
);
memcpy
(
pad_list
,
pcb
->
m_Pads
,
pcb
->
m_NbPads
*
sizeof
(
D_PAD
*
)
);
qsort
(
pad_list
,
pcb
->
m_NbPads
,
sizeof
(
D_PAD
*
),
qsort
(
pad_list
,
pcb
->
m_NbPads
,
sizeof
(
D_PAD
*
),
SortPadsByXCoord
);
(
int
(
*
)
(
const
void
*
,
const
void
*
)
)
SortPadsByXCoord
);
return
pad_list
;
return
pad_list
;
}
}
...
@@ -602,13 +617,15 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
...
@@ -602,13 +617,15 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
int
a_color
;
int
a_color
;
char
new_passe_request
=
1
,
flag
;
char
new_passe_request
=
1
,
flag
;
LISTE_PAD
*
pt_mem
;
LISTE_PAD
*
pt_mem
;
BOARD_ITEM
*
PtStruct
;
BOARD_ITEM
*
PtStruct
;
int
masque_layer
;
int
masque_layer
;
wxString
msg
;
wxString
msg
;
if
(
m_Pcb
->
m_NbPads
==
0
)
if
(
m_Pcb
->
m_NbPads
==
0
)
return
;
return
;
a_color
=
CYAN
;
a_color
=
CYAN
;
if
(
affiche
)
if
(
affiche
)
Affiche_1_Parametre
(
this
,
POS_AFF_CHREF
,
wxT
(
"DataBase"
),
wxT
(
"Netcodes"
),
a_color
);
Affiche_1_Parametre
(
this
,
POS_AFF_CHREF
,
wxT
(
"DataBase"
),
wxT
(
"Netcodes"
),
a_color
);
...
@@ -630,7 +647,7 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
...
@@ -630,7 +647,7 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
for
(
;
pt_piste
!=
NULL
;
pt_piste
=
(
TRACK
*
)
pt_piste
->
Pnext
)
for
(
;
pt_piste
!=
NULL
;
pt_piste
=
(
TRACK
*
)
pt_piste
->
Pnext
)
{
{
pt_piste
->
SetState
(
BUSY
|
EDIT
|
BEGIN_ONPAD
|
END_ONPAD
,
OFF
);
pt_piste
->
SetState
(
BUSY
|
EDIT
|
BEGIN_ONPAD
|
END_ONPAD
,
OFF
);
pt_piste
->
m_NetCode
=
0
;
pt_piste
->
SetNet
(
0
)
;
}
}
pt_piste
=
m_Pcb
->
m_Track
;
pt_piste
=
m_Pcb
->
m_Track
;
...
@@ -648,7 +665,7 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
...
@@ -648,7 +665,7 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
if
(
pt_piste
->
start
!=
NULL
)
if
(
pt_piste
->
start
!=
NULL
)
{
{
pt_piste
->
SetState
(
BEGIN_ONPAD
,
ON
);
pt_piste
->
SetState
(
BEGIN_ONPAD
,
ON
);
pt_piste
->
m_NetCode
=
(
(
D_PAD
*
)
(
pt_piste
->
start
)
)
->
m_NetCode
;
pt_piste
->
SetNet
(
(
(
D_PAD
*
)
(
pt_piste
->
start
)
)
->
GetNet
()
)
;
}
}
pt_piste
->
end
=
SuperFast_Locate_Pad_Connecte
(
m_Pcb
,
pt_piste
->
end
=
SuperFast_Locate_Pad_Connecte
(
m_Pcb
,
...
@@ -660,7 +677,7 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
...
@@ -660,7 +677,7 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
if
(
pt_piste
->
end
!=
NULL
)
if
(
pt_piste
->
end
!=
NULL
)
{
{
pt_piste
->
SetState
(
END_ONPAD
,
ON
);
pt_piste
->
SetState
(
END_ONPAD
,
ON
);
pt_piste
->
m_NetCode
=
(
(
D_PAD
*
)
(
pt_piste
->
end
)
)
->
m_NetCode
;
pt_piste
->
SetNet
(
(
(
D_PAD
*
)
(
pt_piste
->
end
)
)
->
GetNet
()
)
;
}
}
}
}
...
@@ -710,15 +727,17 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
...
@@ -710,15 +727,17 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
{
{
if
(
via
->
Type
()
!=
TYPEVIA
)
if
(
via
->
Type
()
!=
TYPEVIA
)
continue
;
continue
;
if
(
via
->
m_NetCode
>
0
)
if
(
via
->
GetNet
()
>
0
)
continue
;
// Netcode already known
continue
;
// Netcode already known
// Lock for a connection to a track with a known netcode
// Lock for a connection to a track with a known netcode
pt_next
=
m_Pcb
->
m_Track
;
pt_next
=
m_Pcb
->
m_Track
;
while
(
(
pt_next
=
Locate_Piste_Connectee
(
via
,
pt_next
,
NULL
,
START
)
)
!=
NULL
)
while
(
(
pt_next
=
Locate_Piste_Connectee
(
via
,
pt_next
,
NULL
,
START
)
)
!=
NULL
)
{
{
if
(
pt_next
->
m_NetCode
)
if
(
pt_next
->
GetNet
()
)
{
{
via
->
m_NetCode
=
pt_next
->
m_NetCode
;
via
->
SetNet
(
pt_next
->
GetNet
()
)
;
break
;
break
;
}
}
pt_next
->
SetState
(
BUSY
,
ON
);
pt_next
->
SetState
(
BUSY
,
ON
);
...
@@ -737,21 +756,22 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
...
@@ -737,21 +756,22 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
/* Traitement du point de debut */
/* Traitement du point de debut */
PtStruct
=
(
BOARD_ITEM
*
)
pt_piste
->
start
;
PtStruct
=
(
BOARD_ITEM
*
)
pt_piste
->
start
;
if
(
PtStruct
&&
(
PtStruct
->
Type
()
!=
TYPEPAD
)
)
if
(
PtStruct
&&
(
PtStruct
->
Type
()
!=
TYPEPAD
)
)
{
// Begin on an other track segment
{
// Begin on an other track segment
pt_next
=
(
TRACK
*
)
PtStruct
;
pt_next
=
(
TRACK
*
)
PtStruct
;
if
(
pt_piste
->
m_NetCode
)
if
(
pt_piste
->
GetNet
()
)
{
{
if
(
pt_next
->
m_NetCode
==
0
)
if
(
pt_next
->
GetNet
()
==
0
)
{
{
new_passe_request
=
1
;
new_passe_request
=
1
;
pt_next
->
m_NetCode
=
pt_piste
->
m_NetCode
;
pt_next
->
SetNet
(
pt_piste
->
GetNet
()
)
;
}
}
}
}
else
else
{
{
if
(
pt_next
->
m_NetCode
!=
0
)
if
(
pt_next
->
GetNet
()
!=
0
)
{
{
pt_piste
->
m_NetCode
=
pt_next
->
m_NetCode
;
pt_piste
->
SetNet
(
pt_next
->
GetNet
()
)
;
new_passe_request
=
1
;
new_passe_request
=
1
;
}
}
}
}
...
@@ -760,21 +780,22 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
...
@@ -760,21 +780,22 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
/* Localisation du point de fin */
/* Localisation du point de fin */
PtStruct
=
pt_piste
->
end
;
PtStruct
=
pt_piste
->
end
;
if
(
PtStruct
&&
(
PtStruct
->
Type
()
!=
TYPEPAD
)
)
if
(
PtStruct
&&
(
PtStruct
->
Type
()
!=
TYPEPAD
)
)
{
// End sur piste
{
// End sur piste
pt_next
=
(
TRACK
*
)
PtStruct
;
pt_next
=
(
TRACK
*
)
PtStruct
;
if
(
pt_piste
->
m_NetCode
)
if
(
pt_piste
->
GetNet
()
)
{
{
if
(
pt_next
->
m_NetCode
==
0
)
if
(
pt_next
->
GetNet
()
==
0
)
{
{
new_passe_request
=
1
;
new_passe_request
=
1
;
pt_next
->
m_NetCode
=
pt_piste
->
m_NetCode
;
pt_next
->
SetNet
(
pt_piste
->
GetNet
()
)
;
}
}
}
}
else
else
{
{
if
(
pt_next
->
m_NetCode
!=
0
)
if
(
pt_next
->
GetNet
()
!=
0
)
{
{
pt_piste
->
m_NetCode
=
pt_next
->
m_NetCode
;
pt_piste
->
SetNet
(
pt_next
->
GetNet
()
)
;
new_passe_request
=
1
;
new_passe_request
=
1
;
}
}
}
}
...
@@ -800,7 +821,7 @@ int tri_par_netcode( TRACK** pt_ref, TRACK** pt_compare )
...
@@ -800,7 +821,7 @@ int tri_par_netcode( TRACK** pt_ref, TRACK** pt_compare )
{
{
int
ii
;
int
ii
;
ii
=
(
*
pt_ref
)
->
m_NetCode
-
(
*
pt_compare
)
->
m_NetCode
;
ii
=
(
*
pt_ref
)
->
GetNet
()
-
(
*
pt_compare
)
->
GetNet
()
;
return
ii
;
return
ii
;
}
}
...
...
pcbnew/controle.cpp
View file @
3cd47555
...
@@ -268,6 +268,11 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
...
@@ -268,6 +268,11 @@ void WinEDA_BasePcbFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
if
(
delta
.
y
<=
0
)
if
(
delta
.
y
<=
0
)
delta
.
y
=
1
;
delta
.
y
=
1
;
#if 0 && defined(DEBUG)
printf( "delta.x=%d delta.y=%d grid.x=%d, grid.y=%d, zoom=%d\n",
delta.x, delta.y, GetScreen()->GetGrid().x, GetScreen()->GetGrid().y, zoom );
#endif
switch
(
g_KeyPressed
)
switch
(
g_KeyPressed
)
{
{
case
EDA_PANNING_UP_KEY
:
case
EDA_PANNING_UP_KEY
:
...
...
pcbnew/cross-probing.cpp
View file @
3cd47555
...
@@ -85,7 +85,7 @@ void RemoteCommand( const char* cmdline )
...
@@ -85,7 +85,7 @@ void RemoteCommand( const char* cmdline )
pad
=
ReturnPad
(
module
,
pinName
);
pad
=
ReturnPad
(
module
,
pinName
);
if
(
pad
)
if
(
pad
)
netcode
=
pad
->
m_NetCode
;
netcode
=
pad
->
GetNet
()
;
if
(
netcode
>
0
)
/* hightlighted the net selected net*/
if
(
netcode
>
0
)
/* hightlighted the net selected net*/
{
{
...
...
pcbnew/deltrack.cpp
View file @
3cd47555
...
@@ -110,7 +110,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* Track )
...
@@ -110,7 +110,7 @@ TRACK* WinEDA_PcbFrame::Delete_Segment( wxDC* DC, TRACK* Track )
}
// Fin traitement si trace en cours
}
// Fin traitement si trace en cours
current_net_code
=
Track
->
m_NetCode
;
current_net_code
=
Track
->
GetNet
()
;
Track
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
Track
->
Draw
(
DrawPanel
,
DC
,
GR_XOR
);
SaveItemEfface
(
Track
,
1
);
SaveItemEfface
(
Track
,
1
);
...
@@ -128,7 +128,7 @@ void WinEDA_PcbFrame::Delete_Track( wxDC* DC, TRACK* Track )
...
@@ -128,7 +128,7 @@ void WinEDA_PcbFrame::Delete_Track( wxDC* DC, TRACK* Track )
{
{
if
(
Track
!=
NULL
)
if
(
Track
!=
NULL
)
{
{
int
current_net_code
=
Track
->
m_NetCode
;
int
current_net_code
=
Track
->
GetNet
()
;
Supprime_Une_Piste
(
DC
,
Track
);
Supprime_Une_Piste
(
DC
,
Track
);
GetScreen
()
->
SetModify
();
GetScreen
()
->
SetModify
();
test_1_net_connexion
(
DC
,
current_net_code
);
test_1_net_connexion
(
DC
,
current_net_code
);
...
@@ -152,7 +152,7 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* Track )
...
@@ -152,7 +152,7 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* Track )
if
(
IsOK
(
this
,
_
(
"Delete NET ?"
)
)
)
if
(
IsOK
(
this
,
_
(
"Delete NET ?"
)
)
)
{
{
net_code_delete
=
pt_segm
->
m_NetCode
;
net_code_delete
=
pt_segm
->
GetNet
()
;
/* Recherche du debut de la zone des pistes du net_code courant */
/* Recherche du debut de la zone des pistes du net_code courant */
pt_start
=
m_Pcb
->
m_Track
->
GetStartNetCode
(
net_code_delete
);
pt_start
=
m_Pcb
->
m_Track
->
GetStartNetCode
(
net_code_delete
);
...
@@ -160,7 +160,7 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* Track )
...
@@ -160,7 +160,7 @@ void WinEDA_PcbFrame::Delete_net( wxDC* DC, TRACK* Track )
pt_segm
=
pt_start
;
pt_segm
=
pt_start
;
for
(
ii
=
0
;
pt_segm
!=
NULL
;
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
)
for
(
ii
=
0
;
pt_segm
!=
NULL
;
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
)
{
{
if
(
pt_segm
->
m_NetCode
!=
net_code_delete
)
if
(
pt_segm
->
GetNet
()
!=
net_code_delete
)
break
;
break
;
ii
++
;
ii
++
;
}
}
...
...
pcbnew/dragsegm.cpp
View file @
3cd47555
...
@@ -109,7 +109,7 @@ void Build_1_Pad_SegmentsToDrag(WinEDA_DrawPanel * panel, wxDC * DC, D_PAD * PtP
...
@@ -109,7 +109,7 @@ void Build_1_Pad_SegmentsToDrag(WinEDA_DrawPanel * panel, wxDC * DC, D_PAD * PtP
*/
*/
{
{
TRACK
*
Track
;
TRACK
*
Track
;
int
net_code
=
PtPad
->
m_NetCode
;
int
net_code
=
PtPad
->
GetNet
()
;
int
MasqueLayer
;
int
MasqueLayer
;
wxPoint
pos
;
wxPoint
pos
;
BOARD
*
pcb
=
((
WinEDA_BasePcbFrame
*
)(
panel
->
m_Parent
))
->
m_Pcb
;
BOARD
*
pcb
=
((
WinEDA_BasePcbFrame
*
)(
panel
->
m_Parent
))
->
m_Pcb
;
...
@@ -120,7 +120,7 @@ BOARD * pcb = ((WinEDA_BasePcbFrame*)(panel->m_Parent))->m_Pcb;
...
@@ -120,7 +120,7 @@ BOARD * pcb = ((WinEDA_BasePcbFrame*)(panel->m_Parent))->m_Pcb;
MasqueLayer
=
PtPad
->
m_Masque_Layer
;
MasqueLayer
=
PtPad
->
m_Masque_Layer
;
for
(
;
Track
!=
NULL
;
Track
=
(
TRACK
*
)
Track
->
Pnext
)
for
(
;
Track
!=
NULL
;
Track
=
(
TRACK
*
)
Track
->
Pnext
)
{
{
if
(
Track
->
m_NetCode
!=
net_code
)
break
;
/* hors zone */
if
(
Track
->
GetNet
()
!=
net_code
)
break
;
/* hors zone */
if
(
(
MasqueLayer
&
Track
->
ReturnMaskLayer
())
==
0
)
continue
;
/* couches differentes */
if
(
(
MasqueLayer
&
Track
->
ReturnMaskLayer
())
==
0
)
continue
;
/* couches differentes */
if
(
pos
==
Track
->
m_Start
)
if
(
pos
==
Track
->
m_Start
)
{
{
...
@@ -172,7 +172,7 @@ BOARD * pcb = ((WinEDA_BasePcbFrame*)(panel->m_Parent))->m_Pcb;
...
@@ -172,7 +172,7 @@ BOARD * pcb = ((WinEDA_BasePcbFrame*)(panel->m_Parent))->m_Pcb;
for
(
;
Track
!=
NULL
;
Track
=
(
TRACK
*
)
Track
->
Pnext
)
for
(
;
Track
!=
NULL
;
Track
=
(
TRACK
*
)
Track
->
Pnext
)
{
{
if
(
Track
->
m_NetCode
!=
net_code
)
break
;
/* hors zone */
if
(
Track
->
GetNet
()
!=
net_code
)
break
;
/* hors zone */
if
(
(
MasqueLayer
&
Track
->
ReturnMaskLayer
())
==
0
)
continue
;
/* couches differentes */
if
(
(
MasqueLayer
&
Track
->
ReturnMaskLayer
())
==
0
)
continue
;
/* couches differentes */
if
(
Track
->
m_Flags
&
IS_DRAGGED
)
continue
;
// already in list
if
(
Track
->
m_Flags
&
IS_DRAGGED
)
continue
;
// already in list
if
(
Track
->
m_Start
==
point
)
if
(
Track
->
m_Start
==
point
)
...
...
pcbnew/drc.cpp
View file @
3cd47555
...
@@ -87,27 +87,35 @@ void WinEDA_DrcFrame::ListUnconnectedPads( wxCommandEvent& event )
...
@@ -87,27 +87,35 @@ void WinEDA_DrcFrame::ListUnconnectedPads( wxCommandEvent& event )
{
{
if
(
(
Ratsnest
->
status
&
CH_ACTIF
)
==
0
)
if
(
(
Ratsnest
->
status
&
CH_ACTIF
)
==
0
)
continue
;
continue
;
m_UnconnectedCount
++
;
m_UnconnectedCount
++
;
if
(
m_UnconnectedCount
==
1
)
if
(
m_UnconnectedCount
==
1
)
m_logWindow
->
AppendText
(
_
(
"Unconnected found:
\n
"
)
);
m_logWindow
->
AppendText
(
_
(
"Unconnected found:
\n
"
)
);
D_PAD
*
pad
=
Ratsnest
->
pad_start
;
D_PAD
*
pad
=
Ratsnest
->
pad_start
;
pad
->
Draw
(
panel
,
m_DC
,
wxPoint
(
0
,
0
),
draw_mode
);
pad
->
Draw
(
panel
,
m_DC
,
wxPoint
(
0
,
0
),
draw_mode
);
wxString
pad_name
=
pad
->
ReturnStringPadName
();
wxString
pad_name
=
pad
->
ReturnStringPadName
();
wxString
module_name
=
(
(
MODULE
*
)
(
pad
->
m_Parent
)
)
->
m_Reference
->
m_Text
;
wxString
module_name
=
(
(
MODULE
*
)
(
pad
->
m_Parent
)
)
->
m_Reference
->
m_Text
;
msg
.
Printf
(
_
(
"%d > Pad %s (%s) @ %.4f,%.4f and "
),
m_UnconnectedCount
,
msg
.
Printf
(
_
(
"%d > Pad %s (%s) @ %.4f,%.4f and "
),
m_UnconnectedCount
,
pad_name
.
GetData
(),
module_name
.
GetData
(
pad_name
.
GetData
(),
module_name
.
GetData
(),
),
pad
->
m_Pos
.
x
*
convert
,
pad
->
m_Pos
.
y
*
convert
);
pad
->
m_Pos
.
x
*
convert
,
pad
->
m_Pos
.
y
*
convert
);
m_logWindow
->
AppendText
(
msg
);
m_logWindow
->
AppendText
(
msg
);
if
(
s_RptFile
)
if
(
s_RptFile
)
fprintf
(
s_RptFile
,
"%s"
,
CONV_TO_UTF8
(
msg
)
);
fprintf
(
s_RptFile
,
"%s"
,
CONV_TO_UTF8
(
msg
)
);
pad
=
Ratsnest
->
pad_end
;
pad
=
Ratsnest
->
pad_end
;
pad
->
Draw
(
panel
,
m_DC
,
wxPoint
(
0
,
0
),
draw_mode
);
pad
->
Draw
(
panel
,
m_DC
,
wxPoint
(
0
,
0
),
draw_mode
);
pad_name
=
pad
->
ReturnStringPadName
();
pad_name
=
pad
->
ReturnStringPadName
();
module_name
=
(
(
MODULE
*
)
(
pad
->
m_Parent
)
)
->
m_Reference
->
m_Text
;
module_name
=
(
(
MODULE
*
)
(
pad
->
m_Parent
)
)
->
m_Reference
->
m_Text
;
msg
.
Printf
(
_
(
"Pad %s (%s) @ %.4f,%.4f
\n
"
),
msg
.
Printf
(
_
(
"Pad %s (%s) @ %.4f,%.4f
\n
"
),
pad_name
.
GetData
(),
module_name
.
GetData
(
pad_name
.
GetData
(),
module_name
.
GetData
(),
),
pad
->
m_Pos
.
x
*
convert
,
pad
->
m_Pos
.
y
*
convert
);
pad
->
m_Pos
.
x
*
convert
,
pad
->
m_Pos
.
y
*
convert
);
m_logWindow
->
AppendText
(
msg
);
m_logWindow
->
AppendText
(
msg
);
if
(
s_RptFile
)
if
(
s_RptFile
)
fprintf
(
s_RptFile
,
"%s"
,
CONV_TO_UTF8
(
msg
)
);
fprintf
(
s_RptFile
,
"%s"
,
CONV_TO_UTF8
(
msg
)
);
...
@@ -117,6 +125,7 @@ void WinEDA_DrcFrame::ListUnconnectedPads( wxCommandEvent& event )
...
@@ -117,6 +125,7 @@ void WinEDA_DrcFrame::ListUnconnectedPads( wxCommandEvent& event )
msg
.
Printf
(
_
(
"Active routes: %d
\n
"
),
m_UnconnectedCount
);
msg
.
Printf
(
_
(
"Active routes: %d
\n
"
),
m_UnconnectedCount
);
else
else
msg
=
_
(
"OK! (No active routes)
\n
"
);
msg
=
_
(
"OK! (No active routes)
\n
"
);
m_logWindow
->
AppendText
(
msg
);
m_logWindow
->
AppendText
(
msg
);
if
(
s_RptFile
)
if
(
s_RptFile
)
fprintf
(
s_RptFile
,
"%s"
,
CONV_TO_UTF8
(
msg
)
);
fprintf
(
s_RptFile
,
"%s"
,
CONV_TO_UTF8
(
msg
)
);
...
@@ -135,8 +144,10 @@ void WinEDA_DrcFrame::TestDrc( wxCommandEvent& event )
...
@@ -135,8 +144,10 @@ void WinEDA_DrcFrame::TestDrc( wxCommandEvent& event )
if
(
m_CreateRptCtrl
->
IsChecked
()
)
// Create a file rpt
if
(
m_CreateRptCtrl
->
IsChecked
()
)
// Create a file rpt
{
{
s_RptFilename
=
m_RptFilenameCtrl
->
GetValue
();
s_RptFilename
=
m_RptFilenameCtrl
->
GetValue
();
if
(
s_RptFilename
.
IsEmpty
()
)
if
(
s_RptFilename
.
IsEmpty
()
)
OnButtonBrowseRptFileClick
(
event
);
OnButtonBrowseRptFileClick
(
event
);
if
(
!
s_RptFilename
.
IsEmpty
()
)
if
(
!
s_RptFilename
.
IsEmpty
()
)
s_RptFile
=
wxFopen
(
s_RptFilename
,
wxT
(
"w"
)
);
s_RptFile
=
wxFopen
(
s_RptFilename
,
wxT
(
"w"
)
);
else
else
...
@@ -153,14 +164,18 @@ void WinEDA_DrcFrame::TestDrc( wxCommandEvent& event )
...
@@ -153,14 +164,18 @@ void WinEDA_DrcFrame::TestDrc( wxCommandEvent& event )
s_Pad2PadTestOpt
=
m_Pad2PadTestCtrl
->
IsChecked
();
s_Pad2PadTestOpt
=
m_Pad2PadTestCtrl
->
IsChecked
();
s_UnconnectedTestOpt
=
m_UnconnectedTestCtrl
->
IsChecked
();
s_UnconnectedTestOpt
=
m_UnconnectedTestCtrl
->
IsChecked
();
s_ZonesTestOpt
=
m_ZonesTestCtrl
->
IsChecked
();
s_ZonesTestOpt
=
m_ZonesTestCtrl
->
IsChecked
();
AbortDrc
=
FALSE
;
AbortDrc
=
FALSE
;
m_logWindow
->
Clear
();
m_logWindow
->
Clear
();
g_DesignSettings
.
m_TrackClearence
=
g_DesignSettings
.
m_TrackClearence
=
ReturnValueFromTextCtrl
(
*
m_SetClearance
,
m_Parent
->
m_InternalUnits
);
ReturnValueFromTextCtrl
(
*
m_SetClearance
,
m_Parent
->
m_InternalUnits
);
/* Test DRC errors (clearance errors, bad connections .. */
/* Test DRC errors (clearance errors, bad connections .. */
errors
=
m_Parent
->
Test_DRC
(
m_DC
,
m_Pad2PadTestCtrl
->
IsChecked
(
errors
=
m_Parent
->
Test_DRC
(
m_DC
,
m_Pad2PadTestCtrl
->
IsChecked
(
),
m_ZonesTestCtrl
->
IsChecked
()
);
),
m_ZonesTestCtrl
->
IsChecked
()
);
/* Search for active routes (unconnected pads) */
/* Search for active routes (unconnected pads) */
if
(
m_UnconnectedTestCtrl
->
IsChecked
()
)
if
(
m_UnconnectedTestCtrl
->
IsChecked
()
)
ListUnconnectedPads
(
event
);
ListUnconnectedPads
(
event
);
...
@@ -267,6 +282,7 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone )
...
@@ -267,6 +282,7 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone )
LISTE_PAD
*
pad_list_limit
=
&
pad_list_start
[
m_Pcb
->
m_NbPads
];
LISTE_PAD
*
pad_list_limit
=
&
pad_list_start
[
m_Pcb
->
m_NbPads
];
int
max_size
=
0
;
int
max_size
=
0
;
LISTE_PAD
*
pad_list
;
LISTE_PAD
*
pad_list
;
/* Compute the max size of the pads ( used to stop the test) */
/* Compute the max size of the pads ( used to stop the test) */
for
(
pad_list
=
pad_list_start
;
pad_list
<
pad_list_limit
;
pad_list
++
)
for
(
pad_list
=
pad_list_start
;
pad_list
<
pad_list_limit
;
pad_list
++
)
{
{
...
@@ -319,6 +335,7 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone )
...
@@ -319,6 +335,7 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone )
{
{
if
(
pt_segm
->
Pnext
==
NULL
)
if
(
pt_segm
->
Pnext
==
NULL
)
break
;
break
;
if
(
jj
==
0
)
if
(
jj
==
0
)
{
{
jj
=
10
;
jj
=
10
;
...
@@ -332,20 +349,20 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone )
...
@@ -332,20 +349,20 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone )
Affiche_1_Parametre
(
this
,
PRINT_TST_POS
,
wxT
(
"Test"
),
Line
,
CYAN
);
Affiche_1_Parametre
(
this
,
PRINT_TST_POS
,
wxT
(
"Test"
),
Line
,
CYAN
);
}
}
if
(
old_net
!=
pt_segm
->
m_NetCode
)
if
(
old_net
!=
pt_segm
->
GetNet
()
)
{
{
wxString
msg
;
wxString
msg
;
jj
=
1
;
jj
=
1
;
EQUIPOT
*
equipot
=
m_Pcb
->
FindNet
(
pt_segm
->
m_NetCode
);
EQUIPOT
*
equipot
=
m_Pcb
->
FindNet
(
pt_segm
->
GetNet
()
);
if
(
equipot
)
if
(
equipot
)
msg
=
equipot
->
m_Netname
+
wxT
(
" "
);
msg
=
equipot
->
m_Netname
+
wxT
(
" "
);
else
else
msg
=
wxT
(
"<noname>"
);
msg
=
wxT
(
"<noname>"
);
Affiche_1_Parametre
(
this
,
0
,
_
(
"Netname"
),
msg
,
YELLOW
);
Affiche_1_Parametre
(
this
,
0
,
_
(
"Netname"
),
msg
,
YELLOW
);
old_net
=
pt_segm
->
m_NetCode
;
old_net
=
pt_segm
->
GetNet
()
;
}
}
g_HightLigth_NetCode
=
pt_segm
->
m_NetCode
;
g_HightLigth_NetCode
=
pt_segm
->
GetNet
()
;
flag_err_Drc
=
Drc
(
this
,
DC
,
pt_segm
,
(
TRACK
*
)
pt_segm
->
Pnext
,
1
);
flag_err_Drc
=
Drc
(
this
,
DC
,
pt_segm
,
(
TRACK
*
)
pt_segm
->
Pnext
,
1
);
if
(
flag_err_Drc
==
BAD_DRC
)
if
(
flag_err_Drc
==
BAD_DRC
)
{
{
...
@@ -386,6 +403,7 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone )
...
@@ -386,6 +403,7 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone )
DrcFrame
->
m_logWindow
->
AppendText
(
_
(
"Tst Zones
\n
"
)
);
DrcFrame
->
m_logWindow
->
AppendText
(
_
(
"Tst Zones
\n
"
)
);
pt_segm
=
(
TRACK
*
)
m_Pcb
->
m_Zone
;
pt_segm
=
(
TRACK
*
)
m_Pcb
->
m_Zone
;
for
(
ii
=
0
,
old_net
=
-
1
,
jj
=
0
;
for
(
ii
=
0
,
old_net
=
-
1
,
jj
=
0
;
pt_segm
!=
NULL
;
pt_segm
!=
NULL
;
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
,
ii
++
,
jj
--
)
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
,
ii
++
,
jj
--
)
...
@@ -399,18 +417,19 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone )
...
@@ -399,18 +417,19 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone )
wxYield
();
wxYield
();
if
(
AbortDrc
)
if
(
AbortDrc
)
{
{
AbortDrc
=
FALSE
;
break
;
AbortDrc
=
FALSE
;
break
;
}
}
/* Print stats */
/* Print stats */
Line
.
Printf
(
wxT
(
"%d"
),
ii
);
Line
.
Printf
(
wxT
(
"%d"
),
ii
);
Affiche_1_Parametre
(
this
,
PRINT_TST_POS
,
wxT
(
"Test"
),
Line
,
CYAN
);
Affiche_1_Parametre
(
this
,
PRINT_TST_POS
,
wxT
(
"Test"
),
Line
,
CYAN
);
}
}
if
(
old_net
!=
pt_segm
->
m_NetCode
)
if
(
old_net
!=
pt_segm
->
GetNet
()
)
{
{
jj
=
1
;
jj
=
1
;
wxString
msg
;
wxString
msg
;
EQUIPOT
*
equipot
=
m_Pcb
->
FindNet
(
pt_segm
->
m_NetCode
);
EQUIPOT
*
equipot
=
m_Pcb
->
FindNet
(
pt_segm
->
GetNet
()
);
if
(
equipot
)
if
(
equipot
)
msg
=
equipot
->
m_Netname
+
wxT
(
" "
);
msg
=
equipot
->
m_Netname
+
wxT
(
" "
);
...
@@ -418,9 +437,9 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone )
...
@@ -418,9 +437,9 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone )
msg
=
wxT
(
"<noname>"
);
msg
=
wxT
(
"<noname>"
);
Affiche_1_Parametre
(
this
,
0
,
_
(
"Netname"
),
msg
,
YELLOW
);
Affiche_1_Parametre
(
this
,
0
,
_
(
"Netname"
),
msg
,
YELLOW
);
old_net
=
pt_segm
->
m_NetCode
;
old_net
=
pt_segm
->
GetNet
()
;
}
}
g_HightLigth_NetCode
=
pt_segm
->
m_NetCode
;
g_HightLigth_NetCode
=
pt_segm
->
GetNet
()
;
/* Test drc with other zone segments, and pads */
/* Test drc with other zone segments, and pads */
flag_err_Drc
=
Drc
(
this
,
DC
,
pt_segm
,
(
TRACK
*
)
pt_segm
->
Pnext
,
1
);
flag_err_Drc
=
Drc
(
this
,
DC
,
pt_segm
,
(
TRACK
*
)
pt_segm
->
Pnext
,
1
);
...
@@ -480,7 +499,6 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone )
...
@@ -480,7 +499,6 @@ int WinEDA_PcbFrame::Test_DRC( wxDC* DC, bool TestPad2Pad, bool TestZone )
}
}
}
}
AbortDrc
=
FALSE
;
AbortDrc
=
FALSE
;
DrcInProgress
=
FALSE
;
DrcInProgress
=
FALSE
;
return
ErrorsDRC_Count
;
return
ErrorsDRC_Count
;
...
@@ -518,7 +536,7 @@ int Drc( WinEDA_BasePcbFrame* frame, wxDC* DC,
...
@@ -518,7 +536,7 @@ int Drc( WinEDA_BasePcbFrame* frame, wxDC* DC,
finy
=
dy
=
pt_segment
->
m_End
.
y
-
org_Y
;
finy
=
dy
=
pt_segment
->
m_End
.
y
-
org_Y
;
MaskLayer
=
pt_segment
->
ReturnMaskLayer
();
MaskLayer
=
pt_segment
->
ReturnMaskLayer
();
net_code_ref
=
pt_segment
->
m_NetCode
;
net_code_ref
=
pt_segment
->
GetNet
()
;
segm_angle
=
0
;
segm_angle
=
0
;
/* for a non horizontal or vertical segment Compute the segment angle
/* for a non horizontal or vertical segment Compute the segment angle
...
@@ -577,10 +595,10 @@ int Drc( WinEDA_BasePcbFrame* frame, wxDC* DC,
...
@@ -577,10 +595,10 @@ int Drc( WinEDA_BasePcbFrame* frame, wxDC* DC,
continue
;
continue
;
}
}
/* The pad must be in a net (i.e pt_pad->
m_NetCode
!= 0 )
/* The pad must be in a net (i.e pt_pad->
GetNet()
!= 0 )
* but no problem if the pad netcode is the current netcode (same net) */
* but no problem if the pad netcode is the current netcode (same net) */
if
(
pt_pad
->
m_NetCode
&&
// the pad must be connected
if
(
pt_pad
->
GetNet
()
&&
// the pad must be connected
net_code_ref
==
pt_pad
->
m_NetCode
)
// the pad net is the same as current net -> Ok
net_code_ref
==
pt_pad
->
GetNet
()
)
// the pad net is the same as current net -> Ok
continue
;
continue
;
/* Test DRC pour les pads */
/* Test DRC pour les pads */
...
@@ -612,7 +630,7 @@ int Drc( WinEDA_BasePcbFrame* frame, wxDC* DC,
...
@@ -612,7 +630,7 @@ int Drc( WinEDA_BasePcbFrame* frame, wxDC* DC,
for
(
;
pttrack
!=
NULL
;
pttrack
=
(
TRACK
*
)
pttrack
->
Pnext
)
for
(
;
pttrack
!=
NULL
;
pttrack
=
(
TRACK
*
)
pttrack
->
Pnext
)
{
{
//No problem if segments have the meme net code:
//No problem if segments have the meme net code:
if
(
net_code_ref
==
pttrack
->
m_NetCode
)
if
(
net_code_ref
==
pttrack
->
GetNet
()
)
continue
;
continue
;
// No problem if segment are on different layers :
// No problem if segment are on different layers :
...
@@ -706,6 +724,7 @@ int Drc( WinEDA_BasePcbFrame* frame, wxDC* DC,
...
@@ -706,6 +724,7 @@ int Drc( WinEDA_BasePcbFrame* frame, wxDC* DC,
{
{
if
(
abs
(
y0
)
>=
w_dist
)
if
(
abs
(
y0
)
>=
w_dist
)
continue
;
continue
;
if
(
x0
>
xf
)
if
(
x0
>
xf
)
EXCHG
(
x0
,
xf
);
/* pour que x0 <= xf */
EXCHG
(
x0
,
xf
);
/* pour que x0 <= xf */
...
@@ -941,9 +960,9 @@ static bool Test_Pad_to_Pads_Drc( WinEDA_BasePcbFrame* frame,
...
@@ -941,9 +960,9 @@ static bool Test_Pad_to_Pads_Drc( WinEDA_BasePcbFrame* frame,
if
(
(
pad
->
m_Masque_Layer
&
MaskLayer
)
==
0
)
if
(
(
pad
->
m_Masque_Layer
&
MaskLayer
)
==
0
)
continue
;
continue
;
/* The pad must be in a net (i.e pt_pad->
m_NetCode
!= 0 ),
/* The pad must be in a net (i.e pt_pad->
GetNet()
!= 0 ),
* But no problem if pads have the same netcode (same net)*/
* But no problem if pads have the same netcode (same net)*/
if
(
pad
->
m_NetCode
&&
(
pad_ref
->
m_NetCode
==
pad
->
m_NetCode
)
)
if
(
pad
->
GetNet
()
&&
(
pad_ref
->
GetNet
()
==
pad
->
GetNet
()
)
)
continue
;
continue
;
/* No problem if pads are from the same footprint
/* No problem if pads are from the same footprint
...
@@ -1334,7 +1353,7 @@ static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb,
...
@@ -1334,7 +1353,7 @@ static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb,
TRACK
*
pt_segm
;
TRACK
*
pt_segm
;
wxString
msg
;
wxString
msg
;
wxString
tracktype
,
netname1
,
netname2
;
wxString
tracktype
,
netname1
,
netname2
;
EQUIPOT
*
equipot
=
Pcb
->
FindNet
(
pt_ref
->
m_NetCode
);
EQUIPOT
*
equipot
=
Pcb
->
FindNet
(
pt_ref
->
GetNet
()
);
if
(
equipot
)
if
(
equipot
)
netname1
=
equipot
->
m_Netname
;
netname1
=
equipot
->
m_Netname
;
...
@@ -1355,7 +1374,7 @@ static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb,
...
@@ -1355,7 +1374,7 @@ static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb,
if
(
pt_item
->
Type
()
==
TYPEPAD
)
if
(
pt_item
->
Type
()
==
TYPEPAD
)
{
{
D_PAD
*
pad
=
(
D_PAD
*
)
pt_item
;
D_PAD
*
pad
=
(
D_PAD
*
)
pt_item
;
equipot
=
Pcb
->
FindNet
(
pad
->
m_NetCode
);
equipot
=
Pcb
->
FindNet
(
pad
->
GetNet
()
);
if
(
equipot
)
if
(
equipot
)
netname2
=
equipot
->
m_Netname
;
netname2
=
equipot
->
m_Netname
;
...
@@ -1375,7 +1394,7 @@ static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb,
...
@@ -1375,7 +1394,7 @@ static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb,
else
/* erreur sur segment de piste */
else
/* erreur sur segment de piste */
{
{
pt_segm
=
(
TRACK
*
)
pt_item
;
pt_segm
=
(
TRACK
*
)
pt_item
;
equipot
=
Pcb
->
FindNet
(
pt_segm
->
m_NetCode
);
equipot
=
Pcb
->
FindNet
(
pt_segm
->
GetNet
()
);
if
(
equipot
)
if
(
equipot
)
netname2
=
equipot
->
m_Netname
;
netname2
=
equipot
->
m_Netname
;
erc_pos
=
pt_segm
->
m_Start
;
erc_pos
=
pt_segm
->
m_Start
;
...
@@ -1442,14 +1461,14 @@ static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb,
...
@@ -1442,14 +1461,14 @@ static void Affiche_Erreur_DRC( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb,
wxString
module_name2
=
(
(
MODULE
*
)
(
pad2
->
m_Parent
)
)
->
m_Reference
->
m_Text
;
wxString
module_name2
=
(
(
MODULE
*
)
(
pad2
->
m_Parent
)
)
->
m_Reference
->
m_Text
;
wxString
netname1
,
netname2
;
wxString
netname1
,
netname2
;
EQUIPOT
*
equipot
=
Pcb
->
FindNet
(
pad1
->
m_NetCode
);
EQUIPOT
*
equipot
=
Pcb
->
FindNet
(
pad1
->
GetNet
()
);
if
(
equipot
)
if
(
equipot
)
netname1
=
equipot
->
m_Netname
;
netname1
=
equipot
->
m_Netname
;
else
else
netname1
=
wxT
(
"<noname>"
);
netname1
=
wxT
(
"<noname>"
);
equipot
=
Pcb
->
FindNet
(
pad2
->
m_NetCode
);
equipot
=
Pcb
->
FindNet
(
pad2
->
GetNet
()
);
if
(
equipot
)
if
(
equipot
)
netname2
=
equipot
->
m_Netname
;
netname2
=
equipot
->
m_Netname
;
else
else
...
...
pcbnew/edit.cpp
View file @
3cd47555
...
@@ -337,7 +337,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
...
@@ -337,7 +337,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case
ID_POPUP_PCB_EDIT_NET
:
case
ID_POPUP_PCB_EDIT_NET
:
if
(
GetCurItem
()
==
NULL
)
if
(
GetCurItem
()
==
NULL
)
break
;
break
;
Edit_Net_Width
(
&
dc
,
(
(
TRACK
*
)
GetCurItem
()
)
->
m_NetCode
);
Edit_Net_Width
(
&
dc
,
(
(
TRACK
*
)
GetCurItem
()
)
->
GetNet
()
);
DrawPanel
->
MouseToCursorSchema
();
DrawPanel
->
MouseToCursorSchema
();
GetScreen
()
->
SetModify
();
GetScreen
()
->
SetModify
();
break
;
break
;
...
@@ -427,11 +427,11 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
...
@@ -427,11 +427,11 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break
;
break
;
case
ID_POPUP_PCB_LOCK_ON_NET
:
case
ID_POPUP_PCB_LOCK_ON_NET
:
Attribut_net
(
&
dc
,
(
(
TRACK
*
)
GetCurItem
()
)
->
m_NetCode
,
TRUE
);
Attribut_net
(
&
dc
,
(
(
TRACK
*
)
GetCurItem
()
)
->
GetNet
()
,
TRUE
);
break
;
break
;
case
ID_POPUP_PCB_LOCK_OFF_NET
:
case
ID_POPUP_PCB_LOCK_OFF_NET
:
Attribut_net
(
&
dc
,
(
(
TRACK
*
)
GetCurItem
()
)
->
m_NetCode
,
FALSE
);
Attribut_net
(
&
dc
,
(
(
TRACK
*
)
GetCurItem
()
)
->
GetNet
()
,
FALSE
);
break
;
break
;
case
ID_POPUP_PCB_SETFLAGS_TRACK_MNU
:
case
ID_POPUP_PCB_SETFLAGS_TRACK_MNU
:
...
...
pcbnew/edit_track_width.cpp
View file @
3cd47555
...
@@ -87,7 +87,7 @@ int nb_segm_non_modifies = 0;
...
@@ -87,7 +87,7 @@ int nb_segm_non_modifies = 0;
/* balayage des segments */
/* balayage des segments */
for
(
pt_segm
=
m_Pcb
->
m_Track
;
pt_segm
!=
NULL
;
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
)
for
(
pt_segm
=
m_Pcb
->
m_Track
;
pt_segm
!=
NULL
;
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
)
{
{
if
(
Netcode
!=
pt_segm
->
m_NetCode
)
/* mauvaise piste */
if
(
Netcode
!=
pt_segm
->
GetNet
()
)
/* mauvaise piste */
continue
;
continue
;
/* piste d'un net trouvee */
/* piste d'un net trouvee */
errdrc
=
Edit_TrackSegm_Width
(
DC
,
pt_segm
);
errdrc
=
Edit_TrackSegm_Width
(
DC
,
pt_segm
);
...
...
pcbnew/editpads.cpp
View file @
3cd47555
/******************************************************/
/******************************************************/
/* editpads.cpp: Pad editing functions and dialog box */
/* editpads.cpp: Pad editing functions and dialog box */
/******************************************************/
/******************************************************/
#include "fctsys.h"
#include "fctsys.h"
#include "gr_basic.h"
#include "gr_basic.h"
...
@@ -22,422 +22,496 @@ static wxString Current_PadNetName;
...
@@ -22,422 +22,496 @@ static wxString Current_PadNetName;
#define NBSHAPES 4
#define NBSHAPES 4
int
CodeShape
[
NBSHAPES
]
=
/* forme des pads */
int
CodeShape
[
NBSHAPES
]
=
/* forme des pads */
{
{
CIRCLE
,
OVALE
,
RECT
,
TRAPEZE
CIRCLE
,
OVALE
,
RECT
,
TRAPEZE
};
};
#define NBTYPES 5
#define NBTYPES 5
int
CodeType
[
NBTYPES
]
=
int
CodeType
[
NBTYPES
]
=
{
STANDARD
,
SMD
,
CONN
,
P_HOLE
,
MECA
{
STANDARD
,
SMD
,
CONN
,
P_HOLE
,
MECA
};
};
static
long
Std_Pad_Layers
[
NBTYPES
]
=
static
long
Std_Pad_Layers
[
NBTYPES
]
=
{
{
ALL_CU_LAYERS
|
SILKSCREEN_LAYER_CMP
|
SOLDERMASK_LAYER_CU
|
SOLDERMASK_LAYER_CMP
,
ALL_CU_LAYERS
|
SILKSCREEN_LAYER_CMP
|
SOLDERMASK_LAYER_CU
|
SOLDERMASK_LAYER_CMP
,
CMP_LAYER
|
SOLDERPASTE_LAYER_CMP
|
SOLDERMASK_LAYER_CMP
,
CMP_LAYER
|
SOLDERPASTE_LAYER_CMP
|
SOLDERMASK_LAYER_CMP
,
CMP_LAYER
|
SOLDERMASK_LAYER_CMP
,
CMP_LAYER
|
SOLDERMASK_LAYER_CMP
,
ALL_CU_LAYERS
|
SILKSCREEN_LAYER_CU
|
SILKSCREEN_LAYER_CMP
|
ALL_CU_LAYERS
|
SILKSCREEN_LAYER_CU
|
SILKSCREEN_LAYER_CMP
|
SOLDERMASK_LAYER_CU
|
SOLDERMASK_LAYER_CMP
,
SOLDERMASK_LAYER_CU
|
SOLDERMASK_LAYER_CMP
,
ALL_CU_LAYERS
|
SILKSCREEN_LAYER_CU
|
SILKSCREEN_LAYER_CMP
|
ALL_CU_LAYERS
|
SILKSCREEN_LAYER_CU
|
SILKSCREEN_LAYER_CMP
|
SOLDERMASK_LAYER_CU
|
SOLDERMASK_LAYER_CMP
SOLDERMASK_LAYER_CU
|
SOLDERMASK_LAYER_CMP
};
};
/************************************/
/************************************/
/* class WinEDA_PadPropertiesFrame */
/* class WinEDA_PadPropertiesFrame */
/************************************/
/************************************/
#include "dialog_pad_edit.cpp"
#include "dialog_pad_edit.cpp"
/*************************************************************/
/*************************************************************/
void
WinEDA_BasePcbFrame
::
InstallPadOptionsFrame
(
D_PAD
*
Pad
,
void
WinEDA_BasePcbFrame
::
InstallPadOptionsFrame
(
D_PAD
*
Pad
,
wxDC
*
DC
,
const
wxPoint
&
pos
)
wxDC
*
DC
,
const
wxPoint
&
pos
)
/*************************************************************/
/*************************************************************/
{
{
WinEDA_PadPropertiesFrame
*
frame
=
new
WinEDA_PadPropertiesFrame
(
this
,
WinEDA_PadPropertiesFrame
*
frame
=
new
WinEDA_PadPropertiesFrame
(
this
,
Pad
,
DC
);
Pad
,
DC
);
frame
->
ShowModal
();
frame
->
Destroy
();
frame
->
ShowModal
();
frame
->
Destroy
();
}
}
/********************************************************/
/********************************************************/
void
WinEDA_PadPropertiesFrame
::
SetOthersControls
()
void
WinEDA_PadPropertiesFrame
::
SetOthersControls
()
/********************************************************/
/********************************************************/
{
{
int
tmp
;
int
tmp
;
m_PadNumCtrl
->
SetValue
(
g_Current_PadName
);
m_PadNumCtrl
->
SetValue
(
g_Current_PadName
);
m_PadNetNameCtrl
->
SetValue
(
Current_PadNetName
);
m_PadNetNameCtrl
->
SetValue
(
Current_PadNetName
);
m_PadPositionCtrl
=
new
WinEDA_PositionCtrl
(
this
,
_
(
"Pad Position"
),
m_PadPositionCtrl
=
new
WinEDA_PositionCtrl
(
this
,
_
(
CurrentPad
?
CurrentPad
->
m_Pos
:
g_Pad_Master
.
m_Pos
,
"Pad Position"
),
g_UnitMetric
,
m_PadPositionBoxSizer
,
m_Parent
->
m_InternalUnits
);
CurrentPad
?
CurrentPad
->
m_Pos
:
g_Pad_Master
.
m_Pos
,
m_PadSizeCtrl
=
new
WinEDA_SizeCtrl
(
this
,
_
(
"Pad Size"
),
g_UnitMetric
,
m_PadPositionBoxSizer
,
CurrentPad
?
CurrentPad
->
m_Size
:
g_Pad_Master
.
m_Size
,
m_Parent
->
m_InternalUnits
);
g_UnitMetric
,
m_PadPositionBoxSizer
,
m_Parent
->
m_InternalUnits
);
m_PadSizeCtrl
=
new
WinEDA_SizeCtrl
(
this
,
_
(
m_PadDeltaSizeCtrl
=
new
WinEDA_SizeCtrl
(
this
,
_
(
"Delta"
),
"Pad Size"
),
CurrentPad
?
CurrentPad
->
m_DeltaSize
:
g_Pad_Master
.
m_DeltaSize
,
CurrentPad
?
CurrentPad
->
m_Size
:
g_Pad_Master
.
g_UnitMetric
,
m_PadPositionBoxSizer
,
m_Parent
->
m_InternalUnits
);
m_Size
,
g_UnitMetric
,
m_PadPositionBoxSizer
,
m_PadOffsetCtrl
=
new
WinEDA_SizeCtrl
(
this
,
_
(
"Offset"
),
m_Parent
->
m_InternalUnits
);
CurrentPad
?
CurrentPad
->
m_Offset
:
g_Pad_Master
.
m_Offset
,
g_UnitMetric
,
m_PadPositionBoxSizer
,
m_Parent
->
m_InternalUnits
);
m_PadDeltaSizeCtrl
=
new
WinEDA_SizeCtrl
(
this
,
_
(
"Delta"
),
/* In second column */
CurrentPad
?
CurrentPad
->
m_DeltaSize
:
g_Pad_Master
.
m_DeltaSize
,
m_PadDrillCtrl
=
new
WinEDA_SizeCtrl
(
this
,
_
(
"Pad Drill"
),
g_UnitMetric
,
m_PadPositionBoxSizer
,
CurrentPad
?
CurrentPad
->
m_Drill
:
g_Pad_Master
.
m_Drill
,
m_Parent
->
m_InternalUnits
);
g_UnitMetric
,
m_DrillShapeBoxSizer
,
m_Parent
->
m_InternalUnits
);
m_PadOffsetCtrl
=
new
WinEDA_SizeCtrl
(
this
,
_
(
if
(
CurrentPad
)
"Offset"
),
{
CurrentPad
?
CurrentPad
->
m_Offset
:
g_Pad_Master
.
tmp
=
CurrentPad
->
m_Orient
-
m_Module
->
m_Orient
;
m_Offset
,
}
g_UnitMetric
,
m_PadPositionBoxSizer
,
else
tmp
=
g_Pad_Master
.
m_Orient
;
m_Parent
->
m_InternalUnits
);
m_DrillShapeBoxSizer
->
Add
(
5
,
5
,
0
,
wxALIGN_CENTER_HORIZONTAL
|
wxALL
,
5
);
m_PadOrientCtrl
=
new
WinEDA_ValueCtrl
(
this
,
_
(
"Pad Orient (0.1 deg)"
),
/* In second column */
tmp
,
2
,
m_DrillShapeBoxSizer
,
1
);
m_PadDrillCtrl
=
new
WinEDA_SizeCtrl
(
this
,
_
(
"Pad Drill"
),
// Pad Orient
CurrentPad
?
CurrentPad
->
m_Drill
:
g_Pad_Master
.
m_Drill
,
switch
(
tmp
)
g_UnitMetric
,
m_DrillShapeBoxSizer
,
{
m_Parent
->
m_InternalUnits
);
case
0
:
m_PadOrient
->
SetSelection
(
0
);
if
(
CurrentPad
)
m_PadOrientCtrl
->
Enable
(
FALSE
);
{
break
;
tmp
=
CurrentPad
->
m_Orient
-
m_Module
->
m_Orient
;
}
case
-
2700
:
else
case
900
:
tmp
=
g_Pad_Master
.
m_Orient
;
m_PadOrient
->
SetSelection
(
1
);
m_DrillShapeBoxSizer
->
Add
(
5
,
5
,
0
,
wxALIGN_CENTER_HORIZONTAL
|
wxALL
,
5
);
m_PadOrientCtrl
->
Enable
(
FALSE
);
m_PadOrientCtrl
=
new
WinEDA_ValueCtrl
(
this
,
_
(
"Pad Orient (0.1 deg)"
),
break
;
tmp
,
2
,
m_DrillShapeBoxSizer
,
1
);
case
-
900
:
case
2700
:
// Pad Orient
m_PadOrient
->
SetSelection
(
2
);
switch
(
tmp
)
m_PadOrientCtrl
->
Enable
(
FALSE
);
{
break
;
case
0
:
m_PadOrient
->
SetSelection
(
0
);
case
1800
:
m_PadOrientCtrl
->
Enable
(
FALSE
);
case
-
1800
:
break
;
m_PadOrient
->
SetSelection
(
3
);
m_PadOrientCtrl
->
Enable
(
FALSE
);
case
-
2700
:
break
;
case
900
:
m_PadOrient
->
SetSelection
(
1
);
default
:
m_PadOrientCtrl
->
Enable
(
FALSE
);
m_PadOrient
->
SetSelection
(
4
);
break
;
break
;
}
case
-
900
:
case
2700
:
tmp
=
CurrentPad
?
CurrentPad
->
m_PadShape
:
g_Pad_Master
.
m_PadShape
;
m_PadOrient
->
SetSelection
(
2
);
switch
(
tmp
)
m_PadOrientCtrl
->
Enable
(
FALSE
);
{
break
;
case
CIRCLE
:
m_PadDeltaSizeCtrl
->
Enable
(
FALSE
,
FALSE
);
case
1800
:
m_PadSizeCtrl
->
Enable
(
TRUE
,
FALSE
);
case
-
1800
:
m_PadShape
->
SetSelection
(
0
);
m_PadOrient
->
SetSelection
(
3
);
break
;
m_PadOrientCtrl
->
Enable
(
FALSE
);
break
;
case
OVALE
:
m_PadDeltaSizeCtrl
->
Enable
(
FALSE
,
FALSE
);
default
:
m_PadSizeCtrl
->
Enable
(
TRUE
,
TRUE
);
m_PadOrient
->
SetSelection
(
4
);
m_PadShape
->
SetSelection
(
1
);
break
;
break
;
}
case
RECT
:
tmp
=
CurrentPad
?
CurrentPad
->
m_PadShape
:
g_Pad_Master
.
m_PadShape
;
m_PadDeltaSizeCtrl
->
Enable
(
FALSE
,
FALSE
);
m_PadSizeCtrl
->
Enable
(
TRUE
,
TRUE
);
switch
(
tmp
)
m_PadShape
->
SetSelection
(
2
);
{
break
;
case
CIRCLE
:
m_PadDeltaSizeCtrl
->
Enable
(
FALSE
,
FALSE
);
case
TRAPEZE
:
m_PadSizeCtrl
->
Enable
(
TRUE
,
FALSE
);
m_PadDeltaSizeCtrl
->
Enable
(
TRUE
,
TRUE
);
m_PadShape
->
SetSelection
(
0
);
m_PadSizeCtrl
->
Enable
(
TRUE
,
TRUE
);
break
;
m_PadShape
->
SetSelection
(
3
);
break
;
case
OVALE
:
}
m_PadDeltaSizeCtrl
->
Enable
(
FALSE
,
FALSE
);
m_PadSizeCtrl
->
Enable
(
TRUE
,
TRUE
);
// Selection du type
m_PadShape
->
SetSelection
(
1
);
tmp
=
CurrentPad
?
CurrentPad
->
m_Attribut
:
g_Pad_Master
.
m_Attribut
;
break
;
m_PadType
->
SetSelection
(
0
);
for
(
int
ii
=
0
;
ii
<
NBTYPES
;
ii
++
)
case
RECT
:
{
m_PadDeltaSizeCtrl
->
Enable
(
FALSE
,
FALSE
);
if
(
CodeType
[
ii
]
==
tmp
)
m_PadSizeCtrl
->
Enable
(
TRUE
,
TRUE
);
{
m_PadShape
->
SetSelection
(
2
);
m_PadType
->
SetSelection
(
ii
);
break
;
break
;
}
}
case
TRAPEZE
:
m_PadDeltaSizeCtrl
->
Enable
(
TRUE
,
TRUE
);
tmp
=
CurrentPad
?
CurrentPad
->
m_DrillShape
:
g_Pad_Master
.
m_DrillShape
;
m_PadSizeCtrl
->
Enable
(
TRUE
,
TRUE
);
switch
(
tmp
)
m_PadShape
->
SetSelection
(
3
);
{
break
;
case
CIRCLE
:
}
m_DrillShapeCtrl
->
SetSelection
(
0
);
m_PadDrillCtrl
->
Enable
(
TRUE
,
FALSE
);
// Selection du type
break
;
tmp
=
CurrentPad
?
CurrentPad
->
m_Attribut
:
g_Pad_Master
.
m_Attribut
;
m_PadType
->
SetSelection
(
0
);
case
OVALE
:
for
(
int
ii
=
0
;
ii
<
NBTYPES
;
ii
++
)
m_DrillShapeCtrl
->
SetSelection
(
1
);
{
m_PadDrillCtrl
->
Enable
(
TRUE
,
TRUE
);
if
(
CodeType
[
ii
]
==
tmp
)
break
;
{
}
m_PadType
->
SetSelection
(
ii
);
break
;
// Selection des couches cuivre :
}
if
(
CurrentPad
)
SetPadLayersList
(
CurrentPad
->
m_Masque_Layer
);
}
else
PadTypeSelected
();
tmp
=
CurrentPad
?
CurrentPad
->
m_DrillShape
:
g_Pad_Master
.
m_DrillShape
;
switch
(
tmp
)
{
case
CIRCLE
:
m_DrillShapeCtrl
->
SetSelection
(
0
);
m_PadDrillCtrl
->
Enable
(
TRUE
,
FALSE
);
break
;
case
OVALE
:
m_DrillShapeCtrl
->
SetSelection
(
1
);
m_PadDrillCtrl
->
Enable
(
TRUE
,
TRUE
);
break
;
}
// Selection des couches cuivre :
if
(
CurrentPad
)
SetPadLayersList
(
CurrentPad
->
m_Masque_Layer
);
else
PadTypeSelected
();
}
}
/*******************************************************************/
/*******************************************************************/
void
WinEDA_PadPropertiesFrame
::
PadOrientEvent
(
wxCommandEvent
&
event
)
void
WinEDA_PadPropertiesFrame
::
PadOrientEvent
(
wxCommandEvent
&
event
)
/********************************************************************/
/********************************************************************/
{
{
switch
(
m_PadOrient
->
GetSelection
()
)
switch
(
m_PadOrient
->
GetSelection
()
)
{
{
case
0
:
case
0
:
m_PadOrientCtrl
->
SetValue
(
0
);
m_PadOrientCtrl
->
SetValue
(
0
);
m_PadOrientCtrl
->
Enable
(
FALSE
);
m_PadOrientCtrl
->
Enable
(
FALSE
);
break
;
break
;
case
1
:
case
1
:
m_PadOrientCtrl
->
SetValue
(
900
);
m_PadOrientCtrl
->
SetValue
(
900
);
m_PadOrientCtrl
->
Enable
(
FALSE
);
m_PadOrientCtrl
->
Enable
(
FALSE
);
break
;
break
;
case
2
:
case
2
:
m_PadOrientCtrl
->
SetValue
(
2700
);
m_PadOrientCtrl
->
SetValue
(
2700
);
m_PadOrientCtrl
->
Enable
(
FALSE
);
m_PadOrientCtrl
->
Enable
(
FALSE
);
break
;
break
;
case
3
:
case
3
:
m_PadOrientCtrl
->
SetValue
(
1800
);
m_PadOrientCtrl
->
SetValue
(
1800
);
m_PadOrientCtrl
->
Enable
(
FALSE
);
m_PadOrientCtrl
->
Enable
(
FALSE
);
break
;
break
;
default
:
default
:
m_PadOrientCtrl
->
Enable
(
TRUE
);
m_PadOrientCtrl
->
Enable
(
TRUE
);
break
;
break
;
}
}
}
}
/**************************************************************************/
/**************************************************************************/
void
WinEDA_PadPropertiesFrame
::
PadTypeSelectedEvent
(
wxCommandEvent
&
event
)
void
WinEDA_PadPropertiesFrame
::
PadTypeSelectedEvent
(
wxCommandEvent
&
event
)
/**************************************************************************/
/**************************************************************************/
/* calcule un layer_mask type selon la selection du type du pad
/* calcule un layer_mask type selon la selection du type du pad
*/
*/
{
{
PadTypeSelected
();
PadTypeSelected
();
}
}
void
WinEDA_PadPropertiesFrame
::
PadTypeSelected
()
void
WinEDA_PadPropertiesFrame
::
PadTypeSelected
()
{
{
long
layer_mask
;
long
layer_mask
;
int
ii
;
int
ii
;
ii
=
m_PadType
->
GetSelection
();
ii
=
m_PadType
->
GetSelection
();
if
(
(
ii
<
0
)
||
(
ii
>=
NBTYPES
)
)
ii
=
0
;
if
(
(
ii
<
0
)
||
(
ii
>=
NBTYPES
)
)
ii
=
0
;
layer_mask
=
Std_Pad_Layers
[
ii
];
layer_mask
=
Std_Pad_Layers
[
ii
];
SetPadLayersList
(
layer_mask
);
SetPadLayersList
(
layer_mask
);
}
}
/****************************************************************/
/****************************************************************/
void
WinEDA_PadPropertiesFrame
::
SetPadLayersList
(
long
layer_mask
)
void
WinEDA_PadPropertiesFrame
::
SetPadLayersList
(
long
layer_mask
)
/****************************************************************/
/****************************************************************/
/* Met a jour l'etat des CheckBoxes de la liste des layers actives,
/* Met a jour l'etat des CheckBoxes de la liste des layers actives,
donnes bit a bit dans layer_mask
*
donnes bit a bit dans layer_mask
*/
*/
{
{
if
(
layer_mask
&
CUIVRE_LAYER
)
m_PadLayerCu
->
SetValue
(
TRUE
);
if
(
layer_mask
&
CUIVRE_LAYER
)
else
m_PadLayerCu
->
SetValue
(
FALSE
);
m_PadLayerCu
->
SetValue
(
TRUE
);
else
if
(
layer_mask
&
CMP_LAYER
)
m_PadLayerCmp
->
SetValue
(
TRUE
);
m_PadLayerCu
->
SetValue
(
FALSE
);
else
m_PadLayerCmp
->
SetValue
(
FALSE
);
if
(
layer_mask
&
CMP_LAYER
)
if
(
layer_mask
&
ADHESIVE_LAYER_CMP
)
m_PadLayerAdhCmp
->
SetValue
(
TRUE
);
m_PadLayerCmp
->
SetValue
(
TRUE
);
else
m_PadLayerAdhCmp
->
SetValue
(
FALSE
);
else
m_PadLayerCmp
->
SetValue
(
FALSE
);
if
(
layer_mask
&
ADHESIVE_LAYER_CU
)
m_PadLayerAdhCu
->
SetValue
(
TRUE
);
else
m_PadLayerAdhCu
->
SetValue
(
FALSE
);
if
(
layer_mask
&
ADHESIVE_LAYER_CMP
)
m_PadLayerAdhCmp
->
SetValue
(
TRUE
);
if
(
layer_mask
&
SOLDERPASTE_LAYER_CMP
)
m_PadLayerPateCmp
->
SetValue
(
TRUE
);
else
else
m_PadLayerPateCmp
->
SetValue
(
FALSE
);
m_PadLayerAdhCmp
->
SetValue
(
FALSE
);
if
(
layer_mask
&
SOLDERPASTE_LAYER_CU
)
m_PadLayerPateCu
->
SetValue
(
TRUE
);
if
(
layer_mask
&
ADHESIVE_LAYER_CU
)
else
m_PadLayerPateCu
->
SetValue
(
FALSE
);
m_PadLayerAdhCu
->
SetValue
(
TRUE
);
else
if
(
layer_mask
&
SILKSCREEN_LAYER_CMP
)
m_PadLayerSilkCmp
->
SetValue
(
TRUE
);
m_PadLayerAdhCu
->
SetValue
(
FALSE
);
else
m_PadLayerSilkCmp
->
SetValue
(
FALSE
);
if
(
layer_mask
&
SOLDERPASTE_LAYER_CMP
)
if
(
layer_mask
&
SILKSCREEN_LAYER_CU
)
m_PadLayerSilkCu
->
SetValue
(
TRUE
);
m_PadLayerPateCmp
->
SetValue
(
TRUE
);
else
m_PadLayerSilkCu
->
SetValue
(
FALSE
);
else
m_PadLayerPateCmp
->
SetValue
(
FALSE
);
if
(
layer_mask
&
SOLDERMASK_LAYER_CMP
)
m_PadLayerMaskCmp
->
SetValue
(
TRUE
);
else
m_PadLayerMaskCmp
->
SetValue
(
FALSE
);
if
(
layer_mask
&
SOLDERPASTE_LAYER_CU
)
m_PadLayerPateCu
->
SetValue
(
TRUE
);
if
(
layer_mask
&
SOLDERMASK_LAYER_CU
)
m_PadLayerMaskCu
->
SetValue
(
TRUE
);
else
else
m_PadLayerMaskCu
->
SetValue
(
FALSE
);
m_PadLayerPateCu
->
SetValue
(
FALSE
);
if
(
layer_mask
&
ECO1_LAYER
)
m_PadLayerECO1
->
SetValue
(
TRUE
);
if
(
layer_mask
&
SILKSCREEN_LAYER_CMP
)
else
m_PadLayerECO1
->
SetValue
(
FALSE
);
m_PadLayerSilkCmp
->
SetValue
(
TRUE
);
else
if
(
layer_mask
&
ECO2_LAYER
)
m_PadLayerECO2
->
SetValue
(
TRUE
);
m_PadLayerSilkCmp
->
SetValue
(
FALSE
);
else
m_PadLayerECO2
->
SetValue
(
FALSE
);
if
(
layer_mask
&
SILKSCREEN_LAYER_CU
)
if
(
layer_mask
&
DRAW_LAYER
)
m_PadLayerDraft
->
SetValue
(
TRUE
);
m_PadLayerSilkCu
->
SetValue
(
TRUE
);
else
m_PadLayerDraft
->
SetValue
(
FALSE
);
else
m_PadLayerSilkCu
->
SetValue
(
FALSE
);
if
(
layer_mask
&
SOLDERMASK_LAYER_CMP
)
m_PadLayerMaskCmp
->
SetValue
(
TRUE
);
else
m_PadLayerMaskCmp
->
SetValue
(
FALSE
);
if
(
layer_mask
&
SOLDERMASK_LAYER_CU
)
m_PadLayerMaskCu
->
SetValue
(
TRUE
);
else
m_PadLayerMaskCu
->
SetValue
(
FALSE
);
if
(
layer_mask
&
ECO1_LAYER
)
m_PadLayerECO1
->
SetValue
(
TRUE
);
else
m_PadLayerECO1
->
SetValue
(
FALSE
);
if
(
layer_mask
&
ECO2_LAYER
)
m_PadLayerECO2
->
SetValue
(
TRUE
);
else
m_PadLayerECO2
->
SetValue
(
FALSE
);
if
(
layer_mask
&
DRAW_LAYER
)
m_PadLayerDraft
->
SetValue
(
TRUE
);
else
m_PadLayerDraft
->
SetValue
(
FALSE
);
}
}
/*************************************************************************/
/*************************************************************************/
void
WinEDA_PadPropertiesFrame
::
PadPropertiesAccept
(
wxCommandEvent
&
event
)
void
WinEDA_PadPropertiesFrame
::
PadPropertiesAccept
(
wxCommandEvent
&
event
)
/*************************************************************************/
/*************************************************************************/
/* Met a jour les differents parametres pour le composant en cours d'dition
/* Met a jour les differents parametres pour le composant en cours d'dition
*/
*/
{
{
long
PadLayerMask
;
long
PadLayerMask
;
bool
error
=
FALSE
;
bool
error
=
FALSE
;
if
(
m_DC
)
m_Parent
->
DrawPanel
->
CursorOff
(
m_DC
);
if
(
m_DC
)
m_Parent
->
DrawPanel
->
CursorOff
(
m_DC
);
g_Pad_Master
.
m_Attribut
=
CodeType
[
m_PadType
->
GetSelection
()];
g_Pad_Master
.
m_PadShape
=
CodeShape
[
m_PadShape
->
GetSelection
()];
g_Pad_Master
.
m_Attribut
=
CodeType
[
m_PadType
->
GetSelection
()];
g_Pad_Master
.
m_Pos
=
m_PadPositionCtrl
->
GetValue
();
g_Pad_Master
.
m_PadShape
=
CodeShape
[
m_PadShape
->
GetSelection
()];
g_Pad_Master
.
m_Pos0
=
g_Pad_Master
.
m_Pos
;
g_Pad_Master
.
m_Pos
=
m_PadPositionCtrl
->
GetValue
();
g_Pad_Master
.
m_Size
=
m_PadSizeCtrl
->
GetValue
();
g_Pad_Master
.
m_Pos0
=
g_Pad_Master
.
m_Pos
;
if
(
g_Pad_Master
.
m_PadShape
==
CIRCLE
)
g_Pad_Master
.
m_Size
=
m_PadSizeCtrl
->
GetValue
();
g_Pad_Master
.
m_Size
.
y
=
g_Pad_Master
.
m_Size
.
x
;
if
(
g_Pad_Master
.
m_PadShape
==
CIRCLE
)
g_Pad_Master
.
m_DeltaSize
=
m_PadDeltaSizeCtrl
->
GetValue
();
g_Pad_Master
.
m_Size
.
y
=
g_Pad_Master
.
m_Size
.
x
;
g_Pad_Master
.
m_Offset
=
m_PadOffsetCtrl
->
GetValue
();
g_Pad_Master
.
m_DeltaSize
=
m_PadDeltaSizeCtrl
->
GetValue
();
g_Pad_Master
.
m_Drill
=
m_PadDrillCtrl
->
GetValue
();
g_Pad_Master
.
m_Offset
=
m_PadOffsetCtrl
->
GetValue
();
if
(
m_DrillShapeCtrl
->
GetSelection
()
==
0
)
g_Pad_Master
.
m_Drill
=
m_PadDrillCtrl
->
GetValue
();
{
if
(
m_DrillShapeCtrl
->
GetSelection
()
==
0
)
g_Pad_Master
.
m_DrillShape
=
CIRCLE
;
{
g_Pad_Master
.
m_Drill
.
y
=
g_Pad_Master
.
m_Drill
.
x
;
g_Pad_Master
.
m_DrillShape
=
CIRCLE
;
}
g_Pad_Master
.
m_Drill
.
y
=
g_Pad_Master
.
m_Drill
.
x
;
else
g_Pad_Master
.
m_DrillShape
=
OVALE
;
}
g_Pad_Master
.
m_Orient
=
m_PadOrientCtrl
->
GetValue
();
else
g_Current_PadName
=
m_PadNumCtrl
->
GetValue
().
Left
(
4
);
g_Pad_Master
.
m_DrillShape
=
OVALE
;
Current_PadNetName
=
m_PadNetNameCtrl
->
GetValue
();
g_Pad_Master
.
m_Orient
=
m_PadOrientCtrl
->
GetValue
();
g_Current_PadName
=
m_PadNumCtrl
->
GetValue
().
Left
(
4
);
/* Test for incorrect values */
Current_PadNetName
=
m_PadNetNameCtrl
->
GetValue
();
if
(
(
g_Pad_Master
.
m_Size
.
x
<
g_Pad_Master
.
m_Drill
.
x
)
||
(
g_Pad_Master
.
m_Size
.
y
<
g_Pad_Master
.
m_Drill
.
y
)
)
/* Test for incorrect values */
{
if
(
(
g_Pad_Master
.
m_Size
.
x
<
g_Pad_Master
.
m_Drill
.
x
)
error
=
TRUE
;
||
(
g_Pad_Master
.
m_Size
.
y
<
g_Pad_Master
.
m_Drill
.
y
)
)
DisplayError
(
this
,
_
(
"Incorrect value for pad drill: pad drill bigger than pad size"
)
);
{
}
error
=
TRUE
;
if
(
(
g_Pad_Master
.
m_Size
.
x
/
2
<=
ABS
(
g_Pad_Master
.
m_Offset
.
x
))
||
DisplayError
(
this
,
_
(
"Incorrect value for pad drill: pad drill bigger than pad size"
)
);
(
g_Pad_Master
.
m_Size
.
y
/
2
<=
ABS
(
g_Pad_Master
.
m_Offset
.
y
))
)
}
{
if
(
(
g_Pad_Master
.
m_Size
.
x
/
2
<=
ABS
(
g_Pad_Master
.
m_Offset
.
x
)
)
error
=
TRUE
;
||
(
g_Pad_Master
.
m_Size
.
y
/
2
<=
ABS
(
g_Pad_Master
.
m_Offset
.
y
)
)
)
DisplayError
(
this
,
_
(
"Incorrect value for pad offset"
)
);
{
}
error
=
TRUE
;
DisplayError
(
this
,
_
(
"Incorrect value for pad offset"
)
);
if
(
error
)
}
{
if
(
m_DC
)
m_Parent
->
DrawPanel
->
CursorOn
(
m_DC
);
if
(
error
)
return
;
{
}
if
(
m_DC
)
m_Parent
->
DrawPanel
->
CursorOn
(
m_DC
);
PadLayerMask
=
0
;
return
;
if
(
m_PadLayerCu
->
GetValue
()
)
PadLayerMask
|=
CUIVRE_LAYER
;
}
if
(
m_PadLayerCmp
->
GetValue
()
)
PadLayerMask
|=
CMP_LAYER
;
if
(
(
PadLayerMask
&
(
CUIVRE_LAYER
|
CMP_LAYER
))
==
(
CUIVRE_LAYER
|
CMP_LAYER
)
)
PadLayerMask
=
0
;
PadLayerMask
|=
ALL_CU_LAYERS
;
if
(
m_PadLayerCu
->
GetValue
()
)
if
(
m_PadLayerAdhCmp
->
GetValue
()
)
PadLayerMask
|=
ADHESIVE_LAYER_CMP
;
PadLayerMask
|=
CUIVRE_LAYER
;
if
(
m_PadLayerAdhCu
->
GetValue
()
)
PadLayerMask
|=
ADHESIVE_LAYER_CU
;
if
(
m_PadLayerCmp
->
GetValue
()
)
if
(
m_PadLayerPateCmp
->
GetValue
()
)
PadLayerMask
|=
SOLDERPASTE_LAYER_CMP
;
PadLayerMask
|=
CMP_LAYER
;
if
(
m_PadLayerPateCu
->
GetValue
()
)
PadLayerMask
|=
SOLDERPASTE_LAYER_CU
;
if
(
(
PadLayerMask
&
(
CUIVRE_LAYER
|
CMP_LAYER
)
)
==
(
CUIVRE_LAYER
|
CMP_LAYER
)
)
if
(
m_PadLayerSilkCmp
->
GetValue
()
)
PadLayerMask
|=
SILKSCREEN_LAYER_CMP
;
PadLayerMask
|=
ALL_CU_LAYERS
;
if
(
m_PadLayerSilkCu
->
GetValue
()
)
PadLayerMask
|=
SILKSCREEN_LAYER_CU
;
if
(
m_PadLayerAdhCmp
->
GetValue
()
)
if
(
m_PadLayerMaskCmp
->
GetValue
()
)
PadLayerMask
|=
SOLDERMASK_LAYER_CMP
;
PadLayerMask
|=
ADHESIVE_LAYER_CMP
;
if
(
m_PadLayerMaskCu
->
GetValue
()
)
PadLayerMask
|=
SOLDERMASK_LAYER_CU
;
if
(
m_PadLayerAdhCu
->
GetValue
()
)
if
(
m_PadLayerECO1
->
GetValue
()
)
PadLayerMask
|=
ECO1_LAYER
;
PadLayerMask
|=
ADHESIVE_LAYER_CU
;
if
(
m_PadLayerECO2
->
GetValue
()
)
PadLayerMask
|=
ECO2_LAYER
;
if
(
m_PadLayerPateCmp
->
GetValue
()
)
if
(
m_PadLayerDraft
->
GetValue
()
)
PadLayerMask
|=
DRAW_LAYER
;
PadLayerMask
|=
SOLDERPASTE_LAYER_CMP
;
if
(
m_PadLayerPateCu
->
GetValue
()
)
g_Pad_Master
.
m_Masque_Layer
=
PadLayerMask
;
PadLayerMask
|=
SOLDERPASTE_LAYER_CU
;
if
(
m_PadLayerSilkCmp
->
GetValue
()
)
if
(
CurrentPad
)
// Set Pad Name & Num
PadLayerMask
|=
SILKSCREEN_LAYER_CMP
;
{
if
(
m_PadLayerSilkCu
->
GetValue
()
)
m_Parent
->
SaveCopyInUndoList
(
m_Parent
->
m_Pcb
->
m_Modules
);
PadLayerMask
|=
SILKSCREEN_LAYER_CU
;
MODULE
*
Module
;
if
(
m_PadLayerMaskCmp
->
GetValue
()
)
Module
=
(
MODULE
*
)
CurrentPad
->
m_Parent
;
PadLayerMask
|=
SOLDERMASK_LAYER_CMP
;
Module
->
m_LastEdit_Time
=
time
(
NULL
);
if
(
m_PadLayerMaskCu
->
GetValue
()
)
PadLayerMask
|=
SOLDERMASK_LAYER_CU
;
if
(
m_DC
)
CurrentPad
->
Draw
(
m_Parent
->
DrawPanel
,
m_DC
,
wxPoint
(
0
,
0
),
GR_XOR
);
if
(
m_PadLayerECO1
->
GetValue
()
)
CurrentPad
->
m_PadShape
=
g_Pad_Master
.
m_PadShape
;
PadLayerMask
|=
ECO1_LAYER
;
CurrentPad
->
m_Attribut
=
g_Pad_Master
.
m_Attribut
;
if
(
m_PadLayerECO2
->
GetValue
()
)
CurrentPad
->
m_Pos
=
g_Pad_Master
.
m_Pos
;
PadLayerMask
|=
ECO2_LAYER
;
/* compute the pos 0 value, i.e. pad position for module orient = 0 i.e.
if
(
m_PadLayerDraft
->
GetValue
()
)
refer to module origin (module position) */
PadLayerMask
|=
DRAW_LAYER
;
CurrentPad
->
m_Pos0
=
CurrentPad
->
m_Pos
;
CurrentPad
->
m_Pos0
.
x
-=
Module
->
m_Pos
.
x
;
g_Pad_Master
.
m_Masque_Layer
=
PadLayerMask
;
CurrentPad
->
m_Pos0
.
y
-=
Module
->
m_Pos
.
y
;
CurrentPad
->
m_Orient
=
g_Pad_Master
.
m_Orient
+
Module
->
m_Orient
;
if
(
CurrentPad
)
// Set Pad Name & Num
RotatePoint
(
&
CurrentPad
->
m_Pos0
.
x
,
&
CurrentPad
->
m_Pos0
.
y
,
-
Module
->
m_Orient
);
{
m_Parent
->
SaveCopyInUndoList
(
m_Parent
->
m_Pcb
->
m_Modules
);
CurrentPad
->
m_Size
=
g_Pad_Master
.
m_Size
;
MODULE
*
Module
;
CurrentPad
->
m_DeltaSize
=
g_Pad_Master
.
m_DeltaSize
;
Module
=
(
MODULE
*
)
CurrentPad
->
m_Parent
;
CurrentPad
->
m_Drill
=
g_Pad_Master
.
m_Drill
;
Module
->
m_LastEdit_Time
=
time
(
NULL
);
CurrentPad
->
m_DrillShape
=
g_Pad_Master
.
m_DrillShape
;
CurrentPad
->
m_Offset
=
g_Pad_Master
.
m_Offset
;
if
(
m_DC
)
CurrentPad
->
m_Masque_Layer
=
g_Pad_Master
.
m_Masque_Layer
;
CurrentPad
->
Draw
(
m_Parent
->
DrawPanel
,
m_DC
,
wxPoint
(
0
,
0
),
GR_XOR
);
CurrentPad
->
SetPadName
(
g_Current_PadName
);
CurrentPad
->
m_PadShape
=
g_Pad_Master
.
m_PadShape
;
CurrentPad
->
m_Netname
=
Current_PadNetName
;
CurrentPad
->
m_Attribut
=
g_Pad_Master
.
m_Attribut
;
if
(
Current_PadNetName
.
IsEmpty
()
)
CurrentPad
->
m_NetCode
=
0
;
CurrentPad
->
m_Pos
=
g_Pad_Master
.
m_Pos
;
switch
(
CurrentPad
->
m_PadShape
)
/* compute the pos 0 value, i.e. pad position for module orient = 0 i.e.
{
* refer to module origin (module position) */
case
CIRCLE
:
CurrentPad
->
m_Pos0
=
CurrentPad
->
m_Pos
;
CurrentPad
->
m_DeltaSize
=
wxSize
(
0
,
0
);
CurrentPad
->
m_Pos0
.
x
-=
Module
->
m_Pos
.
x
;
CurrentPad
->
m_Size
.
y
=
CurrentPad
->
m_Size
.
x
;
CurrentPad
->
m_Pos0
.
y
-=
Module
->
m_Pos
.
y
;
break
;
CurrentPad
->
m_Orient
=
g_Pad_Master
.
m_Orient
+
Module
->
m_Orient
;
RotatePoint
(
&
CurrentPad
->
m_Pos0
.
x
,
&
CurrentPad
->
m_Pos0
.
y
,
-
Module
->
m_Orient
);
case
RECT
:
CurrentPad
->
m_DeltaSize
=
wxSize
(
0
,
0
);
CurrentPad
->
m_Size
=
g_Pad_Master
.
m_Size
;
break
;
CurrentPad
->
m_DeltaSize
=
g_Pad_Master
.
m_DeltaSize
;
CurrentPad
->
m_Drill
=
g_Pad_Master
.
m_Drill
;
case
OVALE
:
CurrentPad
->
m_DrillShape
=
g_Pad_Master
.
m_DrillShape
;
CurrentPad
->
m_DeltaSize
=
wxSize
(
0
,
0
);
CurrentPad
->
m_Offset
=
g_Pad_Master
.
m_Offset
;
break
;
CurrentPad
->
m_Masque_Layer
=
g_Pad_Master
.
m_Masque_Layer
;
CurrentPad
->
SetPadName
(
g_Current_PadName
);
case
TRAPEZE
:
CurrentPad
->
m_Netname
=
Current_PadNetName
;
break
;
if
(
Current_PadNetName
.
IsEmpty
()
)
}
CurrentPad
->
SetNet
(
0
);
switch
(
CurrentPad
->
m_Attribut
)
switch
(
CurrentPad
->
m_PadShape
)
{
{
case
STANDARD
:
case
CIRCLE
:
break
;
CurrentPad
->
m_DeltaSize
=
wxSize
(
0
,
0
);
CurrentPad
->
m_Size
.
y
=
CurrentPad
->
m_Size
.
x
;
case
CONN
:
break
;
case
SMD
:
CurrentPad
->
m_Offset
=
wxSize
(
0
,
0
);
case
RECT
:
CurrentPad
->
m_Drill
=
wxSize
(
0
,
0
);
CurrentPad
->
m_DeltaSize
=
wxSize
(
0
,
0
);
break
;
break
;
case
P_HOLE
:
case
OVALE
:
case
MECA
:
CurrentPad
->
m_DeltaSize
=
wxSize
(
0
,
0
);
break
;
break
;
}
case
TRAPEZE
:
CurrentPad
->
ComputeRayon
();
break
;
}
Module
->
Set_Rectangle_Encadrement
();
CurrentPad
->
Display_Infos
(
m_Parent
);
switch
(
CurrentPad
->
m_Attribut
)
if
(
m_DC
)
CurrentPad
->
Draw
(
m_Parent
->
DrawPanel
,
m_DC
,
wxPoint
(
0
,
0
),
GR_OR
);
{
m_Parent
->
GetScreen
()
->
SetModify
();
case
STANDARD
:
}
break
;
Close
();
case
CONN
:
case
SMD
:
if
(
m_DC
)
m_Parent
->
DrawPanel
->
CursorOn
(
m_DC
);
CurrentPad
->
m_Offset
=
wxSize
(
0
,
0
);
CurrentPad
->
m_Drill
=
wxSize
(
0
,
0
);
break
;
case
P_HOLE
:
case
MECA
:
break
;
}
CurrentPad
->
ComputeRayon
();
Module
->
Set_Rectangle_Encadrement
();
CurrentPad
->
Display_Infos
(
m_Parent
);
if
(
m_DC
)
CurrentPad
->
Draw
(
m_Parent
->
DrawPanel
,
m_DC
,
wxPoint
(
0
,
0
),
GR_OR
);
m_Parent
->
GetScreen
()
->
SetModify
();
}
Close
();
if
(
m_DC
)
m_Parent
->
DrawPanel
->
CursorOn
(
m_DC
);
}
}
pcbnew/editrack-part2.cpp
View file @
3cd47555
...
@@ -146,7 +146,7 @@ void WinEDA_PcbFrame::ExChange_Track_Layer( TRACK* pt_segm, wxDC* DC )
...
@@ -146,7 +146,7 @@ void WinEDA_PcbFrame::ExChange_Track_Layer( TRACK* pt_segm, wxDC* DC )
pt_segm
->
end
=
Locate_Pad_Connecte
(
m_Pcb
,
pt_segm
,
END
);
pt_segm
->
end
=
Locate_Pad_Connecte
(
m_Pcb
,
pt_segm
,
END
);
}
}
test_1_net_connexion
(
DC
,
pt_track
->
m_NetCode
);
test_1_net_connexion
(
DC
,
pt_track
->
GetNet
()
);
pt_track
->
Display_Infos
(
this
);
pt_track
->
Display_Infos
(
this
);
GetScreen
()
->
SetModify
();
GetScreen
()
->
SetModify
();
}
}
...
@@ -219,7 +219,7 @@ void WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
...
@@ -219,7 +219,7 @@ void WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
Via
->
m_Flags
=
IS_NEW
;
Via
->
m_Flags
=
IS_NEW
;
Via
->
m_Width
=
g_DesignSettings
.
m_CurrentViaSize
;
Via
->
m_Width
=
g_DesignSettings
.
m_CurrentViaSize
;
Via
->
m_Shape
=
g_DesignSettings
.
m_CurrentViaType
;
Via
->
m_Shape
=
g_DesignSettings
.
m_CurrentViaType
;
Via
->
m_NetCode
=
g_HightLigth_NetCode
;
Via
->
SetNet
(
g_HightLigth_NetCode
)
;
Via
->
m_Start
=
Via
->
m_End
=
g_CurrentTrackSegment
->
m_End
;
Via
->
m_Start
=
Via
->
m_End
=
g_CurrentTrackSegment
->
m_End
;
int
old_layer
=
GetScreen
()
->
m_Active_Layer
;
int
old_layer
=
GetScreen
()
->
m_Active_Layer
;
...
@@ -321,7 +321,7 @@ void WinEDA_PcbFrame::Affiche_Status_Net( wxDC* DC )
...
@@ -321,7 +321,7 @@ void WinEDA_PcbFrame::Affiche_Status_Net( wxDC* DC )
if
(
pt_segm
==
NULL
)
if
(
pt_segm
==
NULL
)
m_Pcb
->
Display_Infos
(
this
);
m_Pcb
->
Display_Infos
(
this
);
else
else
test_1_net_connexion
(
DC
,
pt_segm
->
m_NetCode
);
test_1_net_connexion
(
DC
,
pt_segm
->
GetNet
()
);
}
}
...
@@ -362,7 +362,7 @@ void WinEDA_PcbFrame::Show_1_Ratsnest( EDA_BaseStruct* item, wxDC* DC )
...
@@ -362,7 +362,7 @@ void WinEDA_PcbFrame::Show_1_Ratsnest( EDA_BaseStruct* item, wxDC* DC )
pt_chevelu
=
(
CHEVELU
*
)
m_Pcb
->
m_Ratsnest
;
pt_chevelu
=
(
CHEVELU
*
)
m_Pcb
->
m_Ratsnest
;
for
(
ii
=
m_Pcb
->
GetNumRatsnests
();
ii
>
0
;
pt_chevelu
++
,
ii
--
)
for
(
ii
=
m_Pcb
->
GetNumRatsnests
();
ii
>
0
;
pt_chevelu
++
,
ii
--
)
{
{
if
(
pt_chevelu
->
m_NetCode
==
pt_pad
->
m_NetCode
)
if
(
pt_chevelu
->
GetNet
()
==
pt_pad
->
GetNet
()
)
{
{
if
(
(
pt_chevelu
->
status
&
CH_VISIBLE
)
!=
0
)
if
(
(
pt_chevelu
->
status
&
CH_VISIBLE
)
!=
0
)
continue
;
continue
;
...
...
pcbnew/editrack.cpp
View file @
3cd47555
...
@@ -119,12 +119,12 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* track, wxDC* DC )
...
@@ -119,12 +119,12 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* track, wxDC* DC )
/* le debut de la piste est remis sur le centre du pad */
/* le debut de la piste est remis sur le centre du pad */
pos
=
pt_pad
->
m_Pos
;
pos
=
pt_pad
->
m_Pos
;
g_HightLigth_NetCode
=
pt_pad
->
m_NetCode
;
g_HightLigth_NetCode
=
pt_pad
->
GetNet
()
;
}
}
else
/* le point d'accrochage est un segment */
else
/* le point d'accrochage est un segment */
{
{
adr_buf
=
(
TRACK
*
)
LockPoint
;
adr_buf
=
(
TRACK
*
)
LockPoint
;
g_HightLigth_NetCode
=
adr_buf
->
m_NetCode
;
g_HightLigth_NetCode
=
adr_buf
->
GetNet
()
;
CreateLockPoint
(
&
pos
.
x
,
&
pos
.
y
,
adr_buf
,
NULL
);
CreateLockPoint
(
&
pos
.
x
,
&
pos
.
y
,
adr_buf
,
NULL
);
}
}
}
}
...
@@ -137,7 +137,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* track, wxDC* DC )
...
@@ -137,7 +137,7 @@ TRACK* WinEDA_PcbFrame::Begin_Route( TRACK* track, wxDC* DC )
g_CurrentTrackSegment
->
m_Width
=
g_DesignSettings
.
m_CurrentTrackWidth
;
g_CurrentTrackSegment
->
m_Width
=
g_DesignSettings
.
m_CurrentTrackWidth
;
g_CurrentTrackSegment
->
m_Start
=
pos
;
g_CurrentTrackSegment
->
m_Start
=
pos
;
g_CurrentTrackSegment
->
m_End
=
g_CurrentTrackSegment
->
m_Start
;
g_CurrentTrackSegment
->
m_End
=
g_CurrentTrackSegment
->
m_Start
;
g_CurrentTrackSegment
->
m_NetCode
=
g_HightLigth_NetCode
;
g_CurrentTrackSegment
->
SetNet
(
g_HightLigth_NetCode
)
;
if
(
pt_pad
)
if
(
pt_pad
)
{
{
g_CurrentTrackSegment
->
start
=
pt_pad
;
g_CurrentTrackSegment
->
start
=
pt_pad
;
...
@@ -418,7 +418,7 @@ void WinEDA_PcbFrame::End_Route( TRACK* track, wxDC* DC )
...
@@ -418,7 +418,7 @@ void WinEDA_PcbFrame::End_Route( TRACK* track, wxDC* DC )
* peut-etre creer un point d'ancrage */
* peut-etre creer un point d'ancrage */
{
{
adr_buf
=
(
TRACK
*
)
LockPoint
;
adr_buf
=
(
TRACK
*
)
LockPoint
;
g_HightLigth_NetCode
=
adr_buf
->
m_NetCode
;
g_HightLigth_NetCode
=
adr_buf
->
GetNet
()
;
/* creation eventuelle d'un point d'accrochage */
/* creation eventuelle d'un point d'accrochage */
LockPoint
=
CreateLockPoint
(
&
g_CurrentTrackSegment
->
m_End
.
x
,
LockPoint
=
CreateLockPoint
(
&
g_CurrentTrackSegment
->
m_End
.
x
,
&
g_CurrentTrackSegment
->
m_End
.
y
,
&
g_CurrentTrackSegment
->
m_End
.
y
,
...
@@ -458,7 +458,7 @@ void WinEDA_PcbFrame::End_Route( TRACK* track, wxDC* DC )
...
@@ -458,7 +458,7 @@ void WinEDA_PcbFrame::End_Route( TRACK* track, wxDC* DC )
}
}
/* compute the new rastnest : */
/* compute the new rastnest : */
test_1_net_connexion
(
DC
,
g_FirstTrackSegment
->
m_NetCode
);
test_1_net_connexion
(
DC
,
g_FirstTrackSegment
->
GetNet
()
);
GetScreen
()
->
SetModify
();
GetScreen
()
->
SetModify
();
m_Pcb
->
Display_Infos
(
this
);
m_Pcb
->
Display_Infos
(
this
);
...
...
pcbnew/editrout.cpp
View file @
3cd47555
...
@@ -85,7 +85,7 @@ int nb_segm_non_modifies = 0;
...
@@ -85,7 +85,7 @@ int nb_segm_non_modifies = 0;
/* balayage des segments */
/* balayage des segments */
for
(
pt_segm
=
m_Pcb
->
m_Track
;
pt_segm
!=
NULL
;
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
)
for
(
pt_segm
=
m_Pcb
->
m_Track
;
pt_segm
!=
NULL
;
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
)
{
{
if
(
Netcode
!=
pt_segm
->
m_NetCode
)
/* mauvaise piste */
if
(
Netcode
!=
pt_segm
->
GetNet
()
)
/* mauvaise piste */
continue
;
continue
;
/* piste d'un net trouvee */
/* piste d'un net trouvee */
errdrc
=
Edit_TrackSegm_Width
(
DC
,
pt_segm
);
errdrc
=
Edit_TrackSegm_Width
(
DC
,
pt_segm
);
...
...
pcbnew/export_gencad.cpp
View file @
3cd47555
...
@@ -476,7 +476,7 @@ void CreateSignalsSection( FILE* file, BOARD* pcb )
...
@@ -476,7 +476,7 @@ void CreateSignalsSection( FILE* file, BOARD* pcb )
equipot
->
m_Netname
<<
wxT
(
"NoConnection"
)
<<
NbNoConn
++
;
equipot
->
m_Netname
<<
wxT
(
"NoConnection"
)
<<
NbNoConn
++
;
}
}
if
(
equipot
->
m_NetCode
<=
0
)
// dummy equipot (non connexion)
if
(
equipot
->
GetNet
()
<=
0
)
// dummy equipot (non connexion)
continue
;
continue
;
msg
=
wxT
(
"
\n
SIGNAL "
)
+
equipot
->
m_Netname
;
msg
=
wxT
(
"
\n
SIGNAL "
)
+
equipot
->
m_Netname
;
...
@@ -487,7 +487,7 @@ void CreateSignalsSection( FILE* file, BOARD* pcb )
...
@@ -487,7 +487,7 @@ void CreateSignalsSection( FILE* file, BOARD* pcb )
for
(
pad
=
module
->
m_Pads
;
pad
!=
NULL
;
pad
=
(
D_PAD
*
)
pad
->
Pnext
)
for
(
pad
=
module
->
m_Pads
;
pad
!=
NULL
;
pad
=
(
D_PAD
*
)
pad
->
Pnext
)
{
{
wxString
padname
;
wxString
padname
;
if
(
pad
->
m_NetCode
!=
equipot
->
m_NetCode
)
if
(
pad
->
GetNet
()
!=
equipot
->
GetNet
()
)
continue
;
continue
;
pad
->
ReturnStringPadName
(
padname
);
pad
->
ReturnStringPadName
(
padname
);
msg
.
Printf
(
wxT
(
"NODE %s %.4s"
),
msg
.
Printf
(
wxT
(
"NODE %s %.4s"
),
...
@@ -545,7 +545,7 @@ static int Track_list_Sort_by_Netcode( const void* refptr, const void* objptr )
...
@@ -545,7 +545,7 @@ static int Track_list_Sort_by_Netcode( const void* refptr, const void* objptr )
ref
=
*
(
(
TRACK
**
)
refptr
);
ref
=
*
(
(
TRACK
**
)
refptr
);
cmp
=
*
(
(
TRACK
**
)
objptr
);
cmp
=
*
(
(
TRACK
**
)
objptr
);
if
(
(
diff
=
ref
->
m_NetCode
-
cmp
->
m_NetCode
)
)
if
(
(
diff
=
ref
->
GetNet
()
-
cmp
->
GetNet
()
)
)
return
diff
;
return
diff
;
if
(
(
diff
=
ref
->
m_Width
-
cmp
->
m_Width
)
)
if
(
(
diff
=
ref
->
m_Width
-
cmp
->
m_Width
)
)
return
diff
;
return
diff
;
...
@@ -606,10 +606,10 @@ void CreateRoutesSection( FILE* file, BOARD* pcb )
...
@@ -606,10 +606,10 @@ void CreateRoutesSection( FILE* file, BOARD* pcb )
for
(
ii
=
0
;
ii
<
nbitems
;
ii
++
)
for
(
ii
=
0
;
ii
<
nbitems
;
ii
++
)
{
{
track
=
tracklist
[
ii
];
track
=
tracklist
[
ii
];
if
(
old_netcode
!=
track
->
m_NetCode
)
if
(
old_netcode
!=
track
->
GetNet
()
)
{
{
old_netcode
=
track
->
m_NetCode
;
old_netcode
=
track
->
GetNet
()
;
EQUIPOT
*
equipot
=
pcb
->
FindNet
(
track
->
m_NetCode
);
EQUIPOT
*
equipot
=
pcb
->
FindNet
(
track
->
GetNet
()
);
wxString
netname
;
wxString
netname
;
if
(
equipot
&&
(
equipot
->
m_Netname
!=
wxEmptyString
)
)
if
(
equipot
&&
(
equipot
->
m_Netname
!=
wxEmptyString
)
)
netname
=
equipot
->
m_Netname
;
netname
=
equipot
->
m_Netname
;
...
...
pcbnew/ioascii.cpp
View file @
3cd47555
...
@@ -177,7 +177,7 @@ int WinEDA_BasePcbFrame::ReadListeSegmentDescr( wxDC* DC, FILE* File,
...
@@ -177,7 +177,7 @@ int WinEDA_BasePcbFrame::ReadListeSegmentDescr( wxDC* DC, FILE* File,
PtSegm
->
m_Drill
=
-
1
;
PtSegm
->
m_Drill
=
-
1
;
PtSegm
->
SetLayer
(
layer
);
PtSegm
->
SetLayer
(
layer
);
PtSegm
->
m_NetCode
=
net_code
;
PtSegm
->
SetNet
(
net_code
)
;
PtSegm
->
SetState
(
flags
,
ON
);
PtSegm
->
SetState
(
flags
,
ON
);
#ifdef PCBNEW
#ifdef PCBNEW
...
@@ -356,7 +356,8 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum )
...
@@ -356,7 +356,8 @@ int WinEDA_BasePcbFrame::ReadSetup( FILE* File, int* LineNum )
data
=
strtok
(
NULL
,
" =
\n\r
"
);
data
=
strtok
(
NULL
,
" =
\n\r
"
);
if
(
data
)
if
(
data
)
gy
=
atoi
(
data
);
gy
=
atoi
(
data
);
m_Auxiliary_Axis_Position
.
x
=
gx
;
m_Auxiliary_Axis_Position
.
y
=
gy
;
m_Auxiliary_Axis_Position
.
x
=
gx
;
m_Auxiliary_Axis_Position
.
y
=
gy
;
continue
;
continue
;
}
}
#ifdef PCBNEW
#ifdef PCBNEW
...
...
pcbnew/modules.cpp
View file @
3cd47555
...
@@ -499,6 +499,7 @@ void WinEDA_BasePcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC )
...
@@ -499,6 +499,7 @@ void WinEDA_BasePcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC )
if
(
DC
)
if
(
DC
)
{
{
Module
->
Draw
(
DrawPanel
,
DC
,
wxPoint
(
0
,
0
),
GR_OR
);
Module
->
Draw
(
DrawPanel
,
DC
,
wxPoint
(
0
,
0
),
GR_OR
);
/* affichage chevelu general si necessaire */
/* affichage chevelu general si necessaire */
ReCompile_Ratsnest_After_Changes
(
DC
);
ReCompile_Ratsnest_After_Changes
(
DC
);
}
}
...
@@ -730,6 +731,7 @@ void WinEDA_BasePcbFrame::Rotate_Module( wxDC* DC, MODULE* module,
...
@@ -730,6 +731,7 @@ void WinEDA_BasePcbFrame::Rotate_Module( wxDC* DC, MODULE* module,
if
(
!
(
module
->
m_Flags
&
IS_MOVED
)
)
/* Rotation simple */
if
(
!
(
module
->
m_Flags
&
IS_MOVED
)
)
/* Rotation simple */
{
{
module
->
Draw
(
DrawPanel
,
DC
,
wxPoint
(
0
,
0
),
GR_OR
);
module
->
Draw
(
DrawPanel
,
DC
,
wxPoint
(
0
,
0
),
GR_OR
);
/* Reaffichage chevelu general si necessaire */
/* Reaffichage chevelu general si necessaire */
ReCompile_Ratsnest_After_Changes
(
DC
);
ReCompile_Ratsnest_After_Changes
(
DC
);
}
}
...
...
pcbnew/move_copy_track.cpp
View file @
3cd47555
...
@@ -194,7 +194,7 @@ void WinEDA_PcbFrame::Start_MoveOneTrackSegment( TRACK* track, wxDC* DC, bool Dr
...
@@ -194,7 +194,7 @@ void WinEDA_PcbFrame::Start_MoveOneTrackSegment( TRACK* track, wxDC* DC, bool Dr
{
{
track
->
m_Flags
=
IS_DRAGGED
|
STARTPOINT
|
ENDPOINT
;
track
->
m_Flags
=
IS_DRAGGED
|
STARTPOINT
|
ENDPOINT
;
Collect_TrackSegmentsToDrag
(
DrawPanel
,
DC
,
track
->
m_Start
,
Collect_TrackSegmentsToDrag
(
DrawPanel
,
DC
,
track
->
m_Start
,
track
->
ReturnMaskLayer
(),
track
->
m_NetCode
);
track
->
ReturnMaskLayer
(),
track
->
GetNet
()
);
NewTrack
=
track
;
NewTrack
=
track
;
NbPtNewTrack
=
1
;
NbPtNewTrack
=
1
;
PosInit
=
track
->
m_Start
;
PosInit
=
track
->
m_Start
;
...
@@ -204,7 +204,7 @@ void WinEDA_PcbFrame::Start_MoveOneTrackSegment( TRACK* track, wxDC* DC, bool Dr
...
@@ -204,7 +204,7 @@ void WinEDA_PcbFrame::Start_MoveOneTrackSegment( TRACK* track, wxDC* DC, bool Dr
int
diag
=
track
->
IsPointOnEnds
(
GetScreen
()
->
m_Curseur
,
-
1
);
int
diag
=
track
->
IsPointOnEnds
(
GetScreen
()
->
m_Curseur
,
-
1
);
wxPoint
pos
=
(
diag
&
STARTPOINT
)
?
track
->
m_Start
:
track
->
m_End
;
wxPoint
pos
=
(
diag
&
STARTPOINT
)
?
track
->
m_Start
:
track
->
m_End
;
Collect_TrackSegmentsToDrag
(
DrawPanel
,
DC
,
pos
,
Collect_TrackSegmentsToDrag
(
DrawPanel
,
DC
,
pos
,
track
->
ReturnMaskLayer
(),
track
->
m_NetCode
);
track
->
ReturnMaskLayer
(),
track
->
GetNet
()
);
track
->
m_Flags
|=
IS_DRAGGED
;
track
->
m_Flags
|=
IS_DRAGGED
;
NewTrack
=
NULL
;
NewTrack
=
NULL
;
NbPtNewTrack
=
0
;
NbPtNewTrack
=
0
;
...
@@ -214,7 +214,7 @@ void WinEDA_PcbFrame::Start_MoveOneTrackSegment( TRACK* track, wxDC* DC, bool Dr
...
@@ -214,7 +214,7 @@ void WinEDA_PcbFrame::Start_MoveOneTrackSegment( TRACK* track, wxDC* DC, bool Dr
DrawPanel
->
ManageCurseur
=
Show_MoveTrack
;
DrawPanel
->
ManageCurseur
=
Show_MoveTrack
;
DrawPanel
->
ForceCloseManageCurseur
=
Exit_MoveTrack
;
DrawPanel
->
ForceCloseManageCurseur
=
Exit_MoveTrack
;
g_HightLigth_NetCode
=
track
->
m_NetCode
;
g_HightLigth_NetCode
=
track
->
GetNet
()
;
g_HightLigt_Status
=
TRUE
;
g_HightLigt_Status
=
TRUE
;
DrawHightLight
(
DC
,
g_HightLigth_NetCode
);
DrawHightLight
(
DC
,
g_HightLigth_NetCode
);
DrawPanel
->
ManageCurseur
(
DrawPanel
,
DC
,
TRUE
);
DrawPanel
->
ManageCurseur
(
DrawPanel
,
DC
,
TRUE
);
...
...
pcbnew/move_or_drag_track.cpp
View file @
3cd47555
...
@@ -618,7 +618,7 @@ void WinEDA_PcbFrame::Start_MoveOneNodeOrSegment( TRACK* track, wxDC* DC, int co
...
@@ -618,7 +618,7 @@ void WinEDA_PcbFrame::Start_MoveOneNodeOrSegment( TRACK* track, wxDC* DC, int co
if
(
command
!=
ID_POPUP_PCB_MOVE_TRACK_SEGMENT
)
if
(
command
!=
ID_POPUP_PCB_MOVE_TRACK_SEGMENT
)
{
{
Collect_TrackSegmentsToDrag
(
DrawPanel
,
DC
,
track
->
m_Start
,
Collect_TrackSegmentsToDrag
(
DrawPanel
,
DC
,
track
->
m_Start
,
track
->
ReturnMaskLayer
(),
track
->
m_NetCode
);
track
->
ReturnMaskLayer
(),
track
->
GetNet
()
);
}
}
NewTrack
=
track
;
NewTrack
=
track
;
NbPtNewTrack
=
1
;
NbPtNewTrack
=
1
;
...
@@ -639,17 +639,17 @@ void WinEDA_PcbFrame::Start_MoveOneNodeOrSegment( TRACK* track, wxDC* DC, int co
...
@@ -639,17 +639,17 @@ void WinEDA_PcbFrame::Start_MoveOneNodeOrSegment( TRACK* track, wxDC* DC, int co
case
ID_POPUP_PCB_DRAG_TRACK_SEGMENT
:
case
ID_POPUP_PCB_DRAG_TRACK_SEGMENT
:
pos
=
track
->
m_Start
;
pos
=
track
->
m_Start
;
Collect_TrackSegmentsToDrag
(
DrawPanel
,
DC
,
pos
,
Collect_TrackSegmentsToDrag
(
DrawPanel
,
DC
,
pos
,
track
->
ReturnMaskLayer
(),
track
->
m_NetCode
);
track
->
ReturnMaskLayer
(),
track
->
GetNet
()
);
pos
=
track
->
m_End
;
pos
=
track
->
m_End
;
track
->
m_Flags
|=
IS_DRAGGED
|
ENDPOINT
|
STARTPOINT
;
track
->
m_Flags
|=
IS_DRAGGED
|
ENDPOINT
|
STARTPOINT
;
Collect_TrackSegmentsToDrag
(
DrawPanel
,
DC
,
pos
,
Collect_TrackSegmentsToDrag
(
DrawPanel
,
DC
,
pos
,
track
->
ReturnMaskLayer
(),
track
->
m_NetCode
);
track
->
ReturnMaskLayer
(),
track
->
GetNet
()
);
break
;
break
;
case
ID_POPUP_PCB_MOVE_TRACK_NODE
:
case
ID_POPUP_PCB_MOVE_TRACK_NODE
:
pos
=
(
diag
&
STARTPOINT
)
?
track
->
m_Start
:
track
->
m_End
;
pos
=
(
diag
&
STARTPOINT
)
?
track
->
m_Start
:
track
->
m_End
;
Collect_TrackSegmentsToDrag
(
DrawPanel
,
DC
,
pos
,
Collect_TrackSegmentsToDrag
(
DrawPanel
,
DC
,
pos
,
track
->
ReturnMaskLayer
(),
track
->
m_NetCode
);
track
->
ReturnMaskLayer
(),
track
->
GetNet
()
);
PosInit
=
pos
;
PosInit
=
pos
;
break
;
break
;
}
}
...
@@ -660,7 +660,7 @@ void WinEDA_PcbFrame::Start_MoveOneNodeOrSegment( TRACK* track, wxDC* DC, int co
...
@@ -660,7 +660,7 @@ void WinEDA_PcbFrame::Start_MoveOneNodeOrSegment( TRACK* track, wxDC* DC, int co
DrawPanel
->
ManageCurseur
=
Show_MoveNode
;
DrawPanel
->
ManageCurseur
=
Show_MoveNode
;
DrawPanel
->
ForceCloseManageCurseur
=
Abort_MoveTrack
;
DrawPanel
->
ForceCloseManageCurseur
=
Abort_MoveTrack
;
g_HightLigth_NetCode
=
track
->
m_NetCode
;
g_HightLigth_NetCode
=
track
->
GetNet
()
;
g_HightLigt_Status
=
TRUE
;
g_HightLigt_Status
=
TRUE
;
DrawHightLight
(
DC
,
g_HightLigth_NetCode
);
DrawHightLight
(
DC
,
g_HightLigth_NetCode
);
DrawPanel
->
ManageCurseur
(
DrawPanel
,
DC
,
TRUE
);
DrawPanel
->
ManageCurseur
(
DrawPanel
,
DC
,
TRUE
);
...
@@ -753,7 +753,7 @@ void WinEDA_PcbFrame::Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC
...
@@ -753,7 +753,7 @@ void WinEDA_PcbFrame::Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC
DrawPanel
->
ManageCurseur
=
Show_Drag_Track_Segment_With_Cte_Slope
;
DrawPanel
->
ManageCurseur
=
Show_Drag_Track_Segment_With_Cte_Slope
;
DrawPanel
->
ForceCloseManageCurseur
=
Abort_MoveTrack
;
DrawPanel
->
ForceCloseManageCurseur
=
Abort_MoveTrack
;
g_HightLigth_NetCode
=
track
->
m_NetCode
;
g_HightLigth_NetCode
=
track
->
GetNet
()
;
g_HightLigt_Status
=
TRUE
;
g_HightLigt_Status
=
TRUE
;
DrawHightLight
(
DC
,
g_HightLigth_NetCode
);
DrawHightLight
(
DC
,
g_HightLigth_NetCode
);
...
@@ -778,7 +778,7 @@ bool WinEDA_PcbFrame::PlaceDraggedTrackSegment( TRACK* Track, wxDC* DC )
...
@@ -778,7 +778,7 @@ bool WinEDA_PcbFrame::PlaceDraggedTrackSegment( TRACK* Track, wxDC* DC )
if
(
Track
==
NULL
)
if
(
Track
==
NULL
)
return
FALSE
;
return
FALSE
;
int
current_net_code
=
Track
->
m_NetCode
;
int
current_net_code
=
Track
->
GetNet
()
;
// DRC control:
// DRC control:
if
(
Drc_On
)
if
(
Drc_On
)
...
...
pcbnew/ratsnest.cpp
View file @
3cd47555
...
@@ -79,7 +79,7 @@ static int tri_par_net( const void* o1, const void* o2 )
...
@@ -79,7 +79,7 @@ static int tri_par_net( const void* o1, const void* o2 )
LISTE_PAD
*
pt_ref
=
(
LISTE_PAD
*
)
o1
;
LISTE_PAD
*
pt_ref
=
(
LISTE_PAD
*
)
o1
;
LISTE_PAD
*
pt_compare
=
(
LISTE_PAD
*
)
o2
;
LISTE_PAD
*
pt_compare
=
(
LISTE_PAD
*
)
o2
;
return
(
*
pt_ref
)
->
m_NetCode
-
(
*
pt_compare
)
->
m_NetCode
;
return
(
*
pt_ref
)
->
GetNet
()
-
(
*
pt_compare
)
->
GetNet
()
;
}
}
...
@@ -151,9 +151,8 @@ static int gen_rats_block_to_block( WinEDA_DrawPanel* DrawPanel, wxDC* DC,
...
@@ -151,9 +151,8 @@ static int gen_rats_block_to_block( WinEDA_DrawPanel* DrawPanel, wxDC* DC,
continue
;
continue
;
/* Comparaison des distances des pastilles (calcul simplifie) */
/* Comparaison des distances des pastilles (calcul simplifie) */
current_dist
=
current_dist
=
abs
(
curr_pad
->
m_Pos
.
x
-
ref_pad
->
m_Pos
.
x
)
+
abs
(
curr_pad
->
m_Pos
.
x
-
ref_pad
->
m_Pos
.
x
)
abs
(
curr_pad
->
m_Pos
.
y
-
ref_pad
->
m_Pos
.
y
);
+
abs
(
curr_pad
->
m_Pos
.
y
-
ref_pad
->
m_Pos
.
y
);
if
(
dist_min
>
current_dist
)
if
(
dist_min
>
current_dist
)
{
{
...
@@ -177,7 +176,7 @@ static int gen_rats_block_to_block( WinEDA_DrawPanel* DrawPanel, wxDC* DC,
...
@@ -177,7 +176,7 @@ static int gen_rats_block_to_block( WinEDA_DrawPanel* DrawPanel, wxDC* DC,
pt_liste_pad
=
pt_liste_pad_block1
;
pt_liste_pad
=
pt_liste_pad_block1
;
(
*
nblinks
)
++
;
(
*
nblinks
)
++
;
g_pt_chevelu
->
m_NetCode
=
(
*
pt_liste_pad
)
->
m_NetCode
;
g_pt_chevelu
->
SetNet
(
(
*
pt_liste_pad
)
->
GetNet
()
)
;
g_pt_chevelu
->
status
=
CH_ACTIF
|
CH_VISIBLE
;
g_pt_chevelu
->
status
=
CH_ACTIF
|
CH_VISIBLE
;
g_pt_chevelu
->
dist
=
dist_min
;
g_pt_chevelu
->
dist
=
dist_min
;
g_pt_chevelu
->
pad_start
=
*
pt_liste_pad
;
g_pt_chevelu
->
pad_start
=
*
pt_liste_pad
;
...
@@ -255,9 +254,8 @@ static int gen_rats_pad_to_pad( WinEDA_DrawPanel* DrawPanel, wxDC* DC,
...
@@ -255,9 +254,8 @@ static int gen_rats_pad_to_pad( WinEDA_DrawPanel* DrawPanel, wxDC* DC,
pad
=
*
pt_liste_pad_aux
;
pad
=
*
pt_liste_pad_aux
;
/* Comparaison des distances des pastilles (calcul simplifie) */
/* Comparaison des distances des pastilles (calcul simplifie) */
current_dist
=
current_dist
=
abs
(
pad
->
m_Pos
.
x
-
ref_pad
->
m_Pos
.
x
)
+
abs
(
pad
->
m_Pos
.
x
-
ref_pad
->
m_Pos
.
x
)
abs
(
pad
->
m_Pos
.
y
-
ref_pad
->
m_Pos
.
y
);
+
abs
(
pad
->
m_Pos
.
y
-
ref_pad
->
m_Pos
.
y
);
if
(
dist_min
>
current_dist
)
if
(
dist_min
>
current_dist
)
{
{
...
@@ -285,7 +283,7 @@ static int gen_rats_pad_to_pad( WinEDA_DrawPanel* DrawPanel, wxDC* DC,
...
@@ -285,7 +283,7 @@ static int gen_rats_pad_to_pad( WinEDA_DrawPanel* DrawPanel, wxDC* DC,
}
}
(
*
nblinks
)
++
;
(
*
nblinks
)
++
;
g_pt_chevelu
->
m_NetCode
=
ref_pad
->
m_NetCode
;
g_pt_chevelu
->
SetNet
(
ref_pad
->
GetNet
()
)
;
g_pt_chevelu
->
status
=
CH_ACTIF
|
CH_VISIBLE
;
g_pt_chevelu
->
status
=
CH_ACTIF
|
CH_VISIBLE
;
g_pt_chevelu
->
dist
=
dist_min
;
g_pt_chevelu
->
dist
=
dist_min
;
g_pt_chevelu
->
pad_start
=
ref_pad
;
g_pt_chevelu
->
pad_start
=
ref_pad
;
...
@@ -396,7 +394,7 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC )
...
@@ -396,7 +394,7 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC )
pt_deb_liste_ch
=
g_pt_chevelu
;
pt_deb_liste_ch
=
g_pt_chevelu
;
pad
=
*
pt_liste_pad
;
pad
=
*
pt_liste_pad
;
/* saut des pads non connectes */
/* saut des pads non connectes */
if
(
pad
->
m_NetCode
==
0
)
if
(
pad
->
GetNet
()
==
0
)
{
{
pt_liste_pad
++
;
pt_start_liste
=
pt_liste_pad
;
pt_liste_pad
++
;
pt_start_liste
=
pt_liste_pad
;
continue
;
continue
;
...
@@ -409,7 +407,7 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC )
...
@@ -409,7 +407,7 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC )
if
(
pt_end_liste
>=
pt_liste_pad_limite
)
if
(
pt_end_liste
>=
pt_liste_pad_limite
)
break
;
break
;
pad
=
*
pt_end_liste
;
pad
=
*
pt_end_liste
;
if
(
pad
->
m_NetCode
!=
current_net_code
)
if
(
pad
->
GetNet
()
!=
current_net_code
)
break
;
break
;
nbpads
++
;
nbpads
++
;
if
(
num_block
<
pad
->
m_logical_connexion
)
if
(
num_block
<
pad
->
m_logical_connexion
)
...
@@ -454,7 +452,7 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC )
...
@@ -454,7 +452,7 @@ void WinEDA_BasePcbFrame::Build_Board_Ratsnest( wxDC* DC )
pt_liste_pad
=
pt_start_liste
=
pt_end_liste
;
pt_liste_pad
=
pt_start_liste
=
pt_end_liste
;
pt_deb_liste_ch
=
g_pt_chevelu
;
pt_deb_liste_ch
=
g_pt_chevelu
;
if
(
pt_start_liste
<
pt_liste_pad_limite
)
if
(
pt_start_liste
<
pt_liste_pad_limite
)
current_net_code
=
(
*
pt_start_liste
)
->
m_NetCode
;
current_net_code
=
(
*
pt_start_liste
)
->
GetNet
()
;
}
}
m_Pcb
->
m_NbNoconnect
=
noconn
;
m_Pcb
->
m_NbNoconnect
=
noconn
;
...
@@ -519,7 +517,7 @@ void WinEDA_BasePcbFrame::DrawGeneralRatsnest( wxDC* DC, int net_code )
...
@@ -519,7 +517,7 @@ void WinEDA_BasePcbFrame::DrawGeneralRatsnest( wxDC* DC, int net_code )
if
(
(
Chevelu
->
status
&
(
CH_VISIBLE
|
CH_ACTIF
)
)
!=
(
CH_VISIBLE
|
CH_ACTIF
)
)
if
(
(
Chevelu
->
status
&
(
CH_VISIBLE
|
CH_ACTIF
)
)
!=
(
CH_VISIBLE
|
CH_ACTIF
)
)
continue
;
continue
;
if
(
(
net_code
<=
0
)
||
(
net_code
==
Chevelu
->
m_NetCode
)
)
if
(
(
net_code
<=
0
)
||
(
net_code
==
Chevelu
->
GetNet
()
)
)
{
{
GRLine
(
&
DrawPanel
->
m_ClipBox
,
DC
,
GRLine
(
&
DrawPanel
->
m_ClipBox
,
DC
,
Chevelu
->
pad_start
->
m_Pos
.
x
,
Chevelu
->
pad_start
->
m_Pos
.
y
,
Chevelu
->
pad_start
->
m_Pos
.
x
,
Chevelu
->
pad_start
->
m_Pos
.
y
,
...
@@ -765,7 +763,7 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code()
...
@@ -765,7 +763,7 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code()
{
{
if
(
(
*
pad_courant
)
->
m_Netname
.
IsEmpty
()
)
// pad non connecte
if
(
(
*
pad_courant
)
->
m_Netname
.
IsEmpty
()
)
// pad non connecte
{
{
(
*
pad_courant
)
->
m_NetCode
=
0
;
(
*
pad_courant
)
->
SetNet
(
0
)
;
continue
;
continue
;
}
}
...
@@ -784,10 +782,10 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code()
...
@@ -784,10 +782,10 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code()
/* si pad_ref = pad_courant: nouveau net sinon, deja net deja traite */
/* si pad_ref = pad_courant: nouveau net sinon, deja net deja traite */
if
(
pad_ref
==
pad_courant
)
if
(
pad_ref
==
pad_courant
)
{
{
m_Pcb
->
m_NbNets
++
;
(
*
pad_courant
)
->
m_NetCode
=
m_Pcb
->
m_NbNets
;
m_Pcb
->
m_NbNets
++
;
(
*
pad_courant
)
->
SetNet
(
m_Pcb
->
m_NbNets
)
;
}
}
else
else
(
*
pad_courant
)
->
m_NetCode
=
(
*
pad_ref
)
->
m_NetCode
;
(
*
pad_courant
)
->
SetNet
(
(
*
pad_ref
)
->
GetNet
()
)
;
}
}
/* Construction ou correction de la liste des equipotentielles,
/* Construction ou correction de la liste des equipotentielles,
...
@@ -815,7 +813,7 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code()
...
@@ -815,7 +813,7 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code()
pt_equipot
->
Pnext
=
NULL
;
pt_equipot
->
Pnext
=
NULL
;
}
}
pt_equipot
->
m_NetCode
=
ii
;
// Mise a jour du numero d'equipot
pt_equipot
->
SetNet
(
ii
)
;
// Mise a jour du numero d'equipot
pt_equipot
->
m_NbNodes
=
0
;
pt_equipot
->
m_NbNodes
=
0
;
pt_equipot
->
m_Netname
.
Empty
();
pt_equipot
->
m_Netname
.
Empty
();
...
@@ -839,7 +837,7 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code()
...
@@ -839,7 +837,7 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code()
/* Placement des noms de net en structure EQUIPOT */
/* Placement des noms de net en structure EQUIPOT */
for
(
ii
=
m_Pcb
->
m_NbPads
;
ii
>
0
;
pad_courant
++
,
ii
--
)
for
(
ii
=
m_Pcb
->
m_NbPads
;
ii
>
0
;
pad_courant
++
,
ii
--
)
{
{
jj
=
(
*
pad_courant
)
->
m_NetCode
;
jj
=
(
*
pad_courant
)
->
GetNet
()
;
pt_equipot
=
BufPtEquipot
[
jj
];
pt_equipot
=
BufPtEquipot
[
jj
];
pt_equipot
->
m_NbNodes
++
;
pt_equipot
->
m_NbNodes
++
;
if
(
pt_equipot
->
m_Netname
.
IsEmpty
()
)
if
(
pt_equipot
->
m_Netname
.
IsEmpty
()
)
...
@@ -926,7 +924,7 @@ void WinEDA_BasePcbFrame::build_liste_pads()
...
@@ -926,7 +924,7 @@ void WinEDA_BasePcbFrame::build_liste_pads()
PtPad
->
m_logical_connexion
=
0
;
PtPad
->
m_logical_connexion
=
0
;
PtPad
->
m_Parent
=
Module
;
PtPad
->
m_Parent
=
Module
;
if
(
PtPad
->
m_NetCode
)
if
(
PtPad
->
GetNet
()
)
m_Pcb
->
m_NbNodes
++
;
m_Pcb
->
m_NbNodes
++
;
pt_liste_pad
++
;
pt_liste_pad
++
;
...
@@ -998,7 +996,7 @@ char* WinEDA_BasePcbFrame::build_ratsnest_module( wxDC* DC, MODULE* Module )
...
@@ -998,7 +996,7 @@ char* WinEDA_BasePcbFrame::build_ratsnest_module( wxDC* DC, MODULE* Module )
pad_ref
=
Module
->
m_Pads
;
pad_ref
=
Module
->
m_Pads
;
for
(
;
pad_ref
!=
NULL
;
pad_ref
=
(
D_PAD
*
)
pad_ref
->
Pnext
)
for
(
;
pad_ref
!=
NULL
;
pad_ref
=
(
D_PAD
*
)
pad_ref
->
Pnext
)
{
{
if
(
pad_ref
->
m_NetCode
==
0
)
if
(
pad_ref
->
GetNet
()
==
0
)
continue
;
continue
;
*
pt_liste_pad
=
pad_ref
;
*
pt_liste_pad
=
pad_ref
;
...
@@ -1021,15 +1019,15 @@ char* WinEDA_BasePcbFrame::build_ratsnest_module( wxDC* DC, MODULE* Module )
...
@@ -1021,15 +1019,15 @@ char* WinEDA_BasePcbFrame::build_ratsnest_module( wxDC* DC, MODULE* Module )
for
(
ii
=
0
;
ii
<
nb_pads_ref
;
ii
++
)
for
(
ii
=
0
;
ii
<
nb_pads_ref
;
ii
++
)
{
{
pad_ref
=
pt_liste_ref
[
ii
];
pad_ref
=
pt_liste_ref
[
ii
];
if
(
pad_ref
->
m_NetCode
==
current_net_code
)
if
(
pad_ref
->
GetNet
()
==
current_net_code
)
continue
;
continue
;
current_net_code
=
pad_ref
->
m_NetCode
;
current_net_code
=
pad_ref
->
GetNet
()
;
pt_liste_generale
=
m_Pcb
->
m_Pads
;
pt_liste_generale
=
m_Pcb
->
m_Pads
;
for
(
jj
=
m_Pcb
->
m_NbPads
;
jj
>
0
;
jj
--
)
for
(
jj
=
m_Pcb
->
m_NbPads
;
jj
>
0
;
jj
--
)
{
{
pad_externe
=
*
pt_liste_generale
;
pt_liste_generale
++
;
pad_externe
=
*
pt_liste_generale
;
pt_liste_generale
++
;
if
(
pad_externe
->
m_NetCode
!=
current_net_code
)
if
(
pad_externe
->
GetNet
()
!=
current_net_code
)
continue
;
continue
;
if
(
pad_externe
->
m_Parent
==
Module
)
if
(
pad_externe
->
m_Parent
==
Module
)
...
@@ -1056,7 +1054,7 @@ char* WinEDA_BasePcbFrame::build_ratsnest_module( wxDC* DC, MODULE* Module )
...
@@ -1056,7 +1054,7 @@ char* WinEDA_BasePcbFrame::build_ratsnest_module( wxDC* DC, MODULE* Module )
g_pt_chevelu
=
local_liste_chevelu
;
g_pt_chevelu
=
local_liste_chevelu
;
pt_liste_pad
=
pt_start_liste
=
(
LISTE_PAD
*
)
adr_lowmem
;
pt_liste_pad
=
pt_start_liste
=
(
LISTE_PAD
*
)
adr_lowmem
;
pt_liste_pad_limite
=
pt_liste_pad
+
nb_pads_ref
;
pt_liste_pad_limite
=
pt_liste_pad
+
nb_pads_ref
;
current_net_code
=
(
*
pt_liste_pad
)
->
m_NetCode
;
current_net_code
=
(
*
pt_liste_pad
)
->
GetNet
()
;
for
(
;
pt_liste_pad
<
pt_liste_pad_limite
;
)
for
(
;
pt_liste_pad
<
pt_liste_pad_limite
;
)
{
{
...
@@ -1067,7 +1065,7 @@ char* WinEDA_BasePcbFrame::build_ratsnest_module( wxDC* DC, MODULE* Module )
...
@@ -1067,7 +1065,7 @@ char* WinEDA_BasePcbFrame::build_ratsnest_module( wxDC* DC, MODULE* Module )
if
(
pt_end_liste
>=
pt_liste_pad_limite
)
if
(
pt_end_liste
>=
pt_liste_pad_limite
)
break
;
break
;
if
(
(
*
pt_end_liste
)
->
m_NetCode
!=
current_net_code
)
if
(
(
*
pt_end_liste
)
->
GetNet
()
!=
current_net_code
)
break
;
break
;
}
}
...
@@ -1085,7 +1083,7 @@ char* WinEDA_BasePcbFrame::build_ratsnest_module( wxDC* DC, MODULE* Module )
...
@@ -1085,7 +1083,7 @@ char* WinEDA_BasePcbFrame::build_ratsnest_module( wxDC* DC, MODULE* Module )
pt_liste_pad
=
pt_start_liste
=
pt_end_liste
;
pt_liste_pad
=
pt_start_liste
=
pt_end_liste
;
if
(
pt_start_liste
<
pt_liste_pad_limite
)
if
(
pt_start_liste
<
pt_liste_pad_limite
)
current_net_code
=
(
*
pt_start_liste
)
->
m_NetCode
;
current_net_code
=
(
*
pt_start_liste
)
->
GetNet
()
;
}
}
pt_fin_int_chevelu
=
local_chevelu
=
g_pt_chevelu
;
pt_fin_int_chevelu
=
local_chevelu
=
g_pt_chevelu
;
...
@@ -1115,14 +1113,14 @@ calcul_chevelu_ext:
...
@@ -1115,14 +1113,14 @@ calcul_chevelu_ext:
pt_liste_ref
=
(
LISTE_PAD
*
)
adr_lowmem
;
pt_liste_ref
=
(
LISTE_PAD
*
)
adr_lowmem
;
pad_ref
=
*
pt_liste_ref
;
pad_ref
=
*
pt_liste_ref
;
current_net_code
=
pad_ref
->
m_NetCode
;
current_net_code
=
pad_ref
->
GetNet
()
;
local_chevelu
->
dist
=
0x7FFFFFFF
;
local_chevelu
->
dist
=
0x7FFFFFFF
;
local_chevelu
->
status
=
0
;
local_chevelu
->
status
=
0
;
increment
=
0
;
increment
=
0
;
for
(
ii
=
0
;
ii
<
nb_pads_ref
;
ii
++
)
for
(
ii
=
0
;
ii
<
nb_pads_ref
;
ii
++
)
{
{
pad_ref
=
*
(
pt_liste_ref
+
ii
);
pad_ref
=
*
(
pt_liste_ref
+
ii
);
if
(
pad_ref
->
m_NetCode
!=
current_net_code
)
if
(
pad_ref
->
GetNet
()
!=
current_net_code
)
{
{
/* un nouveau chevelu est cree (si necessaire) pour
/* un nouveau chevelu est cree (si necessaire) pour
* chaque nouveau net */
* chaque nouveau net */
...
@@ -1131,7 +1129,7 @@ calcul_chevelu_ext:
...
@@ -1131,7 +1129,7 @@ calcul_chevelu_ext:
nb_local_chevelu
++
;
local_chevelu
++
;
nb_local_chevelu
++
;
local_chevelu
++
;
}
}
increment
=
0
;
increment
=
0
;
current_net_code
=
pad_ref
->
m_NetCode
;
current_net_code
=
pad_ref
->
GetNet
()
;
local_chevelu
->
dist
=
0x7FFFFFFF
;
local_chevelu
->
dist
=
0x7FFFFFFF
;
}
}
...
@@ -1144,10 +1142,10 @@ calcul_chevelu_ext:
...
@@ -1144,10 +1142,10 @@ calcul_chevelu_ext:
pad_externe
=
*
pt_liste_generale
;
pt_liste_generale
++
;
pad_externe
=
*
pt_liste_generale
;
pt_liste_generale
++
;
/* les netcodes doivent etre identiques */
/* les netcodes doivent etre identiques */
if
(
pad_externe
->
m_NetCode
<
pad_ref
->
m_NetCode
)
if
(
pad_externe
->
GetNet
()
<
pad_ref
->
GetNet
()
)
continue
;
continue
;
if
(
pad_externe
->
m_NetCode
>
pad_ref
->
m_NetCode
)
if
(
pad_externe
->
GetNet
()
>
pad_ref
->
GetNet
()
)
break
;
break
;
distance
=
abs
(
pad_externe
->
m_Pos
.
x
-
pad_pos_X
)
+
distance
=
abs
(
pad_externe
->
m_Pos
.
x
-
pad_pos_X
)
+
...
@@ -1157,7 +1155,7 @@ calcul_chevelu_ext:
...
@@ -1157,7 +1155,7 @@ calcul_chevelu_ext:
{
{
local_chevelu
->
pad_start
=
pad_ref
;
local_chevelu
->
pad_start
=
pad_ref
;
local_chevelu
->
pad_end
=
pad_externe
;
local_chevelu
->
pad_end
=
pad_externe
;
local_chevelu
->
m_NetCode
=
pad_ref
->
m_NetCode
;
local_chevelu
->
SetNet
(
pad_ref
->
GetNet
()
)
;
local_chevelu
->
dist
=
distance
;
local_chevelu
->
dist
=
distance
;
local_chevelu
->
status
=
0
;
local_chevelu
->
status
=
0
;
increment
=
1
;
increment
=
1
;
...
@@ -1300,7 +1298,7 @@ int* WinEDA_BasePcbFrame::build_ratsnest_pad( EDA_BaseStruct* ref,
...
@@ -1300,7 +1298,7 @@ int* WinEDA_BasePcbFrame::build_ratsnest_pad( EDA_BaseStruct* ref,
{
{
case
TYPEPAD
:
case
TYPEPAD
:
pad_ref
=
(
D_PAD
*
)
ref
;
pad_ref
=
(
D_PAD
*
)
ref
;
current_net_code
=
pad_ref
->
m_NetCode
;
current_net_code
=
pad_ref
->
GetNet
()
;
conn_number
=
pad_ref
->
m_physical_connexion
;
conn_number
=
pad_ref
->
m_physical_connexion
;
break
;
break
;
...
@@ -1308,8 +1306,8 @@ int* WinEDA_BasePcbFrame::build_ratsnest_pad( EDA_BaseStruct* ref,
...
@@ -1308,8 +1306,8 @@ int* WinEDA_BasePcbFrame::build_ratsnest_pad( EDA_BaseStruct* ref,
case
TYPEVIA
:
case
TYPEVIA
:
{
{
TRACK
*
track_ref
=
(
TRACK
*
)
ref
;
TRACK
*
track_ref
=
(
TRACK
*
)
ref
;
current_net_code
=
track_ref
->
m_NetCode
;
current_net_code
=
track_ref
->
GetNet
()
;
conn_number
=
track_ref
->
m_Sous_Netcode
;
conn_number
=
track_ref
->
GetSubNet
()
;
break
;
break
;
}
}
...
@@ -1320,8 +1318,8 @@ int* WinEDA_BasePcbFrame::build_ratsnest_pad( EDA_BaseStruct* ref,
...
@@ -1320,8 +1318,8 @@ int* WinEDA_BasePcbFrame::build_ratsnest_pad( EDA_BaseStruct* ref,
if
(
current_net_code
<=
0
)
if
(
current_net_code
<=
0
)
return
NULL
;
return
NULL
;
*
pt_coord
=
refpos
.
x
;
pt_coord
++
;
*
pt_coord
++
=
refpos
.
x
;
*
pt_coord
=
refpos
.
y
;
pt_coord
++
;
*
pt_coord
++
=
refpos
.
y
;
if
(
m_Pcb
->
m_Ratsnest
==
NULL
)
if
(
m_Pcb
->
m_Ratsnest
==
NULL
)
return
NULL
;
return
NULL
;
...
@@ -1330,7 +1328,7 @@ int* WinEDA_BasePcbFrame::build_ratsnest_pad( EDA_BaseStruct* ref,
...
@@ -1330,7 +1328,7 @@ int* WinEDA_BasePcbFrame::build_ratsnest_pad( EDA_BaseStruct* ref,
for
(
ii
=
0
;
ii
<
m_Pcb
->
m_NbPads
;
padlist
++
,
ii
++
)
for
(
ii
=
0
;
ii
<
m_Pcb
->
m_NbPads
;
padlist
++
,
ii
++
)
{
{
D_PAD
*
pad
=
*
padlist
;
D_PAD
*
pad
=
*
padlist
;
if
(
pad
->
m_NetCode
!=
current_net_code
)
if
(
pad
->
GetNet
()
!=
current_net_code
)
continue
;
continue
;
if
(
pad
==
pad_ref
)
if
(
pad
==
pad_ref
)
...
@@ -1346,7 +1344,8 @@ int* WinEDA_BasePcbFrame::build_ratsnest_pad( EDA_BaseStruct* ref,
...
@@ -1346,7 +1344,8 @@ int* WinEDA_BasePcbFrame::build_ratsnest_pad( EDA_BaseStruct* ref,
}
/* Fin Init */
}
/* Fin Init */
else
if
(
nb_local_chevelu
)
else
if
(
nb_local_chevelu
)
{
{
*
pt_coord
=
refpos
.
x
;
*
(
pt_coord
+
1
)
=
refpos
.
y
;
*
pt_coord
=
refpos
.
x
;
*
(
pt_coord
+
1
)
=
refpos
.
y
;
}
}
qsort
(
base_data
+
2
,
nb_local_chevelu
,
2
*
sizeof
(
int
),
qsort
(
base_data
+
2
,
nb_local_chevelu
,
2
*
sizeof
(
int
),
...
@@ -1378,8 +1377,8 @@ void WinEDA_BasePcbFrame::trace_ratsnest_pad( wxDC* DC )
...
@@ -1378,8 +1377,8 @@ void WinEDA_BasePcbFrame::trace_ratsnest_pad( wxDC* DC )
pt_coord
=
(
int
*
)
local_liste_chevelu
;
pt_coord
=
(
int
*
)
local_liste_chevelu
;
refX
=
*
pt_coord
;
pt_coord
++
;
refX
=
*
pt_coord
++
;
refY
=
*
pt_coord
;
pt_coord
++
;
refY
=
*
pt_coord
++
;
GRSetDrawMode
(
DC
,
GR_XOR
);
GRSetDrawMode
(
DC
,
GR_XOR
);
for
(
ii
=
0
;
ii
<
nb_local_chevelu
;
ii
++
)
for
(
ii
=
0
;
ii
<
nb_local_chevelu
;
ii
++
)
...
...
pcbnew/router.cpp
View file @
3cd47555
...
@@ -162,7 +162,7 @@ static void Out_Pads( BOARD* Pcb, FILE* outfile )
...
@@ -162,7 +162,7 @@ static void Out_Pads( BOARD* Pcb, FILE* outfile )
if
(
pt_liste_pad
==
NULL
)
if
(
pt_liste_pad
==
NULL
)
return
;
return
;
netcode
=
(
*
pt_liste_pad
)
->
m_NetCode
;
netcode
=
(
*
pt_liste_pad
)
->
GetNet
()
;
nb_pads
=
1
;
plink
=
0
;
nb_pads
=
1
;
plink
=
0
;
for
(
;
pt_liste_pad
<
pt_liste_pad_limite
;
)
for
(
;
pt_liste_pad
<
pt_liste_pad_limite
;
)
{
{
...
@@ -171,7 +171,7 @@ static void Out_Pads( BOARD* Pcb, FILE* outfile )
...
@@ -171,7 +171,7 @@ static void Out_Pads( BOARD* Pcb, FILE* outfile )
{
{
if
(
pt_end_liste
>=
pt_liste_pad_limite
)
if
(
pt_end_liste
>=
pt_liste_pad_limite
)
break
;
break
;
if
(
(
*
pt_end_liste
)
->
m_NetCode
!=
netcode
)
if
(
(
*
pt_end_liste
)
->
GetNet
()
!=
netcode
)
break
;
break
;
nb_pads
++
;
nb_pads
++
;
}
}
...
@@ -197,7 +197,7 @@ static void Out_Pads( BOARD* Pcb, FILE* outfile )
...
@@ -197,7 +197,7 @@ static void Out_Pads( BOARD* Pcb, FILE* outfile )
for
(
;
pt_liste_pad
<
pt_end_liste
;
pt_liste_pad
++
)
for
(
;
pt_liste_pad
<
pt_end_liste
;
pt_liste_pad
++
)
{
{
pt_pad
=
*
pt_liste_pad
;
pt_pad
=
*
pt_liste_pad
;
netcode
=
pt_pad
->
m_NetCode
;
netcode
=
pt_pad
->
GetNet
()
;
plink
=
pt_pad
->
m_physical_connexion
;
plink
=
pt_pad
->
m_physical_connexion
;
/* plink = numero unique si pad non deja connecte a une piste */
/* plink = numero unique si pad non deja connecte a une piste */
if
(
plink
<=
0
)
if
(
plink
<=
0
)
...
@@ -308,7 +308,7 @@ static void Out_Pads( BOARD* Pcb, FILE* outfile )
...
@@ -308,7 +308,7 @@ static void Out_Pads( BOARD* Pcb, FILE* outfile )
nb_pads
=
1
;
nb_pads
=
1
;
pt_liste_pad
=
pt_start_liste
=
pt_end_liste
;
pt_liste_pad
=
pt_start_liste
=
pt_end_liste
;
if
(
pt_start_liste
<
pt_liste_pad_limite
)
if
(
pt_start_liste
<
pt_liste_pad_limite
)
netcode
=
(
*
pt_start_liste
)
->
m_NetCode
;
netcode
=
(
*
pt_start_liste
)
->
GetNet
()
;
}
}
}
}
...
@@ -332,9 +332,9 @@ static void ReturnNbViasAndTracks( BOARD* Pcb, int netcode, int* nb_vias,
...
@@ -332,9 +332,9 @@ static void ReturnNbViasAndTracks( BOARD* Pcb, int netcode, int* nb_vias,
for
(
;
track
!=
NULL
;
track
=
(
TRACK
*
)
track
->
Pnext
)
for
(
;
track
!=
NULL
;
track
=
(
TRACK
*
)
track
->
Pnext
)
{
{
if
(
track
->
m_NetCode
>
netcode
)
if
(
track
->
GetNet
()
>
netcode
)
return
;
return
;
if
(
track
->
m_NetCode
!=
netcode
)
if
(
track
->
GetNet
()
!=
netcode
)
continue
;
continue
;
if
(
track
->
Type
()
==
TYPEVIA
)
if
(
track
->
Type
()
==
TYPEVIA
)
(
*
nb_vias
)
++
;
(
*
nb_vias
)
++
;
...
@@ -362,12 +362,12 @@ static void GenExistantTracks( BOARD* Pcb, FILE* outfile,
...
@@ -362,12 +362,12 @@ static void GenExistantTracks( BOARD* Pcb, FILE* outfile,
for
(
;
track
!=
NULL
;
track
=
(
TRACK
*
)
track
->
Pnext
)
for
(
;
track
!=
NULL
;
track
=
(
TRACK
*
)
track
->
Pnext
)
{
{
netcode
=
track
->
m_NetCode
;
netcode
=
track
->
GetNet
()
;
if
(
netcode
>
current_net_code
)
if
(
netcode
>
current_net_code
)
return
;
return
;
if
(
netcode
!=
current_net_code
)
if
(
netcode
!=
current_net_code
)
continue
;
continue
;
plink
=
track
->
m_Sous_Netcode
;
plink
=
track
->
GetSubNet
()
;
via_min_layer
=
track
->
GetLayer
();
via_min_layer
=
track
->
GetLayer
();
if
(
track
->
Type
()
!=
type
)
if
(
track
->
Type
()
!=
type
)
...
...
pcbnew/solve.cpp
View file @
3cd47555
...
@@ -361,7 +361,7 @@ static int Route_1_Trace( WinEDA_PcbFrame* pcbframe, wxDC* DC,
...
@@ -361,7 +361,7 @@ static int Route_1_Trace( WinEDA_PcbFrame* pcbframe, wxDC* DC,
masque_layers
=
masque_layer_TOP
|
masque_layer_BOTTOM
;
masque_layers
=
masque_layer_TOP
|
masque_layer_BOTTOM
;
pt_cur_ch
=
pt_chevelu
;
pt_cur_ch
=
pt_chevelu
;
current_net_code
=
pt_chevelu
->
m_NetCode
;
current_net_code
=
pt_chevelu
->
GetNet
()
;
pad_masque_layer_s
=
pt_cur_ch
->
pad_start
->
m_Masque_Layer
;
pad_masque_layer_s
=
pt_cur_ch
->
pad_start
->
m_Masque_Layer
;
pad_masque_layer_e
=
pt_cur_ch
->
pad_end
->
m_Masque_Layer
;
pad_masque_layer_e
=
pt_cur_ch
->
pad_end
->
m_Masque_Layer
;
...
@@ -936,7 +936,7 @@ static void OrCell_Trace( BOARD* pcb, int col, int row,
...
@@ -936,7 +936,7 @@ static void OrCell_Trace( BOARD* pcb, int col, int row,
(
g_GridRoutingSize
*
col
);
(
g_GridRoutingSize
*
col
);
g_CurrentTrackSegment
->
m_Width
=
g_DesignSettings
.
m_CurrentViaSize
;
g_CurrentTrackSegment
->
m_Width
=
g_DesignSettings
.
m_CurrentViaSize
;
g_CurrentTrackSegment
->
m_Shape
=
g_DesignSettings
.
m_CurrentViaType
;
g_CurrentTrackSegment
->
m_Shape
=
g_DesignSettings
.
m_CurrentViaType
;
g_CurrentTrackSegment
->
m_NetCode
=
current_net_code
;
g_CurrentTrackSegment
->
SetNet
(
current_net_code
)
;
}
}
else
/* Placement d'un segment standard */
else
/* Placement d'un segment standard */
{
{
...
@@ -958,7 +958,7 @@ static void OrCell_Trace( BOARD* pcb, int col, int row,
...
@@ -958,7 +958,7 @@ static void OrCell_Trace( BOARD* pcb, int col, int row,
g_CurrentTrackSegment
->
SetState
(
SEGM_AR
,
ON
);
g_CurrentTrackSegment
->
SetState
(
SEGM_AR
,
ON
);
g_CurrentTrackSegment
->
m_End
.
x
=
pcb
->
m_BoundaryBox
.
m_Pos
.
x
+
(
g_GridRoutingSize
*
row
);
g_CurrentTrackSegment
->
m_End
.
x
=
pcb
->
m_BoundaryBox
.
m_Pos
.
x
+
(
g_GridRoutingSize
*
row
);
g_CurrentTrackSegment
->
m_End
.
y
=
pcb
->
m_BoundaryBox
.
m_Pos
.
y
+
(
g_GridRoutingSize
*
col
);
g_CurrentTrackSegment
->
m_End
.
y
=
pcb
->
m_BoundaryBox
.
m_Pos
.
y
+
(
g_GridRoutingSize
*
col
);
g_CurrentTrackSegment
->
m_NetCode
=
current_net_code
;
g_CurrentTrackSegment
->
SetNet
(
current_net_code
)
;
if
(
g_CurrentTrackSegment
->
Pback
==
NULL
)
/* Start Piste */
if
(
g_CurrentTrackSegment
->
Pback
==
NULL
)
/* Start Piste */
{
{
...
@@ -1090,7 +1090,7 @@ static void Place_Piste_en_Buffer( WinEDA_PcbFrame* pcbframe, wxDC* DC )
...
@@ -1090,7 +1090,7 @@ static void Place_Piste_en_Buffer( WinEDA_PcbFrame* pcbframe, wxDC* DC )
Trace_Une_Piste
(
panel
,
DC
,
g_FirstTrackSegment
,
g_TrackSegmentCount
,
GR_OR
);
Trace_Une_Piste
(
panel
,
DC
,
g_FirstTrackSegment
,
g_TrackSegmentCount
,
GR_OR
);
pcbframe
->
test_1_net_connexion
(
DC
,
g_FirstTrackSegment
->
m_NetCode
);
pcbframe
->
test_1_net_connexion
(
DC
,
g_FirstTrackSegment
->
GetNet
()
);
/* Trace de la forme exacte de la piste en BOARD */
/* Trace de la forme exacte de la piste en BOARD */
for
(
pt_track
=
g_FirstTrackSegment
;
;
pt_track
=
(
TRACK
*
)
pt_track
->
Pnext
)
for
(
pt_track
=
g_FirstTrackSegment
;
;
pt_track
=
(
TRACK
*
)
pt_track
->
Pnext
)
...
...
pcbnew/surbrill.cpp
View file @
3cd47555
...
@@ -46,7 +46,7 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
...
@@ -46,7 +46,7 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
if
(
!
WildCompareString
(
msg
,
Equipot
->
m_Netname
,
FALSE
)
)
if
(
!
WildCompareString
(
msg
,
Equipot
->
m_Netname
,
FALSE
)
)
continue
;
continue
;
Line
.
Printf
(
wxT
(
"net_code = %3.3d [%.16s] "
),
Equipot
->
m_NetCode
,
Line
.
Printf
(
wxT
(
"net_code = %3.3d [%.16s] "
),
Equipot
->
GetNet
()
,
Equipot
->
m_Netname
.
GetData
()
);
Equipot
->
m_Netname
.
GetData
()
);
List
->
Append
(
Line
);
List
->
Append
(
Line
);
}
}
...
@@ -64,7 +64,7 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
...
@@ -64,7 +64,7 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
continue
;
continue
;
if
(
ii
==
jj
)
if
(
ii
==
jj
)
{
{
ii
=
Equipot
->
m_NetCode
;
ii
=
Equipot
->
GetNet
()
;
break
;
break
;
}
}
jj
++
;
jj
++
;
...
@@ -99,7 +99,7 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
...
@@ -99,7 +99,7 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
pt_piste
=
Locate_Pistes
(
m_Pcb
->
m_Track
,
masquelayer
,
CURSEUR_OFF_GRILLE
);
pt_piste
=
Locate_Pistes
(
m_Pcb
->
m_Track
,
masquelayer
,
CURSEUR_OFF_GRILLE
);
if
(
pt_piste
)
if
(
pt_piste
)
{
{
code
=
g_HightLigth_NetCode
=
pt_piste
->
m_NetCode
;
code
=
g_HightLigth_NetCode
=
pt_piste
->
GetNet
()
;
Hight_Light
(
DC
);
Hight_Light
(
DC
);
}
}
else
else
...
@@ -107,7 +107,7 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
...
@@ -107,7 +107,7 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
pt_pad
=
Locate_Any_Pad
(
m_Pcb
,
CURSEUR_OFF_GRILLE
);
pt_pad
=
Locate_Any_Pad
(
m_Pcb
,
CURSEUR_OFF_GRILLE
);
if
(
pt_pad
!=
NULL
)
if
(
pt_pad
!=
NULL
)
{
{
code
=
g_HightLigth_NetCode
=
pt_pad
->
m_NetCode
;
code
=
g_HightLigth_NetCode
=
pt_pad
->
GetNet
()
;
Hight_Light
(
DC
);
Hight_Light
(
DC
);
SendMessageToEESCHEMA
(
pt_pad
);
SendMessageToEESCHEMA
(
pt_pad
);
}
}
...
@@ -157,7 +157,7 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode )
...
@@ -157,7 +157,7 @@ void WinEDA_PcbFrame::DrawHightLight( wxDC* DC, int NetCode )
/* Redraw track and vias: */
/* Redraw track and vias: */
for
(
pts
=
m_Pcb
->
m_Track
;
pts
!=
NULL
;
pts
=
(
TRACK
*
)
pts
->
Pnext
)
for
(
pts
=
m_Pcb
->
m_Track
;
pts
!=
NULL
;
pts
=
(
TRACK
*
)
pts
->
Pnext
)
{
{
if
(
pts
->
m_NetCode
==
NetCode
)
if
(
pts
->
GetNet
()
==
NetCode
)
{
{
pts
->
Draw
(
DrawPanel
,
DC
,
draw_mode
);
pts
->
Draw
(
DrawPanel
,
DC
,
draw_mode
);
}
}
...
@@ -176,7 +176,7 @@ static void Pad_Surbrillance( WinEDA_DrawPanel* panel,
...
@@ -176,7 +176,7 @@ static void Pad_Surbrillance( WinEDA_DrawPanel* panel,
/* trace des pastilles */
/* trace des pastilles */
for
(
pt_pad
=
Module
->
m_Pads
;
pt_pad
!=
NULL
;
pt_pad
=
(
D_PAD
*
)
pt_pad
->
Pnext
)
for
(
pt_pad
=
Module
->
m_Pads
;
pt_pad
!=
NULL
;
pt_pad
=
(
D_PAD
*
)
pt_pad
->
Pnext
)
{
{
if
(
pt_pad
->
m_NetCode
==
NetCode
)
if
(
pt_pad
->
GetNet
()
==
NetCode
)
{
{
pt_pad
->
Draw
(
panel
,
DC
,
wxPoint
(
0
,
0
),
draw_mode
);
pt_pad
->
Draw
(
panel
,
DC
,
wxPoint
(
0
,
0
),
draw_mode
);
}
}
...
...
pcbnew/tr_modif.cpp
View file @
3cd47555
...
@@ -54,10 +54,10 @@ TRACK * BufDeb, *BufEnd; /* Pointeurs de debut et de fin de la zone
...
@@ -54,10 +54,10 @@ TRACK * BufDeb, *BufEnd; /* Pointeurs de debut et de fin de la zone
/* Calcul des limites de recherche des segments de piste */
/* Calcul des limites de recherche des segments de piste */
/* BufDeb pointe le 1er segment utile */
/* BufDeb pointe le 1er segment utile */
BufDeb
=
Pcb
->
m_Track
->
GetStartNetCode
(
pt_new_track
->
m_NetCode
);
BufDeb
=
Pcb
->
m_Track
->
GetStartNetCode
(
pt_new_track
->
GetNet
()
);
/* BufEnd Pointe le dernier segment */
/* BufEnd Pointe le dernier segment */
BufEnd
=
BufDeb
->
GetEndNetCode
(
pt_new_track
->
m_NetCode
);
BufEnd
=
BufDeb
->
GetEndNetCode
(
pt_new_track
->
GetNet
()
);
/* nettoyage des flags pour tout le net */
/* nettoyage des flags pour tout le net */
for
(
pt_del
=
BufDeb
;
pt_del
!=
NULL
;
pt_del
=
(
TRACK
*
)
pt_del
->
Pnext
)
for
(
pt_del
=
BufDeb
;
pt_del
!=
NULL
;
pt_del
=
(
TRACK
*
)
pt_del
->
Pnext
)
...
...
pcbnew/undelete.cpp
View file @
3cd47555
...
@@ -45,7 +45,7 @@ void WinEDA_PcbFrame::UnDeleteItem( wxDC* DC )
...
@@ -45,7 +45,7 @@ void WinEDA_PcbFrame::UnDeleteItem( wxDC* DC )
}
}
PtStruct
=
g_UnDeleteStack
[
g_UnDeleteStackPtr
];
PtStruct
=
g_UnDeleteStack
[
g_UnDeleteStackPtr
];
net_code
=
(
(
TRACK
*
)
PtStruct
)
->
m_NetCode
;
net_code
=
(
(
TRACK
*
)
PtStruct
)
->
GetNet
()
;
pt_track
=
(
(
TRACK
*
)
PtStruct
)
->
GetBestInsertPoint
(
m_Pcb
);
pt_track
=
(
(
TRACK
*
)
PtStruct
)
->
GetBestInsertPoint
(
m_Pcb
);
(
(
TRACK
*
)
PtStruct
)
->
Insert
(
m_Pcb
,
pt_track
);
(
(
TRACK
*
)
PtStruct
)
->
Insert
(
m_Pcb
,
pt_track
);
g_UnDeleteStack
[
g_UnDeleteStackPtr
]
=
NULL
;
g_UnDeleteStack
[
g_UnDeleteStackPtr
]
=
NULL
;
...
...
pcbnew/xchgmod.cpp
View file @
3cd47555
...
@@ -559,7 +559,7 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff,
...
@@ -559,7 +559,7 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff,
for
(
;
pt_pad
!=
NULL
;
pt_pad
=
(
D_PAD
*
)
pt_pad
->
Pnext
)
for
(
;
pt_pad
!=
NULL
;
pt_pad
=
(
D_PAD
*
)
pt_pad
->
Pnext
)
{
{
pt_pad
->
m_Netname
=
wxEmptyString
;
pt_pad
->
m_Netname
=
wxEmptyString
;
pt_pad
->
m_NetCode
=
0
;
pt_pad
->
SetNet
(
0
)
;
pt_old_pad
=
OldModule
->
m_Pads
;
pt_old_pad
=
OldModule
->
m_Pads
;
for
(
;
pt_old_pad
!=
NULL
;
pt_old_pad
=
(
D_PAD
*
)
pt_old_pad
->
Pnext
)
for
(
;
pt_old_pad
!=
NULL
;
pt_old_pad
=
(
D_PAD
*
)
pt_old_pad
->
Pnext
)
{
{
...
@@ -567,7 +567,7 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff,
...
@@ -567,7 +567,7 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff,
sizeof
(
pt_pad
->
m_Padname
)
)
==
0
)
sizeof
(
pt_pad
->
m_Padname
)
)
==
0
)
{
{
pt_pad
->
m_Netname
=
pt_old_pad
->
m_Netname
;
pt_pad
->
m_Netname
=
pt_old_pad
->
m_Netname
;
pt_pad
->
m_NetCode
=
pt_old_pad
->
m_NetCode
;
pt_pad
->
SetNet
(
pt_old_pad
->
GetNet
()
)
;
}
}
}
}
}
}
...
...
pcbnew/zones.cpp
View file @
3cd47555
...
@@ -543,13 +543,13 @@ void WinEDA_PcbFrame::CaptureNetName( wxDC* DC )
...
@@ -543,13 +543,13 @@ void WinEDA_PcbFrame::CaptureNetName( wxDC* DC )
if
(
pt_pad
)
if
(
pt_pad
)
{
{
pt_pad
->
Display_Infos
(
this
);
pt_pad
->
Display_Infos
(
this
);
netcode
=
pt_pad
->
m_NetCode
;
netcode
=
pt_pad
->
GetNet
()
;
}
}
}
}
else
else
{
{
adrpiste
->
Display_Infos
(
this
);
adrpiste
->
Display_Infos
(
this
);
netcode
=
adrpiste
->
m_NetCode
;
netcode
=
adrpiste
->
GetNet
()
;
}
}
// Mise en surbrillance du net
// Mise en surbrillance du net
...
@@ -584,7 +584,7 @@ static void Display_Zone_Netname( WinEDA_PcbFrame* frame )
...
@@ -584,7 +584,7 @@ static void Display_Zone_Netname( WinEDA_PcbFrame* frame )
{
{
for
(
;
pt_equipot
!=
NULL
;
pt_equipot
=
(
EQUIPOT
*
)
pt_equipot
->
Pnext
)
for
(
;
pt_equipot
!=
NULL
;
pt_equipot
=
(
EQUIPOT
*
)
pt_equipot
->
Pnext
)
{
{
if
(
pt_equipot
->
m_NetCode
==
g_HightLigth_NetCode
)
if
(
pt_equipot
->
GetNet
()
==
g_HightLigth_NetCode
)
break
;
break
;
}
}
...
@@ -920,7 +920,7 @@ void WinEDA_PcbFrame::Fill_Zone( wxDC* DC )
...
@@ -920,7 +920,7 @@ void WinEDA_PcbFrame::Fill_Zone( wxDC* DC )
TRACK
*
pt_segm
=
m_Pcb
->
m_Track
;
TRACK
*
pt_segm
=
m_Pcb
->
m_Track
;
for
(
;
pt_segm
!=
NULL
;
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
)
for
(
;
pt_segm
!=
NULL
;
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
)
{
{
if
(
g_HightLigth_NetCode
!=
pt_segm
->
m_NetCode
)
if
(
g_HightLigth_NetCode
!=
pt_segm
->
GetNet
()
)
continue
;
continue
;
if
(
pt_segm
->
GetLayer
()
!=
GetScreen
()
->
m_Active_Layer
)
if
(
pt_segm
->
GetLayer
()
!=
GetScreen
()
->
m_Active_Layer
)
continue
;
continue
;
...
@@ -1087,7 +1087,7 @@ static void Genere_Segments_Zone( WinEDA_PcbFrame* frame, wxDC* DC, int net_code
...
@@ -1087,7 +1087,7 @@ static void Genere_Segments_Zone( WinEDA_PcbFrame* frame, wxDC* DC, int net_code
/* un segment avait debute de longueur > 0 */
/* un segment avait debute de longueur > 0 */
pt_track
=
new
SEGZONE
(
frame
->
m_Pcb
);
pt_track
=
new
SEGZONE
(
frame
->
m_Pcb
);
pt_track
->
SetLayer
(
layer
);
pt_track
->
SetLayer
(
layer
);
pt_track
->
m_NetCode
=
net_code
;
pt_track
->
SetNet
(
net_code
)
;
pt_track
->
m_Width
=
g_GridRoutingSize
;
pt_track
->
m_Width
=
g_GridRoutingSize
;
pt_track
->
m_Start
.
x
=
ux0
;
pt_track
->
m_Start
.
y
=
uy0
;
pt_track
->
m_Start
.
x
=
ux0
;
pt_track
->
m_Start
.
y
=
uy0
;
pt_track
->
m_End
.
x
=
ux1
;
pt_track
->
m_End
.
y
=
uy1
;
pt_track
->
m_End
.
x
=
ux1
;
pt_track
->
m_End
.
y
=
uy1
;
...
@@ -1126,7 +1126,7 @@ static void Genere_Segments_Zone( WinEDA_PcbFrame* frame, wxDC* DC, int net_code
...
@@ -1126,7 +1126,7 @@ static void Genere_Segments_Zone( WinEDA_PcbFrame* frame, wxDC* DC, int net_code
pt_track
=
new
SEGZONE
(
frame
->
m_Pcb
);
pt_track
=
new
SEGZONE
(
frame
->
m_Pcb
);
pt_track
->
SetLayer
(
layer
);
pt_track
->
SetLayer
(
layer
);
pt_track
->
m_Width
=
g_GridRoutingSize
;
pt_track
->
m_Width
=
g_GridRoutingSize
;
pt_track
->
m_NetCode
=
net_code
;
pt_track
->
SetNet
(
net_code
)
;
pt_track
->
m_Start
.
x
=
ux0
;
pt_track
->
m_Start
.
y
=
uy0
;
pt_track
->
m_Start
.
x
=
ux0
;
pt_track
->
m_Start
.
y
=
uy0
;
pt_track
->
m_End
.
x
=
ux1
;
pt_track
->
m_End
.
y
=
uy1
;
pt_track
->
m_End
.
x
=
ux1
;
pt_track
->
m_End
.
y
=
uy1
;
pt_track
->
m_TimeStamp
=
s_TimeStamp
;
pt_track
->
m_TimeStamp
=
s_TimeStamp
;
...
@@ -1310,7 +1310,7 @@ static bool Genere_Pad_Connexion( WinEDA_PcbFrame* frame, wxDC* DC, int layer )
...
@@ -1310,7 +1310,7 @@ static bool Genere_Pad_Connexion( WinEDA_PcbFrame* frame, wxDC* DC, int layer )
pt_pad
=
*
pt_liste_pad
;
pt_pad
=
*
pt_liste_pad
;
/* la pastille doit etre du meme net */
/* la pastille doit etre du meme net */
if
(
pt_pad
->
m_NetCode
!=
g_HightLigth_NetCode
)
if
(
pt_pad
->
GetNet
()
!=
g_HightLigth_NetCode
)
continue
;
continue
;
/* la pastille doit exister sur la couche */
/* la pastille doit exister sur la couche */
...
@@ -1329,7 +1329,7 @@ static bool Genere_Pad_Connexion( WinEDA_PcbFrame* frame, wxDC* DC, int layer )
...
@@ -1329,7 +1329,7 @@ static bool Genere_Pad_Connexion( WinEDA_PcbFrame* frame, wxDC* DC, int layer )
pt_pad
=
*
pt_liste_pad
;
pt_pad
=
*
pt_liste_pad
;
/* la pastille doit etre du meme net */
/* la pastille doit etre du meme net */
if
(
pt_pad
->
m_NetCode
!=
g_HightLigth_NetCode
)
if
(
pt_pad
->
GetNet
()
!=
g_HightLigth_NetCode
)
continue
;
continue
;
/* la pastille doit exister sur la couche */
/* la pastille doit exister sur la couche */
if
(
(
pt_pad
->
m_Masque_Layer
&
g_TabOneLayerMask
[
layer
])
==
0
)
if
(
(
pt_pad
->
m_Masque_Layer
&
g_TabOneLayerMask
[
layer
])
==
0
)
...
@@ -1365,7 +1365,7 @@ static bool Genere_Pad_Connexion( WinEDA_PcbFrame* frame, wxDC* DC, int layer )
...
@@ -1365,7 +1365,7 @@ static bool Genere_Pad_Connexion( WinEDA_PcbFrame* frame, wxDC* DC, int layer )
pt_track
->
SetLayer
(
layer
);
pt_track
->
SetLayer
(
layer
);
pt_track
->
m_Width
=
g_DesignSettings
.
m_CurrentTrackWidth
;
pt_track
->
m_Width
=
g_DesignSettings
.
m_CurrentTrackWidth
;
pt_track
->
m_NetCode
=
g_HightLigth_NetCode
;
pt_track
->
SetNet
(
g_HightLigth_NetCode
)
;
pt_track
->
start
=
pt_pad
;
pt_track
->
start
=
pt_pad
;
pt_track
->
m_Start
.
x
=
cX
;
pt_track
->
m_Start
.
y
=
cY
;
pt_track
->
m_Start
.
x
=
cX
;
pt_track
->
m_Start
.
y
=
cY
;
pt_track
->
m_End
.
x
=
cX
+
sommet
[
jj
][
0
];
pt_track
->
m_End
.
x
=
cX
+
sommet
[
jj
][
0
];
...
...
share/drawpanel.cpp
View file @
3cd47555
...
@@ -683,7 +683,7 @@ void WinEDA_DrawPanel::m_Draw_Auxiliary_Axis( wxDC* DC, int drawmode )
...
@@ -683,7 +683,7 @@ void WinEDA_DrawPanel::m_Draw_Auxiliary_Axis( wxDC* DC, int drawmode )
/********************************************************************/
/********************************************************************/
{
{
if
(
m_Parent
->
m_Auxiliary_Axis_Position
.
x
==
0
if
(
m_Parent
->
m_Auxiliary_Axis_Position
.
x
==
0
&&
m_Parent
->
m_Auxiliary_Axis_Position
.
y
==
0
)
&&
m_Parent
->
m_Auxiliary_Axis_Position
.
y
==
0
)
return
;
return
;
int
Color
=
DARKRED
;
int
Color
=
DARKRED
;
...
...
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