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
6a3a1085
Commit
6a3a1085
authored
Mar 18, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
crashing bug fix
parent
9e9a8fcf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
36 deletions
+64
-36
change_log.txt
change_log.txt
+11
-0
connect.cpp
pcbnew/connect.cpp
+18
-24
dialog_drc.cpp
pcbnew/dialog_drc.cpp
+5
-0
drc.cpp
pcbnew/drc.cpp
+13
-11
protos.h
pcbnew/protos.h
+17
-1
No files found.
change_log.txt
View file @
6a3a1085
...
...
@@ -5,6 +5,17 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2008-Mar-17 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew
* Fixed a crashing bug which occured when you run the module editor, select
"Update module in current board" and then run the DRC checker after that.
* Changed to void CreateSortedPadListByXCoord( BOARD* aBoard, std::vector<D_PAD*>* aVector )
So caller can safely forget to delete the array of pad pointers and the vector's
destructor handles this automatically.
2008-Mar-14 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+eeschema
...
...
pcbnew/connect.cpp
View file @
6a3a1085
...
...
@@ -542,20 +542,15 @@ static int SortPadsByXCoord( const void* pt_ref, const void* pt_comp )
}
/****************************************************/
LISTE_PAD
*
CreateSortedPadListByXCoord
(
BOARD
*
pcb
)
/****************************************************/
/* Create a sorted list of pointers to pads.
* This list is sorted by X ccordinate value.
* The list must be freed by user
*/
/*****************************************************************************/
void
CreateSortedPadListByXCoord
(
BOARD
*
aBoard
,
std
::
vector
<
D_PAD
*>*
aVector
)
/*****************************************************************************/
{
LISTE_PAD
*
pad_list
=
(
LISTE_PAD
*
)
MyMalloc
(
pcb
->
m_NbPads
*
sizeof
(
D_PAD
*
)
);
aVector
->
resize
(
aBoard
->
m_NbPads
);
memcpy
(
pad_list
,
pcb
->
m_Pads
,
pcb
->
m_NbPads
*
sizeof
(
D_PAD
*
)
);
qsort
(
pad_list
,
pcb
->
m_NbPads
,
sizeof
(
D_PAD
*
),
SortPadsByXCoord
);
return
pad_list
;
memcpy
(
&
(
*
aVector
)[
0
],
aBoard
->
m_Pads
,
aBoard
->
m_NbPads
*
sizeof
(
D_PAD
*
)
);
qsort
(
&
(
*
aVector
)[
0
],
aBoard
->
m_NbPads
,
sizeof
(
D_PAD
*
),
SortPadsByXCoord
)
;
}
...
...
@@ -570,14 +565,14 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
* We search a connection between a track segment and a pad: if found : this segment netcode is set to the pad netcode
*/
{
TRACK
*
pt_piste
,
*
pt_next
;
int
a_color
;
char
new_passe_request
=
1
,
flag
;
LISTE_PAD
*
pt_mem
;
BOARD_ITEM
*
PtStruct
;
int
masque_layer
;
wxString
msg
;
TRACK
*
pt_piste
;
TRACK
*
pt_next
;
int
a_color
;
char
new_passe_request
=
1
,
flag
;
std
::
vector
<
D_PAD
*>
sortedPads
;
BOARD_ITEM
*
PtStruct
;
int
masque_layer
;
wxString
msg
;
if
(
m_Pcb
->
m_NbPads
==
0
)
return
;
...
...
@@ -595,7 +590,7 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
/**************************************************************/
/* Pass 1: search the connections between track ends and pads */
/**************************************************************/
pt_mem
=
CreateSortedPadListByXCoord
(
m_Pcb
);
CreateSortedPadListByXCoord
(
m_Pcb
,
&
sortedPads
);
if
(
affiche
)
Affiche_1_Parametre
(
this
,
-
1
,
wxEmptyString
,
wxT
(
"Conn Pads"
),
a_color
);
...
...
@@ -619,7 +614,7 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
/* Search for a pad on the segment starting point */
pt_piste
->
start
=
SuperFast_Locate_Pad_Connecte
(
m_Pcb
,
pt_mem
,
&
sortedPads
[
0
]
,
pt_piste
->
m_Start
.
x
,
pt_piste
->
m_Start
.
y
,
masque_layer
);
...
...
@@ -631,7 +626,7 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
/* Search for a pad on the segment ending point */
pt_piste
->
end
=
SuperFast_Locate_Pad_Connecte
(
m_Pcb
,
pt_mem
,
&
sortedPads
[
0
]
,
pt_piste
->
m_End
.
x
,
pt_piste
->
m_End
.
y
,
masque_layer
);
...
...
@@ -643,7 +638,6 @@ void WinEDA_BasePcbFrame::reattribution_reference_piste( int affiche )
}
}
MyFree
(
pt_mem
);
/*****************************************************/
/* Pass 2: search the connections between track ends */
...
...
pcbnew/dialog_drc.cpp
View file @
6a3a1085
...
...
@@ -635,6 +635,11 @@ void DrcDialog::OnStartdrcClick( wxCommandEvent& event )
wxBeginBusyCursor
();
// running the module editor and selecting "Update module in current board"
// causes the list to become obsolete because of the new pads from the
// revised module.
m_Parent
->
build_liste_pads
();
// run all the tests, with no UI at this time.
m_tester
->
RunTests
();
...
...
pcbnew/drc.cpp
View file @
6a3a1085
...
...
@@ -197,7 +197,7 @@ void DRC::RunTests()
testTracks
();
// test zone clearances to other zones, pads, tracks, and vias
testZones
(
m_doZonesTest
);
testZones
(
m_doZonesTest
);
// find and gather unconnected pads.
if
(
m_doUnconnectedTest
)
...
...
@@ -251,33 +251,35 @@ void DRC::testTracks()
void
DRC
::
testPad2Pad
()
{
LISTE_PAD
*
pad_list_start
=
CreateSortedPadListByXCoord
(
m_pcb
)
;
LISTE_PAD
*
pad_list_limit
=
&
pad_list_start
[
m_pcb
->
m_NbPads
];
LISTE_PAD
*
ppad
;
std
::
vector
<
D_PAD
*>
sortedPads
;
CreateSortedPadListByXCoord
(
m_pcb
,
&
sortedPads
)
;
// find the max size of the pads (used to stop the test)
int
max_size
=
0
;
for
(
ppad
=
pad_list_start
;
ppad
<
pad_list_limit
;
ppad
++
)
for
(
unsigned
i
=
0
;
i
<
sortedPads
.
size
();
++
i
)
{
D_PAD
*
pad
=
*
ppad
;
D_PAD
*
pad
=
sortedPads
[
i
];
if
(
pad
->
m_Rayon
>
max_size
)
max_size
=
pad
->
m_Rayon
;
}
// Test the pads
for
(
ppad
=
pad_list_start
;
ppad
<
pad_list_limit
;
ppad
++
)
D_PAD
**
listEnd
=
&
sortedPads
[
sortedPads
.
size
()
];
for
(
unsigned
i
=
0
;
i
<
sortedPads
.
size
();
++
i
)
{
D_PAD
*
pad
=
*
ppad
;
D_PAD
*
pad
=
sortedPads
[
i
]
;
if
(
!
doPadToPadsDrc
(
pad
,
ppad
,
pad_list_limit
,
max_size
)
)
if
(
!
doPadToPadsDrc
(
pad
,
&
sortedPads
[
i
],
listEnd
,
max_size
)
)
{
wxASSERT
(
m_currentMarker
);
m_pcb
->
Add
(
m_currentMarker
);
m_currentMarker
=
0
;
}
}
free
(
pad_list_start
);
}
...
...
pcbnew/protos.h
View file @
6a3a1085
...
...
@@ -5,10 +5,26 @@
#ifndef PROTO_H
#define PROTO_H
#include <vector>
/***************/
/* PAD_CONNECT.CPP */
/***************/
LISTE_PAD
*
CreateSortedPadListByXCoord
(
BOARD
*
pcb
);
class
D_PAD
;
/**
* Function CreateSortedPadListByXCoord
* first empties then fills the vector with all pads and sorts them by
* increasing x coordinate. The vector only holds pointers to the pads and
* those pointers are only references to pads which are owned by the BOARD
* through other links.
* @param aBoard Which board to gather pads from.
* @param aVector Where to put the pad pointers.
*/
void
CreateSortedPadListByXCoord
(
BOARD
*
aBoard
,
std
::
vector
<
D_PAD
*>*
aVector
);
/* Create a sorted list of pointers to pads.
* This list is sorted by X ccordinate value.
...
...
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