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
6d856f60
Commit
6d856f60
authored
Dec 14, 2008
by
charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: Added display a short net name on vias and pads. Also, code cleaning
parent
9dae370c
Changes
51
Show whitespace changes
Inline
Side-by-side
Showing
51 changed files
with
1145 additions
and
919 deletions
+1145
-919
change_log.txt
change_log.txt
+8
-0
basicframe.cpp
common/basicframe.cpp
+0
-3
common_plot_functions.cpp
common/common_plot_functions.cpp
+1
-1
drawtxt.cpp
common/drawtxt.cpp
+85
-76
worksheet.cpp
common/worksheet.cpp
+4
-3
CMakeLists.txt
cvpcb/CMakeLists.txt
+1
-1
makefile.include
cvpcb/makefile.include
+4
-0
class_drawsheet.cpp
eeschema/class_drawsheet.cpp
+2
-2
class_hierarchical_PIN_sheet.cpp
eeschema/class_hierarchical_PIN_sheet.cpp
+3
-2
class_pin.cpp
eeschema/class_pin.cpp
+6
-6
class_text-label.cpp
eeschema/class_text-label.cpp
+9
-6
classes_body_items.cpp
eeschema/classes_body_items.cpp
+2
-2
eelayer.cpp
eeschema/eelayer.cpp
+5
-5
eelibs_draw_components.cpp
eeschema/eelibs_draw_components.cpp
+3
-3
libfield.cpp
eeschema/libfield.cpp
+3
-3
plot.cpp
eeschema/plot.cpp
+10
-8
protos.h
eeschema/protos.h
+1
-1
trpiste.cpp
gerbview/trpiste.cpp
+2
-2
build_version.h
include/build_version.h
+2
-2
colors.h
include/colors.h
+1
-0
common.h
include/common.h
+31
-8
kicad.mo
internat/fr/kicad.mo
+0
-0
kicad.po
internat/fr/kicad.po
+108
-102
CMakeLists.txt
pcbnew/CMakeLists.txt
+1
-0
affiche.cpp
pcbnew/affiche.cpp
+1
-1
class_board.cpp
pcbnew/class_board.cpp
+6
-6
class_board_item.cpp
pcbnew/class_board_item.cpp
+5
-5
class_equipot.cpp
pcbnew/class_equipot.cpp
+33
-11
class_equipot.h
pcbnew/class_equipot.h
+32
-16
class_pad.cpp
pcbnew/class_pad.cpp
+82
-467
class_pad.h
pcbnew/class_pad.h
+26
-2
class_pad_draw_functions.cpp
pcbnew/class_pad_draw_functions.cpp
+466
-0
class_text_mod.cpp
pcbnew/class_text_mod.cpp
+1
-1
class_track.cpp
pcbnew/class_track.cpp
+145
-127
class_track.h
pcbnew/class_track.h
+1
-1
class_zone.cpp
pcbnew/class_zone.cpp
+3
-3
dialog_copper_zones.cpp
pcbnew/dialog_copper_zones.cpp
+3
-3
dialog_pad_properties.cpp
pcbnew/dialog_pad_properties.cpp
+3
-3
export_gencad.cpp
pcbnew/export_gencad.cpp
+7
-6
ioascii.cpp
pcbnew/ioascii.cpp
+1
-1
makefile.include
pcbnew/makefile.include
+1
-0
move-drag_pads.cpp
pcbnew/move-drag_pads.cpp
+1
-1
netlist.cpp
pcbnew/netlist.cpp
+3
-3
ratsnest.cpp
pcbnew/ratsnest.cpp
+5
-5
router.cpp
pcbnew/router.cpp
+1
-1
solve.cpp
pcbnew/solve.cpp
+1
-1
specctra_export.cpp
pcbnew/specctra_export.cpp
+3
-3
surbrill.cpp
pcbnew/surbrill.cpp
+3
-3
tracepcb.cpp
pcbnew/tracepcb.cpp
+7
-0
xchgmod.cpp
pcbnew/xchgmod.cpp
+11
-11
zones_by_polygon.cpp
pcbnew/zones_by_polygon.cpp
+2
-2
No files found.
change_log.txt
View file @
6d856f60
...
...
@@ -5,6 +5,14 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2008-Dec-14 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
++pcbnew
Display a short net name on vias and pads (if zoom level allows it).
Short net names are net names without hierarchy path
Add m_ShortNetname and change m_Netname to private in classes D_PAD and EQUIPOT
2008-Dec-08 UPDATE Wayne Stambaugh <stambaughw@verizon.net>
================================================================================
++all
...
...
common/basicframe.cpp
View file @
6d856f60
...
...
@@ -138,9 +138,6 @@ void WinEDA_BasicFrame::PrintMsg( const wxString& text )
/******************************************************/
{
SetStatusText
(
text
);
#ifdef DEBUG
printf
(
"%s
\n
"
,
(
const
char
*
)
text
.
mb_str
()
);
#endif
}
...
...
common/common_plot_functions.cpp
View file @
6d856f60
...
...
@@ -92,7 +92,7 @@ void PlotWorkSheet( int format_plot, BASE_SCREEN* screen )
int
ii
,
jj
,
xg
,
yg
,
ipas
,
gxpas
,
gypas
;
wxSize
PageSize
;
wxPoint
pos
,
ref
;
int
color
;
EDA_Colors
color
;
Ki_WorkSheetData
*
WsItem
;
int
conv_unit
=
screen
->
GetInternalUnits
()
/
1000
;
/* Scale to convert dimension in 1/1000 in into internal units
* (1/1000 inc for EESchema, 1/10000 for pcbnew */
...
...
common/drawtxt.cpp
View file @
6d856f60
...
...
@@ -21,22 +21,23 @@
/* fonctions locales : */
/****************************************************************************/
void
DrawGraphicText
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
Pos
,
int
gcolor
,
const
wxString
&
Text
,
int
orient
,
const
wxSize
&
Size
,
int
h_justify
,
int
v_justify
,
int
width
)
/*****************************************************************************/
/* Draw a graphic text (like module texts)
* Text = text to draw
* Pos = text position (according to h_justify, v_justify)
* Size = text size (size.x or size.y can be < 0 for mirrored texts)
* orient = angle in 0.1 degree
* mode_color = GR_OR, GR_XOR..
* h_justify = horizontal justification (Left, center, right)
* v_justify = vertical justification (bottom, center, top)
* width = line width (pen width) (default = 0)
* if width < 0 : draw segments in sketch mode, width = abs(width)
/****************************************************************************************************/
void
DrawGraphicText
(
WinEDA_DrawPanel
*
aPanel
,
wxDC
*
DC
,
const
wxPoint
&
aPos
,
enum
EDA_Colors
aColor
,
const
wxString
&
aText
,
int
aOrient
,
const
wxSize
&
aSize
,
int
aH_justify
,
int
aV_justify
,
int
aWidth
)
/****************************************************************************************************/
/** Function DrawGraphicText
* Draw a graphic text (like module texts)
* @param aPanel = the current DrawPanel
* @param aPos = text position (according to aH_justify, aV_justify)
* @param aColor (enum EDA_Colors) = text color
* @param aText = text to draw
* @param aOrient = angle in 0.1 degree
* @param aSize = text size (size.x or size.y can be < 0 for mirrored texts)
* @param aH_justify = horizontal justification (Left, center, right)
* @param aV_justify = vertical justification (bottom, center, top)
* @param aWidth = line aWidth (pen aWidth) (default = 0)
*/
{
int
ii
,
kk
,
nbchar
,
AsciiCode
,
endcar
;
...
...
@@ -52,29 +53,29 @@ void DrawGraphicText( WinEDA_DrawPanel* panel, wxDC* DC,
int
coord
[
100
];
// Buffer coordinate used to draw polylines (char shapes)
bool
sketch_mode
=
FALSE
;
zoom
=
p
anel
->
GetZoom
();
zoom
=
aP
anel
->
GetZoom
();
size_h
=
Size
.
x
;
size_v
=
Size
.
y
;
size_h
=
a
Size
.
x
;
size_v
=
a
Size
.
y
;
if
(
w
idth
<
0
)
if
(
aW
idth
<
0
)
{
width
=
-
w
idth
;
aWidth
=
-
aW
idth
;
sketch_mode
=
TRUE
;
}
kk
=
0
;
ptr
=
0
;
/* ptr = text index */
nbchar
=
Text
.
Len
();
nbchar
=
a
Text
.
Len
();
if
(
nbchar
==
0
)
return
;
espacement
=
(
10
*
size_h
)
/
9
;
// this is the pitch between chars
ox
=
cX
=
Pos
.
x
;
oy
=
cY
=
Pos
.
y
;
ox
=
cX
=
a
Pos
.
x
;
oy
=
cY
=
a
Pos
.
y
;
/* Do not draw the text if out of draw area! */
if
(
p
anel
)
if
(
aP
anel
)
{
int
xm
,
ym
,
ll
,
xc
,
yc
;
int
textsize
=
ABS
(
espacement
);
...
...
@@ -83,10 +84,10 @@ void DrawGraphicText( WinEDA_DrawPanel* panel, wxDC* DC,
xc
=
GRMapX
(
cX
);
yc
=
GRMapY
(
cY
);
x0
=
p
anel
->
m_ClipBox
.
GetX
()
-
ll
;
y0
=
p
anel
->
m_ClipBox
.
GetY
()
-
ll
;
xm
=
p
anel
->
m_ClipBox
.
GetRight
()
+
ll
;
ym
=
p
anel
->
m_ClipBox
.
GetBottom
()
+
ll
;
x0
=
aP
anel
->
m_ClipBox
.
GetX
()
-
ll
;
y0
=
aP
anel
->
m_ClipBox
.
GetY
()
-
ll
;
xm
=
aP
anel
->
m_ClipBox
.
GetRight
()
+
ll
;
ym
=
aP
anel
->
m_ClipBox
.
GetBottom
()
+
ll
;
if
(
xc
<
x0
)
return
;
...
...
@@ -105,9 +106,9 @@ void DrawGraphicText( WinEDA_DrawPanel* panel, wxDC* DC,
ux0
=
uy0
=
0
;
/* Decalage du centre du texte / coord de ref */
if
(
(
orient
==
0
)
||
(
o
rient
==
1800
)
)
/* Horizontal Text */
if
(
(
aOrient
==
0
)
||
(
aO
rient
==
1800
)
)
/* Horizontal Text */
{
switch
(
h
_justify
)
switch
(
aH
_justify
)
{
case
GR_TEXT_HJUSTIFY_CENTER
:
break
;
...
...
@@ -121,7 +122,7 @@ void DrawGraphicText( WinEDA_DrawPanel* panel, wxDC* DC,
break
;
}
switch
(
v
_justify
)
switch
(
aV
_justify
)
{
case
GR_TEXT_VJUSTIFY_CENTER
:
break
;
...
...
@@ -137,7 +138,7 @@ void DrawGraphicText( WinEDA_DrawPanel* panel, wxDC* DC,
}
else
/* Vertical Text */
{
switch
(
h
_justify
)
switch
(
aH
_justify
)
{
case
GR_TEXT_HJUSTIFY_CENTER
:
break
;
...
...
@@ -151,7 +152,7 @@ void DrawGraphicText( WinEDA_DrawPanel* panel, wxDC* DC,
break
;
}
switch
(
v
_justify
)
switch
(
aV
_justify
)
{
case
GR_TEXT_VJUSTIFY_CENTER
:
break
;
...
...
@@ -172,10 +173,10 @@ void DrawGraphicText( WinEDA_DrawPanel* panel, wxDC* DC,
ox
=
cX
-
dx
;
oy
=
cY
+
dy
;
if
(
(
Size
.
x
/
zoom
)
==
0
)
if
(
(
a
Size
.
x
/
zoom
)
==
0
)
return
;
if
(
ABS
(
(
Size
.
x
/
zoom
)
)
<
3
)
/* chars trop petits pour etre dessines */
if
(
ABS
(
(
a
Size
.
x
/
zoom
)
)
<
3
)
/* chars trop petits pour etre dessines */
{
/* le texte est symbolise par une barre */
dx
=
(
espacement
*
nbchar
)
/
2
;
dy
=
size_v
/
2
;
/* Decalage du debut du texte / centre */
...
...
@@ -186,10 +187,10 @@ void DrawGraphicText( WinEDA_DrawPanel* panel, wxDC* DC,
dx
+=
cX
;
dy
=
cY
;
RotatePoint
(
&
ux0
,
&
uy0
,
cX
,
cY
,
o
rient
);
RotatePoint
(
&
dx
,
&
dy
,
cX
,
cY
,
o
rient
);
RotatePoint
(
&
ux0
,
&
uy0
,
cX
,
cY
,
aO
rient
);
RotatePoint
(
&
dx
,
&
dy
,
cX
,
cY
,
aO
rient
);
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
ux0
,
uy0
,
dx
,
dy
,
width
,
gc
olor
);
GRLine
(
&
aPanel
->
m_ClipBox
,
DC
,
ux0
,
uy0
,
dx
,
dy
,
aWidth
,
aC
olor
);
return
;
}
...
...
@@ -204,15 +205,15 @@ void DrawGraphicText( WinEDA_DrawPanel* panel, wxDC* DC,
dx += cX;
dy = cY;
RotatePoint( &ux0, &uy0, cX, cY,
o
rient );
RotatePoint( &dx, &dy, cX, cY,
o
rient );
RotatePoint( &ux0, &uy0, cX, cY,
aO
rient );
RotatePoint( &dx, &dy, cX, cY,
aO
rient );
DC->SetTextForeground( wxColour(
ColorRefs[
gc
olor].r,
ColorRefs[
gc
olor].g,
ColorRefs[
gc
olor].b ) );
ColorRefs[
aC
olor].r,
ColorRefs[
aC
olor].g,
ColorRefs[
aC
olor].b ) );
DC->DrawRotatedText( Text, GRMapX( ux0 ), GRMapY( uy0 ), (double)
o
rient / 10.0 );
DC->DrawRotatedText( Text, GRMapX( ux0 ), GRMapY( uy0 ), (double)
aO
rient / 10.0 );
return;
#endif
...
...
@@ -220,13 +221,13 @@ void DrawGraphicText( WinEDA_DrawPanel* panel, wxDC* DC,
{
x0
=
0
;
y0
=
0
;
#if defined(wxUSE_UNICODE) && defined(KICAD_CYRILLIC)
AsciiCode
=
Text
.
GetChar
(
ptr
)
&
0x7FF
;
AsciiCode
=
a
Text
.
GetChar
(
ptr
)
&
0x7FF
;
if
(
AsciiCode
>
0x40F
&&
AsciiCode
<
0x450
)
// big small Cyr
AsciiCode
=
utf8_to_ascii
[
AsciiCode
-
0x410
]
&
0xFF
;
else
AsciiCode
=
AsciiCode
&
0xFF
;
#else
AsciiCode
=
Text
.
GetChar
(
ptr
)
&
255
;
AsciiCode
=
aText
.
GetChar
(
ptr
)
&
0xFF
;
#endif
ptcar
=
graphic_fonte_shape
[
AsciiCode
];
/* ptcar pointe la description
* du caractere a dessiner */
...
...
@@ -245,20 +246,20 @@ void DrawGraphicText( WinEDA_DrawPanel* panel, wxDC* DC,
case
'U'
:
if
(
ii
&&
(
plume
==
'D'
)
)
{
if
(
w
idth
<=
1
)
GRPoly
(
&
p
anel
->
m_ClipBox
,
DC
,
ii
/
2
,
coord
,
0
,
0
,
gcolor
,
gc
olor
);
if
(
aW
idth
<=
1
)
GRPoly
(
&
aP
anel
->
m_ClipBox
,
DC
,
ii
/
2
,
coord
,
0
,
0
,
aColor
,
aC
olor
);
else
if
(
sketch_mode
)
{
int
ik
,
*
coordptr
;
coordptr
=
coord
;
for
(
ik
=
0
;
ik
<
(
ii
-
2
);
ik
+=
2
,
coordptr
+=
2
)
GRCSegm
(
&
p
anel
->
m_ClipBox
,
DC
,
*
coordptr
,
*
(
coordptr
+
1
),
*
(
coordptr
+
2
),
*
(
coordptr
+
3
),
width
,
gc
olor
);
GRCSegm
(
&
aP
anel
->
m_ClipBox
,
DC
,
*
coordptr
,
*
(
coordptr
+
1
),
*
(
coordptr
+
2
),
*
(
coordptr
+
3
),
aWidth
,
aC
olor
);
}
else
GRPoly
(
&
p
anel
->
m_ClipBox
,
DC
,
ii
/
2
,
coord
,
0
,
width
,
gcolor
,
gc
olor
);
GRPoly
(
&
aP
anel
->
m_ClipBox
,
DC
,
ii
/
2
,
coord
,
0
,
aWidth
,
aColor
,
aC
olor
);
}
plume
=
f_cod
;
ii
=
0
;
break
;
...
...
@@ -279,7 +280,7 @@ void DrawGraphicText( WinEDA_DrawPanel* panel, wxDC* DC,
k2
=
(
k2
*
size_h
)
/
9
;
dx
=
k2
+
ox
;
dy
=
k1
+
oy
;
RotatePoint
(
&
dx
,
&
dy
,
cX
,
cY
,
o
rient
);
RotatePoint
(
&
dx
,
&
dy
,
cX
,
cY
,
aO
rient
);
coord
[
ii
++
]
=
dx
;
coord
[
ii
++
]
=
dy
;
break
;
...
...
@@ -299,13 +300,21 @@ void DrawGraphicText( WinEDA_DrawPanel* panel, wxDC* DC,
/******************************************************************************************/
void
PlotGraphicText
(
int
format_plot
,
const
wxPoint
&
Pos
,
int
gc
olor
,
const
wxString
&
Text
,
int
orient
,
const
wxSize
&
Size
,
int
h_justify
,
int
v
_justify
)
void
PlotGraphicText
(
int
aFormat_plot
,
const
wxPoint
&
aPos
,
enum
EDA_Colors
aC
olor
,
const
wxString
&
a
Text
,
int
aOrient
,
const
wxSize
&
aSize
,
int
aH_justify
,
int
aV
_justify
)
/******************************************************************************************/
/*
* id DrawGraphicText, for plot graphic text
/** Function PlotGraphicText
* same as DrawGraphicText, but plot graphic text insteed of draw it
* @param aFormat_plot = plot format (PLOT_FORMAT_POST, PLOT_FORMAT_HPGL, PLOT_FORMAT_GERBER)
* @param aPos = text position (according to aH_justify, aV_justify)
* @param aColor (enum EDA_Colors) = text color
* @param aText = text to draw
* @param aOrient = angle in 0.1 degree
* @param aSize = text size (size.x or size.y can be < 0 for mirrored texts)
* @param aH_justify = horizontal justification (Left, center, right)
* @param aV_justify = vertical justification (bottom, center, top)
*/
{
int
kk
,
nbchar
,
end
,
AsciiCode
;
...
...
@@ -319,7 +328,7 @@ void PlotGraphicText( int format_plot, const wxPoint& Pos, int gcolor,
void
(
*
FctPlume
)(
wxPoint
pos
,
int
state
);
switch
(
f
ormat_plot
)
switch
(
aF
ormat_plot
)
{
case
PLOT_FORMAT_POST
:
FctPlume
=
LineTo_PS
;
...
...
@@ -334,11 +343,11 @@ void PlotGraphicText( int format_plot, const wxPoint& Pos, int gcolor,
return
;
}
if
(
gcolor
>=
0
&&
IsPostScript
(
f
ormat_plot
)
)
SetColorMapPS
(
gc
olor
);
if
(
aColor
>=
0
&&
IsPostScript
(
aF
ormat_plot
)
)
SetColorMapPS
(
aC
olor
);
size_h
=
Size
.
x
;
size_v
=
Size
.
y
;
size_h
=
a
Size
.
x
;
size_v
=
a
Size
.
y
;
if
(
size_h
==
0
)
size_h
=
DEFAULT_SIZE_TEXT
;
if
(
size_v
==
0
)
...
...
@@ -348,11 +357,11 @@ void PlotGraphicText( int format_plot, const wxPoint& Pos, int gcolor,
ptr
=
0
;
/* ptr = text index */
/* calcul de la position du debut des textes: ox et oy */
nbchar
=
Text
.
Len
();
nbchar
=
a
Text
.
Len
();
espacement
=
(
10
*
size_h
)
/
9
;
ox
=
cX
=
Pos
.
x
;
oy
=
cY
=
Pos
.
y
;
ox
=
cX
=
a
Pos
.
x
;
oy
=
cY
=
a
Pos
.
y
;
/* Calcul du cadrage du texte */
dx
=
(
espacement
*
nbchar
)
/
2
;
...
...
@@ -360,9 +369,9 @@ void PlotGraphicText( int format_plot, const wxPoint& Pos, int gcolor,
ux0
=
uy0
=
0
;
/* Decalage du centre du texte / ccord de ref */
if
(
(
orient
==
0
)
||
(
o
rient
==
1800
)
)
/* Texte Horizontal */
if
(
(
aOrient
==
0
)
||
(
aO
rient
==
1800
)
)
/* Texte Horizontal */
{
switch
(
h
_justify
)
switch
(
aH
_justify
)
{
case
GR_TEXT_HJUSTIFY_CENTER
:
break
;
...
...
@@ -376,7 +385,7 @@ void PlotGraphicText( int format_plot, const wxPoint& Pos, int gcolor,
break
;
}
switch
(
v
_justify
)
switch
(
aV
_justify
)
{
case
GR_TEXT_VJUSTIFY_CENTER
:
break
;
...
...
@@ -392,7 +401,7 @@ void PlotGraphicText( int format_plot, const wxPoint& Pos, int gcolor,
}
else
/* Texte Vertical */
{
switch
(
h
_justify
)
switch
(
aH
_justify
)
{
case
GR_TEXT_HJUSTIFY_CENTER
:
break
;
...
...
@@ -406,7 +415,7 @@ void PlotGraphicText( int format_plot, const wxPoint& Pos, int gcolor,
break
;
}
switch
(
v
_justify
)
switch
(
aV
_justify
)
{
case
GR_TEXT_VJUSTIFY_CENTER
:
break
;
...
...
@@ -432,13 +441,13 @@ void PlotGraphicText( int format_plot, const wxPoint& Pos, int gcolor,
while
(
kk
++
<
nbchar
)
{
#if defined(wxUSE_UNICODE) && defined(KICAD_CYRILLIC)
AsciiCode
=
Text
.
GetChar
(
ptr
)
&
0x7FF
;
AsciiCode
=
a
Text
.
GetChar
(
ptr
)
&
0x7FF
;
if
(
AsciiCode
>
0x40F
&&
AsciiCode
<
0x450
)
// big small Cyr
AsciiCode
=
utf8_to_ascii
[
AsciiCode
-
0x410
]
&
0xFF
;
else
AsciiCode
=
AsciiCode
&
0xFF
;
#else
AsciiCode
=
Text
.
GetChar
(
ptr
)
&
0xFF
;
AsciiCode
=
a
Text
.
GetChar
(
ptr
)
&
0xFF
;
#endif
ptcar
=
graphic_fonte_shape
[
AsciiCode
];
/* ptcar pointe la description
* du caractere a dessiner */
...
...
@@ -469,7 +478,7 @@ void PlotGraphicText( int format_plot, const wxPoint& Pos, int gcolor,
dx
=
k2
+
ox
;
dy
=
k1
+
oy
;
RotatePoint
(
&
dx
,
&
dy
,
o
rient
);
RotatePoint
(
&
dx
,
&
dy
,
aO
rient
);
FctPlume
(
wxPoint
(
cX
+
dx
,
cY
+
dy
),
plume
);
x0
=
k2
;
...
...
common/worksheet.cpp
View file @
6d856f60
...
...
@@ -26,7 +26,8 @@ void WinEDA_DrawFrame::TraceWorkSheet( wxDC* DC, BASE_SCREEN* screen, int line_w
Ki_PageDescr
*
Sheet
=
screen
->
m_CurrentSheetDesc
;
int
ii
,
jj
,
xg
,
yg
,
ipas
,
gxpas
,
gypas
;
wxPoint
pos
;
int
refx
,
refy
,
Color
;
int
refx
,
refy
;
EDA_Colors
Color
;
wxString
Line
;
Ki_WorkSheetData
*
WsItem
;
int
scale
=
m_InternalUnits
/
1000
;
...
...
cvpcb/CMakeLists.txt
View file @
6d856f60
...
...
@@ -16,7 +16,6 @@ set(CVPCB_SRCS
dialog_display_options.cpp
displayframe.cpp
genequiv.cpp
# genorcad.cpp
init.cpp
listboxes.cpp
listlib.cpp
...
...
@@ -41,6 +40,7 @@ set(CVPCB_EXTRA_SRCS
../pcbnew/class_mire.cpp
../pcbnew/class_module.cpp
../pcbnew/class_pad.cpp
../pcbnew/class_pad_draw_functions.cpp
../pcbnew/class_pcb_text.cpp
../pcbnew/class_text_mod.cpp
../pcbnew/class_track.cpp
...
...
cvpcb/makefile.include
View file @
6d856f60
...
...
@@ -46,6 +46,7 @@ OBJECTS = $(TARGET).o \
class_board.o
\
class_module.o
\
class_pad.o
\
class_pad_draw_functions.o
\
class_text_mod.o
\
class_edge_mod.o
\
class_equipot.o
\
...
...
@@ -104,6 +105,9 @@ class_track.o: ../pcbnew/class_track.cpp
class_pad.o
:
../pcbnew/class_pad.cpp
$(CXX)
-c
$(EDACPPFLAGS)
-o
$@
../pcbnew/
$*
.cpp
class_pad_draw_functions.o
:
../pcbnew/class_pad_draw_functions.cpp
$(CXX)
-c
$(EDACPPFLAGS)
-o
$@
../pcbnew/
$*
.cpp
class_module.o
:
../pcbnew/class_module.cpp
$(CXX)
-c
$(EDACPPFLAGS)
-o
$@
../pcbnew/
$*
.cpp
...
...
eeschema/class_drawsheet.cpp
View file @
6d856f60
...
...
@@ -316,7 +316,7 @@ void DrawSheetStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
Text
=
wxT
(
"Sheet: "
)
+
m_SheetName
;
DrawGraphicText
(
panel
,
DC
,
wxPoint
(
pos
.
x
,
pos
.
y
-
8
),
txtcolor
,
wxPoint
(
pos
.
x
,
pos
.
y
-
8
),
(
EDA_Colors
)
txtcolor
,
Text
,
TEXT_ORIENT_HORIZ
,
wxSize
(
m_SheetNameSize
,
m_SheetNameSize
),
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_BOTTOM
,
LineWidth
);
...
...
@@ -328,7 +328,7 @@ void DrawSheetStruct::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
Text
=
wxT
(
"File: "
)
+
m_FileName
;
DrawGraphicText
(
panel
,
DC
,
wxPoint
(
pos
.
x
,
pos
.
y
+
m_Size
.
y
+
4
),
txtcolor
,
(
EDA_Colors
)
txtcolor
,
Text
,
TEXT_ORIENT_HORIZ
,
wxSize
(
m_FileNameSize
,
m_FileNameSize
),
GR_TEXT_HJUSTIFY_LEFT
,
GR_TEXT_VJUSTIFY_TOP
,
LineWidth
);
...
...
eeschema/class_hierarchical_PIN_sheet.cpp
View file @
6d856f60
...
...
@@ -72,14 +72,15 @@ void Hierarchical_PIN_Sheet_Struct::Draw( WinEDA_DrawPanel* panel, wxDC* DC, con
/********************************************************************************************/
/* Routine de dessin des Labels type hierarchie */
{
int
side
,
txtcolor
;
int
side
;
EDA_Colors
txtcolor
;
int
posx
,
tposx
,
posy
,
size2
;
wxSize
size
;
int
NbSegm
,
coord
[
20
];
int
LineWidth
=
g_DrawMinimunLineWidth
;
if
(
Color
>=
0
)
txtcolor
=
Color
;
txtcolor
=
(
EDA_Colors
)
Color
;
else
txtcolor
=
ReturnLayerColor
(
m_Layer
);
GRSetDrawMode
(
DC
,
DrawMode
);
...
...
eeschema/class_pin.cpp
View file @
6d856f60
...
...
@@ -244,7 +244,7 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
wxString
PinText
;
int
PinTextBarPos
[
256
];
int
PinTextBarCount
;
int
NameColor
,
NumColor
;
EDA_Colors
NameColor
,
NumColor
;
int
PinTxtLen
;
wxSize
PinNameSize
(
m_PinNameSize
,
m_PinNameSize
);
...
...
@@ -257,8 +257,8 @@ void LibDrawPin::DrawPinTexts( WinEDA_DrawPanel* panel,
/* Get the num and name colors */
if
(
(
Color
<
0
)
&&
(
m_Selected
&
IS_SELECTED
)
)
Color
=
g_ItemSelectetColor
;
NameColor
=
Color
==
-
1
?
ReturnLayerColor
(
LAYER_PINNAM
)
:
Color
;
NumColor
=
Color
==
-
1
?
ReturnLayerColor
(
LAYER_PINNUM
)
:
Color
;
NameColor
=
(
EDA_Colors
)
(
Color
==
-
1
?
ReturnLayerColor
(
LAYER_PINNAM
)
:
Color
)
;
NumColor
=
(
EDA_Colors
)
(
Color
==
-
1
?
ReturnLayerColor
(
LAYER_PINNUM
)
:
Color
)
;
/* Create the pin num string */
ReturnPinStringNum
(
StringPinNum
);
...
...
@@ -563,7 +563,7 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
wxString
PinText
;
int
PinTextBarPos
[
256
];
int
PinTextBarCount
;
int
NameColor
,
NumColor
;
EDA_Colors
NameColor
,
NumColor
;
int
PinTxtLen
=
0
;
wxSize
PinNameSize
=
wxSize
(
m_PinNameSize
,
m_PinNameSize
);
wxSize
PinNumSize
=
wxSize
(
m_PinNumSize
,
m_PinNumSize
);
...
...
@@ -571,8 +571,8 @@ void LibDrawPin::PlotPinTexts( wxPoint& pin_pos,
&&
g_PlotPSColorOpt
;
/* Get the num and name colors */
NameColor
=
plot_color
?
ReturnLayerColor
(
LAYER_PINNAM
)
:
-
1
;
NumColor
=
plot_color
?
ReturnLayerColor
(
LAYER_PINNUM
)
:
-
1
;
NameColor
=
(
EDA_Colors
)
(
plot_color
?
ReturnLayerColor
(
LAYER_PINNAM
)
:
-
1
)
;
NumColor
=
(
EDA_Colors
)
(
plot_color
?
ReturnLayerColor
(
LAYER_PINNUM
)
:
-
1
)
;
/* Create the pin num string */
ReturnPinStringNum
(
StringPinNum
);
...
...
eeschema/class_text-label.cpp
View file @
6d856f60
...
...
@@ -123,11 +123,11 @@ void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offset,
/* Texts type Comment (text on layer "NOTE") have 4 directions, and the Text origin is the first letter
*/
{
int
color
;
EDA_Colors
color
;
int
width
=
MAX
(
m_Width
,
g_DrawMinimunLineWidth
);
if
(
Color
>=
0
)
color
=
Color
;
color
=
(
EDA_Colors
)
Color
;
else
color
=
ReturnLayerColor
(
m_Layer
);
GRSetDrawMode
(
DC
,
DrawMode
);
...
...
@@ -331,13 +331,14 @@ void SCH_HIERLABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& offs
*/
{
int
Poly
[
40
];
int
ii
,
color
;
int
ii
;
EDA_Colors
color
;
wxPoint
AnchorPos
=
m_Pos
+
offset
;;
int
width
=
MAX
(
m_Width
,
g_DrawMinimunLineWidth
);
if
(
Color
>=
0
)
color
=
Color
;
color
=
(
EDA_Colors
)
Color
;
else
color
=
ReturnLayerColor
(
m_Layer
);
...
...
@@ -464,13 +465,15 @@ void SCH_GLOBALLABEL::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& dr
*/
{
int
Poly
[
20
];
int
offset
,
color
,
HalfSize
;
int
offset
;
EDA_Colors
color
;
int
HalfSize
;
wxPoint
AnchorPos
=
m_Pos
+
draw_offset
;;
int
width
=
MAX
(
m_Width
,
g_DrawMinimunLineWidth
);
if
(
Color
>=
0
)
color
=
Color
;
color
=
(
EDA_Colors
)
Color
;
else
color
=
ReturnLayerColor
(
m_Layer
);
...
...
eeschema/classes_body_items.cpp
View file @
6d856f60
...
...
@@ -161,7 +161,7 @@ void LibDrawText::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOff
* transformation matrix causes xy axes to be flipped. */
int
t1
=
(
aTransformMatrix
[
0
][
0
]
!=
0
)
^
(
m_Horiz
!=
0
);
DrawGraphicText
(
aPanel
,
aDC
,
pos1
,
color
,
m_Text
,
DrawGraphicText
(
aPanel
,
aDC
,
pos1
,
(
EDA_Colors
)
color
,
m_Text
,
t1
?
TEXT_ORIENT_HORIZ
:
TEXT_ORIENT_VERT
,
m_Size
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_CENTER
,
linewidth
);
...
...
@@ -337,7 +337,7 @@ void LibDrawField::Draw( WinEDA_DrawPanel* aPanel, wxDC* aDC, const wxPoint& aOf
wxString
*
text
=
aData
?
(
wxString
*
)
aData
:
&
m_Text
;
GRSetDrawMode
(
aDC
,
aDrawMode
);
DrawGraphicText
(
aPanel
,
aDC
,
text_pos
,
color
,
text
->
GetData
(),
(
EDA_Colors
)
color
,
text
->
GetData
(),
m_Orient
?
TEXT_ORIENT_VERT
:
TEXT_ORIENT_HORIZ
,
m_Size
,
m_HJustify
,
m_VJustify
,
linewidth
);
...
...
eeschema/eelayer.cpp
View file @
6d856f60
...
...
@@ -418,12 +418,12 @@ void SeedLayers()
}
/*******************************/
int
ReturnLayerColor
(
int
Layer
)
/*******************************/
/*******************************
********
/
EDA_Colors
ReturnLayerColor
(
int
Layer
)
/*******************************
*********
/
{
if
(
g_LayerDescr
.
Flags
==
0
)
return
g_LayerDescr
.
LayerColor
[
Layer
];
return
(
EDA_Colors
)
g_LayerDescr
.
LayerColor
[
Layer
];
else
return
g_LayerDescr
.
CommonColor
;
return
(
EDA_Colors
)
g_LayerDescr
.
CommonColor
;
}
eeschema/eelibs_draw_components.cpp
View file @
6d856f60
...
...
@@ -249,8 +249,8 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel,
* DrawMode: mode de trace
*/
{
int
orient
,
color
;
int
orient
;
EDA_Colors
color
;
wxPoint
pos
;
/* Position des textes */
SCH_COMPONENT
*
DrawLibItem
=
(
SCH_COMPONENT
*
)
m_Parent
;
int
hjustify
,
vjustify
;
...
...
@@ -304,7 +304,7 @@ void SCH_CMP_FIELD::Draw( WinEDA_DrawPanel* panel,
if
(
!
m_AddExtraText
||
(
m_FieldId
!=
REFERENCE
)
)
{
DrawGraphicText
(
panel
,
DC
,
pos
,
color
,
m_Text
.
GetData
()
,
DrawGraphicText
(
panel
,
DC
,
pos
,
color
,
m_Text
,
orient
?
TEXT_ORIENT_VERT
:
TEXT_ORIENT_HORIZ
,
m_Size
,
hjustify
,
vjustify
,
LineWidth
);
...
...
eeschema/libfield.cpp
View file @
6d856f60
...
...
@@ -131,7 +131,7 @@ static void ShowMoveField( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
void
WinEDA_LibeditFrame
::
PlaceField
(
wxDC
*
DC
,
LibDrawField
*
Field
)
/*******************************************************************/
{
int
color
;
EDA_Colors
color
;
if
(
Field
==
NULL
)
return
;
...
...
@@ -183,7 +183,7 @@ void WinEDA_LibeditFrame::EditField( wxDC* DC, LibDrawField* Field )
{
wxString
Text
;
wxString
title
;
int
color
;
EDA_Colors
color
;
int
LineWidth
=
MAX
(
Field
->
m_Width
,
g_DrawMinimunLineWidth
);
if
(
Field
==
NULL
)
...
...
@@ -253,7 +253,7 @@ void WinEDA_LibeditFrame::RotateField( wxDC* DC, LibDrawField* Field )
* sinon Modif du champ pointe par la souris
*/
{
int
color
;
EDA_Colors
color
;
if
(
Field
==
NULL
)
return
;
...
...
eeschema/plot.cpp
View file @
6d856f60
...
...
@@ -183,7 +183,7 @@ void PlotLibPart( SCH_COMPONENT* DrawLibItem )
LibEDA_BaseStruct
*
DEntry
;
EDA_LibComponentStruct
*
Entry
;
int
TransMat
[
2
][
2
],
Multi
,
convert
;
int
CharColor
=
-
1
;
EDA_Colors
CharColor
=
UNSPECIFIED_COLOR
;
wxPoint
pos
;
bool
draw_bgfill
=
false
;
...
...
@@ -377,7 +377,8 @@ static void PlotTextField( SCH_COMPONENT* DrawLibItem,
wxPoint
textpos
;
/* Position des textes */
SCH_CMP_FIELD
*
field
=
DrawLibItem
->
GetField
(
FieldNumber
);
int
hjustify
,
vjustify
;
int
orient
,
color
=
-
1
;
int
orient
;
EDA_Colors
color
=
UNSPECIFIED_COLOR
;
if
(
(
g_PlotFormat
==
PLOT_FORMAT_POST
)
&&
g_PlotPSColorOpt
)
color
=
ReturnLayerColor
(
field
->
GetLayer
()
);
...
...
@@ -454,7 +455,7 @@ static void PlotPinSymbol( const wxPoint & pos, int len, int orient, int Shape )
*/
{
int
MapX1
,
MapY1
,
x1
,
y1
;
int
color
;
EDA_Colors
color
=
UNSPECIFIED_COLOR
;
color
=
ReturnLayerColor
(
LAYER_PIN
);
...
...
@@ -567,7 +568,7 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
int
pX
,
pY
,
Shape
=
0
,
Orient
=
0
,
offset
;
wxSize
Size
;
wxString
Text
;
int
color
=
-
1
;
EDA_Colors
color
=
UNSPECIFIED_COLOR
;
switch
(
Struct
->
Type
()
)
{
...
...
@@ -680,12 +681,13 @@ void PlotTextStruct( EDA_BaseStruct* Struct )
}
/***********************************************************/
/***********************************************************
************
/
static
void
PlotSheetLabelStruct
(
Hierarchical_PIN_Sheet_Struct
*
Struct
)
/***********************************************************/
/***********************************************************
************
/
/* Routine de dessin des Sheet Labels type hierarchie */
{
int
side
,
txtcolor
=
-
1
;
int
side
;
EDA_Colors
txtcolor
=
UNSPECIFIED_COLOR
;
int
posx
,
tposx
,
posy
,
size
,
size2
;
int
coord
[
16
];
...
...
@@ -760,7 +762,7 @@ void PlotSheetStruct( DrawSheetStruct* Struct )
/* Routine de dessin du bloc type hierarchie */
{
Hierarchical_PIN_Sheet_Struct
*
SheetLabelStruct
;
int
txtcolor
=
-
1
;
EDA_Colors
txtcolor
=
UNSPECIFIED_COLOR
;
wxSize
size
;
wxString
Text
;
wxPoint
pos
;
...
...
eeschema/protos.h
View file @
6d856f60
...
...
@@ -197,7 +197,7 @@ void RedrawOneStruct(WinEDA_DrawPanel * panel, wxDC * DC, SCH_ITEM *Struct, int
/* EELAYER.CPP */
/**************/
void
SeedLayers
();
int
ReturnLayerColor
(
int
Layer
);
EDA_Colors
ReturnLayerColor
(
int
Layer
);
void
DisplayColorSetupFrame
(
WinEDA_DrawFrame
*
parent
,
const
wxPoint
&
pos
);
/*************/
...
...
gerbview/trpiste.cpp
View file @
6d856f60
...
...
@@ -21,7 +21,7 @@ void Draw_Track_Buffer( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int draw_
int
printmasklayer
)
/***************************************************************************************************/
/* Function to draw the tracks (i.e Spo
r
ts or lines) in gerbview
/* Function to draw the tracks (i.e Spots or lines) in gerbview
* Polygons are not handled here (there are in Pcb->m_Zone)
* @param DC = device context to draw
* @param Pcb = Board to draw (only Pcb->m_Track is used)
...
...
@@ -266,7 +266,7 @@ void Affiche_DCodes_Pistes( WinEDA_DrawPanel* panel, wxDC* DC, BOARD* Pcb, int d
}
DrawGraphicText
(
panel
,
DC
,
pos
,
g_DCodesColor
,
Line
,
pos
,
(
EDA_Colors
)
g_DCodesColor
,
Line
,
orient
,
wxSize
(
width
,
width
),
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_CENTER
);
}
...
...
include/build_version.h
View file @
6d856f60
...
...
@@ -9,7 +9,7 @@ COMMON_GLOBL wxString g_BuildVersion
# include "config.h"
(
wxT
(
KICAD_SVN_VERSION
))
# else
(
wxT
(
"(20081
12
4-unstable)"
))
/* main program version */
(
wxT
(
"(20081
21
4-unstable)"
))
/* main program version */
# endif
#endif
;
...
...
@@ -20,7 +20,7 @@ COMMON_GLOBL wxString g_BuildAboutVersion
# include "config.h"
(
wxT
(
KICAD_ABOUT_VERSION
))
# else
(
wxT
(
"(20081
12
4-unstable)"
))
/* svn date & rev (normally overridden) */
(
wxT
(
"(20081
21
4-unstable)"
))
/* svn date & rev (normally overridden) */
# endif
#endif
;
...
...
include/colors.h
View file @
6d856f60
...
...
@@ -46,6 +46,7 @@ static inline int GetAlpha( int aColor )
enum
EDA_Colors
{
UNSPECIFIED_COLOR
=
-
1
,
BLACK
=
0
,
BLUE
,
GREEN
,
...
...
include/common.h
View file @
6d856f60
...
...
@@ -427,14 +427,37 @@ double round( double aNumber );
/**************/
/* DRAWTXT.CPP */
/**************/
void
DrawGraphicText
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
const
wxPoint
&
pos
,
int
mode_color
,
const
wxString
&
Text
,
int
orient
,
const
wxSize
&
char_size
,
int
h_justify
,
int
v_justify
,
int
width
=
0
);
void
PlotGraphicText
(
int
format_plot
,
const
wxPoint
&
Pos
,
int
gcolor
,
const
wxString
&
Text
,
int
orient
,
const
wxSize
&
Size
,
int
h_justify
,
int
v_justify
);
/** Function DrawGraphicText
* Draw a graphic text (like module texts)
* @param aPanel = the current DrawPanel
* @param aPos = text position (according to h_justify, v_justify)
* @param aColor (enum EDA_Colors) = text color
* @param aText = text to draw
* @param aOrient = angle in 0.1 degree
* @param aSize = text size (size.x or size.y can be < 0 for mirrored texts)
* @param aH_justify = horizontal justification (Left, center, right)
* @param aV_justify = vertical justification (bottom, center, top)
* @param aWidth = line width (pen width) (default = 0)
* if width < 0 : draw segments in sketch mode, width = abs(width)
*/
void
DrawGraphicText
(
WinEDA_DrawPanel
*
aPanel
,
wxDC
*
aDC
,
const
wxPoint
&
aPos
,
enum
EDA_Colors
aColor
,
const
wxString
&
aText
,
int
aOrient
,
const
wxSize
&
aSize
,
int
aH_justify
,
int
aV_justify
,
int
aWidth
=
0
);
/** Function PlotGraphicText
* same as DrawGraphicText, but plot graphic text insteed of draw it
* @param aFormat_plot = plot format (PLOT_FORMAT_POST, PLOT_FORMAT_HPGL, PLOT_FORMAT_GERBER)
* @param aPos = text position (according to aH_justify, aV_justify)
* @param aColor (enum EDA_Colors) = text color
* @param aText = text to draw
* @param aOrient = angle in 0.1 degree
* @param aSize = text size (size.x or size.y can be < 0 for mirrored texts)
* @param aH_justify = horizontal justification (Left, center, right)
* @param aV_justify = vertical justification (bottom, center, top)
*/
void
PlotGraphicText
(
int
aFormat_plot
,
const
wxPoint
&
aPos
,
enum
EDA_Colors
aColor
,
const
wxString
&
aText
,
int
aOrient
,
const
wxSize
&
aSize
,
int
aH_justify
,
int
aV_justify
);
/***************/
/* CONFIRM.CPP */
...
...
internat/fr/kicad.mo
View file @
6d856f60
No preview for this file type
internat/fr/kicad.po
View file @
6d856f60
...
...
@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: kicad\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-12-1
1 17:20
+0100\n"
"PO-Revision-Date: 2008-12-1
1 18:52
+0100\n"
"POT-Creation-Date: 2008-12-1
2 22:29
+0100\n"
"PO-Revision-Date: 2008-12-1
2 22:31
+0100\n"
"Last-Translator: \n"
"Language-Team: kicad team <jean-pierre.charras@ujf-grenoble.fr>\n"
"MIME-Version: 1.0\n"
...
...
@@ -24,7 +24,7 @@ msgstr ""
#: pcbnew/clean.cpp:180
msgid "Delete unconnected tracks:"
msgstr "Suppression Pistes non connectées"
msgstr "Suppression Pistes non connectées
:
"
#: pcbnew/clean.cpp:197
msgid "ViaDef"
...
...
@@ -1618,34 +1618,26 @@ msgid "Enable Auto Delete old Track"
msgstr "Autoriser l'effacement automatique des pistes"
#: pcbnew/pcbframe.cpp:457
msgid "Do not Show Zones"
msgstr "Ne pas montrer Zones"
#: pcbnew/pcbframe.cpp:457
msgid "Show Zones"
msgstr "Montrer Zones"
#: pcbnew/pcbframe.cpp:463
msgid "Show Pads Sketch mode"
msgstr "Afficher pastilles en contour"
#: pcbnew/pcbframe.cpp:4
64
#: pcbnew/pcbframe.cpp:4
58
msgid "Show pads filled mode"
msgstr "Afficher pastilles en mode plein"
#: pcbnew/pcbframe.cpp:4
70
#: pcbnew/pcbframe.cpp:4
64
msgid "Show Tracks Sketch mode"
msgstr "Afficher pistes en contour"
#: pcbnew/pcbframe.cpp:4
71
#: pcbnew/pcbframe.cpp:4
65
msgid "Show Tracks filled mode"
msgstr "Afficher pistes en mode plein"
#: pcbnew/pcbframe.cpp:47
7
#: pcbnew/pcbframe.cpp:47
1
msgid "Normal Contrast Mode Display"
msgstr "Mode d'affichage Contraste normal"
#: pcbnew/pcbframe.cpp:47
8
#: pcbnew/pcbframe.cpp:47
2
msgid "Hight Contrast Mode Display"
msgstr "Mode d'affichage Haut Contraste"
...
...
@@ -2457,15 +2449,27 @@ msgstr "Montrer le chevelu du module pendant déplacement"
msgid "Enable Auto Del Track"
msgstr "Autoriser l'effacement automatique des pistes"
#: pcbnew/tool_pcb.cpp:379
#: pcbnew/tool_pcb.cpp:374
msgid "Show filled areas in zones"
msgstr "Afficher les surfaces remplies dans les zones"
#: pcbnew/tool_pcb.cpp:377
msgid "Do not show filled areas in zones"
msgstr "Ne pas fficher les surfaces remplies dans les zones"
#: pcbnew/tool_pcb.cpp:380
msgid "Show outlines of filled areas only in zones"
msgstr "Afficher uniquement les contours des surfaces remplies dans les zones"
#: pcbnew/tool_pcb.cpp:385
msgid "Show Pads Sketch"
msgstr "Afficher pastilles en contour"
#: pcbnew/tool_pcb.cpp:38
3
#: pcbnew/tool_pcb.cpp:38
9
msgid "Show Tracks Sketch"
msgstr "Afficher Pistes en Contour"
#: pcbnew/tool_pcb.cpp:
398
#: pcbnew/tool_pcb.cpp:
404
msgid ""
"Display/remove auxiliary vertical toolbar (tools for micro wave applications)\n"
" This is a experimental feature (under development)"
...
...
@@ -2473,79 +2477,79 @@ msgstr ""
"Affiche/supprime le toolbar vertical auxiliaire (outils pour applications micro-ondes)\n"
"C'est un outil expérimental (en cours de développement)"
#: pcbnew/tool_pcb.cpp:4
28
#: pcbnew/tool_pcb.cpp:4
34
msgid "Net highlight"
msgstr "Surbrillance des équipotentielles"
#: pcbnew/tool_pcb.cpp:43
3
#: pcbnew/tool_pcb.cpp:43
9
msgid "Display local ratsnest (pad or module)"
msgstr "Afficher le chevelu local (pastilles ou modules)"
#: pcbnew/tool_pcb.cpp:4
39
#: pcbnew/tool_pcb.cpp:4
45
msgid "Add modules"
msgstr "Addition de Modules"
#: pcbnew/tool_pcb.cpp:44
3
#: pcbnew/tool_pcb.cpp:44
9
msgid "Add tracks and vias"
msgstr "Ajouter pistes et vias"
#: pcbnew/tool_pcb.cpp:4
47
#: pcbnew/tool_pcb.cpp:4
53
msgid "Add zones"
msgstr "Addition de Zones"
#: pcbnew/tool_pcb.cpp:45
2
#: pcbnew/tool_pcb.cpp:45
8
msgid "Add graphic line or polygon"
msgstr "Addition de lignes ou polygones graphiques"
#: pcbnew/tool_pcb.cpp:4
56
#: pcbnew/tool_pcb.cpp:4
62
msgid "Add graphic circle"
msgstr "Addition de graphiques (Cercle)"
#: pcbnew/tool_pcb.cpp:46
0
#: pcbnew/tool_pcb.cpp:46
6
msgid "Add graphic arc"
msgstr "Addition de graphiques (Arc de Cercle)"
#: pcbnew/tool_pcb.cpp:4
64
#: pcbnew/tool_pcb.cpp:4
70
msgid "Add text"
msgstr "Ajout de Texte"
#: pcbnew/tool_pcb.cpp:4
69
#: pcbnew/tool_pcb.cpp:4
75
msgid "Add dimension"
msgstr "Ajout des cotes"
#: pcbnew/tool_pcb.cpp:47
3
#: pcbnew/tool_pcb.cpp:47
9
msgid "Add layer alignment target"
msgstr "Ajouter Mire de superposition"
#: pcbnew/tool_pcb.cpp:4
78
#: pcbnew/tool_pcb.cpp:4
84
msgid "Delete items"
msgstr "Suppression d'éléments"
#: pcbnew/tool_pcb.cpp:48
3
#: pcbnew/tool_pcb.cpp:48
9
msgid "Offset adjust for drill and place files"
msgstr "Ajuste offset pour fichier de perçage et placement"
#: pcbnew/tool_pcb.cpp:51
1
#: pcbnew/tool_pcb.cpp:51
7
msgid "Create line of specified length for microwave applications"
msgstr "Creation de lignes de longueur spécifiée (pour applications micro-ondes)"
#: pcbnew/tool_pcb.cpp:5
17
#: pcbnew/tool_pcb.cpp:5
23
msgid "Create gap of specified length for microwave applications"
msgstr "Creation de gaps de longueur spécifiée (pour applications micro-ondes)"
#: pcbnew/tool_pcb.cpp:5
25
#: pcbnew/tool_pcb.cpp:5
31
msgid "Create stub of specified length for microwave applications"
msgstr "Creation de stub de longueur spécifiée (pour applications micro-ondes)"
#: pcbnew/tool_pcb.cpp:53
1
#: pcbnew/tool_pcb.cpp:53
7
msgid "Create stub (arc) of specified length for microwave applications"
msgstr "Creation de stub (arc) de longueur spécifiée (pour applications micro-ondes)"
#: pcbnew/tool_pcb.cpp:5
38
#: pcbnew/tool_pcb.cpp:5
44
msgid "Create a polynomial shape for microwave applications"
msgstr "Creation de formes polynomiales (pour applications micro-ondes)"
#: pcbnew/tool_pcb.cpp:5
79
#: pcbnew/tool_pcb.cpp:5
85
msgid ""
"Auto track width: when starting on an existing track use its width\n"
"otherwise, use current width setting"
...
...
@@ -2553,19 +2557,19 @@ msgstr ""
"Largeur de piste automatique: si on démarre sur une piste existante, utiliser sa largeur\n"
" sinon utiliser la largeur courante"
#: pcbnew/tool_pcb.cpp:6
04
#: pcbnew/tool_pcb.cpp:6
10
msgid "Auto"
msgstr "Auto"
#: pcbnew/tool_pcb.cpp:6
08
#: pcbnew/tool_pcb.cpp:6
14
msgid "Zoom "
msgstr "Zoom "
#: pcbnew/tool_pcb.cpp:64
3
#: pcbnew/tool_pcb.cpp:64
9
msgid "User Grid"
msgstr "Grille perso"
#: pcbnew/tool_pcb.cpp:7
59
#: pcbnew/tool_pcb.cpp:7
65
msgid "+/- to switch"
msgstr "+/- pour commuter"
...
...
@@ -3392,7 +3396,7 @@ msgstr "Grille %.1f"
msgid "Grid %.3f"
msgstr "Grille %.3f"
#: pcbnew/dialog_copper_zones.cpp:28
8
#: pcbnew/dialog_copper_zones.cpp:28
5
msgid ""
"Error :\n"
"you must choose a copper min thickness value bigger than 0.001 inch or 0.00254 mm)"
...
...
@@ -3400,7 +3404,7 @@ msgstr ""
"Erreur :\n"
"vous devez choisir une valeur pour l'épaisseur de cuivre dans les freins thermiques plus grande que 0,001 pouce (ou 0,00254 mm)"
#: pcbnew/dialog_copper_zones.cpp:3
13
#: pcbnew/dialog_copper_zones.cpp:3
08
msgid ""
"Error :\n"
"you must choose a copper bridge value for thermal reliefs bigger than the min zone thickness"
...
...
@@ -3408,11 +3412,11 @@ msgstr ""
"Erreur :\n"
"vous devez choisir une valeur pour l'épaisseur de cuivre dans les freins thermiques plus grande que l'épaisseur de cuivre minimum des zones"
#: pcbnew/dialog_copper_zones.cpp:32
5
#: pcbnew/dialog_copper_zones.cpp:32
0
msgid "Error : you must choose a layer"
msgstr "Erreur. Vous devez choisir une couche"
#: pcbnew/dialog_copper_zones.cpp:33
7
#: pcbnew/dialog_copper_zones.cpp:33
2
msgid "Error : you must choose a net name"
msgstr "Erreur. Vous devez choisir une équipotentielle"
...
...
@@ -4072,7 +4076,7 @@ msgid "Pen Number"
msgstr "Numéro de plume"
#: pcbnew/dialog_gendrill.cpp:239
#: pcbnew/dialog_general_options.cpp:3
76
#: pcbnew/dialog_general_options.cpp:3
85
msgid "Options:"
msgstr "Options :"
...
...
@@ -4282,96 +4286,96 @@ msgstr "Larg. piste: %s Diam Vias : %s"
msgid "Drc error, cancelled"
msgstr "Erreur DRC, annulation"
#: pcbnew/dialog_general_options.cpp:2
88
#: pcbnew/dialog_general_options.cpp:2
97
msgid "No Display"
msgstr "Pas d'affichage"
#: pcbnew/dialog_general_options.cpp:
291
#: pcbnew/dialog_general_options.cpp:
300
msgid "Display Polar Coord"
msgstr "Affichage coord Polaires"
#: pcbnew/dialog_general_options.cpp:30
0
#: pcbnew/dialog_general_options.cpp:30
9
msgid "millimeters"
msgstr "millimètres"
#: pcbnew/dialog_general_options.cpp:3
02
#: pcbnew/dialog_general_options.cpp:3
11
msgid "Units"
msgstr "Unités"
#: pcbnew/dialog_general_options.cpp:3
09
#: pcbnew/dialog_general_options.cpp:3
18
msgid "Small"
msgstr "Petit"
#: pcbnew/dialog_general_options.cpp:31
0
#: pcbnew/dialog_general_options.cpp:31
9
msgid "Big"
msgstr "Grand"
#: pcbnew/dialog_general_options.cpp:3
12
#: pcbnew/dialog_general_options.cpp:3
21
msgid "Cursor"
msgstr "Curseur"
#: pcbnew/dialog_general_options.cpp:3
24
#: pcbnew/dialog_general_options.cpp:3
33
msgid "Number of Layers:"
msgstr "Nombre de Couches:"
#: pcbnew/dialog_general_options.cpp:34
0
#: pcbnew/dialog_general_options.cpp:34
9
msgid "Max Links:"
msgstr "Liens max:"
#: pcbnew/dialog_general_options.cpp:3
56
#: pcbnew/dialog_general_options.cpp:3
65
msgid "Auto Save (minuts):"
msgstr "Sauveg. Auto (min)"
#: pcbnew/dialog_general_options.cpp:3
85
#: pcbnew/dialog_general_options.cpp:3
94
msgid "Drc ON"
msgstr "Drc ACTIVE"
#: pcbnew/dialog_general_options.cpp:
394
#: pcbnew/dialog_general_options.cpp:
403
msgid "Show Ratsnest"
msgstr "Montrer le chevelu général"
#: pcbnew/dialog_general_options.cpp:4
01
#: pcbnew/dialog_general_options.cpp:4
10
msgid "Show Mod Ratsnest"
msgstr "Montrer le chevelu du module"
#: pcbnew/dialog_general_options.cpp:4
08
#: pcbnew/dialog_general_options.cpp:4
17
msgid "Tracks Auto Del"
msgstr "Auto Supp. Pistes"
#: pcbnew/dialog_general_options.cpp:4
15
#: pcbnew/dialog_general_options.cpp:4
24
msgid "Track only 45 degrees"
msgstr "Piste à 45° seulement"
#: pcbnew/dialog_general_options.cpp:4
22
#: pcbnew/dialog_general_options.cpp:4
31
msgid "Segments 45 Only"
msgstr "Segments 45 seulement"
#: pcbnew/dialog_general_options.cpp:4
29
#: pcbnew/dialog_general_options.cpp:4
38
msgid "Auto PAN"
msgstr "Auto PAN"
#: pcbnew/dialog_general_options.cpp:4
37
#: pcbnew/dialog_general_options.cpp:4
46
msgid "Double Segm Track"
msgstr "2 segments pour piste"
#: pcbnew/dialog_general_options.cpp:45
0
#: pcbnew/dialog_general_options.cpp:4
65
#: pcbnew/dialog_general_options.cpp:45
9
#: pcbnew/dialog_general_options.cpp:4
74
msgid "When creating tracks"
msgstr "En creation de pistes"
#: pcbnew/dialog_general_options.cpp:4
53
#: pcbnew/dialog_general_options.cpp:4
62
msgid "Magnetic Pads"
msgstr " Pads magnétiques"
#: pcbnew/dialog_general_options.cpp:46
0
#: pcbnew/dialog_general_options.cpp:46
9
msgid "control the capture of the pcb cursor when the mouse cursor enters a pad area"
msgstr "Contrôle la capture du curseur pcb quand le curseuir souris est sur un pad"
#: pcbnew/dialog_general_options.cpp:4
68
#: pcbnew/dialog_general_options.cpp:4
77
msgid "Magnetic Tracks"
msgstr "Pistes Magnétiques"
#: pcbnew/dialog_general_options.cpp:4
75
#: pcbnew/dialog_general_options.cpp:4
84
msgid "control the capture of the pcb cursor when the mouse cursor enters a track"
msgstr "Contrôle la capture du curseur pcb quand le curseuir souris est sur une piste"
...
...
@@ -4533,60 +4537,48 @@ msgid "Others Options:"
msgstr "Autres Options:"
#: pcbnew/dialog_copper_zones_base.cpp:118
msgid "Show filled areas in sketch mode"
msgstr "Afficher les surfaces remplies en mode contour"
#: pcbnew/dialog_copper_zones_base.cpp:120
msgid ""
"If enabled, filled areas in is this zone will be displayed as non filled polygons.\n"
"If disabled, filled areas in is this zone will be displayed as \"solid\" areas (normal mode)."
msgstr ""
"Si activé, les surfaces remplies dans cette zone seront affichées comme des polygones non remplis.\n"
"Si désactivé, les surfaces remplies dans cette zone seront affichées comme des surfaces \"solides\"."
#: pcbnew/dialog_copper_zones_base.cpp:124
msgid "Zone clearance value"
msgstr "Valeur isolation zone"
#: pcbnew/dialog_copper_zones_base.cpp:1
31
#: pcbnew/dialog_copper_zones_base.cpp:1
25
msgid "Zone min thickness value"
msgstr "Valeur épaisseur min pour zone"
#: pcbnew/dialog_copper_zones_base.cpp:13
6
#: pcbnew/dialog_copper_zones_base.cpp:13
0
msgid "Value of minimun thickness of filled areas"
msgstr "Valeur de l'épaisseur minimum des zones remplies"
#: pcbnew/dialog_copper_zones_base.cpp:15
6
#: pcbnew/dialog_copper_zones_base.cpp:15
0
msgid "Export Setup to others zones"
msgstr "Exporter options vers autres zones"
#: pcbnew/dialog_copper_zones_base.cpp:15
7
#: pcbnew/dialog_copper_zones_base.cpp:15
2
msgid "Export this zone setup to all others copper zones"
msgstr "Exporter ces options vers les autres zones de cuivre"
#: pcbnew/dialog_copper_zones_base.cpp:1
61
#: pcbnew/dialog_copper_zones_base.cpp:1
56
#: pcbnew/dialog_pad_properties_base.cpp:91
#: pcbnew/zone_filling_deprecated_algorithm.cpp:310
msgid "Ok"
msgstr "Ok"
#: pcbnew/dialog_copper_zones_base.cpp:17
2
#: pcbnew/dialog_copper_zones_base.cpp:17
1
msgid "Nets Display Options:"
msgstr "Options d'Affichage des Nets"
#: pcbnew/dialog_copper_zones_base.cpp:17
4
#: pcbnew/dialog_copper_zones_base.cpp:17
3
msgid "Alphabetic"
msgstr "Alphabetique"
#: pcbnew/dialog_copper_zones_base.cpp:17
4
#: pcbnew/dialog_copper_zones_base.cpp:17
3
msgid "Advanced"
msgstr "Avancé"
#: pcbnew/dialog_copper_zones_base.cpp:17
6
#: pcbnew/dialog_copper_zones_base.cpp:17
5
msgid "Net sorting:"
msgstr "Tri des Equipotentielles:"
#: pcbnew/dialog_copper_zones_base.cpp:17
8
#: pcbnew/dialog_copper_zones_base.cpp:17
7
msgid ""
"Nets can be sorted:\n"
"By alphabetic order\n"
...
...
@@ -4596,11 +4588,11 @@ msgstr ""
"Paur ordre alphabétique\n"
"Par nombre de pads dans les équipotentielles (avancé)"
#: pcbnew/dialog_copper_zones_base.cpp:18
2
#: pcbnew/dialog_copper_zones_base.cpp:18
1
msgid "Filter"
msgstr "Filtre"
#: pcbnew/dialog_copper_zones_base.cpp:18
7
#: pcbnew/dialog_copper_zones_base.cpp:18
6
msgid ""
"Pattern in advanced mode, to filter net names in list\n"
"Net names matching this pattern are not displayed"
...
...
@@ -6402,11 +6394,11 @@ msgstr "Ajout Composant"
msgid "Add Wire"
msgstr "Ajouter Fils"
#: eeschema/libarch.cpp:6
6
#: eeschema/libarch.cpp:6
8
msgid "Failed to create archive lib file "
msgstr "Impossible de créer le fichier librairie archive "
#: eeschema/libarch.cpp:7
3
#: eeschema/libarch.cpp:7
5
msgid "Failed to create doc lib file "
msgstr "Impossible de créer le fichier lib document"
...
...
@@ -6511,7 +6503,7 @@ msgstr "Oriente Composant"
msgid "Footprint "
msgstr "Empreinte: "
#: eeschema/onrightclick.cpp:32
2
#: eeschema/onrightclick.cpp:32
3
#, c-format
msgid "Unit %d %c"
msgstr "Unité %d %c"
...
...
@@ -10426,15 +10418,15 @@ msgstr "Texte Module invisible"
msgid "Anchors"
msgstr "Ancres"
#: pcbnew/set_color.h:4
32
#: pcbnew/set_color.h:4
23
msgid "Show Noconnect"
msgstr "Montrer Non Conn"
#: pcbnew/set_color.h:4
41
#: pcbnew/set_color.h:4
32
msgid "Show Modules Cmp"
msgstr "Afficher Modules Cmp"
#: pcbnew/set_color.h:4
50
#: pcbnew/set_color.h:4
41
msgid "Show Modules Cu"
msgstr "Afficher Modules Cu"
...
...
@@ -10474,7 +10466,7 @@ msgstr "Type Err(%d): <b>%s</b><ul><li> %s: %s </li><li> %s: %s </li></ul>"
msgid "ErrType(%d): <b>%s</b><ul><li> %s: %s </li></ul>"
msgstr "ErrType(%d): <b>%s</b><ul><li> %s: %s </li></ul>"
#: pcbnew/dialog_copper_zones_base.h:
101
#: pcbnew/dialog_copper_zones_base.h:
99
msgid "Fill Zones Options"
msgstr "Options de Remplissage de Zone"
...
...
@@ -10798,6 +10790,20 @@ msgstr "Imprimer"
msgid "Create SVG file"
msgstr "Créer Fichier SVG"
#~ msgid "Do not Show Zones"
#~ msgstr "Ne pas montrer Zones"
#~ msgid "Show Zones"
#~ msgstr "Montrer Zones"
#~ msgid ""
#~ "If enabled, filled areas in is this zone will be displayed as non filled "
#~ "polygons.\n"
#~ "If disabled, filled areas in is this zone will be displayed as \"solid\" "
#~ "areas (normal mode)."
#~ msgstr ""
#~ "Si activé, les surfaces remplies dans cette zone seront affichées comme "
#~ "des polygones non remplis.\n"
#~ "Si désactivé, les surfaces remplies dans cette zone seront affichées "
#~ "comme des surfaces \"solides\"."
#~ msgid "grid user"
#~ msgstr "grille user"
pcbnew/CMakeLists.txt
View file @
6d856f60
...
...
@@ -28,6 +28,7 @@ set(PCBNEW_SRCS
class_mire.cpp
class_module.cpp
class_pad.cpp
class_pad_draw_functions.cpp
classpcb.cpp
class_pcb_text.cpp
class_text_mod.cpp
...
...
pcbnew/affiche.cpp
View file @
6d856f60
...
...
@@ -32,7 +32,7 @@ void Affiche_Infos_Equipot( int netcode, WinEDA_BasePcbFrame* frame )
equipot
=
frame
->
m_Pcb
->
FindNet
(
netcode
);
if
(
equipot
)
Affiche_1_Parametre
(
frame
,
1
,
_
(
"Net Name"
),
equipot
->
m_Netname
,
RED
);
Affiche_1_Parametre
(
frame
,
1
,
_
(
"Net Name"
),
equipot
->
GetNetname
()
,
RED
);
else
Affiche_1_Parametre
(
frame
,
1
,
_
(
"No Net (not connected)"
),
wxEmptyString
,
RED
);
...
...
pcbnew/class_board.cpp
View file @
6d856f60
...
...
@@ -835,7 +835,7 @@ EQUIPOT* BOARD::FindNet( const wxString & aNetname ) const
{
for
(
EQUIPOT
*
net
=
m_Equipots
;
net
;
net
=
net
->
Next
()
)
{
if
(
net
->
m_Netname
==
aNetname
)
if
(
net
->
GetNetname
()
==
aNetname
)
return
net
;
}
}
...
...
@@ -882,7 +882,7 @@ int s_SortByNames(const void * ptr1, const void * ptr2)
{
EQUIPOT
*
item1
=
*
(
EQUIPOT
**
)
ptr1
;
EQUIPOT
*
item2
=
*
(
EQUIPOT
**
)
ptr2
;
return
item1
->
m_Netname
.
CmpNoCase
(
item2
->
m_Netname
);
return
item1
->
GetNetname
().
CmpNoCase
(
item2
->
GetNetname
()
);
}
// Sort nets by decreasing pad count
...
...
@@ -892,7 +892,7 @@ int s_SortByNodes(const void * ptr1, const void * ptr2)
EQUIPOT
*
item2
=
*
(
EQUIPOT
**
)
ptr2
;
if
(
(
item1
->
m_NbNodes
-
item2
->
m_NbNodes
)
!=
0
)
return
-
(
item1
->
m_NbNodes
-
item2
->
m_NbNodes
);
return
item1
->
m_Netname
.
CmpNoCase
(
item2
->
m_Netname
);
return
item1
->
GetNetname
().
CmpNoCase
(
item2
->
GetNetname
()
);
}
...
...
@@ -912,7 +912,7 @@ int BOARD::ReturnSortedNetnamesList( wxArrayString & aNames, const int aSort_Typ
/* count items to list and sort */
for
(
net
=
m_Equipots
;
net
;
net
=
net
->
Next
()
)
{
if
(
net
->
m_Netname
.
IsEmpty
()
)
continue
;
if
(
net
->
GetNetname
()
.
IsEmpty
()
)
continue
;
NetCount
++
;
}
...
...
@@ -922,7 +922,7 @@ int BOARD::ReturnSortedNetnamesList( wxArrayString & aNames, const int aSort_Typ
EQUIPOT
*
*
net_ptr_list
=
(
EQUIPOT
*
*
)
MyMalloc
(
NetCount
*
sizeof
(
*
net_ptr_list
)
);
for
(
ii
=
0
,
net
=
m_Equipots
;
net
;
net
=
net
->
Next
()
)
{
if
(
net
->
m_Netname
.
IsEmpty
()
)
continue
;
if
(
net
->
GetNetname
()
.
IsEmpty
()
)
continue
;
net_ptr_list
[
ii
]
=
net
;
ii
++
;
}
...
...
@@ -945,7 +945,7 @@ int BOARD::ReturnSortedNetnamesList( wxArrayString & aNames, const int aSort_Typ
for
(
ii
=
0
;
ii
<
NetCount
;
ii
++
)
{
net
=
net_ptr_list
[
ii
];
aNames
.
Add
(
net
->
m_Netname
);
aNames
.
Add
(
net
->
GetNetname
()
);
}
MyFree
(
net_ptr_list
);
...
...
pcbnew/class_board_item.cpp
View file @
6d856f60
...
...
@@ -56,7 +56,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
switch
(
item
->
Type
()
)
{
case
TYPE_EQUIPOT
:
text
<<
_
(
"Net"
)
<<
(
(
EQUIPOT
*
)
item
)
->
m_Netname
<<
wxT
(
" "
)
<<
text
<<
_
(
"Net"
)
<<
(
(
EQUIPOT
*
)
item
)
->
GetNetname
()
<<
wxT
(
" "
)
<<
(
(
EQUIPOT
*
)
item
)
->
GetNet
();
break
;
...
...
@@ -130,7 +130,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
net
=
aPcb
->
FindNet
(
((
TRACK
*
)
item
)
->
GetNet
()
);
if
(
net
)
{
text
<<
wxT
(
" ["
)
<<
net
->
m_Netname
<<
wxT
(
"]"
);
text
<<
wxT
(
" ["
)
<<
net
->
GetNetname
()
<<
wxT
(
"]"
);
}
text
<<
_
(
" on "
)
<<
aPcb
->
GetLayerName
(
item
->
GetLayer
()
).
Trim
()
<<
wxT
(
" "
)
<<
_
(
"Net:"
)
<<
((
TRACK
*
)
item
)
->
GetNet
()
...
...
@@ -160,7 +160,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
net
=
aPcb
->
FindNet
(
(
(
ZONE_CONTAINER
*
)
item
)
->
GetNet
()
);
if
(
net
)
{
text
<<
wxT
(
" ["
)
<<
net
->
m_Netname
<<
wxT
(
"]"
);
text
<<
wxT
(
" ["
)
<<
net
->
GetNetname
()
<<
wxT
(
"]"
);
}
}
else
// A netcode < 0 is an error flag (Netname not found or area not initialised)
...
...
@@ -182,7 +182,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
net
=
aPcb
->
FindNet
(
(
(
SEGZONE
*
)
item
)
->
GetNet
()
);
if
(
net
)
{
text
<<
wxT
(
" ["
)
<<
net
->
m_Netname
<<
wxT
(
"]"
);
text
<<
wxT
(
" ["
)
<<
net
->
GetNetname
()
<<
wxT
(
"]"
);
}
text
<<
_
(
" on "
)
<<
aPcb
->
GetLayerName
(
item
->
GetLayer
()
).
Trim
();
break
;
...
...
@@ -202,7 +202,7 @@ wxString BOARD_ITEM::MenuText( const BOARD* aPcb ) const
net
=
aPcb
->
FindNet
(
via
->
GetNet
()
);
if
(
net
)
{
text
<<
wxT
(
" ["
)
<<
net
->
m_Netname
<<
wxT
(
"]"
);
text
<<
wxT
(
" ["
)
<<
net
->
GetNetname
()
<<
wxT
(
"]"
);
}
text
<<
wxChar
(
' '
)
<<
_
(
"Net:"
)
<<
via
->
GetNet
();
...
...
pcbnew/class_equipot.cpp
View file @
6d856f60
...
...
@@ -44,15 +44,16 @@ EQUIPOT::~EQUIPOT()
}
wxPoint
&
EQUIPOT
::
GetPosition
()
{
static
wxPoint
dummy
;
return
dummy
;
}
/*********************************************************/
int
EQUIPOT
::
Read
Equipot
Descr
(
FILE
*
File
,
int
*
LineNum
)
int
EQUIPOT
::
ReadDescr
(
FILE
*
File
,
int
*
LineNum
)
/*********************************************************/
/* Routine de lecture de 1 descr Equipotentielle.
...
...
@@ -90,31 +91,52 @@ int EQUIPOT:: ReadEquipotDescr( FILE* File, int* LineNum )
}
/**************************************/
bool
EQUIPOT
::
Save
(
FILE
*
aFile
)
const
/**************************************/
{
if
(
GetState
(
DELETED
)
)
return
true
;
bool
rc
=
false
;
bool
success
=
false
;
fprintf
(
aFile
,
"$EQUIPOT
\n
"
);
fprintf
(
aFile
,
"Na %d
\"
%
.16
s
\"\n
"
,
GetNet
(),
CONV_TO_UTF8
(
m_Netname
)
);
fprintf
(
aFile
,
"Na %d
\"
%s
\"\n
"
,
GetNet
(),
CONV_TO_UTF8
(
m_Netname
)
);
fprintf
(
aFile
,
"St %s
\n
"
,
"~"
);
if
(
m_ForceWidth
)
fprintf
(
aFile
,
"Lw %d
\n
"
,
m_ForceWidth
);
if
(
fprintf
(
aFile
,
"$EndEQUIPOT
\n
"
)
!=
sizeof
(
"$EndEQUIPOT
\n
"
)
-
1
)
if
(
fprintf
(
aFile
,
"$EndEQUIPOT
\n
"
)
!=
sizeof
(
"$EndEQUIPOT
\n
"
)
-
1
)
goto
out
;
rc
=
true
;
success
=
true
;
out
:
return
rc
;
return
success
;
}
/**
* Function SetNetname
* @param const wxString : the new netname
*/
void
EQUIPOT
::
SetNetname
(
const
wxString
&
aNetname
)
{
m_Netname
=
aNetname
;
m_ShortNetname
=
m_Netname
.
AfterLast
(
'/'
);
}
/** function Draw
* we actually could show a NET, simply show all the tracks and pads or net name on pad and vias
*/
void
EQUIPOT
::
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
int
aDrawMode
,
const
wxPoint
&
offset
)
{
}
#if defined(DEBUG)
/**
* Function Show
* is used to output the object tree, currently for debugging only.
...
...
@@ -129,6 +151,6 @@ void EQUIPOT::Show( int nestLevel, std::ostream& os )
" name=
\"
"
<<
m_Netname
.
mb_str
()
<<
'"'
<<
" netcode=
\"
"
<<
GetNet
()
<<
"
\"
/>
\n
"
;
}
#endif
#endif
pcbnew/class_equipot.h
View file @
6d856f60
/*************************************************************************/
/* classe EQUIPOT: definition des elements relatifs aux equipotentielles */
/*************************************************************************/
/* Representation des descriptions des equipotentielles */
/*************************************************/
/* classe EQUIPOT: Class to handle info on nets */
/*************************************************/
class
EQUIPOT
:
public
BOARD_ITEM
{
private
:
int
m_NetCode
;
// numero de code interne du net
int
m_NetCode
;
// this is a number equivalent to the net name
// Used for fast comparisons in rastnest and DRC computations.
wxString
m_Netname
;
// Full net name like /mysheet/mysubsheet/vout used by eeschema
wxString
m_ShortNetname
;
// short net name, like vout from /mysheet/mysubsheet/vout
public
:
wxString
m_Netname
;
// nom du net
int
status
;
// no route, hight light...
int
m_NbNodes
;
//
nombre de pads appartenant au
net
int
m_NbLink
;
//
nombre de chevelus
int
m_NbNoconn
;
//
nombre de chevelus actifs
int
m_NbNodes
;
//
Pads count for this
net
int
m_NbLink
;
//
Ratsnets count for this net
int
m_NbNoconn
;
//
Ratsnets remaining to route count
int
m_Masque_Layer
;
// couches interdites (bit 0 = layer 0...)
int
m_Masque_Plan
;
// couches mises en plan de cuivre
int
m_ForceWidth
;
// specific width (O = default width)
...
...
@@ -41,7 +40,7 @@ public:
wxPoint
&
GetPosition
();
/* Readind and writing data on files */
int
Read
Equipot
Descr
(
FILE
*
File
,
int
*
LineNum
);
int
ReadDescr
(
FILE
*
File
,
int
*
LineNum
);
/**
* Function Save
...
...
@@ -52,11 +51,11 @@ public:
bool
Save
(
FILE
*
aFile
)
const
;
/** function Draw
* @todo we actually could show a NET, simply show all the tracks and pads or net name on pad and vias
*/
void
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
int
aDrawMode
,
const
wxPoint
&
offset
=
ZeroOffset
)
{
// @todo we actually could show a NET, simply show all the tracks and pads
}
int
aDrawMode
,
const
wxPoint
&
offset
=
ZeroOffset
);
/**
...
...
@@ -66,6 +65,23 @@ public:
int
GetNet
()
const
{
return
m_NetCode
;
}
void
SetNet
(
int
aNetCode
)
{
m_NetCode
=
aNetCode
;
}
/**
* Function GetNetname
* @return const wxString * , a pointer to the full netname
*/
wxString
GetNetname
()
const
{
return
m_Netname
;
}
/**
* Function GetShortNetname
* @return const wxString * , a pointer to the short netname
*/
wxString
GetShortNetname
()
const
{
return
m_ShortNetname
;
}
/**
* Function SetNetname
* @param const wxString : the new netname
*/
void
SetNetname
(
const
wxString
&
aNetname
);
/**
* Function GetClass
...
...
pcbnew/class_pad.cpp
View file @
6d856f60
...
...
@@ -3,24 +3,12 @@
/************************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "wxstruct.h"
#include "common.h"
#include "pcbnew.h"
#include "trigo.h"
#include "id.h" // ID_TRACK_BUTT
#ifdef PCBNEW
#include "drag.h"
#endif
#ifdef CVPCB
#include "cvpcb.h"
#endif
#include "protos.h"
/*******************************/
/* classe D_PAD : constructeur */
...
...
@@ -43,7 +31,7 @@ D_PAD::D_PAD( MODULE* parent ) : BOARD_CONNECTED_ITEM( parent, TYPE_PAD )
m_Attribut
=
PAD_STANDARD
;
// NORMAL, PAD_SMD, PAD_CONN, Bit 7 = STACK
m_Orient
=
0
;
// en 1/10 degres
SetSubRatsnest
(
0
);
SetSubRatsnest
(
0
);
ComputeRayon
();
}
...
...
@@ -72,8 +60,8 @@ void D_PAD::ComputeRayon()
case
PAD_RECT
:
case
PAD_TRAPEZOID
:
m_Rayon
=
(
int
)
(
sqrt
(
(
double
)
m_Size
.
y
*
m_Size
.
y
+
(
double
)
m_Size
.
x
*
m_Size
.
x
)
/
2
);
m_Rayon
=
(
int
)
(
sqrt
(
(
double
)
m_Size
.
y
*
m_Size
.
y
+
(
double
)
m_Size
.
x
*
m_Size
.
x
)
/
2
);
break
;
}
}
...
...
@@ -89,8 +77,8 @@ EDA_Rect D_PAD::GetBoundingBox()
// Calculate area:
ComputeRayon
();
// calculate the radius of the area, considered as a circle
EDA_Rect
area
;
area
.
SetOrigin
(
m_Pos
);
area
.
Inflate
(
m_Rayon
,
m_Rayon
);
area
.
SetOrigin
(
m_Pos
);
area
.
Inflate
(
m_Rayon
,
m_Rayon
);
return
area
;
}
...
...
@@ -171,6 +159,18 @@ void D_PAD::SetPadName( const wxString& name )
m_Padname
[
ii
]
=
0
;
}
/**************************************************/
void
D_PAD
::
SetNetname
(
const
wxString
&
aNetname
)
/**************************************************/
/**
* Function SetNetname
* @param const wxString : the new netname
*/
{
m_Netname
=
aNetname
;
m_ShortNetname
=
m_Netname
.
AfterLast
(
'/'
);
}
/********************************/
void
D_PAD
::
Copy
(
D_PAD
*
source
)
...
...
@@ -199,416 +199,7 @@ void D_PAD::Copy( D_PAD* source )
SetSubRatsnest
(
0
);
SetSubNet
(
0
);
m_Netname
=
source
->
m_Netname
;
}
/*******************************************************************************************/
void
D_PAD
::
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
int
draw_mode
,
const
wxPoint
&
offset
)
/*******************************************************************************************/
/** Draw a pad:
* @param DC = device context
* @param offset = draw offset
* @param draw_mode = mode: GR_OR, GR_XOR, GR_AND...
*/
{
int
ii
;
int
color
=
0
;
int
ux0
,
uy0
,
dx
,
dx0
,
dy
,
dy0
,
rotdx
,
delta_cx
,
delta_cy
,
xc
,
yc
;
int
angle
;
wxPoint
coord
[
4
];
int
zoom
;
int
fillpad
=
0
;
wxPoint
shape_pos
;
if
(
m_Flags
&
DO_NOT_DRAW
)
return
;
wxASSERT
(
panel
);
WinEDA_BasePcbFrame
*
frame
=
(
WinEDA_BasePcbFrame
*
)
panel
->
m_Parent
;
PCB_SCREEN
*
screen
=
frame
->
GetScreen
();
zoom
=
screen
->
GetZoom
();
if
(
frame
->
m_DisplayPadFill
==
FILLED
)
fillpad
=
1
;
#ifdef PCBNEW
if
(
m_Flags
&
IS_MOVED
)
fillpad
=
0
;
#endif
if
(
m_Masque_Layer
&
CMP_LAYER
)
color
=
g_PadCMPColor
;
if
(
m_Masque_Layer
&
CUIVRE_LAYER
)
color
|=
g_PadCUColor
;
if
(
color
==
0
)
/* Not on copper layer */
{
switch
(
m_Masque_Layer
&
~
ALL_CU_LAYERS
)
{
case
ADHESIVE_LAYER_CU
:
color
=
g_DesignSettings
.
m_LayerColor
[
ADHESIVE_N_CU
];
break
;
case
ADHESIVE_LAYER_CMP
:
color
=
g_DesignSettings
.
m_LayerColor
[
ADHESIVE_N_CMP
];
break
;
case
SOLDERPASTE_LAYER_CU
:
color
=
g_DesignSettings
.
m_LayerColor
[
SOLDERPASTE_N_CU
];
break
;
case
SOLDERPASTE_LAYER_CMP
:
color
=
g_DesignSettings
.
m_LayerColor
[
SOLDERPASTE_N_CMP
];
break
;
case
SILKSCREEN_LAYER_CU
:
color
=
g_DesignSettings
.
m_LayerColor
[
SILKSCREEN_N_CU
];
break
;
case
SILKSCREEN_LAYER_CMP
:
color
=
g_DesignSettings
.
m_LayerColor
[
SILKSCREEN_N_CMP
];
break
;
case
SOLDERMASK_LAYER_CU
:
color
=
g_DesignSettings
.
m_LayerColor
[
SOLDERMASK_N_CU
];
break
;
case
SOLDERMASK_LAYER_CMP
:
color
=
g_DesignSettings
.
m_LayerColor
[
SOLDERMASK_N_CMP
];
break
;
case
DRAW_LAYER
:
color
=
g_DesignSettings
.
m_LayerColor
[
DRAW_N
];
break
;
case
COMMENT_LAYER
:
color
=
g_DesignSettings
.
m_LayerColor
[
COMMENT_N
];
break
;
case
ECO1_LAYER
:
color
=
g_DesignSettings
.
m_LayerColor
[
ECO1_N
];
break
;
case
ECO2_LAYER
:
color
=
g_DesignSettings
.
m_LayerColor
[
ECO2_N
];
break
;
case
EDGE_LAYER
:
color
=
g_DesignSettings
.
m_LayerColor
[
EDGE_N
];
break
;
default
:
color
=
DARKGRAY
;
break
;
}
}
// if PAD_SMD pad and high contrast mode
if
(
(
m_Attribut
==
PAD_SMD
||
m_Attribut
==
PAD_CONN
)
&&
DisplayOpt
.
ContrastModeDisplay
)
{
// when routing tracks
if
(
frame
&&
frame
->
m_ID_current_state
==
ID_TRACK_BUTT
)
{
int
routeTop
=
screen
->
m_Route_Layer_TOP
;
int
routeBot
=
screen
->
m_Route_Layer_BOTTOM
;
// if routing between copper and component layers,
// or the current layer is one of said 2 external copper layers,
// then highlight only the current layer.
if
(
((
1
<<
routeTop
)
|
(
1
<<
routeBot
))
==
(
CUIVRE_LAYER
|
CMP_LAYER
)
||
((
1
<<
screen
->
m_Active_Layer
)
&
(
CUIVRE_LAYER
|
CMP_LAYER
))
)
{
if
(
!
IsOnLayer
(
screen
->
m_Active_Layer
)
)
{
color
&=
~
MASKCOLOR
;
color
|=
DARKDARKGRAY
;
}
}
// else routing between an internal signal layer and some other layer.
// grey out all PAD_SMD pads not on current or the single selected
// external layer.
else
if
(
!
IsOnLayer
(
screen
->
m_Active_Layer
)
&&
!
IsOnLayer
(
routeTop
)
&&
!
IsOnLayer
(
routeBot
)
)
{
color
&=
~
MASKCOLOR
;
color
|=
DARKDARKGRAY
;
}
}
// when not edting tracks, show PAD_SMD components not on active layer as greyed out
else
{
if
(
!
IsOnLayer
(
screen
->
m_Active_Layer
)
)
{
color
&=
~
MASKCOLOR
;
color
|=
DARKDARKGRAY
;
}
}
}
if
(
draw_mode
&
GR_SURBRILL
)
{
if
(
draw_mode
&
GR_AND
)
color
&=
~
HIGHT_LIGHT_FLAG
;
else
color
|=
HIGHT_LIGHT_FLAG
;
}
if
(
color
&
HIGHT_LIGHT_FLAG
)
color
=
ColorRefs
[
color
&
MASKCOLOR
].
m_LightColor
;
GRSetDrawMode
(
DC
,
draw_mode
);
/* mode de trace */
/* calcul du centre des pads en coordonnees Ecran : */
shape_pos
=
ReturnShapePos
();
ux0
=
shape_pos
.
x
-
offset
.
x
;
uy0
=
shape_pos
.
y
-
offset
.
y
;
xc
=
ux0
;
yc
=
uy0
;
/* le trace depend de la rotation de l'empreinte */
dx
=
dx0
=
m_Size
.
x
>>
1
;
dy
=
dy0
=
m_Size
.
y
>>
1
;
/* demi dim dx et dy */
angle
=
m_Orient
;
bool
DisplayIsol
=
DisplayOpt
.
DisplayPadIsol
;
if
(
(
m_Masque_Layer
&
ALL_CU_LAYERS
)
==
0
)
DisplayIsol
=
FALSE
;
switch
(
m_PadShape
&
0x7F
)
{
case
PAD_CIRCLE
:
if
(
fillpad
)
GRFilledCircle
(
&
panel
->
m_ClipBox
,
DC
,
xc
,
yc
,
dx
,
0
,
color
,
color
);
else
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
xc
,
yc
,
dx
,
0
,
color
);
if
(
DisplayIsol
)
{
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
xc
,
yc
,
dx
+
g_DesignSettings
.
m_TrackClearence
,
0
,
color
);
}
break
;
case
PAD_OVAL
:
/* calcul de l'entraxe de l'ellipse */
if
(
dx
>
dy
)
/* ellipse horizontale */
{
delta_cx
=
dx
-
dy
;
delta_cy
=
0
;
rotdx
=
m_Size
.
y
;
}
else
/* ellipse verticale */
{
delta_cx
=
0
;
delta_cy
=
dy
-
dx
;
rotdx
=
m_Size
.
x
;
}
RotatePoint
(
&
delta_cx
,
&
delta_cy
,
angle
);
if
(
fillpad
)
{
GRFillCSegm
(
&
panel
->
m_ClipBox
,
DC
,
ux0
+
delta_cx
,
uy0
+
delta_cy
,
ux0
-
delta_cx
,
uy0
-
delta_cy
,
rotdx
,
color
);
}
else
{
GRCSegm
(
&
panel
->
m_ClipBox
,
DC
,
ux0
+
delta_cx
,
uy0
+
delta_cy
,
ux0
-
delta_cx
,
uy0
-
delta_cy
,
rotdx
,
color
);
}
/* Trace de la marge d'isolement */
if
(
DisplayIsol
)
{
rotdx
=
rotdx
+
g_DesignSettings
.
m_TrackClearence
+
g_DesignSettings
.
m_TrackClearence
;
GRCSegm
(
&
panel
->
m_ClipBox
,
DC
,
ux0
+
delta_cx
,
uy0
+
delta_cy
,
ux0
-
delta_cx
,
uy0
-
delta_cy
,
rotdx
,
color
);
}
break
;
case
PAD_RECT
:
case
PAD_TRAPEZOID
:
{
int
ddx
,
ddy
;
ddx
=
m_DeltaSize
.
x
>>
1
;
ddy
=
m_DeltaSize
.
y
>>
1
;
/* demi dim dx et dy */
coord
[
0
].
x
=
-
dx
-
ddy
;
coord
[
0
].
y
=
+
dy
+
ddx
;
coord
[
1
].
x
=
-
dx
+
ddy
;
coord
[
1
].
y
=
-
dy
-
ddx
;
coord
[
2
].
x
=
+
dx
-
ddy
;
coord
[
2
].
y
=
-
dy
+
ddx
;
coord
[
3
].
x
=
+
dx
+
ddy
;
coord
[
3
].
y
=
+
dy
-
ddx
;
for
(
ii
=
0
;
ii
<
4
;
ii
++
)
{
RotatePoint
(
&
coord
[
ii
].
x
,
&
coord
[
ii
].
y
,
angle
);
coord
[
ii
].
x
=
coord
[
ii
].
x
+
ux0
;
coord
[
ii
].
y
=
coord
[
ii
].
y
+
uy0
;
}
GRClosedPoly
(
&
panel
->
m_ClipBox
,
DC
,
4
,
(
int
*
)
coord
,
fillpad
,
color
,
color
);
if
(
DisplayIsol
)
{
dx
+=
g_DesignSettings
.
m_TrackClearence
;
dy
+=
g_DesignSettings
.
m_TrackClearence
;
coord
[
0
].
x
=
-
dx
-
ddy
;
coord
[
0
].
y
=
dy
+
ddx
;
coord
[
1
].
x
=
-
dx
+
ddy
;
coord
[
1
].
y
=
-
dy
-
ddx
;
coord
[
2
].
x
=
dx
-
ddy
;
coord
[
2
].
y
=
-
dy
+
ddx
;
coord
[
3
].
x
=
dx
+
ddy
;
coord
[
3
].
y
=
dy
-
ddx
;
for
(
ii
=
0
;
ii
<
4
;
ii
++
)
{
RotatePoint
(
&
coord
[
ii
].
x
,
&
coord
[
ii
].
y
,
angle
);
coord
[
ii
].
x
=
coord
[
ii
].
x
+
ux0
;
coord
[
ii
].
y
=
coord
[
ii
].
y
+
uy0
;
}
GRClosedPoly
(
&
panel
->
m_ClipBox
,
DC
,
4
,
(
int
*
)
coord
,
0
,
color
,
color
);
}
}
break
;
default
:
break
;
}
/* Draw the pad hole */
int
cx0
=
m_Pos
.
x
-
offset
.
x
;
int
cy0
=
m_Pos
.
y
-
offset
.
y
;
int
hole
=
m_Drill
.
x
>>
1
;
if
(
fillpad
&&
hole
)
{
bool
blackpenstate
=
false
;
if
(
g_IsPrinting
)
{
blackpenstate
=
GetGRForceBlackPenState
(
);
GRForceBlackPen
(
false
);
color
=
WHITE
;
}
else
color
=
BLACK
;
// or DARKGRAY;
if
(
draw_mode
!=
GR_XOR
)
GRSetDrawMode
(
DC
,
GR_COPY
);
else
GRSetDrawMode
(
DC
,
GR_XOR
);
switch
(
m_DrillShape
)
{
case
PAD_CIRCLE
:
if
(
(
hole
/
zoom
)
>
1
)
/* draw hole if its size is enought */
GRFilledCircle
(
&
panel
->
m_ClipBox
,
DC
,
cx0
,
cy0
,
hole
,
0
,
color
,
color
);
break
;
case
PAD_OVAL
:
dx
=
m_Drill
.
x
>>
1
;
dy
=
m_Drill
.
y
>>
1
;
/* demi dim dx et dy */
/* calcul de l'entraxe de l'ellipse */
if
(
m_Drill
.
x
>
m_Drill
.
y
)
/* ellipse horizontale */
{
delta_cx
=
dx
-
dy
;
delta_cy
=
0
;
rotdx
=
m_Drill
.
y
;
}
else
/* ellipse verticale */
{
delta_cx
=
0
;
delta_cy
=
dy
-
dx
;
rotdx
=
m_Drill
.
x
;
}
RotatePoint
(
&
delta_cx
,
&
delta_cy
,
angle
);
GRFillCSegm
(
&
panel
->
m_ClipBox
,
DC
,
ux0
+
delta_cx
,
uy0
+
delta_cy
,
ux0
-
delta_cx
,
uy0
-
delta_cy
,
rotdx
,
color
);
break
;
default
:
break
;
}
if
(
g_IsPrinting
)
GRForceBlackPen
(
blackpenstate
);
}
GRSetDrawMode
(
DC
,
draw_mode
);
/* Trace du symbole "No connect" ( / ou \ ou croix en X) si necessaire : */
if
(
m_Netname
.
IsEmpty
()
&&
DisplayOpt
.
DisplayPadNoConn
)
{
dx0
=
MIN
(
dx0
,
dy0
);
int
nc_color
=
BLUE
;
if
(
m_Masque_Layer
&
CMP_LAYER
)
/* Trace forme \ */
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
cx0
-
dx0
,
cy0
-
dx0
,
cx0
+
dx0
,
cy0
+
dx0
,
0
,
nc_color
);
if
(
m_Masque_Layer
&
CUIVRE_LAYER
)
/* Trace forme / */
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
cx0
+
dx0
,
cy0
-
dx0
,
cx0
-
dx0
,
cy0
+
dx0
,
0
,
nc_color
);
}
/* Draw the pad number */
if
(
frame
&&
!
frame
->
m_DisplayPadNum
)
return
;
dx
=
MIN
(
m_Size
.
x
,
m_Size
.
y
);
/* dx = text size */
if
(
(
dx
/
zoom
)
>
12
)
/* size must be enought to draw 2 chars */
{
wxString
buffer
;
ReturnStringPadName
(
buffer
);
dy
=
buffer
.
Len
();
/* Draw text with an angle between -90 deg and + 90 deg */
NORMALIZE_ANGLE_90
(
angle
);
if
(
dy
<
2
)
dy
=
2
;
/* text min size is 2 char */
dx
=
(
dx
*
9
)
/
(
dy
*
13
);
/* Text size ajusted to pad size */
DrawGraphicText
(
panel
,
DC
,
wxPoint
(
ux0
,
uy0
),
WHITE
,
buffer
,
angle
,
wxSize
(
dx
,
dx
),
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_CENTER
);
}
m_ShortNetname
=
source
->
m_ShortNetname
;
}
...
...
@@ -735,7 +326,7 @@ int D_PAD::ReadDescr( FILE* File, int* LineNum )
/* Lecture du netname */
ReadDelimitedText
(
BufLine
,
PtLine
,
sizeof
(
BufLine
)
);
m_Netname
=
CONV_FROM_UTF8
(
StrPurge
(
BufLine
)
);
SetNetname
(
CONV_FROM_UTF8
(
StrPurge
(
BufLine
)
)
);
break
;
case
'P'
:
...
...
@@ -766,7 +357,7 @@ bool D_PAD::Save( FILE* aFile ) const
bool
rc
=
false
;
// check the return values for first and last fprints() in this function
if
(
fprintf
(
aFile
,
"$PAD
\n
"
)
!=
sizeof
(
"$PAD
\n
"
)
-
1
)
if
(
fprintf
(
aFile
,
"$PAD
\n
"
)
!=
sizeof
(
"$PAD
\n
"
)
-
1
)
goto
out
;
switch
(
m_PadShape
)
...
...
@@ -826,7 +417,7 @@ bool D_PAD::Save( FILE* aFile ) const
fprintf
(
aFile
,
"Po %d %d
\n
"
,
m_Pos0
.
x
,
m_Pos0
.
y
);
if
(
fprintf
(
aFile
,
"$EndPAD
\n
"
)
!=
sizeof
(
"$EndPAD
\n
"
)
-
1
)
if
(
fprintf
(
aFile
,
"$EndPAD
\n
"
)
!=
sizeof
(
"$EndPAD
\n
"
)
-
1
)
goto
out
;
rc
=
true
;
...
...
@@ -836,7 +427,6 @@ out:
}
/******************************************************/
void
D_PAD
::
Display_Infos
(
WinEDA_DrawFrame
*
frame
)
/******************************************************/
...
...
@@ -853,7 +443,8 @@ void D_PAD::Display_Infos( WinEDA_DrawFrame* frame )
static
const
wxString
Msg_Pad_Layer
[
9
]
=
{
wxT
(
"??? "
),
wxT
(
"cmp "
),
wxT
(
"cu "
),
wxT
(
"cmp+cu "
),
wxT
(
"int "
),
wxT
(
"??? "
),
wxT
(
"cmp "
),
wxT
(
"cu "
),
wxT
(
"cmp+cu "
),
wxT
(
"int "
),
wxT
(
"cmp+int "
),
wxT
(
"cu+int "
),
wxT
(
"all "
),
wxT
(
"No copp"
)
};
...
...
@@ -880,7 +471,7 @@ void D_PAD::Display_Infos( WinEDA_DrawFrame* frame )
pos
+=
10
;
#if 1 // Used only to debug connectivity calculations
Line
.
Printf
(
wxT
(
"%d-%d-%d "
),
GetSubRatsnest
(),
GetSubNet
(),
m_ZoneSubnet
);
Affiche_1_Parametre
(
frame
,
pos
,
wxT
(
"L-P-Z"
),
Line
,
DARKGREEN
);
Affiche_1_Parametre
(
frame
,
pos
,
wxT
(
"L-P-Z"
),
Line
,
DARKGREEN
);
#endif
wxString
LayerInfo
;
...
...
@@ -962,8 +553,13 @@ void D_PAD::Display_Infos( WinEDA_DrawFrame* frame )
pos
+=
6
;
int
attribut
=
m_Attribut
&
15
;
if
(
attribut
>
3
)
attribut
=
3
;
Affiche_1_Parametre
(
frame
,
pos
,
Msg_Pad_Shape
[
m_PadShape
],
Msg_Pad_Attribut
[
attribut
],
DARKGREEN
);
if
(
attribut
>
3
)
attribut
=
3
;
Affiche_1_Parametre
(
frame
,
pos
,
Msg_Pad_Shape
[
m_PadShape
],
Msg_Pad_Attribut
[
attribut
],
DARKGREEN
);
valeur_param
(
m_Size
.
x
,
Line
);
pos
+=
6
;
...
...
@@ -992,7 +588,7 @@ void D_PAD::Display_Infos( WinEDA_DrawFrame* frame )
int
module_orient
=
module
?
module
->
m_Orient
:
0
;
if
(
module_orient
)
Line
.
Printf
(
wxT
(
"%3.1f(+%3.1f)"
),
(
float
)
(
m_Orient
-
module_orient
)
/
10
,
(
float
)
module_orient
/
10
);
(
float
)
(
m_Orient
-
module_orient
)
/
10
,
(
float
)
module_orient
/
10
);
else
Line
.
Printf
(
wxT
(
"%3.1f"
),
(
float
)
m_Orient
/
10
);
pos
+=
8
;
...
...
@@ -1011,7 +607,7 @@ void D_PAD::Display_Infos( WinEDA_DrawFrame* frame )
// see class_pad.h
bool
D_PAD
::
IsOnLayer
(
int
aLayer
)
const
{
return
(
1
<<
aLayer
)
&
m_Masque_Layer
;
return
(
1
<<
aLayer
)
&
m_Masque_Layer
;
}
...
...
@@ -1099,11 +695,20 @@ static const char* ShowPadType( int aPadType )
{
switch
(
aPadType
)
{
case
PAD_CIRCLE
:
return
"circle"
;
case
PAD_OVAL
:
return
"oval"
;
case
PAD_RECT
:
return
"rect"
;
case
PAD_TRAPEZOID
:
return
"trap"
;
default
:
return
"??unknown??"
;
case
PAD_CIRCLE
:
return
"circle"
;
case
PAD_OVAL
:
return
"oval"
;
case
PAD_RECT
:
return
"rect"
;
case
PAD_TRAPEZOID
:
return
"trap"
;
default
:
return
"??unknown??"
;
}
}
...
...
@@ -1112,11 +717,20 @@ static const char* ShowPadAttr( int aPadAttr )
{
switch
(
aPadAttr
)
{
case
PAD_STANDARD
:
return
"STD"
;
case
PAD_SMD
:
return
"SMD"
;
case
PAD_CONN
:
return
"CONN"
;
case
PAD_HOLE_NOT_PLATED
:
return
"HOLE"
;
default
:
return
"??unkown??"
;
case
PAD_STANDARD
:
return
"STD"
;
case
PAD_SMD
:
return
"SMD"
;
case
PAD_CONN
:
return
"CONN"
;
case
PAD_HOLE_NOT_PLATED
:
return
"HOLE"
;
default
:
return
"??unkown??"
;
}
}
...
...
@@ -1150,4 +764,5 @@ void D_PAD::Show( int nestLevel, std::ostream& os )
// NestedSpace( nestLevel, os ) << "</" << GetClass().Lower().mb_str() << ">\n";
}
#endif
pcbnew/class_pad.h
View file @
6d856f60
...
...
@@ -12,6 +12,8 @@ class D_PAD : public BOARD_CONNECTED_ITEM
{
private
:
int
m_NetCode
;
// Net number for fast comparisons
wxString
m_Netname
;
// Full net name like /mysheet/mysubsheet/vout used by eeschema
wxString
m_ShortNetname
;
// short net name, like vout from /mysheet/mysubsheet/vout
public
:
...
...
@@ -25,8 +27,6 @@ public:
*/
};
wxString
m_Netname
;
/* Net Name */
int
m_Masque_Layer
;
// Bitwise layer :1= copper layer, 15= cmp,
// 2..14 = internal layers
// 16 .. 31 = technical layers
...
...
@@ -73,6 +73,30 @@ public:
D_PAD
*
Next
()
{
return
(
D_PAD
*
)
Pnext
;
}
/**
* Function GetNetname
* @return const wxString * , a pointer to the full netname
*/
wxString
GetNetname
()
const
{
return
m_Netname
;
}
/**
* Function GetShortNetname
* @return const wxString * , a pointer to the short netname
*/
wxString
GetShortNetname
()
const
{
return
m_ShortNetname
;
}
/**
* Function SetNetname
* @param const wxString : the new netname
*/
void
SetNetname
(
const
wxString
&
aNetname
);
/**
* Function GetShape
* @return the shape of this pad.
*/
int
GetShape
(
)
{
return
(
m_PadShape
&
0xFF
);
}
/**
* Function GetPosition
* returns the position of this object.
...
...
pcbnew/class_pad_draw_functions.cpp
0 → 100644
View file @
6d856f60
/*******************************************************/
/* class_pad_draw_function.cpp : functionsto draw pads */
/*******************************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "pcbnew.h"
#include "trigo.h"
#include "id.h" // ID_TRACK_BUTT
/*******************************************************************************************/
void
D_PAD
::
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
int
draw_mode
,
const
wxPoint
&
offset
)
/*******************************************************************************************/
/** Draw a pad:
* @param DC = device context
* @param offset = draw offset
* @param draw_mode = mode: GR_OR, GR_XOR, GR_AND...
*/
{
int
ii
;
int
color
=
0
;
int
ux0
,
uy0
,
dx
,
dx0
,
dy
,
dy0
,
rotdx
,
delta_cx
,
delta_cy
,
xc
,
yc
;
int
angle
;
wxPoint
coord
[
4
];
int
zoom
;
int
fillpad
=
0
;
wxPoint
shape_pos
;
if
(
m_Flags
&
DO_NOT_DRAW
)
return
;
wxASSERT
(
panel
);
zoom
=
panel
->
GetZoom
();
WinEDA_BasePcbFrame
*
frame
=
(
WinEDA_BasePcbFrame
*
)
panel
->
m_Parent
;
PCB_SCREEN
*
screen
=
frame
->
GetScreen
();
if
(
frame
->
m_DisplayPadFill
==
FILLED
)
fillpad
=
1
;
#ifdef PCBNEW
if
(
m_Flags
&
IS_MOVED
)
fillpad
=
0
;
#endif
if
(
m_Masque_Layer
&
CMP_LAYER
)
color
=
g_PadCMPColor
;
if
(
m_Masque_Layer
&
CUIVRE_LAYER
)
color
|=
g_PadCUColor
;
if
(
color
==
0
)
/* Not on copper layer */
{
switch
(
m_Masque_Layer
&
~
ALL_CU_LAYERS
)
{
case
ADHESIVE_LAYER_CU
:
color
=
g_DesignSettings
.
m_LayerColor
[
ADHESIVE_N_CU
];
break
;
case
ADHESIVE_LAYER_CMP
:
color
=
g_DesignSettings
.
m_LayerColor
[
ADHESIVE_N_CMP
];
break
;
case
SOLDERPASTE_LAYER_CU
:
color
=
g_DesignSettings
.
m_LayerColor
[
SOLDERPASTE_N_CU
];
break
;
case
SOLDERPASTE_LAYER_CMP
:
color
=
g_DesignSettings
.
m_LayerColor
[
SOLDERPASTE_N_CMP
];
break
;
case
SILKSCREEN_LAYER_CU
:
color
=
g_DesignSettings
.
m_LayerColor
[
SILKSCREEN_N_CU
];
break
;
case
SILKSCREEN_LAYER_CMP
:
color
=
g_DesignSettings
.
m_LayerColor
[
SILKSCREEN_N_CMP
];
break
;
case
SOLDERMASK_LAYER_CU
:
color
=
g_DesignSettings
.
m_LayerColor
[
SOLDERMASK_N_CU
];
break
;
case
SOLDERMASK_LAYER_CMP
:
color
=
g_DesignSettings
.
m_LayerColor
[
SOLDERMASK_N_CMP
];
break
;
case
DRAW_LAYER
:
color
=
g_DesignSettings
.
m_LayerColor
[
DRAW_N
];
break
;
case
COMMENT_LAYER
:
color
=
g_DesignSettings
.
m_LayerColor
[
COMMENT_N
];
break
;
case
ECO1_LAYER
:
color
=
g_DesignSettings
.
m_LayerColor
[
ECO1_N
];
break
;
case
ECO2_LAYER
:
color
=
g_DesignSettings
.
m_LayerColor
[
ECO2_N
];
break
;
case
EDGE_LAYER
:
color
=
g_DesignSettings
.
m_LayerColor
[
EDGE_N
];
break
;
default
:
color
=
DARKGRAY
;
break
;
}
}
// if PAD_SMD pad and high contrast mode
if
(
(
m_Attribut
==
PAD_SMD
||
m_Attribut
==
PAD_CONN
)
&&
DisplayOpt
.
ContrastModeDisplay
)
{
// when routing tracks
if
(
frame
&&
frame
->
m_ID_current_state
==
ID_TRACK_BUTT
)
{
int
routeTop
=
screen
->
m_Route_Layer_TOP
;
int
routeBot
=
screen
->
m_Route_Layer_BOTTOM
;
// if routing between copper and component layers,
// or the current layer is one of said 2 external copper layers,
// then highlight only the current layer.
if
(
(
(
1
<<
routeTop
)
|
(
1
<<
routeBot
)
)
==
(
CUIVRE_LAYER
|
CMP_LAYER
)
||
(
(
1
<<
screen
->
m_Active_Layer
)
&
(
CUIVRE_LAYER
|
CMP_LAYER
)
)
)
{
if
(
!
IsOnLayer
(
screen
->
m_Active_Layer
)
)
{
color
&=
~
MASKCOLOR
;
color
|=
DARKDARKGRAY
;
}
}
// else routing between an internal signal layer and some other layer.
// grey out all PAD_SMD pads not on current or the single selected
// external layer.
else
if
(
!
IsOnLayer
(
screen
->
m_Active_Layer
)
&&
!
IsOnLayer
(
routeTop
)
&&
!
IsOnLayer
(
routeBot
)
)
{
color
&=
~
MASKCOLOR
;
color
|=
DARKDARKGRAY
;
}
}
// when not edting tracks, show PAD_SMD components not on active layer as greyed out
else
{
if
(
!
IsOnLayer
(
screen
->
m_Active_Layer
)
)
{
color
&=
~
MASKCOLOR
;
color
|=
DARKDARKGRAY
;
}
}
}
if
(
draw_mode
&
GR_SURBRILL
)
{
if
(
draw_mode
&
GR_AND
)
color
&=
~
HIGHT_LIGHT_FLAG
;
else
color
|=
HIGHT_LIGHT_FLAG
;
}
if
(
color
&
HIGHT_LIGHT_FLAG
)
color
=
ColorRefs
[
color
&
MASKCOLOR
].
m_LightColor
;
GRSetDrawMode
(
DC
,
draw_mode
);
/* mode de trace */
/* calcul du centre des pads en coordonnees Ecran : */
shape_pos
=
ReturnShapePos
();
ux0
=
shape_pos
.
x
-
offset
.
x
;
uy0
=
shape_pos
.
y
-
offset
.
y
;
xc
=
ux0
;
yc
=
uy0
;
/* le trace depend de la rotation de l'empreinte */
dx
=
dx0
=
m_Size
.
x
>>
1
;
dy
=
dy0
=
m_Size
.
y
>>
1
;
/* demi dim dx et dy */
angle
=
m_Orient
;
bool
DisplayIsol
=
DisplayOpt
.
DisplayPadIsol
;
if
(
(
m_Masque_Layer
&
ALL_CU_LAYERS
)
==
0
)
DisplayIsol
=
FALSE
;
switch
(
GetShape
()
)
{
case
PAD_CIRCLE
:
if
(
fillpad
)
GRFilledCircle
(
&
panel
->
m_ClipBox
,
DC
,
xc
,
yc
,
dx
,
0
,
color
,
color
);
else
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
xc
,
yc
,
dx
,
0
,
color
);
if
(
DisplayIsol
)
{
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
xc
,
yc
,
dx
+
g_DesignSettings
.
m_TrackClearence
,
0
,
color
);
}
break
;
case
PAD_OVAL
:
/* calcul de l'entraxe de l'ellipse */
if
(
dx
>
dy
)
/* ellipse horizontale */
{
delta_cx
=
dx
-
dy
;
delta_cy
=
0
;
rotdx
=
m_Size
.
y
;
}
else
/* ellipse verticale */
{
delta_cx
=
0
;
delta_cy
=
dy
-
dx
;
rotdx
=
m_Size
.
x
;
}
RotatePoint
(
&
delta_cx
,
&
delta_cy
,
angle
);
if
(
fillpad
)
{
GRFillCSegm
(
&
panel
->
m_ClipBox
,
DC
,
ux0
+
delta_cx
,
uy0
+
delta_cy
,
ux0
-
delta_cx
,
uy0
-
delta_cy
,
rotdx
,
color
);
}
else
{
GRCSegm
(
&
panel
->
m_ClipBox
,
DC
,
ux0
+
delta_cx
,
uy0
+
delta_cy
,
ux0
-
delta_cx
,
uy0
-
delta_cy
,
rotdx
,
color
);
}
/* Trace de la marge d'isolement */
if
(
DisplayIsol
)
{
rotdx
=
rotdx
+
g_DesignSettings
.
m_TrackClearence
+
g_DesignSettings
.
m_TrackClearence
;
GRCSegm
(
&
panel
->
m_ClipBox
,
DC
,
ux0
+
delta_cx
,
uy0
+
delta_cy
,
ux0
-
delta_cx
,
uy0
-
delta_cy
,
rotdx
,
color
);
}
break
;
case
PAD_RECT
:
case
PAD_TRAPEZOID
:
{
int
ddx
,
ddy
;
ddx
=
m_DeltaSize
.
x
>>
1
;
ddy
=
m_DeltaSize
.
y
>>
1
;
/* demi dim dx et dy */
coord
[
0
].
x
=
-
dx
-
ddy
;
coord
[
0
].
y
=
+
dy
+
ddx
;
coord
[
1
].
x
=
-
dx
+
ddy
;
coord
[
1
].
y
=
-
dy
-
ddx
;
coord
[
2
].
x
=
+
dx
-
ddy
;
coord
[
2
].
y
=
-
dy
+
ddx
;
coord
[
3
].
x
=
+
dx
+
ddy
;
coord
[
3
].
y
=
+
dy
-
ddx
;
for
(
ii
=
0
;
ii
<
4
;
ii
++
)
{
RotatePoint
(
&
coord
[
ii
].
x
,
&
coord
[
ii
].
y
,
angle
);
coord
[
ii
].
x
=
coord
[
ii
].
x
+
ux0
;
coord
[
ii
].
y
=
coord
[
ii
].
y
+
uy0
;
}
GRClosedPoly
(
&
panel
->
m_ClipBox
,
DC
,
4
,
(
int
*
)
coord
,
fillpad
,
color
,
color
);
if
(
DisplayIsol
)
{
dx
+=
g_DesignSettings
.
m_TrackClearence
;
dy
+=
g_DesignSettings
.
m_TrackClearence
;
coord
[
0
].
x
=
-
dx
-
ddy
;
coord
[
0
].
y
=
dy
+
ddx
;
coord
[
1
].
x
=
-
dx
+
ddy
;
coord
[
1
].
y
=
-
dy
-
ddx
;
coord
[
2
].
x
=
dx
-
ddy
;
coord
[
2
].
y
=
-
dy
+
ddx
;
coord
[
3
].
x
=
dx
+
ddy
;
coord
[
3
].
y
=
dy
-
ddx
;
for
(
ii
=
0
;
ii
<
4
;
ii
++
)
{
RotatePoint
(
&
coord
[
ii
].
x
,
&
coord
[
ii
].
y
,
angle
);
coord
[
ii
].
x
=
coord
[
ii
].
x
+
ux0
;
coord
[
ii
].
y
=
coord
[
ii
].
y
+
uy0
;
}
GRClosedPoly
(
&
panel
->
m_ClipBox
,
DC
,
4
,
(
int
*
)
coord
,
0
,
color
,
color
);
}
}
break
;
default
:
break
;
}
/* Draw the pad hole */
int
cx0
=
m_Pos
.
x
-
offset
.
x
;
int
cy0
=
m_Pos
.
y
-
offset
.
y
;
int
hole
=
m_Drill
.
x
>>
1
;
if
(
fillpad
&&
hole
)
{
bool
blackpenstate
=
false
;
if
(
g_IsPrinting
)
{
blackpenstate
=
GetGRForceBlackPenState
();
GRForceBlackPen
(
false
);
color
=
WHITE
;
}
else
color
=
BLACK
;
// or DARKGRAY;
if
(
draw_mode
!=
GR_XOR
)
GRSetDrawMode
(
DC
,
GR_COPY
);
else
GRSetDrawMode
(
DC
,
GR_XOR
);
switch
(
m_DrillShape
)
{
case
PAD_CIRCLE
:
if
(
(
hole
/
zoom
)
>
1
)
/* draw hole if its size is enought */
GRFilledCircle
(
&
panel
->
m_ClipBox
,
DC
,
cx0
,
cy0
,
hole
,
0
,
color
,
color
);
break
;
case
PAD_OVAL
:
dx
=
m_Drill
.
x
>>
1
;
dy
=
m_Drill
.
y
>>
1
;
/* demi dim dx et dy */
/* calcul de l'entraxe de l'ellipse */
if
(
m_Drill
.
x
>
m_Drill
.
y
)
/* ellipse horizontale */
{
delta_cx
=
dx
-
dy
;
delta_cy
=
0
;
rotdx
=
m_Drill
.
y
;
}
else
/* ellipse verticale */
{
delta_cx
=
0
;
delta_cy
=
dy
-
dx
;
rotdx
=
m_Drill
.
x
;
}
RotatePoint
(
&
delta_cx
,
&
delta_cy
,
angle
);
GRFillCSegm
(
&
panel
->
m_ClipBox
,
DC
,
ux0
+
delta_cx
,
uy0
+
delta_cy
,
ux0
-
delta_cx
,
uy0
-
delta_cy
,
rotdx
,
color
);
break
;
default
:
break
;
}
if
(
g_IsPrinting
)
GRForceBlackPen
(
blackpenstate
);
}
GRSetDrawMode
(
DC
,
draw_mode
);
/* Trace du symbole "No connect" ( / ou \ ou croix en X) si necessaire : */
if
(
m_Netname
.
IsEmpty
()
&&
DisplayOpt
.
DisplayPadNoConn
)
{
dx0
=
MIN
(
dx0
,
dy0
);
int
nc_color
=
BLUE
;
if
(
m_Masque_Layer
&
CMP_LAYER
)
/* Trace forme \ */
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
cx0
-
dx0
,
cy0
-
dx0
,
cx0
+
dx0
,
cy0
+
dx0
,
0
,
nc_color
);
if
(
m_Masque_Layer
&
CUIVRE_LAYER
)
/* Trace forme / */
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
cx0
+
dx0
,
cy0
-
dx0
,
cx0
-
dx0
,
cy0
+
dx0
,
0
,
nc_color
);
}
/* Draw the pad number */
if
(
frame
&&
!
frame
->
m_DisplayPadNum
)
return
;
wxPoint
tpos0
=
wxPoint
(
ux0
,
uy0
);
// Position of the centre of text
wxPoint
tpos
=
tpos0
;
wxSize
AreaSize
;
// size of text area, normalized to AreaSize.y < AreaSize.x
int
len
;
if
(
GetShape
()
==
PAD_CIRCLE
)
angle
=
0
;
AreaSize
=
m_Size
;
if
(
m_Size
.
y
>
m_Size
.
x
)
{
angle
+=
900
;
AreaSize
.
x
=
m_Size
.
y
;
AreaSize
.
y
=
m_Size
.
x
;
}
if
(
!
m_Netname
.
IsEmpty
()
)
// if there is a netname, provides room to display this netname
{
AreaSize
.
y
/=
2
;
// Text used only the upper area of the pad. The lower area displays the net name
tpos
.
y
-=
AreaSize
.
y
/
2
;
}
// Calculate the position of text, that is the middle point of the upper area of the pad
RotatePoint
(
&
tpos
,
wxPoint
(
ux0
,
uy0
),
angle
);
/* Draw text with an angle between -90 deg and + 90 deg */
int
t_angle
=
angle
;
NORMALIZE_ANGLE_90
(
t_angle
);
/* Note: in next calculations, texte size is calculated for 3 or more chars.
Of course, pads nimbers and nets names can have less than 3 chars.
but after some tries, i found this is gives the best look
*/
#define MIN_CHAR_COUNT 3
wxString
buffer
;
ReturnStringPadName
(
buffer
);
len
=
buffer
.
Len
();
len
=
MAX
(
len
,
MIN_CHAR_COUNT
);
int
tsize
=
min
(
AreaSize
.
y
,
AreaSize
.
x
/
len
);
#define CHAR_SIZE_MIN 5
if
(
(
tsize
/
zoom
)
>=
CHAR_SIZE_MIN
)
// Not drawable in size too small.
{
tsize
=
(
int
)
(
tsize
*
0.8
);
// reserve room for marges and segments thickness
DrawGraphicText
(
panel
,
DC
,
tpos
,
WHITE
,
buffer
,
t_angle
,
wxSize
(
tsize
,
tsize
),
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_CENTER
,
tsize
/
8
);
}
// display the short netname
len
=
m_ShortNetname
.
Len
();
if
(
len
==
0
)
return
;
len
=
MAX
(
len
,
MIN_CHAR_COUNT
);
tsize
=
min
(
AreaSize
.
y
,
AreaSize
.
x
/
len
);
if
(
(
tsize
/
zoom
)
>=
CHAR_SIZE_MIN
)
// Not drawable in size too small.
{
tpos
=
tpos0
;
tpos
.
y
+=
AreaSize
.
y
/
2
;
RotatePoint
(
&
tpos
,
wxPoint
(
ux0
,
uy0
),
angle
);
tsize
=
(
int
)
(
tsize
*
0.8
);
// reserve room for marges and segments thickness
DrawGraphicText
(
panel
,
DC
,
tpos
,
WHITE
,
m_ShortNetname
,
t_angle
,
wxSize
(
tsize
,
tsize
),
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_CENTER
,
tsize
/
8
);
}
}
pcbnew/class_text_mod.cpp
View file @
6d856f60
...
...
@@ -411,7 +411,7 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const
size
.
x
=
-
size
.
x
;
/* Trace du texte */
DrawGraphicText
(
panel
,
DC
,
pos
,
color
,
m_Text
,
DrawGraphicText
(
panel
,
DC
,
pos
,
(
enum
EDA_Colors
)
color
,
m_Text
,
orient
,
size
,
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_CENTER
,
width
);
}
...
...
pcbnew/class_track.cpp
View file @
6d856f60
...
...
@@ -38,6 +38,7 @@ void DbgDisplayTrackInfos( TRACK* track )
wxMessageBox
(
msg
);
}
#endif
...
...
@@ -56,7 +57,6 @@ static bool ShowClearance( const TRACK* aTrack )
}
/**********************************************************/
TRACK
::
TRACK
(
BOARD_ITEM
*
aParent
,
KICAD_T
idtype
)
:
BOARD_CONNECTED_ITEM
(
aParent
,
idtype
)
...
...
@@ -138,16 +138,16 @@ TRACK* TRACK::Copy() const
* Function GetDrillValue
* calculate the drill value for vias (m-Drill if > 0, or default drill value for the board
* @return real drill_value
*/
*/
int
TRACK
::
GetDrillValue
()
const
{
if
(
Type
()
!=
TYPE_VIA
)
if
(
Type
()
!=
TYPE_VIA
)
return
0
;
if
(
m_Drill
>=
0
)
if
(
m_Drill
>=
0
)
return
m_Drill
;
if
(
m_Shape
==
VIA_MICROVIA
)
if
(
m_Shape
==
VIA_MICROVIA
)
return
g_DesignSettings
.
m_MicroViaDrill
;
return
g_DesignSettings
.
m_ViaDrill
;
...
...
@@ -222,7 +222,7 @@ int TRACK::IsPointOnEnds( const wxPoint& point, int min_dist )
EDA_Rect
TRACK
::
GetBoundingBox
()
{
// end of track is round, this is its radius, rounded up
int
radius
=
(
m_Width
+
1
)
/
2
;
int
radius
=
(
m_Width
+
1
)
/
2
;
int
ymax
;
int
xmax
;
...
...
@@ -247,7 +247,7 @@ EDA_Rect TRACK::GetBoundingBox()
}
else
{
radius
=
(
m_Width
+
1
)
/
2
;
radius
=
(
m_Width
+
1
)
/
2
;
ymax
=
MAX
(
m_Start
.
y
,
m_End
.
y
);
xmax
=
MAX
(
m_Start
.
x
,
m_End
.
x
);
...
...
@@ -269,7 +269,7 @@ EDA_Rect TRACK::GetBoundingBox()
xmin
-=
radius
;
// return a rectangle which is [pos,dim) in nature. therefore the +1
EDA_Rect
ret
(
wxPoint
(
xmin
,
ymin
),
wxSize
(
xmax
-
xmin
+
1
,
ymax
-
ymin
+
1
)
);
EDA_Rect
ret
(
wxPoint
(
xmin
,
ymin
),
wxSize
(
xmax
-
xmin
+
1
,
ymax
-
ymin
+
1
)
);
return
ret
;
}
...
...
@@ -528,7 +528,6 @@ bool TRACK::Save( FILE* aFile ) const
}
/*********************************************************************/
void
TRACK
::
Draw
(
WinEDA_DrawPanel
*
panel
,
wxDC
*
DC
,
int
draw_mode
,
const
wxPoint
&
notUsed
)
/*********************************************************************/
...
...
@@ -545,9 +544,8 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
if
(
m_Flags
&
DRAW_ERASED
)
// draw in background color, used by classs TRACK in gerbview
{
color
=
g_DrawBgColor
;
D
(
printf
(
"DRAW_ERASED in Track::Draw, g_DrawBgColor=%04X
\n
"
,
g_DrawBgColor
);
)
D
(
printf
(
"DRAW_ERASED in Track::Draw, g_DrawBgColor=%04X
\n
"
,
g_DrawBgColor
);
)
}
else
{
color
=
g_DesignSettings
.
m_LayerColor
[
m_Layer
];
...
...
@@ -586,8 +584,8 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoin
if
(
m_Shape
==
S_CIRCLE
)
{
rayon
=
(
int
)
hypot
(
(
double
)
(
m_End
.
x
-
m_Start
.
x
),
(
double
)
(
m_End
.
y
-
m_Start
.
y
)
);
rayon
=
(
int
)
hypot
(
(
double
)
(
m_End
.
x
-
m_Start
.
x
),
(
double
)
(
m_End
.
y
-
m_Start
.
y
)
);
if
(
(
l_piste
/
zoom
)
<
L_MIN_DESSIN
)
{
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
rayon
,
color
);
...
...
@@ -685,8 +683,9 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
rayon
=
zoom
;
GRCircle
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
rayon
,
color
);
if
(
rayon
>
(
4
*
zoom
)
)
{
if
(
rayon
<=
(
4
*
zoom
)
)
// Size too small: cannot be drawn
return
;
int
drill_rayon
=
GetDrillValue
()
/
2
;
int
inner_rayon
=
rayon
-
(
2
*
zoom
);
...
...
@@ -696,8 +695,8 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
// Draw the via hole if the display option allows it
if
(
DisplayOpt
.
m_DisplayViaMode
!=
VIA_HOLE_NOT_SHOW
)
{
if
(
(
DisplayOpt
.
m_DisplayViaMode
==
ALL_VIA_HOLE_SHOW
)
||
// Display all drill holes requested
(
(
drill_rayon
>
0
)
&&
!
IsDrillDefault
()
)
)
// Or Display non default holes requested
if
(
(
DisplayOpt
.
m_DisplayViaMode
==
ALL_VIA_HOLE_SHOW
)
// Display all drill holes requested
||
(
(
drill_rayon
>
0
)
&&
!
IsDrillDefault
()
)
)
// Or Display non default holes requested
{
if
(
drill_rayon
<
inner_rayon
)
// We can show the via hole
{
...
...
@@ -718,7 +717,7 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
{
int
ax
,
ay
,
bx
,
by
;
if
(
IsOnLayer
(
COPPER_LAYER_N
)
)
if
(
IsOnLayer
(
COPPER_LAYER_N
)
)
{
ax
=
rayon
;
ay
=
0
;
bx
=
drill_rayon
;
by
=
0
;
...
...
@@ -730,15 +729,15 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
}
/* lines | or \ */
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
-
ax
,
m_Start
.
y
-
ay
,
m_Start
.
x
-
bx
,
m_Start
.
y
-
by
,
0
,
color
);
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
+
bx
,
m_Start
.
y
+
by
,
m_Start
.
x
+
ax
,
m_Start
.
y
+
ay
,
0
,
color
);
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
-
ax
,
m_Start
.
y
-
ay
,
m_Start
.
x
-
bx
,
m_Start
.
y
-
by
,
0
,
color
);
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
+
bx
,
m_Start
.
y
+
by
,
m_Start
.
x
+
ax
,
m_Start
.
y
+
ay
,
0
,
color
);
/* lines - or / */
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
+
ay
,
m_Start
.
y
-
ax
,
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
+
ay
,
m_Start
.
y
-
ax
,
m_Start
.
x
+
by
,
m_Start
.
y
-
bx
,
0
,
color
);
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
-
by
,
m_Start
.
y
+
bx
,
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
-
by
,
m_Start
.
y
+
bx
,
m_Start
.
x
-
ay
,
m_Start
.
y
+
ax
,
0
,
color
);
}
...
...
@@ -750,32 +749,49 @@ void SEGVIA::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode, const wxPoi
int
ax
=
0
,
ay
=
rayon
,
bx
=
0
,
by
=
drill_rayon
;
int
layer_top
,
layer_bottom
;
((
SEGVIA
*
)
this
)
->
ReturnLayerPair
(
&
layer_top
,
&
layer_bottom
);
(
(
SEGVIA
*
)
this
)
->
ReturnLayerPair
(
&
layer_top
,
&
layer_bottom
);
/* lines for the top layer */
RotatePoint
(
&
ax
,
&
ay
,
layer_top
*
3600
/
g_DesignSettings
.
m_CopperLayerCount
);
RotatePoint
(
&
bx
,
&
by
,
layer_top
*
3600
/
g_DesignSettings
.
m_CopperLayerCount
);
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
-
ax
,
m_Start
.
y
-
ay
,
m_Start
.
x
-
bx
,
m_Start
.
y
-
by
,
0
,
color
);
RotatePoint
(
&
ax
,
&
ay
,
layer_top
*
3600
/
g_DesignSettings
.
m_CopperLayerCount
);
RotatePoint
(
&
bx
,
&
by
,
layer_top
*
3600
/
g_DesignSettings
.
m_CopperLayerCount
);
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
-
ax
,
m_Start
.
y
-
ay
,
m_Start
.
x
-
bx
,
m_Start
.
y
-
by
,
0
,
color
);
/* lines for the bottom layer */
ax
=
0
;
ay
=
rayon
;
bx
=
0
;
by
=
drill_rayon
;
RotatePoint
(
&
ax
,
&
ay
,
layer_bottom
*
3600
/
g_DesignSettings
.
m_CopperLayerCount
);
RotatePoint
(
&
bx
,
&
by
,
layer_bottom
*
3600
/
g_DesignSettings
.
m_CopperLayerCount
);
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
-
ax
,
m_Start
.
y
-
ay
,
m_Start
.
x
-
bx
,
m_Start
.
y
-
by
,
0
,
color
);
RotatePoint
(
&
ax
,
&
ay
,
layer_bottom
*
3600
/
g_DesignSettings
.
m_CopperLayerCount
);
RotatePoint
(
&
bx
,
&
by
,
layer_bottom
*
3600
/
g_DesignSettings
.
m_CopperLayerCount
);
GRLine
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
-
ax
,
m_Start
.
y
-
ay
,
m_Start
.
x
-
bx
,
m_Start
.
y
-
by
,
0
,
color
);
}
// Display the short netname:
if
(
GetNet
()
==
0
)
return
;
EQUIPOT
*
net
=
((
BOARD
*
)
GetParent
())
->
FindNet
(
GetNet
()
);
if
(
net
==
NULL
)
return
;
int
len
=
net
->
GetShortNetname
().
Len
();
// calculate a good size for the text (fixed to 9 pixels, if possible)
int
tsize
=
m_Width
/
len
;
if
(
(
tsize
/
zoom
)
>=
6
)
{
tsize
=
(
tsize
*
8
)
/
10
;
// small reduction to give a better look, inside via
DrawGraphicText
(
panel
,
DC
,
m_Start
,
WHITE
,
net
->
GetShortNetname
(),
0
,
wxSize
(
tsize
,
tsize
),
GR_TEXT_HJUSTIFY_CENTER
,
GR_TEXT_VJUSTIFY_CENTER
,
tsize
/
8
);
}
}
// see class_track.h
void
TRACK
::
Display_Infos
(
WinEDA_DrawFrame
*
frame
)
{
wxString
msg
;
int
text_pos
;
BOARD
*
board
=
((
WinEDA_PcbFrame
*
)
frame
)
->
m_Pcb
;
BOARD
*
board
=
(
(
WinEDA_PcbFrame
*
)
frame
)
->
m_Pcb
;
#ifdef RATSNET_DEBUG
DbgDisplayTrackInfos
(
this
);
...
...
@@ -815,7 +831,7 @@ void TRACK::Display_Infos( WinEDA_DrawFrame* frame )
EQUIPOT
*
equipot
=
board
->
FindNet
(
GetNet
()
);
if
(
equipot
)
msg
=
equipot
->
m_Netname
;
msg
=
equipot
->
GetNetname
()
;
else
msg
=
wxT
(
"<noname>"
);
...
...
@@ -841,7 +857,7 @@ void TRACK::Display_Infos( WinEDA_DrawFrame* frame )
#if defined(DEBUG)
/* Display the flags */
msg
.
Printf
(
wxT
(
"0x%08X"
),
m_Flags
);
msg
.
Printf
(
wxT
(
"0x%08X"
),
m_Flags
);
Affiche_1_Parametre
(
frame
,
text_pos
,
_
(
"Flags"
),
msg
,
BLUE
);
text_pos
+=
8
;
...
...
@@ -930,6 +946,7 @@ bool TRACK::HitTest( const wxPoint& ref_pos )
return
false
;
}
/**
* Function HitTest (overlayed)
* tests if the given EDA_Rect intersect this object.
...
...
@@ -937,7 +954,7 @@ bool TRACK::HitTest( const wxPoint& ref_pos )
* @param refArea : the given EDA_Rect
* @return bool - true if a hit, else false
*/
bool
TRACK
::
HitTest
(
EDA_Rect
&
refArea
)
bool
TRACK
::
HitTest
(
EDA_Rect
&
refArea
)
{
if
(
refArea
.
Inside
(
m_Start
)
)
return
true
;
...
...
@@ -965,7 +982,7 @@ void TRACK::Show( int nestLevel, std::ostream& os )
" layer=
\"
"
<<
m_Layer
<<
'"'
<<
" width=
\"
"
<<
m_Width
<<
'"'
<<
" flags=
\"
"
<<
m_Flags
<<
'"'
<<
" status=
\"
"
<<
GetState
(
-
1
)
<<
'"'
<<
" status=
\"
"
<<
GetState
(
-
1
)
<<
'"'
<<
// " drill=\"" << GetDrillValue() << '"' <<
" netcode=
\"
"
<<
GetNet
()
<<
"
\"
>"
<<
...
...
@@ -1035,33 +1052,34 @@ wxString TRACK::ShowState( int stateBits )
wxString
ret
;
if
(
stateBits
&
CHAIN
)
ret
<<
wxT
(
" | CHAIN"
);
ret
<<
wxT
(
" | CHAIN"
);
if
(
stateBits
&
SEGM_AR
)
ret
<<
wxT
(
" | SEGM_AR"
);
ret
<<
wxT
(
" | SEGM_AR"
);
if
(
stateBits
&
SEGM_FIXE
)
ret
<<
wxT
(
" | SEGM_FIXE"
);
ret
<<
wxT
(
" | SEGM_FIXE"
);
if
(
stateBits
&
EDIT
)
ret
<<
wxT
(
" | EDIT"
);
ret
<<
wxT
(
" | EDIT"
);
if
(
stateBits
&
DRAG
)
ret
<<
wxT
(
" | DRAG"
);
ret
<<
wxT
(
" | DRAG"
);
if
(
stateBits
&
SURBRILL
)
ret
<<
wxT
(
" | SURBRILL"
);
ret
<<
wxT
(
" | SURBRILL"
);
if
(
stateBits
&
NO_TRACE
)
ret
<<
wxT
(
" | NO_TRACE"
);
ret
<<
wxT
(
" | NO_TRACE"
);
if
(
stateBits
&
DELETED
)
ret
<<
wxT
(
" | DELETED"
);
ret
<<
wxT
(
" | DELETED"
);
if
(
stateBits
&
BUSY
)
ret
<<
wxT
(
" | BUSY"
);
if
(
stateBits
&
END_ONPAD
)
ret
<<
wxT
(
" | END_ONPAD"
);
if
(
stateBits
&
BEGIN_ONPAD
)
ret
<<
wxT
(
" | BEGIN_ONPAD"
);
if
(
stateBits
&
FLAG0
)
ret
<<
wxT
(
" | FLAG0"
);
ret
<<
wxT
(
" | BUSY"
);
if
(
stateBits
&
END_ONPAD
)
ret
<<
wxT
(
" | END_ONPAD"
);
if
(
stateBits
&
BEGIN_ONPAD
)
ret
<<
wxT
(
" | BEGIN_ONPAD"
);
if
(
stateBits
&
FLAG0
)
ret
<<
wxT
(
" | FLAG0"
);
if
(
stateBits
&
FLAG1
)
ret
<<
wxT
(
" | FLAG1"
);
ret
<<
wxT
(
" | FLAG1"
);
return
ret
;
}
#endif
pcbnew/class_track.h
View file @
6d856f60
...
...
@@ -26,7 +26,7 @@ private:
public
:
int
m_Width
;
//
0 = line, > 0 = tracks, bus ...
int
m_Width
;
//
Thickness of track, or via diameter
wxPoint
m_Start
;
// Line start point
wxPoint
m_End
;
// Line end point
int
m_Shape
;
// vias: shape and type, Track = shape..
...
...
pcbnew/class_zone.cpp
View file @
6d856f60
...
...
@@ -71,7 +71,7 @@ void ZONE_CONTAINER::SetNet( int anet_code )
{
EQUIPOT
*
net
=
(
(
BOARD
*
)
m_Parent
)
->
FindNet
(
anet_code
);
if
(
net
)
m_Netname
=
net
->
m_Netname
;
m_Netname
=
net
->
GetNetname
()
;
else
m_Netname
.
Empty
();
}
...
...
@@ -875,7 +875,7 @@ void ZONE_CONTAINER::Display_Infos( WinEDA_DrawFrame* frame )
EQUIPOT
*
equipot
=
(
(
WinEDA_PcbFrame
*
)
frame
)
->
m_Pcb
->
FindNet
(
GetNet
()
);
if
(
equipot
)
msg
=
equipot
->
m_Netname
;
msg
=
equipot
->
GetNetname
()
;
else
msg
=
wxT
(
"<noname>"
);
}
...
...
@@ -1047,7 +1047,7 @@ bool ZONE_CONTAINER::SetNetNameFromNetCode( void )
EQUIPOT
*
net
;
if
(
m_Parent
&&
(
net
=
((
BOARD
*
)
m_Parent
)
->
FindNet
(
GetNet
())
)
)
{
m_Netname
=
net
->
m_Netname
;
m_Netname
=
net
->
GetNetname
()
;
return
true
;
}
...
...
pcbnew/dialog_copper_zones.cpp
View file @
6d856f60
...
...
@@ -195,7 +195,7 @@ void dialog_copper_zone::OnInitDialog( wxInitDialogEvent& event )
{
for
(
unsigned
ii
=
0
;
ii
<
ListNetName
.
GetCount
();
ii
++
)
{
if
(
ListNetName
[
ii
]
==
equipot
->
m_Netname
)
if
(
ListNetName
[
ii
]
==
equipot
->
GetNetname
()
)
{
m_ListNetNameSelection
->
SetSelection
(
ii
);
m_ListNetNameSelection
->
EnsureVisible
(
ii
);
...
...
@@ -340,7 +340,7 @@ bool dialog_copper_zone::AcceptOptions( bool aPromptForErrors, bool aUseExportab
g_Zone_Default_Setting
.
m_NetcodeSelection
=
0
;
for
(
net
=
m_Parent
->
m_Pcb
->
m_Equipots
;
net
;
net
=
net
->
Next
()
)
{
if
(
net
->
m_Netname
==
net_name
)
if
(
net
->
GetNetname
()
==
net_name
)
{
g_Zone_Default_Setting
.
m_NetcodeSelection
=
net
->
GetNet
();
break
;
...
...
@@ -392,7 +392,7 @@ void dialog_copper_zone::OnNetSortingOptionSelected( wxCommandEvent& event )
{
for
(
unsigned
ii
=
0
;
ii
<
ListNetName
.
GetCount
();
ii
++
)
{
if
(
ListNetName
[
ii
]
==
equipot
->
m_Netname
)
if
(
ListNetName
[
ii
]
==
equipot
->
GetNetname
()
)
{
m_ListNetNameSelection
->
SetSelection
(
ii
);
m_ListNetNameSelection
->
EnsureVisible
(
ii
);
...
...
pcbnew/dialog_pad_properties.cpp
View file @
6d856f60
...
...
@@ -84,7 +84,7 @@ DialogPadProperties::DialogPadProperties( WinEDA_BasePcbFrame* parent, D_PAD* Pa
if
(
m_CurrentPad
)
{
Current_PadNetName
=
m_CurrentPad
->
m_Netname
;
Current_PadNetName
=
m_CurrentPad
->
GetNetname
()
;
g_Current_PadName
=
m_CurrentPad
->
ReturnStringPadName
();
}
}
...
...
@@ -511,7 +511,7 @@ void DialogPadProperties::PadPropertiesAccept( wxCommandEvent& event )
}
m_CurrentPad
->
SetPadName
(
g_Current_PadName
);
if
(
m_CurrentPad
->
m_Netname
!=
Current_PadNetName
)
if
(
m_CurrentPad
->
GetNetname
()
!=
Current_PadNetName
)
{
if
(
Current_PadNetName
.
IsEmpty
()
)
m_CurrentPad
->
SetNet
(
0
);
...
...
@@ -521,7 +521,7 @@ void DialogPadProperties::PadPropertiesAccept( wxCommandEvent& event )
if
(
net
)
{
RastnestIsChanged
=
true
;
m_CurrentPad
->
m_Netname
=
Current_PadNetName
;
m_CurrentPad
->
SetNetname
(
Current_PadNetName
)
;
m_CurrentPad
->
SetNet
(
net
->
GetNet
()
);
}
else
...
...
pcbnew/export_gencad.cpp
View file @
6d856f60
...
...
@@ -442,15 +442,16 @@ void CreateSignalsSection( FILE* file, BOARD* pcb )
for
(
equipot
=
pcb
->
m_Equipots
;
equipot
!=
NULL
;
equipot
=
equipot
->
Next
()
)
{
if
(
equipot
->
m_Netname
==
wxEmptyString
)
// dummy equipot (non connexion)
if
(
equipot
->
GetNetname
()
==
wxEmptyString
)
// dummy equipot (non connexion)
{
equipot
->
m_Netname
<<
wxT
(
"NoConnection"
)
<<
NbNoConn
++
;
wxString
msg
;
msg
<<
wxT
(
"NoConnection"
)
<<
NbNoConn
++
;
equipot
->
SetNetname
(
msg
);
;
}
if
(
equipot
->
GetNet
()
<=
0
)
// dummy equipot (non connexion)
continue
;
msg
=
wxT
(
"
\n
SIGNAL "
)
+
equipot
->
m_Netname
;
msg
=
wxT
(
"
\n
SIGNAL "
)
+
equipot
->
GetNetname
()
;
fputs
(
CONV_TO_UTF8
(
msg
),
file
);
fputs
(
"
\n
"
,
file
);
...
...
@@ -587,8 +588,8 @@ void CreateRoutesSection( FILE* file, BOARD* pcb )
old_netcode
=
track
->
GetNet
();
EQUIPOT
*
equipot
=
pcb
->
FindNet
(
track
->
GetNet
()
);
wxString
netname
;
if
(
equipot
&&
(
equipot
->
m_Netname
!=
wxEmptyString
)
)
netname
=
equipot
->
m_Netname
;
if
(
equipot
&&
(
equipot
->
GetNetname
()
!=
wxEmptyString
)
)
netname
=
equipot
->
GetNetname
()
;
else
netname
=
wxT
(
"_noname_"
);
fprintf
(
file
,
"
\n
ROUTE %s
\n
"
,
CONV_TO_UTF8
(
netname
)
);
...
...
@@ -649,7 +650,7 @@ void CreateDevicesSection( FILE* file, BOARD* pcb )
for
(
pad
=
module
->
m_Pads
;
pad
!=
NULL
;
pad
=
pad
->
Next
()
)
{
fprintf
(
file
,
"PINDESCR %.4s"
,
pad
->
m_Padname
);
if
(
pad
->
m_Netname
==
wxEmptyString
)
if
(
pad
->
GetNetname
()
==
wxEmptyString
)
fputs
(
" NoConn
\n
"
,
file
);
else
fprintf
(
file
,
" %.4s
\n
"
,
pad
->
m_Padname
);
...
...
pcbnew/ioascii.cpp
View file @
6d856f60
...
...
@@ -808,7 +808,7 @@ int WinEDA_PcbFrame::ReadPcbFile( FILE* File, bool Append )
{
EQUIPOT
*
Equipot
=
new
EQUIPOT
(
m_Pcb
);
m_Pcb
->
m_Equipots
.
PushBack
(
Equipot
);
Equipot
->
Read
Equipot
Descr
(
File
,
&
LineNum
);
Equipot
->
ReadDescr
(
File
,
&
LineNum
);
continue
;
}
...
...
pcbnew/makefile.include
View file @
6d856f60
...
...
@@ -49,6 +49,7 @@ OBJECTS= $(TARGET).o classpcb.o\
class_mire.o
\
class_cotation.o
\
class_pad.o
\
class_pad_draw_functions.o
\
class_equipot.o
\
class_module.o
\
class_edge_mod.o
\
...
...
pcbnew/move-drag_pads.cpp
View file @
6d856f60
...
...
@@ -206,7 +206,7 @@ void WinEDA_BasePcbFrame::AddPad( MODULE* Module, bool draw )
/* Mise a jour des caract de la pastille : */
Import_Pad_Settings
(
Pad
,
false
);
Pad
->
m_Netname
.
Empty
(
);
Pad
->
SetNetname
(
wxEmptyString
);
Pad
->
m_Pos
=
GetScreen
()
->
m_Curseur
;
...
...
pcbnew/netlist.cpp
View file @
6d856f60
...
...
@@ -296,7 +296,7 @@ void ReadPcbNetlist( WinEDA_PcbFrame* aFrame,
PtPad
=
Module
->
m_Pads
;
for
(
;
PtPad
!=
NULL
;
PtPad
=
(
D_PAD
*
)
PtPad
->
Next
()
)
{
PtPad
->
m_Netname
=
wxEmptyString
;
PtPad
->
SetNetname
(
wxEmptyString
)
;
}
}
continue
;
...
...
@@ -597,9 +597,9 @@ int SetPadNetName( wxWindow* frame, char* Text, MODULE* Module )
{
/* trouve */
trouve
=
TRUE
;
if
(
*
TextNetName
!=
'?'
)
pad
->
m_Netname
=
CONV_FROM_UTF8
(
TextNetName
);
pad
->
SetNetname
(
CONV_FROM_UTF8
(
TextNetName
)
);
else
pad
->
m_Netname
.
Empty
(
);
pad
->
SetNetname
(
wxEmptyString
);
}
}
...
...
pcbnew/ratsnest.cpp
View file @
6d856f60
...
...
@@ -880,7 +880,7 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code()
pad_courant
=
&
m_Pcb
->
m_Pads
[
0
];
for
(
;
ii
>
0
;
pad_courant
++
,
ii
--
)
{
if
(
(
*
pad_courant
)
->
m_Netname
.
IsEmpty
()
)
// pad not connected
if
(
(
*
pad_courant
)
->
GetNetname
()
.
IsEmpty
()
)
// pad not connected
{
(
*
pad_courant
)
->
SetNet
(
0
);
continue
;
...
...
@@ -892,7 +892,7 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code()
pad_ref
=
&
m_Pcb
->
m_Pads
[
0
];
while
(
pad_ref
<
pad_courant
)
{
if
(
(
*
pad_ref
)
->
m_Netname
==
(
*
pad_courant
)
->
m_Netname
)
if
(
(
*
pad_ref
)
->
GetNetname
()
==
(
*
pad_courant
)
->
GetNetname
()
)
break
;
// sont du meme met
pad_ref
++
;
...
...
@@ -926,7 +926,7 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code()
// Set the net_code for this equipot and reset other values
equipot
->
SetNet
(
ii
);
equipot
->
m_NbNodes
=
0
;
equipot
->
m_Netname
.
Empty
(
);
equipot
->
SetNetname
(
wxEmptyString
);
BufPtEquipot
[
ii
]
=
equipot
;
}
...
...
@@ -950,9 +950,9 @@ void WinEDA_BasePcbFrame::recalcule_pad_net_code()
equipot
=
BufPtEquipot
[
net
];
equipot
->
m_NbNodes
++
;
if
(
equipot
->
m_Netname
.
IsEmpty
()
)
if
(
equipot
->
GetNetname
()
.
IsEmpty
()
)
{
equipot
->
m_Netname
=
(
*
pad_courant
)
->
m_Netname
;
equipot
->
SetNetname
((
*
pad_courant
)
->
GetNetname
())
;
}
}
...
...
pcbnew/router.cpp
View file @
6d856f60
...
...
@@ -189,7 +189,7 @@ void Out_Pads( BOARD* Pcb, FILE* outfile )
wxString
Line
;
EQUIPOT
*
equipot
=
Pcb
->
FindNet
(
netcode
);
Line
.
Printf
(
wxT
(
"Warning: %d pad, net %s"
),
nb_pads
,
equipot
->
m_Netname
.
GetData
()
);
nb_pads
,
equipot
->
GetNetname
()
.
GetData
()
);
DisplayError
(
NULL
,
Line
,
20
);
}
fprintf
(
outfile
,
"r %d %d %d %d %d %d 1 1
\n
"
,
...
...
pcbnew/solve.cpp
View file @
6d856f60
...
...
@@ -245,7 +245,7 @@ int WinEDA_PcbFrame::Solve( wxDC* DC, int two_sides )
pt_equipot
=
m_Pcb
->
FindNet
(
current_net_code
);
if
(
pt_equipot
)
{
msg
.
Printf
(
wxT
(
"[%8.8s]"
),
pt_equipot
->
m_Netname
.
GetData
()
);
msg
.
Printf
(
wxT
(
"[%8.8s]"
),
pt_equipot
->
GetNetname
()
.
GetData
()
);
Affiche_1_Parametre
(
this
,
1
,
wxT
(
"Net route"
),
msg
,
BROWN
);
msg
.
Printf
(
wxT
(
"%d / %d"
),
Ncurrent
,
Ntotal
);
Affiche_1_Parametre
(
this
,
12
,
wxT
(
"Activity"
),
msg
,
BROWN
);
...
...
pcbnew/specctra_export.cpp
View file @
6d856f60
...
...
@@ -1076,7 +1076,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
{
int
netcode
=
equipot
->
GetNet
();
if
(
netcode
>
0
)
nets
[
netcode
]
->
net_id
=
CONV_TO_UTF8
(
equipot
->
m_Netname
);
nets
[
netcode
]
->
net_id
=
CONV_TO_UTF8
(
equipot
->
GetNetname
()
);
}
items
.
Collect
(
aBoard
,
scanMODULEs
);
...
...
@@ -1253,7 +1253,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
old_netcode
=
netcode
;
EQUIPOT
*
equipot
=
aBoard
->
FindNet
(
netcode
);
wxASSERT
(
equipot
);
netname
=
CONV_TO_UTF8
(
equipot
->
m_Netname
);
netname
=
CONV_TO_UTF8
(
equipot
->
GetNetname
()
);
}
WIRE
*
wire
=
new
WIRE
(
wiring
);
...
...
@@ -1315,7 +1315,7 @@ void SPECCTRA_DB::FromBOARD( BOARD* aBoard ) throw( IOError )
EQUIPOT
*
equipot
=
aBoard
->
FindNet
(
netcode
);
wxASSERT
(
equipot
);
dsnVia
->
net_id
=
CONV_TO_UTF8
(
equipot
->
m_Netname
);
dsnVia
->
net_id
=
CONV_TO_UTF8
(
equipot
->
GetNetname
()
);
dsnVia
->
via_type
=
T_protect
;
// @todo, this should be configurable
}
...
...
pcbnew/surbrill.cpp
View file @
6d856f60
...
...
@@ -45,11 +45,11 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
{
wxString
Line
;
/* calcul adr relative du nom de la pastille reference de la piste */
if
(
!
WildCompareString
(
msg
,
Equipot
->
m_Netname
,
FALSE
)
)
if
(
!
WildCompareString
(
msg
,
Equipot
->
GetNetname
()
,
FALSE
)
)
continue
;
Line
.
Printf
(
wxT
(
"net_code = %3.3d [%.16s] "
),
Equipot
->
GetNet
(),
Equipot
->
m_Netname
.
GetData
()
);
Equipot
->
GetNetname
()
.
GetData
()
);
List
->
Append
(
Line
);
}
...
...
@@ -65,7 +65,7 @@ void WinEDA_PcbFrame::Liste_Equipot( wxCommandEvent& event )
for
(
jj
=
0
;
Equipot
!=
NULL
;
Equipot
=
(
EQUIPOT
*
)
Equipot
->
Next
()
)
{
/* calcul adr relative du nom de la pastille reference de la piste */
if
(
!
WildCompareString
(
msg
,
Equipot
->
m_Netname
,
FALSE
)
)
if
(
!
WildCompareString
(
msg
,
Equipot
->
GetNetname
()
,
FALSE
)
)
continue
;
if
(
ii
==
jj
)
...
...
pcbnew/tracepcb.cpp
View file @
6d856f60
...
...
@@ -190,6 +190,13 @@ void BOARD::Draw( WinEDA_DrawPanel* aPanel, wxDC* DC,
{
m_markers
[
i
]
->
Draw
(
aPanel
,
DC
,
aDrawMode
);
}
// 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
);
}
}
pcbnew/xchgmod.cpp
View file @
6d856f60
...
...
@@ -516,7 +516,7 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff,
*/
{
wxPoint
oldpos
;
/* memorisation temporaire pos curseur */
D_PAD
*
p
t_pad
,
*
pt_
old_pad
;
D_PAD
*
p
ad
,
*
old_pad
;
if
(
(
OldModule
->
Type
()
!=
TYPE_MODULE
)
||
(
NewModule
->
Type
()
!=
TYPE_MODULE
)
)
...
...
@@ -553,19 +553,19 @@ MODULE* WinEDA_BasePcbFrame::Exchange_Module( wxWindow* winaff,
NewModule
->
m_Path
=
OldModule
->
m_Path
;
/* mise a jour des netnames ( lorsque c'est possible) */
p
t_p
ad
=
NewModule
->
m_Pads
;
for
(
;
p
t_pad
!=
NULL
;
pt_pad
=
pt_
pad
->
Next
()
)
pad
=
NewModule
->
m_Pads
;
for
(
;
p
ad
!=
NULL
;
pad
=
pad
->
Next
()
)
{
p
t_pad
->
m_Netname
=
wxEmptyString
;
p
t_p
ad
->
SetNet
(
0
);
pt_
old_pad
=
OldModule
->
m_Pads
;
for
(
;
pt_old_pad
!=
NULL
;
pt_old_pad
=
pt_
old_pad
->
Next
()
)
p
ad
->
SetNetname
(
wxEmptyString
)
;
pad
->
SetNet
(
0
);
old_pad
=
OldModule
->
m_Pads
;
for
(
;
old_pad
!=
NULL
;
old_pad
=
old_pad
->
Next
()
)
{
if
(
strnicmp
(
p
t_pad
->
m_Padname
,
pt_
old_pad
->
m_Padname
,
sizeof
(
p
t_p
ad
->
m_Padname
)
)
==
0
)
if
(
strnicmp
(
p
ad
->
m_Padname
,
old_pad
->
m_Padname
,
sizeof
(
pad
->
m_Padname
)
)
==
0
)
{
p
t_pad
->
m_Netname
=
pt_old_pad
->
m_Netname
;
p
t_pad
->
SetNet
(
pt_
old_pad
->
GetNet
()
);
p
ad
->
SetNetname
(
old_pad
->
GetNetname
()
)
;
p
ad
->
SetNet
(
old_pad
->
GetNet
()
);
}
}
}
...
...
pcbnew/zones_by_polygon.cpp
View file @
6d856f60
...
...
@@ -801,7 +801,7 @@ void WinEDA_PcbFrame::Edit_Zone_Params( wxDC* DC, ZONE_CONTAINER* zone_container
g_Zone_Default_Setting
.
ExportSetting
(
*
zone_container
);
EQUIPOT
*
net
=
m_Pcb
->
FindNet
(
g_Zone_Default_Setting
.
m_NetcodeSelection
);
if
(
net
)
// net === NULL should not occur
zone_container
->
m_Netname
=
net
->
m_Netname
;
zone_container
->
m_Netname
=
net
->
GetNetname
()
;
// Combine zones if possible :
...
...
@@ -897,7 +897,7 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v
}
}
else
msg
=
net
->
m_Netname
;
msg
=
net
->
GetNetname
()
;
}
else
msg
=
_
(
"No Net"
);
...
...
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