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
4a32a601
Commit
4a32a601
authored
17 years ago
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SwitchLayer() fix
parent
806f9aa1
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
23 deletions
+53
-23
change_log.txt
change_log.txt
+9
-0
wxstruct.h
include/wxstruct.h
+14
-1
dragsegm.cpp
pcbnew/dragsegm.cpp
+0
-1
edit.cpp
pcbnew/edit.cpp
+11
-1
editrack-part2.cpp
pcbnew/editrack-part2.cpp
+10
-17
move_or_drag_track.cpp
pcbnew/move_or_drag_track.cpp
+9
-3
No files found.
change_log.txt
View file @
4a32a601
...
@@ -5,6 +5,15 @@ Please add newer entries at the top, list the date and your name with
...
@@ -5,6 +5,15 @@ Please add newer entries at the top, list the date and your name with
email address.
email address.
2007-Dec-14 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
+pcbnew
WinEDA_PcbFrame::Other_Layer_Route() now returns bool, so that if the DRC
would not allow the new via placement, then it can be checked and the layer
change can also then be aborted. Previously the layer change would happen
in mid track if the via could not be placed.
2007-Dec-13 UPDATE Dick Hollenbeck <dick@softplc.com>
2007-Dec-13 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
+pcbnew
+pcbnew
...
...
This diff is collapsed.
Click to expand it.
include/wxstruct.h
View file @
4a32a601
...
@@ -709,7 +709,20 @@ public:
...
@@ -709,7 +709,20 @@ public:
// Track and via edition:
// Track and via edition:
void
DisplayTrackSettings
();
void
DisplayTrackSettings
();
void
Other_Layer_Route
(
TRACK
*
track
,
wxDC
*
DC
);
/**
* Function Other_Layer_Route
* operates in one of two ways. If argument track is NULL, then swap the active
* layer between m_Route_Layer_TOP and m_Route_Layer_BOTTOM. If a track is
* in progress (track is not NULL), and if DRC allows it, place a via on the end
* of the current track, and then swap the current active layer and start a new
* segment on the new layer.
* @param track A TRACK* to append the via to or NULL.
* @param DC A device context to draw on.
* @return bool - true if the operation was successful, else false such as
* the case where DRC would not allow a via.
*/
bool
Other_Layer_Route
(
TRACK
*
track
,
wxDC
*
DC
);
void
Affiche_PadsNoConnect
(
wxDC
*
DC
);
void
Affiche_PadsNoConnect
(
wxDC
*
DC
);
void
Affiche_Status_Net
(
wxDC
*
DC
);
void
Affiche_Status_Net
(
wxDC
*
DC
);
TRACK
*
Delete_Segment
(
wxDC
*
DC
,
TRACK
*
Track
);
TRACK
*
Delete_Segment
(
wxDC
*
DC
,
TRACK
*
Track
);
...
...
This diff is collapsed.
Click to expand it.
pcbnew/dragsegm.cpp
View file @
4a32a601
...
@@ -242,7 +242,6 @@ void EraseDragListe()
...
@@ -242,7 +242,6 @@ void EraseDragListe()
{
{
NextStruct
=
pt_drag
->
Pnext
;
NextStruct
=
pt_drag
->
Pnext
;
pt_drag
->
m_Segm
->
m_Flags
=
0
;
pt_drag
->
m_Segm
->
m_Flags
=
0
;
pt_drag
->
m_Segm
->
m_Flags
=
0
;
delete
pt_drag
;
delete
pt_drag
;
}
}
...
...
This diff is collapsed.
Click to expand it.
pcbnew/edit.cpp
View file @
4a32a601
...
@@ -1051,7 +1051,17 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
...
@@ -1051,7 +1051,17 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
GetScreen
()
->
m_Route_Layer_TOP
=
preslayer
;
GetScreen
()
->
m_Route_Layer_TOP
=
preslayer
;
GetScreen
()
->
m_Route_Layer_BOTTOM
=
layer
;
GetScreen
()
->
m_Route_Layer_BOTTOM
=
layer
;
GetScreen
()
->
m_Active_Layer
=
preslayer
;
GetScreen
()
->
m_Active_Layer
=
preslayer
;
Other_Layer_Route
(
(
TRACK
*
)
GetScreen
()
->
GetCurItem
(),
DC
);
if
(
Other_Layer_Route
(
(
TRACK
*
)
GetScreen
()
->
GetCurItem
(),
DC
)
)
{
if
(
DisplayOpt
.
ContrastModeDisplay
)
GetScreen
()
->
SetRefreshReq
();
}
// if the via was allowed by DRC, then the layer swap has already
// been done by Other_Layer_Route(). if via not allowed, then
// return now so assignment to m_Active_Layer below doesn't happen.
return
;
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
pcbnew/editrack-part2.cpp
View file @
4a32a601
...
@@ -153,19 +153,10 @@ void WinEDA_PcbFrame::ExChange_Track_Layer( TRACK* pt_segm, wxDC* DC )
...
@@ -153,19 +153,10 @@ void WinEDA_PcbFrame::ExChange_Track_Layer( TRACK* pt_segm, wxDC* DC )
}
}
/****************************************************************/
/****************************************************************/
void
WinEDA_PcbFrame
::
Other_Layer_Route
(
TRACK
*
track
,
wxDC
*
DC
)
bool
WinEDA_PcbFrame
::
Other_Layer_Route
(
TRACK
*
track
,
wxDC
*
DC
)
/****************************************************************/
/****************************************************************/
/*
* if no track in progress :
* swap the active layer between m_Route_Layer_TOP and m_Route_Layer_BOTTOM
* if a track is in progress :
* put (if possible, i.e. if no DRC problem) a Via on the end of the current
* track, swap the current active layer and start a new trac segment on the new layer
* @param track = track in progress, or NULL
* @param DC = current device context
*/
{
{
TRACK
*
pt_segm
;
TRACK
*
pt_segm
;
SEGVIA
*
Via
;
SEGVIA
*
Via
;
...
@@ -180,19 +171,19 @@ void WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
...
@@ -180,19 +171,19 @@ void WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
GetScreen
()
->
m_Active_Layer
=
GetScreen
()
->
m_Route_Layer_BOTTOM
;
GetScreen
()
->
m_Active_Layer
=
GetScreen
()
->
m_Route_Layer_BOTTOM
;
Affiche_Status_Box
();
Affiche_Status_Box
();
SetToolbars
();
SetToolbars
();
return
;
return
true
;
}
}
/* Avoid more than one via on the current location: */
/* Avoid more than one via on the current location: */
if
(
Locate_Via
(
m_Pcb
,
g_CurrentTrackSegment
->
m_End
,
g_CurrentTrackSegment
->
GetLayer
()
)
)
if
(
Locate_Via
(
m_Pcb
,
g_CurrentTrackSegment
->
m_End
,
g_CurrentTrackSegment
->
GetLayer
()
)
)
return
;
return
false
;
pt_segm
=
g_FirstTrackSegment
;
pt_segm
=
g_FirstTrackSegment
;
for
(
ii
=
0
;
ii
<
g_TrackSegmentCount
-
1
;
ii
++
,
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
)
for
(
ii
=
0
;
ii
<
g_TrackSegmentCount
-
1
;
ii
++
,
pt_segm
=
(
TRACK
*
)
pt_segm
->
Pnext
)
{
{
if
(
(
pt_segm
->
Type
()
==
TYPEVIA
)
if
(
(
pt_segm
->
Type
()
==
TYPEVIA
)
&&
(
g_CurrentTrackSegment
->
m_End
==
pt_segm
->
m_Start
)
)
&&
(
g_CurrentTrackSegment
->
m_End
==
pt_segm
->
m_Start
)
)
return
;
return
false
;
}
}
/* Is the current segment Ok (no DRC error) ? */
/* Is the current segment Ok (no DRC error) ? */
...
@@ -200,12 +191,12 @@ void WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
...
@@ -200,12 +191,12 @@ void WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
{
{
if
(
BAD_DRC
==
m_drc
->
Drc
(
g_CurrentTrackSegment
,
m_Pcb
->
m_Track
)
)
if
(
BAD_DRC
==
m_drc
->
Drc
(
g_CurrentTrackSegment
,
m_Pcb
->
m_Track
)
)
/* DRC error, the change layer is not made */
/* DRC error, the change layer is not made */
return
;
return
false
;
if
(
g_TwoSegmentTrackBuild
&&
g_CurrentTrackSegment
->
Back
()
)
// We must handle 2 segments
if
(
g_TwoSegmentTrackBuild
&&
g_CurrentTrackSegment
->
Back
()
)
// We must handle 2 segments
{
{
if
(
BAD_DRC
==
m_drc
->
Drc
(
g_CurrentTrackSegment
->
Back
(),
m_Pcb
->
m_Track
)
)
if
(
BAD_DRC
==
m_drc
->
Drc
(
g_CurrentTrackSegment
->
Back
(),
m_Pcb
->
m_Track
)
)
return
;
return
false
;
}
}
}
}
...
@@ -256,7 +247,7 @@ void WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
...
@@ -256,7 +247,7 @@ void WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
delete
Via
;
delete
Via
;
GetScreen
()
->
m_Active_Layer
=
old_layer
;
GetScreen
()
->
m_Active_Layer
=
old_layer
;
DrawPanel
->
ManageCurseur
(
DrawPanel
,
DC
,
FALSE
);
DrawPanel
->
ManageCurseur
(
DrawPanel
,
DC
,
FALSE
);
return
;
return
false
;
}
}
/* A new via was created. It was Ok.
/* A new via was created. It was Ok.
...
@@ -303,6 +294,8 @@ void WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
...
@@ -303,6 +294,8 @@ void WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
Affiche_Status_Box
();
Affiche_Status_Box
();
SetToolbars
();
SetToolbars
();
return
true
;
}
}
...
...
This diff is collapsed.
Click to expand it.
pcbnew/move_or_drag_track.cpp
View file @
4a32a601
...
@@ -234,7 +234,9 @@ static void Show_Drag_Track_Segment_With_Cte_Slope( WinEDA_DrawPanel* panel,
...
@@ -234,7 +234,9 @@ static void Show_Drag_Track_Segment_With_Cte_Slope( WinEDA_DrawPanel* panel,
if
(
TrackSegWrapper
==
NULL
)
if
(
TrackSegWrapper
==
NULL
)
return
;
return
;
Track
=
TrackSegWrapper
->
m_Segm
;
if
(
Track
==
NULL
)
Track
=
TrackSegWrapper
->
m_Segm
;
if
(
Track
==
NULL
)
return
;
return
;
TrackSegWrapper
=
TrackSegWrapper
->
Pnext
;
TrackSegWrapper
=
TrackSegWrapper
->
Pnext
;
...
@@ -260,6 +262,7 @@ static void Show_Drag_Track_Segment_With_Cte_Slope( WinEDA_DrawPanel* panel,
...
@@ -260,6 +262,7 @@ static void Show_Drag_Track_Segment_With_Cte_Slope( WinEDA_DrawPanel* panel,
Track
->
Draw
(
panel
,
DC
,
draw_mode
);
Track
->
Draw
(
panel
,
DC
,
draw_mode
);
if
(
tSegmentToStart
)
if
(
tSegmentToStart
)
tSegmentToStart
->
Draw
(
panel
,
DC
,
draw_mode
);
tSegmentToStart
->
Draw
(
panel
,
DC
,
draw_mode
);
if
(
tSegmentToEnd
)
if
(
tSegmentToEnd
)
tSegmentToEnd
->
Draw
(
panel
,
DC
,
draw_mode
);
tSegmentToEnd
->
Draw
(
panel
,
DC
,
draw_mode
);
}
}
...
@@ -386,11 +389,13 @@ static void Show_Drag_Track_Segment_With_Cte_Slope( WinEDA_DrawPanel* panel,
...
@@ -386,11 +389,13 @@ static void Show_Drag_Track_Segment_With_Cte_Slope( WinEDA_DrawPanel* panel,
// update the segment coordinates (if possible)
// update the segment coordinates (if possible)
if
(
tSegmentToStart
==
NULL
)
if
(
tSegmentToStart
==
NULL
)
{
{
xi1
=
tx1
;
yi1
=
ty1
;
xi1
=
tx1
;
yi1
=
ty1
;
}
}
if
(
tSegmentToEnd
==
NULL
)
if
(
tSegmentToEnd
==
NULL
)
{
{
xi2
=
tx2
;
yi2
=
ty2
;
xi2
=
tx2
;
yi2
=
ty2
;
}
}
...
@@ -736,6 +741,7 @@ void WinEDA_PcbFrame::Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC
...
@@ -736,6 +741,7 @@ void WinEDA_PcbFrame::Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC
AddSegmentToDragList
(
DrawPanel
,
DC
,
flag
,
TrackToStartPoint
);
AddSegmentToDragList
(
DrawPanel
,
DC
,
flag
,
TrackToStartPoint
);
track
->
m_Flags
|=
STARTPOINT
;
track
->
m_Flags
|=
STARTPOINT
;
}
}
if
(
TrackToEndPoint
)
if
(
TrackToEndPoint
)
{
{
int
flag
=
STARTPOINT
;
int
flag
=
STARTPOINT
;
...
...
This diff is collapsed.
Click to expand it.
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