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
327f307a
Commit
327f307a
authored
Jul 09, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FIx layer switching after via placement in PNS router.
parent
0953d573
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
25 deletions
+57
-25
pns_line_placer.cpp
pcbnew/router/pns_line_placer.cpp
+15
-3
pns_line_placer.h
pcbnew/router/pns_line_placer.h
+1
-1
pns_router.cpp
pcbnew/router/pns_router.cpp
+4
-2
pns_router.h
pcbnew/router/pns_router.h
+2
-2
pns_routing_settings.h
pcbnew/router/pns_routing_settings.h
+21
-0
router_tool.cpp
pcbnew/router/router_tool.cpp
+14
-17
No files found.
pcbnew/router/pns_line_placer.cpp
View file @
327f307a
...
...
@@ -758,9 +758,12 @@ void PNS_LINE_PLACER::splitAdjacentSegments( PNS_NODE* aNode, PNS_ITEM* aSeg, co
}
void
PNS_LINE_PLACER
::
SetLayer
(
int
aLayer
)
void
PNS_LINE_PLACER
::
SetLayer
(
int
aLayer
)
{
m_currentLayer
=
aLayer
;
m_head
.
SetLayer
(
aLayer
);
m_tail
.
SetLayer
(
aLayer
);
}
...
...
@@ -901,9 +904,18 @@ bool PNS_LINE_PLACER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem )
VECTOR2I
p_start
=
m_placingVia
?
p_last
:
p_pre_last
;
if
(
m_placingVia
)
m_currentLayer
=
Router
()
->
NextCopperLayer
(
true
);
{
int
layerTop
=
Router
()
->
Settings
().
GetLayerTop
();
int
layerBottom
=
Router
()
->
Settings
().
GetLayerBottom
();
// Change the current layer to the other side of the board
if
(
m_currentLayer
==
layerTop
)
m_currentLayer
=
layerBottom
;
else
m_currentLayer
=
layerTop
;
}
setWorld
(
Router
()
->
GetWorld
()
->
Branch
()
);
setWorld
(
Router
()
->
GetWorld
()
->
Branch
()
);
startPlacement
(
p_start
,
m_head
.
Net
(),
m_head
.
Width
(),
m_currentLayer
);
m_startsOnVia
=
m_placingVia
;
...
...
pcbnew/router/pns_line_placer.h
View file @
327f307a
...
...
@@ -212,7 +212,7 @@ private:
*
* Sets the board to route.
*/
void
setWorld
(
PNS_NODE
*
aWorld
);
void
setWorld
(
PNS_NODE
*
aWorld
);
/**
* Function startPlacement()
...
...
pcbnew/router/pns_router.cpp
View file @
327f307a
...
...
@@ -323,6 +323,7 @@ PNS_ROUTER::PNS_ROUTER()
m_currentLayer
=
1
;
m_placingVia
=
false
;
m_startsOnVia
=
false
;
m_currentNet
=
-
1
;
m_state
=
IDLE
;
m_world
=
NULL
;
...
...
@@ -758,6 +759,7 @@ void PNS_ROUTER::CommitRouting( PNS_NODE* aNode )
via_board
->
SetWidth
(
via
->
Diameter
()
);
via_board
->
SetDrill
(
via
->
Drill
()
);
via_board
->
SetNetCode
(
via
->
Net
()
);
via_board
->
SetLayerPair
(
m_settings
.
GetLayerTop
(),
m_settings
.
GetLayerBottom
()
);
newBI
=
via_board
;
break
;
}
...
...
@@ -809,6 +811,7 @@ bool PNS_ROUTER::FixRoute( const VECTOR2I& aP, PNS_ITEM* aEndItem )
{
case
ROUTE_TRACK
:
rv
=
m_placer
->
FixRoute
(
aP
,
aEndItem
);
m_startsOnVia
=
m_placingVia
;
m_placingVia
=
false
;
break
;
...
...
@@ -874,8 +877,7 @@ void PNS_ROUTER::SwitchLayer( int aLayer )
if
(
m_startsOnVia
)
{
m_currentLayer
=
aLayer
;
//m_placer->StartPlacement( m_currentStart, m_currentNet, m_currentWidth,
// m_currentLayer );
m_placer
->
SetLayer
(
aLayer
);
}
break
;
...
...
pcbnew/router/pns_router.h
View file @
327f307a
...
...
@@ -107,7 +107,7 @@ public:
void
DisplayItems
(
const
PNS_ITEMSET
&
aItems
);
void
DisplayDebugLine
(
const
SHAPE_LINE_CHAIN
&
aLine
,
int
aType
=
0
,
int
aWidth
=
0
);
void
DisplayDebugPoint
(
const
VECTOR2I
aPos
,
int
aType
=
0
);
void
DisplayDebugPoint
(
const
VECTOR2I
aPos
,
int
aType
=
0
);
void
DisplayDebugBox
(
const
BOX2I
&
aBox
,
int
aType
=
0
,
int
aWidth
=
0
);
void
SwitchLayer
(
int
layer
);
...
...
@@ -223,7 +223,7 @@ private:
void
highlightCurrent
(
bool
enabled
);
void
markViolations
(
PNS_NODE
*
aNode
,
PNS_ITEMSET
&
aCurrent
,
PNS_NODE
::
ITEM_VECTOR
&
aRemoved
);
void
markViolations
(
PNS_NODE
*
aNode
,
PNS_ITEMSET
&
aCurrent
,
PNS_NODE
::
ITEM_VECTOR
&
aRemoved
);
int
m_currentLayer
;
int
m_currentNet
;
...
...
pcbnew/router/pns_routing_settings.h
View file @
327f307a
...
...
@@ -127,6 +127,23 @@ public:
int
WalkaroundIterationLimit
()
const
{
return
m_walkaroundIterationLimit
;
};
TIME_LIMIT
WalkaroundTimeLimit
()
const
;
void
SetLayerPair
(
int
aLayer1
,
int
aLayer2
)
{
if
(
aLayer1
>
aLayer2
)
{
m_layerTop
=
aLayer1
;
m_layerBottom
=
aLayer2
;
}
else
{
m_layerBottom
=
aLayer1
;
m_layerTop
=
aLayer2
;
}
}
int
GetLayerTop
()
const
{
return
m_layerTop
;
}
int
GetLayerBottom
()
const
{
return
m_layerBottom
;
}
private
:
bool
m_shoveVias
;
bool
m_startDiagonal
;
...
...
@@ -150,6 +167,10 @@ private:
int
m_shoveIterationLimit
;
TIME_LIMIT
m_shoveTimeLimit
;
TIME_LIMIT
m_walkaroundTimeLimit
;
// Routing layers pair
int
m_layerTop
;
int
m_layerBottom
;
};
#endif
pcbnew/router/router_tool.cpp
View file @
327f307a
...
...
@@ -478,7 +478,7 @@ void ROUTER_TOOL::updateEndItem( TOOL_EVENT& aEvent )
int
layer
;
bool
snapEnabled
=
!
aEvent
.
Modifier
(
MD_SHIFT
);
m_router
->
EnableSnapping
(
snapEnabled
);
m_router
->
EnableSnapping
(
snapEnabled
);
if
(
!
snapEnabled
||
m_router
->
GetCurrentNet
()
<
0
||
!
m_startItem
)
{
...
...
@@ -566,39 +566,36 @@ void ROUTER_TOOL::performRouting()
if
(
m_router
->
FixRoute
(
m_endSnapPoint
,
m_endItem
)
)
break
;
// Synchronize the indicated layer
frame
->
SetActiveLayer
(
m_router
->
GetCurrentLayer
()
);
m_router
->
Move
(
m_endSnapPoint
,
m_endItem
);
}
else
if
(
evt
->
IsAction
(
&
ACT_PlaceThroughVia
)
)
{
m_router
->
Settings
().
SetLayerPair
(
frame
->
GetScreen
()
->
m_Route_Layer_TOP
,
frame
->
GetScreen
()
->
m_Route_Layer_BOTTOM
);
m_router
->
ToggleViaPlacement
();
frame
->
GetGalCanvas
()
->
SetTopLayer
(
ToLAYER_ID
(
m_router
->
GetCurrentLayer
()
)
);
m_router
->
Move
(
m_endSnapPoint
,
m_endItem
);
m_router
->
Move
(
m_endSnapPoint
,
m_endItem
);
// refresh
}
else
if
(
evt
->
IsAction
(
&
ACT_SwitchPosture
)
)
{
m_router
->
FlipPosture
();
m_router
->
Move
(
m_endSnapPoint
,
m_endItem
);
m_router
->
Move
(
m_endSnapPoint
,
m_endItem
);
// refresh
}
else
if
(
evt
->
IsAction
(
&
COMMON_ACTIONS
::
layer
Next
)
)
else
if
(
evt
->
IsAction
(
&
COMMON_ACTIONS
::
layer
Changed
)
)
{
m_router
->
SwitchLayer
(
m_router
->
NextCopperLayer
(
true
)
);
updateEndItem
(
*
evt
);
frame
->
SetActiveLayer
(
ToLAYER_ID
(
m_router
->
GetCurrentLayer
()
)
);
m_router
->
Move
(
m_endSnapPoint
,
m_endItem
);
}
else
if
(
evt
->
IsAction
(
&
COMMON_ACTIONS
::
layerPrev
)
)
{
m_router
->
SwitchLayer
(
m_router
->
NextCopperLayer
(
false
)
);
frame
->
SetActiveLayer
(
ToLAYER_ID
(
m_router
->
GetCurrentLayer
()
)
);
m_router
->
Move
(
m_endSnapPoint
,
m_endItem
);
m_router
->
SwitchLayer
(
frame
->
GetActiveLayer
()
);
m_router
->
Move
(
m_endSnapPoint
,
m_endItem
);
// refresh
}
else
if
(
evt
->
IsAction
(
&
ACT_EndTrack
)
)
{
if
(
m_router
->
FixRoute
(
m_endSnapPoint
,
m_endItem
)
)
break
;
}
handleCommonEvents
(
*
evt
);
handleCommonEvents
(
*
evt
);
}
m_router
->
StopRouting
();
...
...
@@ -642,7 +639,7 @@ int ROUTER_TOOL::Main( TOOL_EVENT& aEvent )
m_router
->
Settings
().
SetViaDiameter
(
bds
.
GetCurrentViaSize
()
);
m_router
->
Settings
().
SetViaDrill
(
bds
.
GetCurrentViaDrill
()
);
ROUTER_TOOL_MENU
*
ctxMenu
=
new
ROUTER_TOOL_MENU
(
board
);
ROUTER_TOOL_MENU
*
ctxMenu
=
new
ROUTER_TOOL_MENU
(
board
);
SetContextMenu
(
ctxMenu
);
...
...
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