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
387a8763
Commit
387a8763
authored
Oct 17, 2007
by
CHARRAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed enhancements in connectivity computation (in certain cases, does not work)
parent
0d403649
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
206 additions
and
182 deletions
+206
-182
change_log.txt
change_log.txt
+11
-0
wxstruct.h
include/wxstruct.h
+0
-1
class_track.cpp
pcbnew/class_track.cpp
+26
-0
connect.cpp
pcbnew/connect.cpp
+127
-154
locate.cpp
pcbnew/locate.cpp
+42
-27
No files found.
change_log.txt
View file @
387a8763
...
@@ -4,6 +4,17 @@ Started 2007-June-11
...
@@ -4,6 +4,17 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.
2007-Oct-17 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ pcbnew:
Removed enhancements in connectivity computation because
rastnest computation does not work (errors) with short track segments
(lenght < width) . This is not a bug, but an algorithm problem, so
I must work on algos.
2007-Oct-17 UPDATE Geoff Harland <gharlandau@yahoo.com.au>
2007-Oct-17 UPDATE Geoff Harland <gharlandau@yahoo.com.au>
================================================================================
================================================================================
+ pcbnew
+ pcbnew
...
...
include/wxstruct.h
View file @
387a8763
...
@@ -502,7 +502,6 @@ public:
...
@@ -502,7 +502,6 @@ public:
int
*
build_ratsnest_pad
(
EDA_BaseStruct
*
ref
,
const
wxPoint
&
refpos
,
bool
init
);
int
*
build_ratsnest_pad
(
EDA_BaseStruct
*
ref
,
const
wxPoint
&
refpos
,
bool
init
);
void
Tst_Ratsnest
(
wxDC
*
DC
,
int
ref_netcode
);
void
Tst_Ratsnest
(
wxDC
*
DC
,
int
ref_netcode
);
void
Recalcule_all_net_connexion
(
wxDC
*
DC
);
void
test_connexions
(
wxDC
*
DC
);
void
test_connexions
(
wxDC
*
DC
);
void
test_1_net_connexion
(
wxDC
*
DC
,
int
net_code
);
void
test_1_net_connexion
(
wxDC
*
DC
,
int
net_code
);
void
reattribution_reference_piste
(
int
affiche
);
void
reattribution_reference_piste
(
int
affiche
);
...
...
pcbnew/class_track.cpp
View file @
387a8763
...
@@ -16,6 +16,28 @@
...
@@ -16,6 +16,28 @@
#include "protos.h"
#include "protos.h"
// #define RATSNET_DEBUG
#ifdef RATSNET_DEBUG
/**************************************/
void
DbgDisplayTrackInfos
(
TRACK
*
track
)
/**************************************/
/* Only for ratsnest debug
*/
{
wxString
msg
;
msg
<<
wxT
(
"Netcode "
)
<<
track
->
GetNet
();
msg
<<
wxT
(
" - "
)
<<
track
->
GetSubNet
();
msg
<<
wxT
(
"
\n
ptrS "
)
<<
(
unsigned
)
track
->
start
;
msg
<<
wxT
(
" ptrE "
)
<<
(
unsigned
)
track
->
end
;
msg
<<
wxT
(
" this "
)
<<
(
unsigned
)
track
;
wxMessageBox
(
msg
);
}
#endif
/**************************************/
/**************************************/
/* Classes pour Pistes, Vias et Zones */
/* Classes pour Pistes, Vias et Zones */
/**************************************/
/**************************************/
...
@@ -715,6 +737,9 @@ void TRACK::Display_Infos( WinEDA_DrawFrame* frame )
...
@@ -715,6 +737,9 @@ void TRACK::Display_Infos( WinEDA_DrawFrame* frame )
{
{
wxString
msg
;
wxString
msg
;
int
text_pos
;
int
text_pos
;
#ifdef RATSNET_DEBUG
DbgDisplayTrackInfos
(
this
);
#endif
frame
->
MsgPanel
->
EraseMsgBox
();
frame
->
MsgPanel
->
EraseMsgBox
();
...
@@ -865,6 +890,7 @@ bool TRACK::HitTest( const wxPoint& ref_pos )
...
@@ -865,6 +890,7 @@ bool TRACK::HitTest( const wxPoint& ref_pos )
}
}
#if defined(DEBUG)
#if defined(DEBUG)
/**
/**
...
...
pcbnew/connect.cpp
View file @
387a8763
This diff is collapsed.
Click to expand it.
pcbnew/locate.cpp
View file @
387a8763
...
@@ -664,18 +664,27 @@ TEXTE_MODULE* LocateTexteModule( BOARD* Pcb, MODULE** PtModule, int typeloc )
...
@@ -664,18 +664,27 @@ TEXTE_MODULE* LocateTexteModule( BOARD* Pcb, MODULE** PtModule, int typeloc )
/******************************************/
/******************************************
************************
/
inline
int
Dist
(
wxPoint
&
p1
,
wxPoint
&
p2
)
inline
bool
IsPointsAreNear
(
wxPoint
&
p1
,
wxPoint
&
p2
,
int
max_dist
)
/******************************************/
/******************************************
************************
/
/*
/*
return the dist min between p1 and p2
return true if the dist between p1 and p2 < max_dist
Currently in test (currently rasnest algos work only if p1 == p2
*/
*/
{
{
extern
bool
zflg
;
if
(
zflg
==
true
)
{
int
dist
;
int
dist
;
dist
=
abs
(
p1
.
x
-
p2
.
x
)
+
abs
(
p1
.
y
-
p2
.
y
);
dist
=
abs
(
p1
.
x
-
p2
.
x
)
+
abs
(
p1
.
y
-
p2
.
y
);
dist
*=
7
;
dist
*=
7
;
dist
/=
10
;
dist
/=
10
;
return
dist
;
if
(
dist
<
max_dist
)
return
true
;
}
else
if
(
p1
==
p2
)
return
true
;
//#endif
return
false
;
}
}
/**************************************************************/
/**************************************************************/
...
@@ -683,25 +692,30 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
...
@@ -683,25 +692,30 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
TRACK
*
pt_lim
,
int
extr
)
TRACK
*
pt_lim
,
int
extr
)
/**************************************************************/
/**************************************************************/
/* recherche le segment connecte au segment pointe par
/** Search for the track (or via) segment which is connected to the track segment PtRefSegm
* PtRefSegm:
* if extr == START, the starting track segment PtRefSegm is used to locate a connected segment
* si int extr = START, le point de debut du segment est utilise
* if extr == END, the ending track segment PtRefSegm is used
* si int extr = END, le point de fin du segment est utilise
* The test connection consider only end track segments
* La recherche ne se fait que sur les EXTREMITES des segments
*
* Search is made from pt_base to pt_lim (in the track linked list)
* if pt_lim == NULL, the search is made from pt_base to the end of list
*
* In order to have a fast computation time:
* a first search is made considering only the +/- 50 next door neightbour of PtRefSegm.
* if no track is found : the entire list is tested
*
*
* La recherche se fait de l'adresse :
* @param PtRefSegm = reference segment
* pt_base a pt_lim (borne finale comprise)
* @param pt_base = lower limit for search
* si pt_lim = NULL, la recherche se fait jusqu'a la fin de la liste
* @param pt_lim = upper limit for search (can be NULL)
* Afin d'accelerer la recherche, une 1ere passe est faite, avec une recherche
* @param extr = START or END = end of ref track segment to use in tests
* realisee sur un ensemble de +/- 100 points autour du point courant.
* Si echec: recherche generale
*/
*/
{
{
#define NEIGHTBOUR_COUNT_MAX 50
TRACK
*
PtSegmB
,
*
PtSegmN
;
TRACK
*
PtSegmB
,
*
PtSegmN
;
int
Reflayer
;
int
Reflayer
;
wxPoint
pos_ref
;
wxPoint
pos_ref
;
int
ii
;
int
ii
;
int
m
in
_dist
;
int
m
ax
_dist
;
if
(
extr
==
START
)
if
(
extr
==
START
)
pos_ref
=
PtRefSegm
->
m_Start
;
pos_ref
=
PtRefSegm
->
m_Start
;
...
@@ -713,7 +727,7 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
...
@@ -713,7 +727,7 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
/* 1ere passe */
/* 1ere passe */
PtSegmB
=
PtSegmN
=
PtRefSegm
;
PtSegmB
=
PtSegmN
=
PtRefSegm
;
for
(
ii
=
0
;
ii
<
50
;
ii
++
)
for
(
ii
=
0
;
ii
<
NEIGHTBOUR_COUNT_MAX
;
ii
++
)
{
{
if
(
(
PtSegmN
==
NULL
)
&&
(
PtSegmB
==
NULL
)
)
if
(
(
PtSegmN
==
NULL
)
&&
(
PtSegmB
==
NULL
)
)
break
;
break
;
...
@@ -725,15 +739,16 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
...
@@ -725,15 +739,16 @@ TRACK* Locate_Piste_Connectee( TRACK* PtRefSegm, TRACK* pt_base,
if
(
PtSegmN
==
PtRefSegm
)
if
(
PtSegmN
==
PtRefSegm
)
goto
suite
;
goto
suite
;
min_dist
=
(
PtSegmN
->
m_Width
+
PtRefSegm
->
m_Width
)
/
2
;
/* max_dist is the max distance between 2 tack ends which ensure a copper continuty */
max_dist
=
(
PtSegmN
->
m_Width
+
PtRefSegm
->
m_Width
)
/
2
;
if
(
Dist
(
pos_ref
,
PtSegmN
->
m_Start
)
<
min_dist
)
if
(
IsPointsAreNear
(
pos_ref
,
PtSegmN
->
m_Start
,
max_dist
)
)
{
/* Test des couches */
{
/* Test des couches */
if
(
Reflayer
&
PtSegmN
->
ReturnMaskLayer
()
)
if
(
Reflayer
&
PtSegmN
->
ReturnMaskLayer
()
)
return
PtSegmN
;
return
PtSegmN
;
}
}
if
(
Dist
(
pos_ref
,
PtSegmN
->
m_End
)
<
min_dist
)
if
(
IsPointsAreNear
(
pos_ref
,
PtSegmN
->
m_End
,
max_dist
)
)
{
/* Test des couches */
{
/* Test des couches */
if
(
Reflayer
&
PtSegmN
->
ReturnMaskLayer
()
)
if
(
Reflayer
&
PtSegmN
->
ReturnMaskLayer
()
)
return
PtSegmN
;
return
PtSegmN
;
...
@@ -752,15 +767,15 @@ suite:
...
@@ -752,15 +767,15 @@ suite:
if
(
PtSegmB
==
PtRefSegm
)
if
(
PtSegmB
==
PtRefSegm
)
goto
suite1
;
goto
suite1
;
m
in
_dist
=
(
PtSegmB
->
m_Width
+
PtRefSegm
->
m_Width
)
/
2
;
m
ax
_dist
=
(
PtSegmB
->
m_Width
+
PtRefSegm
->
m_Width
)
/
2
;
if
(
Dist
(
pos_ref
,
PtSegmB
->
m_Start
)
<
min_dist
)
if
(
IsPointsAreNear
(
pos_ref
,
PtSegmB
->
m_Start
,
max_dist
)
)
{
/* Test des couches */
{
/* Test des couches */
if
(
Reflayer
&
PtSegmB
->
ReturnMaskLayer
()
)
if
(
Reflayer
&
PtSegmB
->
ReturnMaskLayer
()
)
return
PtSegmB
;
return
PtSegmB
;
}
}
if
(
Dist
(
pos_ref
,
PtSegmB
->
m_End
)
<
min_dist
)
if
(
IsPointsAreNear
(
pos_ref
,
PtSegmB
->
m_End
,
max_dist
)
)
{
/* Test des couches */
{
/* Test des couches */
if
(
Reflayer
&
PtSegmB
->
ReturnMaskLayer
()
)
if
(
Reflayer
&
PtSegmB
->
ReturnMaskLayer
()
)
return
PtSegmB
;
return
PtSegmB
;
...
@@ -792,15 +807,15 @@ suite1:
...
@@ -792,15 +807,15 @@ suite1:
}
}
m
in
_dist
=
(
PtSegmN
->
m_Width
+
PtRefSegm
->
m_Width
)
/
2
;
m
ax
_dist
=
(
PtSegmN
->
m_Width
+
PtRefSegm
->
m_Width
)
/
2
;
if
(
Dist
(
pos_ref
,
PtSegmN
->
m_Start
)
<
min_dist
)
if
(
IsPointsAreNear
(
pos_ref
,
PtSegmN
->
m_Start
,
max_dist
)
)
{
/* Test des couches */
{
/* Test des couches */
if
(
Reflayer
&
PtSegmN
->
ReturnMaskLayer
()
)
if
(
Reflayer
&
PtSegmN
->
ReturnMaskLayer
()
)
return
PtSegmN
;
return
PtSegmN
;
}
}
if
(
Dist
(
pos_ref
,
PtSegmN
->
m_End
)
<
min_dist
)
if
(
IsPointsAreNear
(
pos_ref
,
PtSegmN
->
m_End
,
max_dist
)
)
{
/* Test des couches */
{
/* Test des couches */
if
(
Reflayer
&
PtSegmN
->
ReturnMaskLayer
()
)
if
(
Reflayer
&
PtSegmN
->
ReturnMaskLayer
()
)
return
PtSegmN
;
return
PtSegmN
;
...
...
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