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
b88505dd
Commit
b88505dd
authored
Nov 08, 2011
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: code cleaning in ratsnest.cpp. Add comments.
parent
619a82a6
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
180 additions
and
130 deletions
+180
-130
wxBasePcbFrame.h
include/wxBasePcbFrame.h
+30
-8
class_board.cpp
pcbnew/class_board.cpp
+1
-1
class_board.h
pcbnew/class_board.h
+1
-1
edit.cpp
pcbnew/edit.cpp
+1
-1
editrack.cpp
pcbnew/editrack.cpp
+8
-8
ratsnest.cpp
pcbnew/ratsnest.cpp
+138
-110
zones_by_polygon_fill_functions.cpp
pcbnew/zones_by_polygon_fill_functions.cpp
+1
-1
No files found.
include/wxBasePcbFrame.h
View file @
b88505dd
...
...
@@ -397,17 +397,39 @@ public:
*/
void
DrawGeneralRatsnest
(
wxDC
*
aDC
,
int
aNetcode
=
0
);
void
trace_ratsnest_pad
(
wxDC
*
DC
);
void
build_ratsnest_pad
(
BOARD_ITEM
*
ref
,
const
wxPoint
&
refpos
,
bool
init
);
/**
* Function TraceAirWiresToTargets
* This functions shows airwires to nearest connecting points (pads)
* from the current new track end during track creation
* Uses data prepared by BuildAirWiresTargetsList()
* @param aDC = the current device context
*/
void
TraceAirWiresToTargets
(
wxDC
*
DC
);
/**
* Function BuildAirWiresTargetsList
* Build a list of candidates that can be a coonection point
* when a track is started.
* This functions prepares data to show airwires to nearest connecting points (pads)
* from the current new track to candidates during track creation
* @param aItemRef = the item connected to the starting point of the new track (track or pad)
* @param aPosition = the position of the new track end (usually the mouse cursor on grid)
* @param aInit = true to build full candidate list or false to update data
* When aInit = false, aItemRef is not used (can be NULL)
*/
void
BuildAirWiresTargetsList
(
BOARD_CONNECTED_ITEM
*
aItemRef
,
const
wxPoint
&
aPosition
,
bool
aInit
);
/**
* Fucntion TestRatsNest
* computes the active rats nest
* The general rats nest list must exist.
* Compute the ACTIVE rats nest in the general rats nest list
* if aNetCode == 0, test all nets, else test only aNetCode
* Function TestForActiveLinksInRatsnest
* Explores the full rats nest list (which must exist) to determine
* the ACTIVE links in the full rats nest list
* When tracks exist between pads, a link can connect 2 pads already connected by a track
* and the link is said inactive.
* When a link connects 2 pads not already connected by a track, the link is said active.
* @param aNetCode = net code to test. If 0, test all nets
*/
void
Test
RatsNest
(
wxDC
*
aDC
,
int
aNetCode
);
void
Test
ForActiveLinksInRatsnest
(
int
aNetCode
);
/**
* Function TestConnections
...
...
pcbnew/class_board.cpp
View file @
b88505dd
...
...
@@ -2133,7 +2133,7 @@ MODULE* BOARD::GetFootprint( const wxPoint& aPosition, int aActiveLayer,
}
BOARD_ITEM
*
BOARD
::
GetLockPoint
(
const
wxPoint
&
aPosition
,
int
aLayerMask
)
BOARD_
CONNECTED_
ITEM
*
BOARD
::
GetLockPoint
(
const
wxPoint
&
aPosition
,
int
aLayerMask
)
{
for
(
MODULE
*
module
=
m_Modules
;
module
;
module
=
module
->
Next
()
)
{
...
...
pcbnew/class_board.h
View file @
b88505dd
...
...
@@ -1251,7 +1251,7 @@ public:
* layer mask.
* @return A pointer to a BOARD_ITEM object if found otherwise NULL.
*/
BOARD_ITEM
*
GetLockPoint
(
const
wxPoint
&
aPosition
,
int
aLayerMask
);
BOARD_
CONNECTED_
ITEM
*
GetLockPoint
(
const
wxPoint
&
aPosition
,
int
aLayerMask
);
/**
* Function CreateLockPoint
...
...
pcbnew/edit.cpp
View file @
b88505dd
...
...
@@ -558,7 +558,7 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
SetCurItem
(
NULL
);
// CurItem might be deleted by this command, clear the pointer
TestConnections
(
NULL
);
Test
RatsNest
(
NULL
,
0
);
// Recalculate the active ratsnest, i.e. the unconnected links
Test
ForActiveLinksInRatsnest
(
0
);
// Recalculate the active ratsnest, i.e. the unconnected links
OnModify
();
GetBoard
()
->
DisplayInfo
(
this
);
DrawPanel
->
Refresh
();
...
...
pcbnew/editrack.cpp
View file @
b88505dd
...
...
@@ -94,7 +94,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
D_PAD
*
pt_pad
=
NULL
;
TRACK
*
TrackOnStartPoint
=
NULL
;
int
layerMask
=
g_TabOneLayerMask
[(
(
PCB_SCREEN
*
)
GetScreen
()
)
->
m_Active_Layer
];
BOARD_ITEM
*
LockPoint
;
BOARD_
CONNECTED_
ITEM
*
LockPoint
;
wxPoint
pos
=
GetScreen
()
->
GetCrossHairPosition
();
if
(
aTrack
==
NULL
)
/* Starting a new track */
...
...
@@ -148,7 +148,7 @@ TRACK* PCB_EDIT_FRAME::Begin_Route( TRACK* aTrack, wxDC* aDC )
D
(
g_CurrentTrackList
.
VerifyListIntegrity
();
);
build_ratsnest_pad
(
LockPoint
,
wxPoint
(
0
,
0
),
true
);
BuildAirWiresTargetsList
(
LockPoint
,
wxPoint
(
0
,
0
),
true
);
D
(
g_CurrentTrackList
.
VerifyListIntegrity
();
);
...
...
@@ -428,7 +428,7 @@ bool PCB_EDIT_FRAME::End_Route( TRACK* aTrack, wxDC* aDC )
ShowNewTrackWhenMovingCursor
(
DrawPanel
,
aDC
,
wxDefaultPosition
,
true
);
ShowNewTrackWhenMovingCursor
(
DrawPanel
,
aDC
,
wxDefaultPosition
,
false
);
trace_ratsnest_pad
(
aDC
);
TraceAirWiresToTargets
(
aDC
);
/* cleanup
* if( g_CurrentTrackSegment->Next() != NULL )
...
...
@@ -447,7 +447,7 @@ bool PCB_EDIT_FRAME::End_Route( TRACK* aTrack, wxDC* aDC )
* This helps to reduce the computing time */
/* Attaching the end of the track. */
BOARD_ITEM
*
LockPoint
=
GetBoard
()
->
GetLockPoint
(
pos
,
layerMask
);
BOARD_
CONNECTED_
ITEM
*
LockPoint
=
GetBoard
()
->
GetLockPoint
(
pos
,
layerMask
);
if
(
LockPoint
)
/* End of trace is on a pad. */
{
...
...
@@ -489,7 +489,7 @@ bool PCB_EDIT_FRAME::End_Route( TRACK* aTrack, wxDC* aDC )
GetBoard
()
->
m_Track
.
Insert
(
track
,
insertBeforeMe
);
}
trace_ratsnest_pad
(
aDC
);
TraceAirWiresToTargets
(
aDC
);
DrawTraces
(
DrawPanel
,
aDC
,
firstTrack
,
newCount
,
GR_OR
);
...
...
@@ -680,7 +680,7 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
{
DrawTraces
(
aPanel
,
aDC
,
g_FirstTrackSegment
,
g_CurrentTrackList
.
GetCount
(),
GR_XOR
);
frame
->
trace_ratsnest_pad
(
aDC
);
frame
->
TraceAirWiresToTargets
(
aDC
);
if
(
showTrackClearanceMode
>=
SHOW_CLEARANCE_NEW_TRACKS_AND_VIA_AREAS
)
{
...
...
@@ -807,8 +807,8 @@ void ShowNewTrackWhenMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPo
DisplayOpt
.
ShowTrackClearanceMode
=
showTrackClearanceMode
;
DisplayOpt
.
DisplayPcbTrackFill
=
Track_fill_copy
;
frame
->
build_ratsnest_pad
(
NULL
,
g_CurrentTrackSegment
->
m_End
,
false
);
frame
->
trace_ratsnest_pad
(
aDC
);
frame
->
BuildAirWiresTargetsList
(
NULL
,
g_CurrentTrackSegment
->
m_End
,
false
);
frame
->
TraceAirWiresToTargets
(
aDC
);
}
...
...
pcbnew/ratsnest.cpp
View file @
b88505dd
This diff is collapsed.
Click to expand it.
pcbnew/zones_by_polygon_fill_functions.cpp
View file @
b88505dd
...
...
@@ -174,7 +174,7 @@ int PCB_EDIT_FRAME::Fill_All_Zones( bool verbose )
TestConnections
(
NULL
);
// Recalculate the active ratsnest, i.e. the unconnected links
Test
RatsNest
(
NULL
,
0
);
Test
ForActiveLinksInRatsnest
(
0
);
DrawPanel
->
Refresh
(
true
);
return
errorLevel
;
...
...
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