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
5f297726
Commit
5f297726
authored
Jul 09, 2014
by
Maciej Suminski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Module anchors are visible in GAL canvas.
parent
6f772c90
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
3 deletions
+49
-3
class_module.cpp
pcbnew/class_module.cpp
+15
-0
class_module.h
pcbnew/class_module.h
+6
-0
pcb_draw_panel_gal.cpp
pcbnew/pcb_draw_panel_gal.cpp
+3
-1
pcb_painter.cpp
pcbnew/pcb_painter.cpp
+24
-2
pcb_painter.h
pcbnew/pcb_painter.h
+1
-0
No files found.
pcbnew/class_module.cpp
View file @
5f297726
...
...
@@ -830,6 +830,21 @@ void MODULE::ViewUpdate( int aUpdateFlags )
}
void
MODULE
::
ViewGetLayers
(
int
aLayers
[],
int
&
aCount
)
const
{
aCount
=
1
;
aLayers
[
0
]
=
ITEM_GAL_LAYER
(
ANCHOR_VISIBLE
);
}
unsigned
int
MODULE
::
ViewGetLOD
(
int
aLayer
)
const
{
// Currently there is only one layer, so there is nothing to check
// if( aLayer == ITEM_GAL_LAYER( ANCHOR_VISIBLE ) )
return
30
;
}
/* Test for validity of the name in a library of the footprint
* ( no spaces, dir separators ... )
* return true if the given name is valid
...
...
pcbnew/class_module.h
View file @
5f297726
...
...
@@ -483,6 +483,12 @@ public:
/// @copydoc VIEW_ITEM::ViewUpdate()
void
ViewUpdate
(
int
aUpdateFlags
=
KIGFX
::
VIEW_ITEM
::
ALL
);
/// @copydoc VIEW_ITEM::ViewGetLayers()
virtual
void
ViewGetLayers
(
int
aLayers
[],
int
&
aCount
)
const
;
/// @copydoc VIEW_ITEM::ViewGetLOD()
virtual
unsigned
int
ViewGetLOD
(
int
aLayer
)
const
;
/**
* Function CopyNetlistSettings
* copies the netlist settings to \a aModule.
...
...
pcbnew/pcb_draw_panel_gal.cpp
View file @
5f297726
...
...
@@ -47,7 +47,7 @@ const LAYER_NUM GAL_LAYER_ORDER[] =
ITEM_GAL_LAYER
(
MOD_TEXT_FR_VISIBLE
),
ITEM_GAL_LAYER
(
MOD_REFERENCES_VISIBLE
),
ITEM_GAL_LAYER
(
MOD_VALUES_VISIBLE
),
ITEM_GAL_LAYER
(
RATSNEST_VISIBLE
),
ITEM_GAL_LAYER
(
RATSNEST_VISIBLE
),
ITEM_GAL_LAYER
(
ANCHOR_VISIBLE
),
ITEM_GAL_LAYER
(
VIAS_HOLES_VISIBLE
),
ITEM_GAL_LAYER
(
PADS_HOLES_VISIBLE
),
ITEM_GAL_LAYER
(
VIA_THROUGH_VISIBLE
),
ITEM_GAL_LAYER
(
PADS_VISIBLE
),
...
...
@@ -141,6 +141,8 @@ EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aGalType )
}
}
m_view
->
SetLayerTarget
(
ITEM_GAL_LAYER
(
ANCHOR_VISIBLE
),
KIGFX
::
TARGET_NONCACHED
);
// Some more required layers settings
m_view
->
SetRequired
(
ITEM_GAL_LAYER
(
VIAS_HOLES_VISIBLE
),
ITEM_GAL_LAYER
(
VIA_THROUGH_VISIBLE
)
);
m_view
->
SetRequired
(
ITEM_GAL_LAYER
(
PADS_HOLES_VISIBLE
),
ITEM_GAL_LAYER
(
PADS_VISIBLE
)
);
...
...
pcbnew/pcb_painter.cpp
View file @
5f297726
...
...
@@ -79,6 +79,7 @@ void PCB_RENDER_SETTINGS::ImportLegacyColors( const COLORS_DESIGN_SETTINGS* aSet
m_layerColors
[
NETNAMES_GAL_LAYER
(
PADS_NETNAMES_VISIBLE
)]
=
COLOR4D
(
1.0
,
1.0
,
1.0
,
0.9
);
m_layerColors
[
NETNAMES_GAL_LAYER
(
PAD_FR_NETNAMES_VISIBLE
)]
=
COLOR4D
(
1.0
,
1.0
,
1.0
,
0.9
);
m_layerColors
[
NETNAMES_GAL_LAYER
(
PAD_BK_NETNAMES_VISIBLE
)]
=
COLOR4D
(
1.0
,
1.0
,
1.0
,
0.9
);
m_layerColors
[
ITEM_GAL_LAYER
(
ANCHOR_VISIBLE
)]
=
COLOR4D
(
0.3
,
0.3
,
1.0
,
0.9
);
m_layerColors
[
ITEM_GAL_LAYER
(
RATSNEST_VISIBLE
)]
=
COLOR4D
(
0.4
,
0.4
,
0.4
,
0.8
);
m_layerColors
[
ITEM_GAL_LAYER
(
WORKSHEET
)]
=
COLOR4D
(
0.5
,
0.0
,
0.0
,
0.8
);
m_layerColors
[
ITEM_GAL_LAYER
(
DRC_VISIBLE
)]
=
COLOR4D
(
1.0
,
0.0
,
0.0
,
0.8
);
...
...
@@ -233,6 +234,10 @@ bool PCB_PAINTER::Draw( const VIEW_ITEM* aItem, int aLayer )
draw
(
(
TEXTE_MODULE
*
)
item
,
aLayer
);
break
;
case
PCB_MODULE_T
:
draw
(
(
MODULE
*
)
item
);
break
;
case
PCB_ZONE_AREA_T
:
draw
(
(
ZONE_CONTAINER
*
)
item
);
break
;
...
...
@@ -284,7 +289,7 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer )
// Set a proper color for the label
const
COLOR4D
&
color
=
m_pcbSettings
.
GetColor
(
aTrack
,
aTrack
->
GetLayer
()
);
COLOR4D
labelColor
=
m_pcbSettings
.
GetColor
(
NULL
,
aLayer
);
const
COLOR4D
labelColor
=
m_pcbSettings
.
GetColor
(
NULL
,
aLayer
);
if
(
color
.
GetBrightness
()
>
0.5
)
m_gal
->
SetStrokeColor
(
labelColor
.
Inverted
()
);
...
...
@@ -421,7 +426,7 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
// Set a proper color for the label
const
COLOR4D
&
color
=
m_pcbSettings
.
GetColor
(
aPad
,
aPad
->
GetLayer
()
);
COLOR4D
labelColor
=
m_pcbSettings
.
GetColor
(
NULL
,
aLayer
);
const
COLOR4D
labelColor
=
m_pcbSettings
.
GetColor
(
NULL
,
aLayer
);
if
(
color
.
GetBrightness
()
>
0.5
)
m_gal
->
SetStrokeColor
(
labelColor
.
Inverted
()
);
...
...
@@ -726,6 +731,23 @@ void PCB_PAINTER::draw( const TEXTE_MODULE* aText, int aLayer )
}
void
PCB_PAINTER
::
draw
(
const
MODULE
*
aModule
)
{
const
COLOR4D
color
=
m_pcbSettings
.
GetColor
(
aModule
,
ITEM_GAL_LAYER
(
ANCHOR_VISIBLE
)
);
// Draw anchor
m_gal
->
SetStrokeColor
(
color
);
m_gal
->
SetLineWidth
(
1.0
);
// Keep the size constant, not related to the scale
double
anchorSize
=
5.0
/
m_gal
->
GetWorldScale
();
VECTOR2D
center
=
aModule
->
GetPosition
();
m_gal
->
DrawLine
(
center
-
VECTOR2D
(
anchorSize
,
0
),
center
+
VECTOR2D
(
anchorSize
,
0
)
);
m_gal
->
DrawLine
(
center
-
VECTOR2D
(
0
,
anchorSize
),
center
+
VECTOR2D
(
0
,
anchorSize
)
);
}
void
PCB_PAINTER
::
draw
(
const
ZONE_CONTAINER
*
aZone
)
{
const
COLOR4D
&
color
=
m_pcbSettings
.
GetColor
(
aZone
,
aZone
->
GetLayer
()
);
...
...
pcbnew/pcb_painter.h
View file @
5f297726
...
...
@@ -213,6 +213,7 @@ protected:
void
draw
(
const
DRAWSEGMENT
*
aSegment
);
void
draw
(
const
TEXTE_PCB
*
aText
,
int
aLayer
);
void
draw
(
const
TEXTE_MODULE
*
aText
,
int
aLayer
);
void
draw
(
const
MODULE
*
aModule
);
void
draw
(
const
ZONE_CONTAINER
*
aZone
);
void
draw
(
const
DIMENSION
*
aDimension
,
int
aLayer
);
void
draw
(
const
PCB_TARGET
*
aTarget
);
...
...
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