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
073d0767
Commit
073d0767
authored
Feb 25, 2009
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix markers on pads when pads are high-lighted
parent
6d91cdd6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
92 deletions
+91
-92
CHANGELOG.txt
CHANGELOG.txt
+8
-0
wxPcbStruct.h
include/wxPcbStruct.h
+0
-1
class_board.h
pcbnew/class_board.h
+9
-0
move_or_drag_track.cpp
pcbnew/move_or_drag_track.cpp
+5
-5
surbrill.cpp
pcbnew/surbrill.cpp
+2
-76
tracepcb.cpp
pcbnew/tracepcb.cpp
+67
-10
No files found.
CHANGELOG.txt
View file @
073d0767
...
...
@@ -5,6 +5,14 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2009-Feb-25 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
++pcbnew
Markers were now shown when on top of a high-lighted pad. Moved highlight
drawing function into class BOARD and out of Frame. Call BOARD::DrawHighLight() from
within BOARD::Draw() to fix.
2009-Feb-24 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
++pcbnew
...
...
include/wxPcbStruct.h
View file @
073d0767
...
...
@@ -495,7 +495,6 @@ public:
// Hightlight functions:
int
Select_High_Light
(
wxDC
*
DC
);
void
Hight_Light
(
wxDC
*
DC
);
void
DrawHightLight
(
wxDC
*
DC
,
int
NetCode
);
// Track and via edition:
void
DisplayTrackSettings
();
...
...
pcbnew/class_board.h
View file @
073d0767
...
...
@@ -263,6 +263,15 @@ public:
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
int
aDrawMode
,
const
wxPoint
&
offset
=
ZeroOffset
);
/**
* Function DrawHighLight
* redraws the objects in the board that are associated with the given aNetCode
* and turns on or off the brilliance associated with that net according to the
* current value of global g_HightLigt_Status
* @param aDrawPanel is needed for the clipping support.
* @param aNetCode is the net number to highlight or to dim.
*/
void
DrawHighLight
(
WinEDA_DrawPanel
*
aDrawPanel
,
wxDC
*
DC
,
int
aNetCode
);
/**
* Function Visit
...
...
pcbnew/move_or_drag_track.cpp
View file @
073d0767
...
...
@@ -60,8 +60,7 @@ static void Abort_MoveTrack( WinEDA_DrawPanel* Panel, wxDC* DC )
Panel
->
GetScreen
()
->
m_Curseur
=
oldpos
;
g_HightLigt_Status
=
FALSE
;
(
(
WinEDA_PcbFrame
*
)
Panel
->
m_Parent
)
->
DrawHightLight
(
DC
,
g_HightLigth_NetCode
);
(
(
WinEDA_PcbFrame
*
)
Panel
->
m_Parent
)
->
GetBoard
()
->
DrawHighLight
(
Panel
,
DC
,
g_HightLigth_NetCode
);
if
(
NewTrack
)
{
...
...
@@ -119,7 +118,7 @@ static void Abort_MoveTrack( WinEDA_DrawPanel* Panel, wxDC* DC )
g_HightLigth_NetCode
=
Old_HightLigth_NetCode
;
g_HightLigt_Status
=
Old_HightLigt_Status
;
if
(
g_HightLigt_Status
)
(
(
WinEDA_PcbFrame
*
)
Panel
->
m_Parent
)
->
DrawHightLight
(
DC
,
g_HightLigth_NetCode
);
(
(
WinEDA_PcbFrame
*
)
Panel
->
m_Parent
)
->
GetBoard
()
->
DrawHighLight
(
Panel
,
DC
,
g_HightLigth_NetCode
);
EraseDragListe
();
}
...
...
@@ -688,7 +687,8 @@ void WinEDA_PcbFrame::Start_MoveOneNodeOrSegment( TRACK* track, wxDC* DC, int co
g_HightLigth_NetCode
=
track
->
GetNet
();
g_HightLigt_Status
=
TRUE
;
DrawHightLight
(
DC
,
g_HightLigth_NetCode
);
GetBoard
()
->
DrawHighLight
(
DrawPanel
,
DC
,
g_HightLigth_NetCode
);
DrawPanel
->
ManageCurseur
(
DrawPanel
,
DC
,
TRUE
);
}
void
SortTrackEndPoints
(
TRACK
*
track
)
...
...
@@ -844,7 +844,7 @@ void WinEDA_PcbFrame::Start_DragTrackSegmentAndKeepSlope( TRACK* track, wxDC* DC
g_HightLigth_NetCode
=
track
->
GetNet
();
g_HightLigt_Status
=
TRUE
;
DrawHightLight
(
DC
,
g_HightLigth_NetCode
);
GetBoard
()
->
DrawHighLight
(
DrawPanel
,
DC
,
g_HightLigth_NetCode
);
if
(
!
InitialiseDragParameters
()
)
{
...
...
pcbnew/surbrill.cpp
View file @
073d0767
...
...
@@ -15,11 +15,6 @@
#define Pad_fill (Pad_Fill_Item.State == RUN)
static
void
Pad_Surbrillance
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
MODULE
*
Module
,
int
NetCode
);
/* variables locales : */
static
int
draw_mode
;
/*********************************************************/
void
WinEDA_PcbFrame
::
Liste_Equipot
(
wxCommandEvent
&
event
)
...
...
@@ -99,16 +94,14 @@ int WinEDA_PcbFrame::Select_High_Light( wxDC* DC )
if
(
g_HightLigt_Status
)
Hight_Light
(
DC
);
// use this scheme because
of pad is higher priority than tracks
in the
// use this scheme because
a pad is a higher priority than a track
in the
// search, and finding a pad, instead of a track on a pad,
// allows us to fire a message to eeschema.
GENERAL_COLLECTORS_GUIDE
guide
=
GetCollectorsGuide
();
// optionally, modify the "guide" here as needed using its member functions
m_Collector
->
Collect
(
GetBoard
(),
GENERAL_COLLECTOR
::
PadsTracksOrZones
,
GetScreen
()
->
RefPos
(
true
),
guide
);
...
...
@@ -158,74 +151,7 @@ void WinEDA_PcbFrame::Hight_Light( wxDC* DC )
*/
{
g_HightLigt_Status
=
!
g_HightLigt_Status
;
DrawHightLight
(
DC
,
g_HightLigth_NetCode
);
}
/****************************************************************/
void
WinEDA_PcbFrame
::
DrawHightLight
(
wxDC
*
DC
,
int
NetCode
)
/****************************************************************/
/* Turn On or OFF the HightLight for trcak and pads with the netcode "NetCode'
*/
{
if
(
g_HightLigt_Status
)
draw_mode
=
GR_SURBRILL
|
GR_OR
;
else
draw_mode
=
GR_AND
|
GR_SURBRILL
;
#if 0 // does not unhighlight properly
// redraw the zones with the NetCode
for( SEGZONE* zone = GetBoard()->m_Zone; zone; zone = zone->Next() )
{
if( zone->GetNet() == NetCode )
{
zone->Draw( DrawPanel, DC, draw_mode );
}
}
#endif
// Redraw ZONE_CONTAINERS
BOARD
::
ZONE_CONTAINERS
&
zones
=
GetBoard
()
->
m_ZoneDescriptorList
;
for
(
BOARD
::
ZONE_CONTAINERS
::
iterator
zc
=
zones
.
begin
();
zc
!=
zones
.
end
();
++
zc
)
{
if
(
(
*
zc
)
->
GetNet
()
==
NetCode
)
{
(
*
zc
)
->
Draw
(
DrawPanel
,
DC
,
draw_mode
);
}
}
/* Redraw pads */
for
(
MODULE
*
module
=
GetBoard
()
->
m_Modules
;
module
;
module
=
module
->
Next
()
)
{
Pad_Surbrillance
(
DrawPanel
,
DC
,
module
,
NetCode
);
}
/* Redraw track and vias: */
for
(
TRACK
*
pts
=
GetBoard
()
->
m_Track
;
pts
;
pts
=
pts
->
Next
()
)
{
if
(
pts
->
GetNet
()
==
NetCode
)
{
pts
->
Draw
(
DrawPanel
,
DC
,
draw_mode
);
}
}
GetBoard
()
->
DrawHighLight
(
DrawPanel
,
DC
,
g_HightLigth_NetCode
);
}
/*******************************************************/
static
void
Pad_Surbrillance
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
MODULE
*
Module
,
int
NetCode
)
/*******************************************************/
/* Mise en Surbrillance des Pads */
{
D_PAD
*
pt_pad
;
/* trace des pastilles */
for
(
pt_pad
=
Module
->
m_Pads
;
pt_pad
;
pt_pad
=
pt_pad
->
Next
()
)
{
if
(
pt_pad
->
GetNet
()
==
NetCode
)
{
pt_pad
->
Draw
(
panel
,
DC
,
draw_mode
);
}
}
}
pcbnew/tracepcb.cpp
View file @
073d0767
...
...
@@ -43,7 +43,7 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
DrawPanel
->
DrawBackGround
(
DC
);
TraceWorkSheet
(
DC
,
screen
,
0
);
/* Redraw the footprint */
/* Redraw the footprint
s
*/
for
(
MODULE
*
module
=
GetBoard
()
->
m_Modules
;
module
;
module
=
module
->
Next
()
)
{
module
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
...
...
@@ -84,8 +84,6 @@ void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
TraceWorkSheet
(
DC
,
GetScreen
(),
0
);
GetBoard
()
->
Draw
(
DrawPanel
,
DC
,
GR_OR
);
if
(
g_HightLigt_Status
)
DrawHightLight
(
DC
,
g_HightLigth_NetCode
);
DrawGeneralRatsnest
(
DC
);
...
...
@@ -107,6 +105,9 @@ void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* DC,
/********************************************************************/
/* Redraw the BOARD items but not cursors, axis or grid */
{
for
(
MODULE
*
module
=
m_Modules
;
module
;
module
=
module
->
Next
()
)
{
bool
display
=
true
;
...
...
@@ -135,7 +136,6 @@ void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* DC,
Trace_Pads_Only
(
aPanel
,
DC
,
module
,
0
,
0
,
layerMask
,
aDrawMode
);
}
// Draw the graphic items
for
(
BOARD_ITEM
*
item
=
m_Drawings
;
item
;
item
=
item
->
Next
()
)
{
...
...
@@ -184,19 +184,76 @@ void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* DC,
}
}
// Draw equipots info
for
(
EQUIPOT
*
net
=
m_Equipots
;
net
;
net
=
net
->
Next
()
)
{
if
(
net
->
GetNet
()
!=
0
)
// no net if 0
net
->
Draw
(
aPanel
,
DC
,
aDrawMode
);
}
// draw the BOARD's markers.
// @todo: this high-light functionality could be built into me.
if
(
g_HightLigt_Status
)
DrawHighLight
(
aPanel
,
DC
,
g_HightLigth_NetCode
);
// draw the BOARD's markers last, otherwise the high light will erase any marker on a pad
for
(
unsigned
i
=
0
;
i
<
m_markers
.
size
();
++
i
)
{
m_markers
[
i
]
->
Draw
(
aPanel
,
DC
,
aDrawMode
);
}
}
// Draw equipots info
for
(
EQUIPOT
*
net
=
m_Equipots
;
net
;
net
=
net
->
Next
()
)
/******************************************************************************/
void
BOARD
::
DrawHighLight
(
WinEDA_DrawPanel
*
aDrawPanel
,
wxDC
*
DC
,
int
aNetCode
)
/******************************************************************************/
{
int
draw_mode
;
if
(
g_HightLigt_Status
)
draw_mode
=
GR_SURBRILL
|
GR_OR
;
else
draw_mode
=
GR_AND
|
GR_SURBRILL
;
#if 0 // does not unhighlight properly
// redraw the zones with the aNetCode
for( SEGZONE* zone = m_Zone; zone; zone = zone->Next() )
{
if
(
net
->
GetNet
()
!=
0
)
// no net if 0
net
->
Draw
(
aPanel
,
DC
,
aDrawMode
);
if( zone->GetNet() == aNetCode )
{
zone->Draw( aDrawPanel, DC, draw_mode );
}
}
#endif
// Redraw ZONE_CONTAINERS
BOARD
::
ZONE_CONTAINERS
&
zones
=
m_ZoneDescriptorList
;
for
(
BOARD
::
ZONE_CONTAINERS
::
iterator
zc
=
zones
.
begin
();
zc
!=
zones
.
end
();
++
zc
)
{
if
(
(
*
zc
)
->
GetNet
()
==
aNetCode
)
{
(
*
zc
)
->
Draw
(
aDrawPanel
,
DC
,
draw_mode
);
}
}
}
// Redraw any pads that have aNetCode
for
(
MODULE
*
module
=
m_Modules
;
module
;
module
=
module
->
Next
()
)
{
for
(
D_PAD
*
pad
=
module
->
m_Pads
;
pad
;
pad
=
pad
->
Next
()
)
{
if
(
pad
->
GetNet
()
==
aNetCode
)
{
pad
->
Draw
(
aDrawPanel
,
DC
,
draw_mode
);
}
}
}
// Redraw track and vias that have aNetCode
for
(
TRACK
*
seg
=
m_Track
;
seg
;
seg
=
seg
->
Next
()
)
{
if
(
seg
->
GetNet
()
==
aNetCode
)
{
seg
->
Draw
(
aDrawPanel
,
DC
,
draw_mode
);
}
}
}
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