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
1f842ae1
Commit
1f842ae1
authored
Oct 07, 2007
by
CHARRAS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug in move pad fixed (could crash pcbnew).Other minor changes
parent
88ef06ef
Changes
50
Show whitespace changes
Inline
Side-by-side
Showing
50 changed files
with
396 additions
and
267 deletions
+396
-267
3d_draw.cpp
3d-viewer/3d_draw.cpp
+19
-19
change_log.txt
change_log.txt
+15
-0
cvstruct.h
cvpcb/cvstruct.h
+1
-1
displayframe.cpp
cvpcb/displayframe.cpp
+8
-1
controle.cpp
eeschema/controle.cpp
+3
-91
cross-probing.cpp
eeschema/cross-probing.cpp
+142
-0
libedit_onrightclick.cpp
eeschema/libedit_onrightclick.cpp
+4
-3
makefile.include
eeschema/makefile.include
+1
-0
onrightclick.cpp
eeschema/onrightclick.cpp
+4
-3
viewlibs.cpp
eeschema/viewlibs.cpp
+2
-1
onrightclick.cpp
gerbview/onrightclick.cpp
+4
-3
drawpanel_wxstruct.h
include/drawpanel_wxstruct.h
+1
-1
pcbstruct.h
include/pcbstruct.h
+3
-5
wxstruct.h
include/wxstruct.h
+13
-10
autoplac.cpp
pcbnew/autoplac.cpp
+4
-4
autorout.cpp
pcbnew/autorout.cpp
+10
-3
basepcbframe.cpp
pcbnew/basepcbframe.cpp
+36
-32
block.cpp
pcbnew/block.cpp
+1
-1
class_board.cpp
pcbnew/class_board.cpp
+1
-1
class_module.cpp
pcbnew/class_module.cpp
+1
-1
class_pcb_text.cpp
pcbnew/class_pcb_text.cpp
+2
-2
class_text_mod.cpp
pcbnew/class_text_mod.cpp
+4
-4
class_track.cpp
pcbnew/class_track.cpp
+3
-3
classpcb.cpp
pcbnew/classpcb.cpp
+2
-2
classtrc.cpp.notused
pcbnew/classtrc.cpp.notused
+1
-1
collectors.cpp
pcbnew/collectors.cpp
+2
-2
controle.cpp
pcbnew/controle.cpp
+13
-3
cross-probing.cpp
pcbnew/cross-probing.cpp
+3
-3
dialog_edit_module.cpp
pcbnew/dialog_edit_module.cpp
+2
-2
edgemod.cpp
pcbnew/edgemod.cpp
+3
-3
edit.cpp
pcbnew/edit.cpp
+6
-2
editrack-part2.cpp
pcbnew/editrack-part2.cpp
+1
-1
export_gencad.cpp
pcbnew/export_gencad.cpp
+1
-1
gen_modules_placefile.cpp
pcbnew/gen_modules_placefile.cpp
+3
-3
hotkeys.cpp
pcbnew/hotkeys.cpp
+6
-6
lay2plot.cpp
pcbnew/lay2plot.cpp
+1
-1
locate.cpp
pcbnew/locate.cpp
+3
-3
modedit_onclick.cpp
pcbnew/modedit_onclick.cpp
+4
-2
modules.cpp
pcbnew/modules.cpp
+9
-9
move-drag_pads.cpp
pcbnew/move-drag_pads.cpp
+5
-2
onrightclick.cpp
pcbnew/onrightclick.cpp
+32
-19
pcbnew.h
pcbnew/pcbnew.h
+1
-1
pcbtexte.cpp
pcbnew/pcbtexte.cpp
+1
-1
plotgerb.cpp
pcbnew/plotgerb.cpp
+1
-1
plothpgl.cpp
pcbnew/plothpgl.cpp
+1
-1
plotps.cpp
pcbnew/plotps.cpp
+1
-1
router.cpp
pcbnew/router.cpp
+2
-2
set_color.cpp
pcbnew/set_color.cpp
+2
-2
tracepcb.cpp
pcbnew/tracepcb.cpp
+1
-1
drawpanel.cpp
share/drawpanel.cpp
+7
-3
No files found.
3d-viewer/3d_draw.cpp
View file @
1f842ae1
...
...
@@ -150,7 +150,7 @@ glEnable(GL_FOG);
glVertex3f( sx, -sy , zpos);
glEnd();
glBegin(GL_QUADS);
SetGLColor(g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[C
UIVRE
_N]);
SetGLColor(g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[C
OPPER_LAYER
_N]);
glNormal3f( 0.0, 0.0, -1.0); // Normal is -Z axis
glVertex3f( -sx, -sy , 0);
glVertex3f( -sx, sy , 0);
...
...
@@ -213,7 +213,7 @@ double w;
zpos
=
g_Parm_3D_Visu
.
m_LayerZcoord
[
layer
];
SetGLColor
(
color
);
glNormal3f
(
0.0
,
0.0
,
(
layer
==
C
UIVRE
_N
)
?
-
1.0
:
1.0
);
glNormal3f
(
0.0
,
0.0
,
(
layer
==
C
OPPER_LAYER
_N
)
?
-
1.0
:
1.0
);
w
=
track
->
m_Width
*
g_Parm_3D_Visu
.
m_BoardScale
;
ox
=
track
->
m_Start
.
x
*
g_Parm_3D_Visu
.
m_BoardScale
;
...
...
@@ -250,7 +250,7 @@ int color;
else
color
=
g_Parm_3D_Visu
.
m_BoardSettings
->
m_LayerColor
[
CMP_N
];
if
(
color
&
ITEM_NOT_SHOW
)
continue
;
SetGLColor
(
color
);
glNormal3f
(
0.0
,
0.0
,
(
layer
==
C
UIVRE
_N
)
?
-
1.0
:
1.0
);
glNormal3f
(
0.0
,
0.0
,
(
layer
==
C
OPPER_LAYER
_N
)
?
-
1.0
:
1.0
);
Draw3D_FilledCircle
(
x
,
-
y
,
r
,
hole
,
zpos
);
if
(
layer
>=
top_layer
)
break
;
...
...
@@ -284,7 +284,7 @@ int color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[segment->GetLayer()];
{
for
(
layer
=
0
;
layer
<
g_Parm_3D_Visu
.
m_Layers
;
layer
++
)
{
glNormal3f
(
0.0
,
0.0
,
(
layer
==
C
UIVRE
_N
)
?
-
1.0
:
1.0
);
glNormal3f
(
0.0
,
0.0
,
(
layer
==
C
OPPER_LAYER
_N
)
?
-
1.0
:
1.0
);
zpos
=
g_Parm_3D_Visu
.
m_LayerZcoord
[
layer
];
Draw3D_FilledSegment
(
x
,
-
y
,
xf
,
-
yf
,
w
,
zpos
);
}
...
...
@@ -312,7 +312,7 @@ D_PAD * pad = m_Pads;
}
if( ! DisplayOpt.Show_Modules_Cu )
{
if(m_Layer == C
UIVRE
_N) return;
if(m_Layer == C
OPPER_LAYER
_N) return;
}
#endif
...
...
@@ -335,7 +335,7 @@ bool As3dShape = FALSE;
{
glRotatef
(
(
double
)
m_Orient
/
10
,
0.0
,
0.0
,
1.0
);
}
if
(
m_Layer
==
C
UIVRE
_N
)
if
(
m_Layer
==
C
OPPER_LAYER
_N
)
{
glRotatef
(
180.0
,
0.0
,
1.0
,
0.0
);
glRotatef
(
180.0
,
0.0
,
0.0
,
1.0
);
...
...
@@ -384,7 +384,7 @@ int color = g_Parm_3D_Visu.m_BoardSettings->m_LayerColor[m_Layer];
if
(
color
&
ITEM_NOT_SHOW
)
return
;
SetGLColor
(
color
);
glNormal3f
(
0.0
,
0.0
,
(
m_Layer
==
C
UIVRE
_N
)
?
-
1.0
:
1.0
);
glNormal3f
(
0.0
,
0.0
,
(
m_Layer
==
C
OPPER_LAYER
_N
)
?
-
1.0
:
1.0
);
scale
=
g_Parm_3D_Visu
.
m_BoardScale
;
ux0
=
m_Start
.
x
;
...
...
@@ -477,16 +477,16 @@ int color;
x
=
xc
*
scale
;
y
=
yc
*
scale
;
r
=
(
double
)
dx
*
scale
;
for
(
layer
=
C
UIVRE
_N
;
layer
<=
CMP_N
;
layer
++
)
for
(
layer
=
C
OPPER_LAYER
_N
;
layer
<=
CMP_N
;
layer
++
)
{
if
(
layer
&&
(
layer
==
nlmax
)
)
layer
=
CMP_N
;
if
(
(
layer
==
CMP_N
)
&&
!
Oncmp
)
continue
;
if
(
(
layer
==
C
UIVRE
_N
)
&&
!
Oncu
)
continue
;
if
(
(
layer
>
C
UIVRE
_N
)
&&
(
layer
<
CMP_N
)
&&
!
Both
)
continue
;
if
(
(
layer
==
C
OPPER_LAYER
_N
)
&&
!
Oncu
)
continue
;
if
(
(
layer
>
C
OPPER_LAYER
_N
)
&&
(
layer
<
CMP_N
)
&&
!
Both
)
continue
;
color
=
g_Parm_3D_Visu
.
m_BoardSettings
->
m_LayerColor
[
layer
];
if
(
color
&
ITEM_NOT_SHOW
)
continue
;
SetGLColor
(
color
);
glNormal3f
(
0.0
,
0.0
,
(
layer
==
C
UIVRE
_N
)
?
-
1.0
:
1.0
);
glNormal3f
(
0.0
,
0.0
,
(
layer
==
C
OPPER_LAYER
_N
)
?
-
1.0
:
1.0
);
zpos
=
g_Parm_3D_Visu
.
m_LayerZcoord
[
layer
];
Draw3D_FilledCircle
(
x
,
-
y
,
r
,
hole
,
zpos
);
}
...
...
@@ -513,14 +513,14 @@ int color;
oy
=
(
double
)(
uy0
+
delta_cy
)
*
scale
;
fx
=
(
double
)(
ux0
-
delta_cx
)
*
scale
;
fy
=
(
double
)(
uy0
-
delta_cy
)
*
scale
;
for
(
layer
=
C
UIVRE
_N
;
layer
<=
CMP_N
;
layer
++
)
for
(
layer
=
C
OPPER_LAYER
_N
;
layer
<=
CMP_N
;
layer
++
)
{
if
(
layer
&&
(
layer
==
nlmax
)
)
layer
=
CMP_N
;
if
(
(
layer
==
CMP_N
)
&&
!
Oncmp
)
continue
;
if
(
(
layer
==
C
UIVRE
_N
)
&&
!
Oncu
)
continue
;
if
(
(
layer
>
C
UIVRE
_N
)
&&
(
layer
<
CMP_N
)
&&
!
Both
)
continue
;
if
(
(
layer
==
C
OPPER_LAYER
_N
)
&&
!
Oncu
)
continue
;
if
(
(
layer
>
C
OPPER_LAYER
_N
)
&&
(
layer
<
CMP_N
)
&&
!
Both
)
continue
;
color
=
g_Parm_3D_Visu
.
m_BoardSettings
->
m_LayerColor
[
layer
];
glNormal3f
(
0.0
,
0.0
,
(
layer
==
C
UIVRE
_N
)
?
-
1.0
:
1.0
);
glNormal3f
(
0.0
,
0.0
,
(
layer
==
C
OPPER_LAYER
_N
)
?
-
1.0
:
1.0
);
if
(
color
&
ITEM_NOT_SHOW
)
continue
;
SetGLColor
(
color
);
zpos
=
g_Parm_3D_Visu
.
m_LayerZcoord
[
layer
];
...
...
@@ -574,14 +574,14 @@ int color;
f_hole_coord
[
ii
][
1
]
+=
drilly
;
}
for
(
layer
=
C
UIVRE
_N
;
layer
<=
CMP_N
;
layer
++
)
for
(
layer
=
C
OPPER_LAYER
_N
;
layer
<=
CMP_N
;
layer
++
)
{
if
(
layer
&&
(
layer
==
nlmax
)
)
layer
=
CMP_N
;
if
(
(
layer
==
CMP_N
)
&&
!
Oncmp
)
continue
;
if
(
(
layer
==
C
UIVRE
_N
)
&&
!
Oncu
)
continue
;
if
(
(
layer
>
C
UIVRE
_N
)
&&
(
layer
<
CMP_N
)
&&
!
Both
)
continue
;
if
(
(
layer
==
C
OPPER_LAYER
_N
)
&&
!
Oncu
)
continue
;
if
(
(
layer
>
C
OPPER_LAYER
_N
)
&&
(
layer
<
CMP_N
)
&&
!
Both
)
continue
;
color
=
g_Parm_3D_Visu
.
m_BoardSettings
->
m_LayerColor
[
layer
];
glNormal3f
(
0.0
,
0.0
,
(
layer
==
C
UIVRE
_N
)
?
-
1.0
:
1.0
);
glNormal3f
(
0.0
,
0.0
,
(
layer
==
C
OPPER_LAYER
_N
)
?
-
1.0
:
1.0
);
if
(
color
&
ITEM_NOT_SHOW
)
continue
;
SetGLColor
(
color
);
zpos
=
g_Parm_3D_Visu
.
m_LayerZcoord
[
layer
];
...
...
change_log.txt
View file @
1f842ae1
...
...
@@ -4,6 +4,21 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-Oct-7 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+ eeschema
create new file cross-probing.cpp
move RemoteCommand() to cross-probing.cpp and create SendMessageToPCBNEW()
+ pcbnew
bug in move pad fixed (could crash pcbnew)
Small change in selection clarification (side effect removed):
- Escape or click on title does not show the next popup menu.
- the title is displayed under linux
- definition CUIVRE_N translated into COPPER_LAYER_N
2007-Oct-07 UPDATE Geoff Harland <gharlandau@yahoo.com.au>
================================================================================
+ all
...
...
cvpcb/cvstruct.h
View file @
1f842ae1
...
...
@@ -192,7 +192,7 @@ public:
void
RecreateMenuBar
();
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
bool
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
void
SetToolbars
();
void
InstallOptionsDisplay
(
wxCommandEvent
&
event
);
MODULE
*
Get_Module
(
const
wxString
&
CmpName
);
...
...
cvpcb/displayframe.cpp
View file @
1f842ae1
...
...
@@ -144,18 +144,25 @@ void WinEDA_DisplayFrame::SetToolbars()
}
/*************************************************************************/
void
WinEDA_DisplayFrame
::
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
/*************************************************************************/
{
}
/*************************************************************************/
void
WinEDA_DisplayFrame
::
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
/*************************************************************************/
{
}
void
WinEDA_DisplayFrame
::
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
/*********************************************************************************/
bool
WinEDA_DisplayFrame
::
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
/*********************************************************************************/
{
return
true
;
}
...
...
eeschema/controle.cpp
View file @
1f842ae1
...
...
@@ -17,79 +17,6 @@
#include "protos.h"
/* Routines locales */
/* variables externes */
/***************************************************************/
void
RemoteCommand
(
const
char
*
cmdline
)
/***************************************************************/
/** Read a remote command sent by pcbnew (via a socket connection) , so when user selects a module
* or pin in pcbnew, eeschema shows that same component or pin.
* The cursor is put on the item
* @param cmdline = received command from pcbnew
* commands are:
* $PART: "reference" put cursor on component
* $PART: "reference" $REF: "ref" put cursor on reference component
* $PART: "reference" $VAL: "value" put cursor on value component
* $PART: "reference" $PAD: "pin name" put cursor on the component pin
*/
{
char
line
[
1024
];
char
*
idcmd
;
char
*
text
;
WinEDA_SchematicFrame
*
frame
=
EDA_Appl
->
m_SchematicFrame
;
wxString
part_ref
,
msg
;
strncpy
(
line
,
cmdline
,
sizeof
(
line
)
-
1
);
idcmd
=
strtok
(
line
,
"
\n\r
"
);
text
=
strtok
(
NULL
,
"
\"\n\r
"
);
if
(
(
idcmd
==
NULL
)
||
(
text
==
NULL
)
)
return
;
if
(
strcmp
(
idcmd
,
"$PART:"
)
!=
0
)
return
;
part_ref
=
CONV_FROM_UTF8
(
text
);
/* look for a complement */
idcmd
=
strtok
(
NULL
,
"
\n\r
"
);
if
(
idcmd
==
NULL
)
// component only
{
frame
->
FindComponentAndItem
(
part_ref
,
true
,
0
,
wxEmptyString
,
false
);
return
;
}
text
=
strtok
(
NULL
,
"
\"\n\r
"
);
if
(
text
==
NULL
)
return
;
msg
=
CONV_FROM_UTF8
(
text
);
if
(
strcmp
(
idcmd
,
"$REF:"
)
==
0
)
{
frame
->
FindComponentAndItem
(
part_ref
,
true
,
2
,
msg
,
false
);
}
else
if
(
strcmp
(
idcmd
,
"$VAL:"
)
==
0
)
{
frame
->
FindComponentAndItem
(
part_ref
,
true
,
3
,
msg
,
false
);
}
else
if
(
strcmp
(
idcmd
,
"$PAD:"
)
==
0
)
{
frame
->
FindComponentAndItem
(
part_ref
,
true
,
1
,
msg
,
false
);
}
else
frame
->
FindComponentAndItem
(
part_ref
,
true
,
0
,
wxEmptyString
,
false
);
}
/**************************************************************/
EDA_BaseStruct
*
WinEDA_SchematicFrame
::
SchematicGeneralLocateAndDisplay
(
bool
IncludePin
)
...
...
@@ -114,7 +41,6 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
wxPoint
mouse_position
=
GetScreen
()
->
m_MousePosition
;
LibDrawPin
*
Pin
=
NULL
;
EDA_SchComponentStruct
*
LibItem
=
NULL
;
char
Line
[
1024
];
DrawStruct
=
SchematicGeneralLocateAndDisplay
(
mouse_position
,
IncludePin
);
if
(
!
DrawStruct
&&
(
mouse_position
!=
GetScreen
()
->
m_Curseur
)
)
...
...
@@ -128,21 +54,14 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
switch
(
DrawStruct
->
Type
()
)
{
case
COMPONENT_FIELD_DRAW_TYPE
:
{
PartTextStruct
*
Field
=
(
PartTextStruct
*
)
DrawStruct
;
LibItem
=
(
EDA_SchComponentStruct
*
)
Field
->
m_Parent
;
sprintf
(
Line
,
"$PART: %s"
,
CONV_TO_UTF8
(
LibItem
->
m_Field
[
REFERENCE
].
m_Text
)
);
SendCommand
(
MSG_TO_PCB
,
Line
);
}
SendMessageToPCBNEW
(
DrawStruct
);
break
;
case
DRAW_LIB_ITEM_STRUCT_TYPE
:
Pin
=
LocateAnyPin
(
m_CurrentScreen
->
EEDrawList
,
GetScreen
()
->
m_Curseur
,
&
LibItem
);
if
(
Pin
)
break
;
// Priority is probing a pin first
LibItem
=
(
EDA_SchComponentStruct
*
)
DrawStruct
;
sprintf
(
Line
,
"$PART: %s"
,
CONV_TO_UTF8
(
LibItem
->
m_Field
[
REFERENCE
].
m_Text
)
);
SendCommand
(
MSG_TO_PCB
,
Line
);
SendMessageToPCBNEW
(
DrawStruct
);
break
;
default
:
...
...
@@ -165,14 +84,7 @@ SchematicGeneralLocateAndDisplay( bool IncludePin )
CYAN
);
// Cross probing:2 - pin found, and send a locate pin command to pcbnew (hightlight net)
if
(
Pin
->
m_PinNum
)
{
wxString
pinnum
;
Pin
->
ReturnPinStringNum
(
pinnum
);
sprintf
(
Line
,
"$PIN: %s $PART: %s"
,
CONV_TO_UTF8
(
pinnum
),
CONV_TO_UTF8
(
LibItem
->
m_Field
[
REFERENCE
].
m_Text
)
);
SendCommand
(
MSG_TO_PCB
,
Line
);
}
SendMessageToPCBNEW
(
Pin
);
}
return
DrawStruct
;
}
...
...
eeschema/cross-probing.cpp
0 → 100644
View file @
1f842ae1
/*********************/
/* cross-probing.cpp */
/*********************/
#include "fctsys.h"
#include "common.h"
#include "program.h"
#include "libcmp.h"
#include "general.h"
#include "eda_dde.h"
#include "id.h"
#include "protos.h"
/***************************************************************/
void
RemoteCommand
(
const
char
*
cmdline
)
/***************************************************************/
/** Read a remote command sent by pcbnew (via a socket connection) ,
* so when user selects a module or pin in pcbnew,
* eeschema shows that same component or pin.
* The cursor is put on the item
* port KICAD_SCH_PORT_SERVICE_NUMBER (currently 4243)
* @param cmdline = received command from pcbnew
* commands are:
* $PART: "reference" put cursor on component
* $PART: "reference" $REF: "ref" put cursor on reference component
* $PART: "reference" $VAL: "value" put cursor on value component
* $PART: "reference" $PAD: "pin name" put cursor on the component pin
*/
{
char
line
[
1024
];
char
*
idcmd
;
char
*
text
;
WinEDA_SchematicFrame
*
frame
=
EDA_Appl
->
m_SchematicFrame
;
wxString
part_ref
,
msg
;
strncpy
(
line
,
cmdline
,
sizeof
(
line
)
-
1
);
idcmd
=
strtok
(
line
,
"
\n\r
"
);
text
=
strtok
(
NULL
,
"
\"\n\r
"
);
if
(
(
idcmd
==
NULL
)
||
(
text
==
NULL
)
)
return
;
if
(
strcmp
(
idcmd
,
"$PART:"
)
!=
0
)
return
;
part_ref
=
CONV_FROM_UTF8
(
text
);
/* look for a complement */
idcmd
=
strtok
(
NULL
,
"
\n\r
"
);
if
(
idcmd
==
NULL
)
// component only
{
frame
->
FindComponentAndItem
(
part_ref
,
true
,
0
,
wxEmptyString
,
false
);
return
;
}
text
=
strtok
(
NULL
,
"
\"\n\r
"
);
if
(
text
==
NULL
)
return
;
msg
=
CONV_FROM_UTF8
(
text
);
if
(
strcmp
(
idcmd
,
"$REF:"
)
==
0
)
{
frame
->
FindComponentAndItem
(
part_ref
,
true
,
2
,
msg
,
false
);
}
else
if
(
strcmp
(
idcmd
,
"$VAL:"
)
==
0
)
{
frame
->
FindComponentAndItem
(
part_ref
,
true
,
3
,
msg
,
false
);
}
else
if
(
strcmp
(
idcmd
,
"$PAD:"
)
==
0
)
{
frame
->
FindComponentAndItem
(
part_ref
,
true
,
1
,
msg
,
false
);
}
else
frame
->
FindComponentAndItem
(
part_ref
,
true
,
0
,
wxEmptyString
,
false
);
}
/*****************************************************************************/
void
WinEDA_SchematicFrame
::
SendMessageToPCBNEW
(
EDA_BaseStruct
*
objectToSync
)
/*****************************************************************************/
/** Send a remote command to eeschema via a socket,
* @param objectToSync = item to be located on board (footprint, pad or text)
* Commands are
* $PART: reference put cursor on footprint anchor
* $PIN: number $PART: reference put cursor on the footprint pad
*/
{
if
(
objectToSync
==
NULL
)
return
;
LibDrawPin
*
Pin
=
NULL
;
EDA_SchComponentStruct
*
LibItem
=
NULL
;
char
Line
[
1024
];
/* Cross probing to pcbnew if a pin or a component is found */
switch
(
objectToSync
->
Type
()
)
{
case
COMPONENT_FIELD_DRAW_TYPE
:
{
PartTextStruct
*
Field
=
(
PartTextStruct
*
)
objectToSync
;
LibItem
=
(
EDA_SchComponentStruct
*
)
Field
->
m_Parent
;
if
(
LibItem
==
NULL
)
break
;
sprintf
(
Line
,
"$PART: %s"
,
CONV_TO_UTF8
(
LibItem
->
m_Field
[
REFERENCE
].
m_Text
)
);
SendCommand
(
MSG_TO_PCB
,
Line
);
}
break
;
case
DRAW_LIB_ITEM_STRUCT_TYPE
:
LibItem
=
(
EDA_SchComponentStruct
*
)
objectToSync
;
sprintf
(
Line
,
"$PART: %s"
,
CONV_TO_UTF8
(
LibItem
->
m_Field
[
REFERENCE
].
m_Text
)
);
SendCommand
(
MSG_TO_PCB
,
Line
);
break
;
case
COMPONENT_PIN_DRAW_TYPE
:
Pin
=
(
LibDrawPin
*
)
objectToSync
;
LibItem
=
(
EDA_SchComponentStruct
*
)
Pin
->
m_Parent
;
if
(
LibItem
==
NULL
)
break
;
if
(
Pin
->
m_PinNum
)
{
wxString
pinnum
;
Pin
->
ReturnPinStringNum
(
pinnum
);
sprintf
(
Line
,
"$PIN: %s $PART: %s"
,
CONV_TO_UTF8
(
pinnum
),
CONV_TO_UTF8
(
LibItem
->
m_Field
[
REFERENCE
].
m_Text
)
);
}
else
sprintf
(
Line
,
"$PART: %s"
,
CONV_TO_UTF8
(
LibItem
->
m_Field
[
REFERENCE
].
m_Text
)
);
SendCommand
(
MSG_TO_PCB
,
Line
);
break
;
default
:
break
;
}
}
eeschema/libedit_onrightclick.cpp
View file @
1f842ae1
...
...
@@ -30,13 +30,13 @@ static void AddMenusForPin(wxMenu * PopMenu, LibDrawPin* Pin, WinEDA_LibeditFram
/********************************************************************************/
void
WinEDA_LibeditFrame
::
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
bool
WinEDA_LibeditFrame
::
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
/********************************************************************************/
{
LibEDA_BaseStruct
*
DrawEntry
=
CurrentDrawItem
;
bool
BlockActive
=
(
m_CurrentScreen
->
BlockLocate
.
m_Command
!=
BLOCK_IDLE
);
if
(
CurrentLibEntry
==
NULL
)
return
;
if
(
CurrentLibEntry
==
NULL
)
return
true
;
if
(
(
DrawEntry
==
NULL
)
||
(
DrawEntry
->
m_Flags
==
0
)
)
{
// Simple localisation des elements
...
...
@@ -86,7 +86,7 @@ bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE);
}
if
(
DrawEntry
)
DrawEntry
->
Display_Infos_DrawEntry
(
this
);
else
return
;
else
return
true
;
CurrentDrawItem
=
DrawEntry
;
...
...
@@ -208,6 +208,7 @@ bool BlockActive = (m_CurrentScreen->BlockLocate.m_Command != BLOCK_IDLE);
break
;
}
PopMenu
->
AppendSeparator
();
return
true
;
}
/**********************************************************************************/
...
...
eeschema/makefile.include
View file @
1f842ae1
...
...
@@ -17,6 +17,7 @@ OBJECTS = eeschema.o\
libedit_onrightclick.o
\
libedit_onleftclick.o
\
dangling_ends.o
\
cross-probing.o
\
setpage.o
\
cmpclass.o
\
class_hierarchy_sheet.o
\
...
...
eeschema/onrightclick.cpp
View file @
1f842ae1
...
...
@@ -77,7 +77,7 @@ void WinEDA_SchematicFrame::ToolOnRightClick( wxCommandEvent& event )
/*****************************************************************/
void
WinEDA_SchematicFrame
::
OnRightClick
(
const
wxPoint
&
MousePos
,
bool
WinEDA_SchematicFrame
::
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
/*****************************************************************/
...
...
@@ -96,7 +96,7 @@ void WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
{
AddMenusForBlock
(
PopMenu
,
this
);
PopMenu
->
AppendSeparator
();
return
;
return
true
;
}
// Simple localisation des elements si possible
...
...
@@ -142,7 +142,7 @@ void WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
ADD_MENUITEM
(
PopMenu
,
ID_POPUP_SCH_LEAVE_SHEET
,
_
(
"Leave Sheet"
),
leave_sheet_xpm
);
PopMenu
->
AppendSeparator
();
}
return
;
return
true
;
}
m_CurrentScreen
->
SetCurItem
(
DrawStruct
);
...
...
@@ -251,6 +251,7 @@ void WinEDA_SchematicFrame::OnRightClick( const wxPoint& MousePos,
}
PopMenu
->
AppendSeparator
();
return
true
;
}
...
...
eeschema/viewlibs.cpp
View file @
1f842ae1
...
...
@@ -99,9 +99,10 @@ void WinEDA_ViewlibFrame::OnLeftClick(wxDC * DC, const wxPoint& MousePos)
}
/********************************************************************************/
void
WinEDA_ViewlibFrame
::
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
bool
WinEDA_ViewlibFrame
::
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
/********************************************************************************/
{
return
true
;
}
...
...
gerbview/onrightclick.cpp
View file @
1f842ae1
...
...
@@ -13,7 +13,7 @@
#include "protos.h"
/********************************************************************************/
void
WinEDA_GerberFrame
::
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
bool
WinEDA_GerberFrame
::
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
/********************************************************************************/
/* Prepare le menu PullUp affich par un click sur le bouton droit
...
...
@@ -62,12 +62,12 @@ void WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu
}
if
(
BlockActive
)
return
;
return
true
;
PopMenu
->
Append
(
ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS
,
_
(
"Delete Dcode items"
)
);
if
(
DrawStruct
==
NULL
)
return
;
return
true
;
GetScreen
()
->
SetCurItem
(
DrawStruct
);
...
...
@@ -90,4 +90,5 @@ void WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu
}
PopMenu
->
AppendSeparator
();
return
true
;
}
include/drawpanel_wxstruct.h
View file @
1f842ae1
...
...
@@ -90,7 +90,7 @@ public:
wxSize
GetGrid
();
void
AddMenuZoom
(
wxMenu
*
MasterMenu
);
void
OnRightClick
(
wxMouseEvent
&
event
);
bool
OnRightClick
(
wxMouseEvent
&
event
);
void
Process_Popup_Zoom
(
wxCommandEvent
&
event
);
void
Process_Special_Functions
(
wxCommandEvent
&
event
);
wxPoint
CursorRealPosition
(
const
wxPoint
&
ScreenPos
);
...
...
include/pcbstruct.h
View file @
1f842ae1
...
...
@@ -34,10 +34,8 @@
#define CHAIN 0x01
/* segment marque */
/* Flags pour les couches cuivres */
/* numero des couches particulieres */
#define LAYER_CUIVRE_N 0
#define CUIVRE_N 0
/* Layer identification (layer number) */
#define COPPER_LAYER_N 0
#define LAYER_N_2 1
/* Numero layer 2 */
#define LAYER_N_3 2
/* Numero layer 3 */
#define LAYER_N_4 3
/* Numero layer 4 */
...
...
@@ -79,7 +77,7 @@
/*************************************/
/* constantes de gestion des couches */
/*************************************/
#define CUIVRE_LAYER (1<<
LAYER_CUIVRE
_N) ///< bit mask for copper layer
#define CUIVRE_LAYER (1<<
COPPER_LAYER
_N) ///< bit mask for copper layer
#define LAYER_2 (1<<LAYER_N_2) ///< bit mask for layer 2
#define LAYER_3 (1<<LAYER_N_3) ///< bit mask for layer 3
#define LAYER_4 (1<<LAYER_N_4) ///< bit mask for layer 4
...
...
include/wxstruct.h
View file @
1f842ae1
...
...
@@ -300,7 +300,7 @@ public:
virtual
void
Process_Special_Functions
(
wxCommandEvent
&
event
)
=
0
;
virtual
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
=
0
;
virtual
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
virtual
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
=
0
;
virtual
bool
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
=
0
;
virtual
void
ToolOnRightClick
(
wxCommandEvent
&
event
);
void
AdjustScrollBars
();
void
Affiche_Status_Box
();
/* Affichage des coord curseur, zoom .. */
...
...
@@ -363,7 +363,7 @@ public:
virtual
void
ReCreateVToolbar
()
=
0
;
virtual
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
=
0
;
virtual
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
)
=
0
;
virtual
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
=
0
;
virtual
bool
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
=
0
;
virtual
void
ReCreateMenuBar
();
PCB_SCREEN
*
GetScreen
()
{
return
(
PCB_SCREEN
*
)
m_CurrentScreen
;
}
...
...
@@ -614,7 +614,7 @@ public:
* @param aMousePos The current mouse position
* @param aPopMenu The menu to add to.
*/
void
OnRightClick
(
const
wxPoint
&
aMousePos
,
wxMenu
*
aPopMenu
);
bool
OnRightClick
(
const
wxPoint
&
aMousePos
,
wxMenu
*
aPopMenu
);
void
OnSelectOptionToolbar
(
wxCommandEvent
&
event
);
void
ToolOnRightClick
(
wxCommandEvent
&
event
);
...
...
@@ -822,7 +822,7 @@ public:
void
ReCreateMenuBar
();
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
bool
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
int
BestZoom
();
// Retourne le meilleur zoom
void
OnSelectOptionToolbar
(
wxCommandEvent
&
event
);
void
OnHotKey
(
wxDC
*
DC
,
int
hotkey
,
EDA_BaseStruct
*
DrawStruct
);
...
...
@@ -928,7 +928,7 @@ public:
void
ReCreateAuxiliaryToolbar
();
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
bool
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
void
SetToolbars
();
void
ReCreateMenuBar
();
void
ToolOnRightClick
(
wxCommandEvent
&
event
);
...
...
@@ -1033,7 +1033,7 @@ public:
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
bool
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
void
OnSelectOptionToolbar
(
wxCommandEvent
&
event
);
void
ToolOnRightClick
(
wxCommandEvent
&
event
);
int
BestZoom
();
// Retourne le meilleur zoom
...
...
@@ -1050,6 +1050,9 @@ public:
const
wxString
&
text_to_find
,
bool
mouseWarp
);
/* Cross probing with pcbnew */
void
SendMessageToPCBNEW
(
EDA_BaseStruct
*
objectToSync
);
/* netlist generation */
void
*
BuildNetListBase
();
...
...
@@ -1223,7 +1226,7 @@ public:
void
ReCreateHToolbar
();
void
ReCreateVToolbar
();
void
OnLeftClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
bool
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
int
BestZoom
();
// Retourne le meilleur zoom
void
SetToolbars
();
void
OnLeftDClick
(
wxDC
*
DC
,
const
wxPoint
&
MousePos
);
...
...
@@ -1344,7 +1347,7 @@ private:
void
SelectAndViewLibraryPart
(
int
option
);
void
ExportToSchematicLibraryPart
(
wxCommandEvent
&
event
);
void
ViewOneLibraryContent
(
LibraryStruct
*
Lib
,
int
Flag
);
void
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
bool
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
);
DECLARE_EVENT_TABLE
()
};
...
...
pcbnew/autoplac.cpp
View file @
1f842ae1
...
...
@@ -441,7 +441,7 @@ int WinEDA_PcbFrame::GenPlaceBoard()
Route_Layer_BOTTOM
=
CMP_N
;
if
(
Nb_Sides
==
TWO_SIDES
)
Route_Layer_BOTTOM
=
C
UIVRE
_N
;
Route_Layer_BOTTOM
=
C
OPPER_LAYER
_N
;
Route_Layer_TOP
=
CMP_N
;
/* Place the edge layer segments */
...
...
@@ -538,7 +538,7 @@ void WinEDA_PcbFrame::GenModuleOnBoard( MODULE* Module )
masque_layer
=
0
;
if
(
Module
->
GetLayer
()
==
CMP_N
)
masque_layer
=
CMP_LAYER
;
if
(
Module
->
GetLayer
()
==
C
UIVRE
_N
)
if
(
Module
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
masque_layer
=
CUIVRE_LAYER
;
TraceFilledRectangle
(
m_Pcb
,
ox
,
oy
,
fx
,
fy
,
masque_layer
,
...
...
@@ -615,7 +615,7 @@ int WinEDA_PcbFrame::RecherchePlacementModule( MODULE* Module, wxDC* DC )
{
D_PAD
*
Pad
;
int
masque_otherlayer
;
masque_otherlayer
=
CUIVRE_LAYER
;
if
(
Module
->
GetLayer
()
==
C
UIVRE
_N
)
if
(
Module
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
masque_otherlayer
=
CMP_LAYER
;
for
(
Pad
=
Module
->
m_Pads
;
Pad
!=
NULL
;
Pad
=
(
D_PAD
*
)
Pad
->
Pnext
)
...
...
@@ -823,7 +823,7 @@ int TstModuleOnBoard( BOARD* Pcb, MODULE* Module, bool TstOtherSide )
int
error
,
Penalite
,
marge
,
side
,
otherside
;
side
=
TOP
;
otherside
=
BOTTOM
;
if
(
Module
->
GetLayer
()
==
C
UIVRE
_N
)
if
(
Module
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
{
side
=
BOTTOM
;
otherside
=
TOP
;
}
...
...
pcbnew/autorout.cpp
View file @
1f842ae1
...
...
@@ -27,9 +27,16 @@ D_PAD * Pad = NULL;
int
autoroute_net_code
=
-
1
;
wxString
msg
;
if
(
g_DesignSettings
.
m_CopperLayerCount
>
1
)
{
Route_Layer_TOP
=
GetScreen
()
->
m_Route_Layer_TOP
;
Route_Layer_BOTTOM
=
GetScreen
()
->
m_Route_Layer_BOTTOM
;
}
else
{
Route_Layer_TOP
=
Route_Layer_BOTTOM
=
COPPER_LAYER_N
;
}
switch
(
mode
)
{
...
...
pcbnew/basepcbframe.cpp
View file @
1f842ae1
...
...
@@ -24,15 +24,13 @@
BEGIN_EVENT_TABLE
(
WinEDA_BasePcbFrame
,
WinEDA_DrawFrame
)
COMMON_EVENTS_DRAWFRAME
EVT_MENU_RANGE
(
ID_POPUP_PCB_ITEM_SELECTION_START
,
ID_POPUP_PCB_ITEM_SELECTION_END
,
COMMON_EVENTS_DRAWFRAME
EVT_MENU_RANGE
(
ID_POPUP_PCB_ITEM_SELECTION_START
,
ID_POPUP_PCB_ITEM_SELECTION_END
,
WinEDA_BasePcbFrame
::
ProcessItemSelection
)
END_EVENT_TABLE
()
/****************/
/* Constructeur */
/****************/
...
...
@@ -98,6 +96,7 @@ int WinEDA_BasePcbFrame::BestZoom( void )
/*************************************************/
void
WinEDA_BasePcbFrame
::
ReCreateMenuBar
(
void
)
/*************************************************/
// Virtual function
{
}
...
...
@@ -154,13 +153,14 @@ void WinEDA_BasePcbFrame::GetComponentFromRedoList( void )
/****************************************************************/
void
WinEDA_BasePcbFrame
::
SwitchLayer
(
wxDC
*
DC
,
int
layer
)
/*****************************************************************/
//Note: virtual, overridden in WinEDA_PcbFrame;
{
int
preslayer
=
GetScreen
()
->
m_Active_Layer
;
//if there is only one layer, don't switch.
if
(
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
<=
1
)
layer
=
LAYER_CUIVRE
_N
;
// Of course we select the copper layer
layer
=
COPPER_LAYER
_N
;
// Of course we select the copper layer
//otherwise, we select the requested layer only if it is possible
if
(
layer
!=
LAYER_CMP_N
&&
layer
>=
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
-
1
)
...
...
@@ -176,7 +176,6 @@ void WinEDA_BasePcbFrame::SwitchLayer( wxDC* DC, int layer )
}
/**********************************************************************/
void
WinEDA_BasePcbFrame
::
ProcessItemSelection
(
wxCommandEvent
&
event
)
/**********************************************************************/
...
...
@@ -186,13 +185,18 @@ void WinEDA_BasePcbFrame::ProcessItemSelection( wxCommandEvent& event )
// index into the collector list:
int
itemNdx
=
id
-
ID_POPUP_PCB_ITEM_SELECTION_START
;
if
(
(
id
>=
ID_POPUP_PCB_ITEM_SELECTION_START
)
&&
(
id
<=
ID_POPUP_PCB_ITEM_SELECTION_END
)
)
{
BOARD_ITEM
*
item
=
(
*
m_Collector
)[
itemNdx
];
DrawPanel
->
m_AbortRequest
=
false
;
#if defined(DEBUG)
#if defined
(DEBUG)
item
->
Show
(
0
,
std
::
cout
);
#endif
SetCurItem
(
item
);
}
}
...
...
@@ -202,12 +206,12 @@ void WinEDA_BasePcbFrame::SetCurItem( BOARD_ITEM* aItem )
{
m_CurrentScreen
->
SetCurItem
(
aItem
);
if
(
aItem
)
aItem
->
Display_Infos
(
this
);
aItem
->
Display_Infos
(
this
);
else
{
// we can use either of these:
//MsgPanel->EraseMsgBox();
m_Pcb
->
Display_Infos
(
this
);
m_Pcb
->
Display_Infos
(
this
);
}
}
...
...
pcbnew/block.cpp
View file @
1f842ae1
...
...
@@ -940,7 +940,7 @@ void WinEDA_BasePcbFrame::Block_Invert( wxDC* DC )
/* Redessin du Texte */
INVERT
(
STRUCT
->
m_Pos
.
y
);
INVERT_ANGLE
(
STRUCT
->
m_Orient
);
if
(
(
STRUCT
->
GetLayer
()
==
C
UIVRE
_N
)
||
(
STRUCT
->
GetLayer
()
==
CMP_N
)
)
if
(
(
STRUCT
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
||
(
STRUCT
->
GetLayer
()
==
CMP_N
)
)
{
STRUCT
->
m_Miroir
^=
1
;
/* inverse miroir */
}
...
...
pcbnew/class_board.cpp
View file @
1f842ae1
...
...
@@ -646,7 +646,7 @@ const char* BOARD::ShowLayer( int aLayer )
switch( aLayer )
{
case LAYER_C
UIVRE
_N: rs = "cu"; break;
case LAYER_C
OPPER_LAYER
_N: rs = "cu"; break;
case LAYER_N_2: rs = "layer2"; break;
case LAYER_N_3: rs = "layer3"; break;
case LAYER_N_4: rs = "layer4"; break;
...
...
pcbnew/class_module.cpp
View file @
1f842ae1
...
...
@@ -750,7 +750,7 @@ int MODULE::ReadDescr( FILE* File, int* LineNum )
else
DrawText
->
m_NoShow
=
0
;
if
(
layer
==
C
UIVRE
_N
)
if
(
layer
==
C
OPPER_LAYER
_N
)
layer
=
SILKSCREEN_N_CU
;
else
if
(
layer
==
CMP_N
)
layer
=
SILKSCREEN_N_CMP
;
...
...
pcbnew/class_pcb_text.cpp
View file @
1f842ae1
...
...
@@ -99,8 +99,8 @@ int TEXTE_PCB::ReadTextePcbDescr( FILE* File, int* LineNum )
{
sscanf
(
Line
+
2
,
" %d %d %lX %d
\n
"
,
&
m_Layer
,
&
m_Miroir
,
&
m_TimeStamp
,
&
dummy
);
if
(
m_Layer
<
LAYER_CUIVRE
_N
)
m_Layer
=
LAYER_CUIVRE
_N
;
if
(
m_Layer
<
COPPER_LAYER
_N
)
m_Layer
=
COPPER_LAYER
_N
;
if
(
m_Layer
>
LAST_NO_COPPER_LAYER
)
m_Layer
=
LAST_NO_COPPER_LAYER
;
...
...
pcbnew/class_text_mod.cpp
View file @
1f842ae1
...
...
@@ -49,7 +49,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
int
moduleLayer
=
Module
->
GetLayer
();
if
(
moduleLayer
==
C
UIVRE
_N
)
if
(
moduleLayer
==
C
OPPER_LAYER
_N
)
SetLayer
(
SILKSCREEN_N_CU
);
else
if
(
moduleLayer
==
CMP_N
)
SetLayer
(
SILKSCREEN_N_CMP
);
...
...
@@ -58,7 +58,7 @@ TEXTE_MODULE::TEXTE_MODULE( MODULE* parent, int text_type ) :
if
(
moduleLayer
==
SILKSCREEN_N_CU
||
moduleLayer
==
ADHESIVE_N_CU
||
moduleLayer
==
C
UIVRE
_N
)
||
moduleLayer
==
C
OPPER_LAYER
_N
)
{
m_Miroir
=
0
;
}
...
...
@@ -257,7 +257,7 @@ void TEXTE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC, wxPoint offset, int
color
=
g_DesignSettings
.
m_LayerColor
[
Module
->
GetLayer
()];
if
(
Module
&&
Module
->
GetLayer
()
==
C
UIVRE
_N
)
if
(
Module
&&
Module
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
color
=
g_ModuleTextCUColor
;
else
if
(
Module
&&
Module
->
GetLayer
()
==
CMP_N
)
...
...
@@ -381,7 +381,7 @@ bool TEXTE_MODULE::IsOnLayer( int aLayer ) const
if
(
aLayer
==
GetParent
()
->
GetLayer
()
)
return
true
;
if
(
aLayer
==
C
UIVRE
_N
)
if
(
aLayer
==
C
OPPER_LAYER
_N
)
{
if
(
m_Layer
==
ADHESIVE_N_CU
||
m_Layer
==
SILKSCREEN_N_CU
)
return
true
;
...
...
pcbnew/class_track.cpp
View file @
1f842ae1
...
...
@@ -253,7 +253,7 @@ void SEGVIA::SetLayerPair( int top_layer, int bottom_layer )
if
(
via_type
==
VIA_NORMALE
)
{
top_layer
=
LAYER_CMP_N
;
bottom_layer
=
LAYER_CUIVRE
_N
;
bottom_layer
=
COPPER_LAYER
_N
;
}
if
(
bottom_layer
>
top_layer
)
...
...
@@ -263,9 +263,9 @@ void SEGVIA::SetLayerPair( int top_layer, int bottom_layer )
}
/***************************************************************/
/***************************************************************
******
/
void
SEGVIA
::
ReturnLayerPair
(
int
*
top_layer
,
int
*
bottom_layer
)
const
/***************************************************************/
/***************************************************************
******
/
/* Retourne les 2 couches limitant la via
* les pointeurs top_layer et bottom_layer peuvent etre NULLs
...
...
pcbnew/classpcb.cpp
View file @
1f842ae1
...
...
@@ -360,9 +360,9 @@ void PCB_SCREEN::Init()
/*************************/
{
InitDatas
();
m_Active_Layer
=
C
UIVRE
_N
;
/* ref couche active 0.. 31 */
m_Active_Layer
=
C
OPPER_LAYER
_N
;
/* ref couche active 0.. 31 */
m_Route_Layer_TOP
=
CMP_N
;
/* ref couches par defaut pour vias (Cu.. Cmp) */
m_Route_Layer_BOTTOM
=
C
UIVRE
_N
;
m_Route_Layer_BOTTOM
=
C
OPPER_LAYER
_N
;
m_Zoom
=
128
;
/* valeur */
m_Grid
=
wxSize
(
500
,
500
);
/* pas de la grille en 1/10000 "*/
}
...
...
pcbnew/classtrc.cpp.notused
View file @
1f842ae1
...
...
@@ -82,7 +82,7 @@ void SEGVIA::SetLayerPair( int top_layer, int bottom_layer )
if( via_type == VIA_NORMALE )
{
top_layer = LAYER_CMP_N; bottom_layer = LAYER_C
UIVRE
_N;
top_layer = LAYER_CMP_N; bottom_layer = LAYER_C
OPPER_LAYER
_N;
}
if( bottom_layer > top_layer )
...
...
pcbnew/collectors.cpp
View file @
1f842ae1
...
...
@@ -205,7 +205,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
if
(
module
)
{
if
(
m_Guide
->
IgnoreMTextsOnCopper
()
&&
module
->
GetLayer
()
==
LAYER_CUIVRE
_N
)
if
(
m_Guide
->
IgnoreMTextsOnCopper
()
&&
module
->
GetLayer
()
==
COPPER_LAYER
_N
)
goto
exit
;
if
(
m_Guide
->
IgnoreMTextsOnCmp
()
&&
module
->
GetLayer
()
==
LAYER_CMP_N
)
...
...
@@ -225,7 +225,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_BaseStruct* testItem, const void*
if
(
module
)
// true from case TYPEPAD, TYPETEXTEMODULE, or TYPEMODULE
{
if
(
m_Guide
->
IgnoreModulesOnCu
()
&&
module
->
GetLayer
()
==
LAYER_CUIVRE
_N
)
if
(
m_Guide
->
IgnoreModulesOnCu
()
&&
module
->
GetLayer
()
==
COPPER_LAYER
_N
)
goto
exit
;
if
(
m_Guide
->
IgnoreModulesOnCmp
()
&&
module
->
GetLayer
()
==
LAYER_CMP_N
)
...
...
pcbnew/controle.cpp
View file @
1f842ae1
...
...
@@ -70,7 +70,7 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode )
// Assign to scanList the proper item types desired based on tool type
// or hotkey that is in play.
const
KICAD_T
*
scanList
;
const
KICAD_T
*
scanList
=
NULL
;
if
(
aHotKeyCode
)
{
...
...
@@ -170,7 +170,16 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode )
{
wxMenu
itemMenu
;
itemMenu
.
SetTitle
(
_
(
"Selection Clarification"
)
);
// does this work? not under Linux!
/* Give a title to the selection menu. This is also a cancel menu item */
wxMenuItem
*
item_title
=
new
wxMenuItem
(
&
itemMenu
,
-
1
,
_
(
"Selection Clarification"
)
);
#ifdef __WINDOWS__
wxFont
bold_font
(
*
wxNORMAL_FONT
);
bold_font
.
SetWeight
(
wxFONTWEIGHT_BOLD
);
bold_font
.
SetStyle
(
wxFONTSTYLE_ITALIC
);
item_title
->
SetFont
(
bold_font
);
#endif
itemMenu
.
Append
(
item_title
);
itemMenu
.
AppendSeparator
();
int
limit
=
MIN
(
MAX_ITEMS_IN_PICKER
,
m_Collector
->
GetCount
()
);
...
...
@@ -197,7 +206,8 @@ BOARD_ITEM* WinEDA_BasePcbFrame::PcbGeneralLocateAndDisplay( int aHotKeyCode )
// this menu's handler is void WinEDA_BasePcbFrame::ProcessItemSelection()
// and it calls SetCurItem() which in turn calls Display_Infos() on the item.
PopupMenu
(
&
itemMenu
);
DrawPanel
->
m_AbortRequest
=
true
;
// changed in false if an item
PopupMenu
(
&
itemMenu
);
// m_AbortRequest = false if an item is selected
DrawPanel
->
MouseToCursorSchema
();
...
...
pcbnew/cross-probing.cpp
View file @
1f842ae1
...
...
@@ -119,6 +119,7 @@ void RemoteCommand( const char* cmdline )
/**************************************************************************/
void
WinEDA_PcbFrame
::
SendMessageToEESCHEMA
(
BOARD_ITEM
*
objectToSync
)
/**************************************************************************/
/** Send a remote command to eeschema via a socket,
* @param objectToSync = item to be located on schematic (module, pin or text)
* Commands are
...
...
@@ -182,4 +183,3 @@ void WinEDA_PcbFrame::SendMessageToEESCHEMA( BOARD_ITEM* objectToSync )
SendCommand
(
MSG_TO_SCH
,
cmd
);
}
}
pcbnew/dialog_edit_module.cpp
View file @
1f842ae1
...
...
@@ -233,7 +233,7 @@ void WinEDA_ModulePropertiesFrame::BuildPanelModuleProperties( bool FullOptions
wxString
layer_list
[
2
]
=
{
_
(
"Component"
),
_
(
"Copper"
)
};
m_LayerCtrl
=
new
wxRadioBox
(
m_PanelProperties
,
-
1
,
_
(
"Layer"
),
wxDefaultPosition
,
wxSize
(
-
1
,
-
1
),
2
,
layer_list
,
1
);
m_LayerCtrl
->
SetSelection
(
(
m_CurrentModule
->
GetLayer
()
==
C
UIVRE
_N
)
?
1
:
0
);
m_LayerCtrl
->
SetSelection
(
(
m_CurrentModule
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
?
1
:
0
);
PropLeftSizer
->
Add
(
m_LayerCtrl
,
0
,
wxGROW
|
wxALL
,
5
);
bool
select
=
FALSE
;
...
...
@@ -515,7 +515,7 @@ void WinEDA_ModulePropertiesFrame::OnOkClick( wxCommandEvent& event )
{
if
(
m_LayerCtrl
->
GetSelection
()
==
0
)
// layer req = COMPONENT
{
if
(
m_CurrentModule
->
GetLayer
()
==
C
UIVRE
_N
)
if
(
m_CurrentModule
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
change_layer
=
TRUE
;
}
else
if
(
m_CurrentModule
->
GetLayer
()
==
CMP_N
)
...
...
pcbnew/edgemod.cpp
View file @
1f842ae1
...
...
@@ -194,11 +194,11 @@ void WinEDA_ModuleEditFrame::Edit_Edge_Layer( EDGE_MODULE* Edge, wxDC* DC )
/* Ask for the new layer */
new_layer
=
SelectLayer
(
new_layer
,
LAYER_CUIVRE
_N
,
LAST_NO_COPPER_LAYER
);
new_layer
=
SelectLayer
(
new_layer
,
COPPER_LAYER
_N
,
LAST_NO_COPPER_LAYER
);
if
(
new_layer
<
0
)
return
;
if
(
new_layer
>=
LAYER_CUIVRE
_N
&&
new_layer
<=
LAYER_CMP_N
)
if
(
new_layer
>=
COPPER_LAYER
_N
&&
new_layer
<=
LAYER_CMP_N
)
/* an edge is put on a copper layer, and it is very dangerous. a confirmation is requested */
{
if
(
!
IsOK
(
this
,
_
(
"The graphic item will be on a copper layer.It is very dangerous. Are you sure"
)
)
)
...
...
@@ -364,7 +364,7 @@ EDGE_MODULE* WinEDA_ModuleEditFrame::Begin_Edge_Module( EDGE_MODULE* Edge,
Edge
->
SetLayer
(
Module
->
GetLayer
()
);
if
(
Module
->
GetLayer
()
==
CMP_N
)
Edge
->
SetLayer
(
SILKSCREEN_N_CMP
);
if
(
Module
->
GetLayer
()
==
C
UIVRE
_N
)
if
(
Module
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
Edge
->
SetLayer
(
SILKSCREEN_N_CU
);
/* Initialise the starting point of the new segment or arc */
Edge
->
m_Start
=
GetScreen
()
->
m_Curseur
;
...
...
pcbnew/edit.cpp
View file @
1f842ae1
...
...
@@ -551,8 +551,12 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case
ID_POPUP_PCB_DRAG_PAD_REQUEST
:
g_Drag_Pistes_On
=
TRUE
;
DrawPanel
->
MouseToCursorSchema
();
StartMovePad
(
(
D_PAD
*
)
GetCurItem
(),
&
dc
);
break
;
case
ID_POPUP_PCB_MOVE_PAD_REQUEST
:
g_Drag_Pistes_On
=
false
;
DrawPanel
->
MouseToCursorSchema
();
StartMovePad
(
(
D_PAD
*
)
GetCurItem
(),
&
dc
);
break
;
...
...
@@ -982,8 +986,8 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
if
(
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
<=
1
)
return
;
//otherwise, must be at least 2 layers.
.
see if it is possible.
if
(
layer
==
LAYER_CUIVRE
_N
||
layer
==
LAYER_CMP_N
//otherwise, must be at least 2 layers.
see if it is possible.
if
(
layer
==
COPPER_LAYER
_N
||
layer
==
LAYER_CMP_N
||
layer
<
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
-
1
)
{
if
(
preslayer
==
layer
)
...
...
pcbnew/editrack-part2.cpp
View file @
1f842ae1
...
...
@@ -246,7 +246,7 @@ void WinEDA_PcbFrame::Other_Layer_Route( TRACK* track, wxDC* DC )
else
{
// Usual via is from copper to component; layer pair is 0 and 0x0F.
Via
->
SetLayerPair
(
LAYER_CUIVRE
_N
,
LAYER_CMP_N
);
Via
->
SetLayerPair
(
COPPER_LAYER
_N
,
LAYER_CMP_N
);
}
if
(
Drc_On
&&
(
Drc
(
this
,
DC
,
Via
,
m_Pcb
->
m_Track
,
1
)
==
BAD_DRC
)
)
...
...
pcbnew/export_gencad.cpp
View file @
1f842ae1
...
...
@@ -101,7 +101,7 @@ void WinEDA_PcbFrame::ExportToGenCAD( wxCommandEvent& event )
for
(
module
=
m_Pcb
->
m_Modules
;
module
!=
NULL
;
module
=
module
->
Next
()
)
{
module
->
flag
=
0
;
if
(
module
->
GetLayer
()
==
C
UIVRE
_N
)
if
(
module
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
{
Change_Side_Module
(
module
,
NULL
);
module
->
flag
=
1
;
...
...
pcbnew/gen_modules_placefile.cpp
View file @
1f842ae1
...
...
@@ -66,7 +66,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
continue
;
if
(
(
Module
->
m_Attributs
&
MOD_CMS
)
==
0
)
continue
;
if
(
Module
->
GetLayer
()
==
C
UIVRE
_N
)
if
(
Module
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
GenCu
=
TRUE
;
NbMod
++
;
}
...
...
@@ -193,7 +193,7 @@ void WinEDA_PcbFrame::GenModulesPosition( wxCommandEvent& event )
strcat
(
Line
,
"Cmp.
\n
"
);
fputs
(
Line
,
LayerCmp
);
}
else
if
(
Liste
[
ii
].
m_Module
->
GetLayer
()
==
C
UIVRE
_N
)
else
if
(
Liste
[
ii
].
m_Module
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
{
strcat
(
Line
,
"Cu
\n
"
);
fputs
(
Line
,
LayerCu
);
...
...
@@ -317,7 +317,7 @@ void WinEDA_PcbFrame::GenModuleReport( wxCommandEvent& event )
sprintf
(
Line
,
"orientation %.2f
\n
"
,
(
float
)
Module
->
m_Orient
/
10
);
if
(
Module
->
GetLayer
()
==
CMP_N
)
strcat
(
Line
,
"layer component
\n
"
);
else
if
(
Module
->
GetLayer
()
==
C
UIVRE
_N
)
else
if
(
Module
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
strcat
(
Line
,
"layer copper
\n
"
);
else
strcat
(
Line
,
"layer other
\n
"
);
...
...
pcbnew/hotkeys.cpp
View file @
1f842ae1
...
...
@@ -204,13 +204,13 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
ll
=
GetScreen
()
->
m_Active_Layer
;
if
(
ll
>
CMP_N
)
break
;
if
(
ll
<=
C
UIVRE
_N
)
if
(
ll
<=
C
OPPER_LAYER
_N
)
break
;
if
(
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
<=
1
)
// Single layer
ll
=
C
UIVRE
_N
;
ll
=
C
OPPER_LAYER
_N
;
if
(
ll
==
CMP_N
)
ll
=
MAX
(
C
UIVRE
_N
,
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
-
2
);
else
if
(
ll
>
C
UIVRE
_N
)
ll
=
MAX
(
C
OPPER_LAYER
_N
,
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
-
2
);
else
if
(
ll
>
C
OPPER_LAYER
_N
)
ll
--
;
SwitchLayer
(
DC
,
ll
);
break
;
...
...
@@ -223,7 +223,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
if
(
ll
>=
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
-
1
)
ll
=
CMP_N
;
if
(
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
<=
1
)
// Single layer
ll
=
C
UIVRE
_N
;
ll
=
C
OPPER_LAYER
_N
;
SwitchLayer
(
DC
,
ll
);
break
;
...
...
@@ -232,7 +232,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
break
;
case
HK_SWITCH_LAYER_TO_COPPER
:
SwitchLayer
(
DC
,
C
UIVRE
_N
);
SwitchLayer
(
DC
,
C
OPPER_LAYER
_N
);
break
;
case
HK_SWITCH_LAYER_TO_INNER1
:
...
...
pcbnew/lay2plot.cpp
View file @
1f842ae1
...
...
@@ -176,7 +176,7 @@ static void Plot_Module( WinEDA_DrawPanel* panel, wxDC* DC,
/* draw footprint graphic shapes */
PtStruct
=
Module
->
m_Drawings
;
mlayer
=
g_TabOneLayerMask
[
Module
->
GetLayer
()];
if
(
Module
->
GetLayer
()
==
C
UIVRE
_N
)
if
(
Module
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
mlayer
=
SILKSCREEN_LAYER_CU
;
else
if
(
Module
->
GetLayer
()
==
CMP_N
)
mlayer
=
SILKSCREEN_LAYER_CMP
;
...
...
pcbnew/locate.cpp
View file @
1f842ae1
...
...
@@ -164,7 +164,7 @@ BOARD_ITEM* WinEDA_BasePcbFrame::Locate( int typeloc, int LayerSearch )
// Priority to the active layer (component or copper).
// This is useful for small smd components when 2 texts overlap but are not
// on the same layer
if
(
LayerSearch
==
LAYER_CUIVRE_N
||
LayerSearch
==
CMP_N
)
if
(
LayerSearch
==
COPPER_LAYER_N
||
LayerSearch
==
LAYER_
CMP_N
)
{
MODULE
*
module
=
m_Pcb
->
m_Modules
;
for
(
;
module
!=
NULL
;
module
=
(
MODULE
*
)
module
->
Pnext
)
...
...
@@ -525,7 +525,7 @@ MODULE* Locate_Prefered_Module( BOARD* Pcb, int typeloc )
layer
=
pt_module
->
GetLayer
();
if
(
layer
==
ADHESIVE_N_CU
||
layer
==
SILKSCREEN_N_CU
)
layer
=
C
UIVRE
_N
;
layer
=
C
OPPER_LAYER
_N
;
else
if
(
layer
==
ADHESIVE_N_CMP
||
layer
==
SILKSCREEN_N_CMP
)
layer
=
CMP_N
;
...
...
@@ -605,7 +605,7 @@ TEXTE_MODULE* LocateTexteModule( BOARD* Pcb, MODULE** PtModule, int typeloc )
{
int
layer
=
module
->
GetLayer
();
if
(
layer
==
ADHESIVE_N_CU
||
layer
==
SILKSCREEN_N_CU
)
layer
=
C
UIVRE
_N
;
layer
=
C
OPPER_LAYER
_N
;
else
if
(
layer
==
ADHESIVE_N_CMP
||
layer
==
SILKSCREEN_N_CMP
)
layer
=
CMP_N
;
...
...
pcbnew/modedit_onclick.cpp
View file @
1f842ae1
...
...
@@ -173,7 +173,7 @@ void WinEDA_ModuleEditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
/*********************************************************************/
void
WinEDA_ModuleEditFrame
::
OnRightClick
(
const
wxPoint
&
MousePos
,
bool
WinEDA_ModuleEditFrame
::
OnRightClick
(
const
wxPoint
&
MousePos
,
wxMenu
*
PopMenu
)
/*********************************************************************/
...
...
@@ -238,7 +238,7 @@ void WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
}
if
(
DrawStruct
==
NULL
)
return
;
return
true
;
int
flags
=
DrawStruct
->
m_Flags
;
...
...
@@ -367,6 +367,8 @@ void WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
_
(
"Set Width"
),
width_segment_xpm
);
PopMenu
->
AppendSeparator
();
}
return
true
;
}
...
...
pcbnew/modules.cpp
View file @
1f842ae1
...
...
@@ -337,7 +337,7 @@ void WinEDA_BasePcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC )
if
(
Module
==
NULL
)
return
;
if
(
(
Module
->
GetLayer
()
!=
CMP_N
)
&&
(
Module
->
GetLayer
()
!=
C
UIVRE
_N
)
)
if
(
(
Module
->
GetLayer
()
!=
CMP_N
)
&&
(
Module
->
GetLayer
()
!=
C
OPPER_LAYER
_N
)
)
return
;
m_CurrentScreen
->
SetModify
();
...
...
@@ -400,14 +400,14 @@ void WinEDA_BasePcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC )
pt_texte
->
SetLayer
(
Module
->
GetLayer
()
);
pt_texte
->
SetLayer
(
ChangeSideNumLayer
(
pt_texte
->
GetLayer
()
)
);
if
(
Module
->
GetLayer
()
==
C
UIVRE
_N
)
if
(
Module
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
pt_texte
->
SetLayer
(
SILKSCREEN_N_CU
);
if
(
Module
->
GetLayer
()
==
CMP_N
)
pt_texte
->
SetLayer
(
SILKSCREEN_N_CMP
);
if
(
(
Module
->
GetLayer
()
==
SILKSCREEN_N_CU
)
||
(
Module
->
GetLayer
()
==
ADHESIVE_N_CU
)
||
(
Module
->
GetLayer
()
==
C
UIVRE
_N
)
)
||
(
Module
->
GetLayer
()
==
ADHESIVE_N_CU
)
||
(
Module
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
)
pt_texte
->
m_Miroir
=
0
;
/* Inversion miroir de la Valeur et mise en miroir : */
...
...
@@ -421,14 +421,14 @@ void WinEDA_BasePcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC )
pt_texte
->
SetLayer
(
Module
->
GetLayer
()
);
pt_texte
->
SetLayer
(
ChangeSideNumLayer
(
pt_texte
->
GetLayer
()
)
);
if
(
Module
->
GetLayer
()
==
C
UIVRE
_N
)
if
(
Module
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
pt_texte
->
SetLayer
(
SILKSCREEN_N_CU
);
if
(
Module
->
GetLayer
()
==
CMP_N
)
pt_texte
->
SetLayer
(
SILKSCREEN_N_CMP
);
if
(
(
Module
->
GetLayer
()
==
SILKSCREEN_N_CU
)
||
(
Module
->
GetLayer
()
==
ADHESIVE_N_CU
)
||
(
Module
->
GetLayer
()
==
C
UIVRE
_N
)
)
||
(
Module
->
GetLayer
()
==
ADHESIVE_N_CU
)
||
(
Module
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
)
pt_texte
->
m_Miroir
=
0
;
/* Inversion miroir des dessins de l'empreinte : */
...
...
@@ -469,7 +469,7 @@ void WinEDA_BasePcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC )
pt_texte
->
SetLayer
(
Module
->
GetLayer
()
);
pt_texte
->
SetLayer
(
ChangeSideNumLayer
(
pt_texte
->
GetLayer
()
)
);
if
(
Module
->
GetLayer
()
==
C
UIVRE
_N
)
if
(
Module
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
pt_texte
->
SetLayer
(
SILKSCREEN_N_CU
);
if
(
Module
->
GetLayer
()
==
CMP_N
)
...
...
@@ -477,7 +477,7 @@ void WinEDA_BasePcbFrame::Change_Side_Module( MODULE* Module, wxDC* DC )
if
(
Module
->
GetLayer
()
==
SILKSCREEN_N_CU
||
Module
->
GetLayer
()
==
ADHESIVE_N_CU
||
Module
->
GetLayer
()
==
C
UIVRE
_N
)
||
Module
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
{
pt_texte
->
m_Miroir
=
0
;
}
...
...
@@ -580,11 +580,11 @@ int ChangeSideNumLayer( int oldlayer )
switch
(
oldlayer
)
{
case
C
UIVRE
_N
:
case
C
OPPER_LAYER
_N
:
newlayer
=
CMP_N
;
break
;
case
CMP_N
:
newlayer
=
C
UIVRE
_N
;
break
;
newlayer
=
C
OPPER_LAYER
_N
;
break
;
case
SILKSCREEN_N_CU
:
newlayer
=
SILKSCREEN_N_CMP
;
break
;
...
...
pcbnew/move-drag_pads.cpp
View file @
1f842ae1
...
...
@@ -287,8 +287,11 @@ MODULE * Module;
Pad
->
m_Flags
|=
IS_MOVED
;
Pad
->
Draw
(
DrawPanel
,
DC
,
wxPoint
(
0
,
0
),
GR_XOR
);
/* Build the list of track segments to drag */
/* Build the list of track segments to drag if the command is a drag pad*/
if
(
g_Drag_Pistes_On
)
Build_1_Pad_SegmentsToDrag
(
DrawPanel
,
DC
,
Pad
);
else
EraseDragListe
();
}
...
...
pcbnew/onrightclick.cpp
View file @
1f842ae1
...
...
@@ -108,7 +108,7 @@ static wxMenu* Append_Track_Width_List()
/******************************************************************************/
void
WinEDA_PcbFrame
::
OnRightClick
(
const
wxPoint
&
aMousePos
,
wxMenu
*
aPopMenu
)
bool
WinEDA_PcbFrame
::
OnRightClick
(
const
wxPoint
&
aMousePos
,
wxMenu
*
aPopMenu
)
/******************************************************************************/
{
wxString
msg
;
...
...
@@ -123,13 +123,14 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
DrawPanel
->
m_CanStartBlock
=
-
1
;
// Avoid to start a block coomand when clicking on menu
// If command or block in progress: Put the Cancel command (if needed) and the End command
// If a command or a block is in progress:
// Put the Cancel command (if needed) and the End command
if
(
BlockActive
)
{
createPopUpBlockMenu
(
aPopMenu
);
aPopMenu
->
AppendSeparator
();
return
;
return
true
;
}
DrawPanel
->
CursorOff
(
&
dc
);
...
...
@@ -162,7 +163,14 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
/* Select a proper item */
if
(
!
item
||
!
item
->
m_Flags
)
{
DrawPanel
->
m_AbortRequest
=
false
;
item
=
PcbGeneralLocateAndDisplay
();
if
(
DrawPanel
->
m_AbortRequest
)
{
DrawPanel
->
CursorOn
(
&
dc
);
return
false
;
}
SetCurItem
(
item
);
}
...
...
@@ -183,15 +191,19 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
{
aPopMenu
->
AppendSeparator
();
if
(
!
(
(
MODULE
*
)
item
)
->
IsLocked
()
)
if
(
!
(
(
MODULE
*
)
item
)
->
IsLocked
()
)
{
msg
=
AddHotkeyName
(
_
(
"Lock Module"
),
s_Board_Editor_Hokeys_Descr
,
HK_LOCK_UNLOCK_FOOTPRINT
);
msg
=
AddHotkeyName
(
_
(
"Lock Module"
),
s_Board_Editor_Hokeys_Descr
,
HK_LOCK_UNLOCK_FOOTPRINT
);
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_AUTOPLACE_FIXE_MODULE
,
msg
,
Locked_xpm
);
}
else
{
msg
=
AddHotkeyName
(
_
(
"Unlock Module"
),
s_Board_Editor_Hokeys_Descr
,
HK_LOCK_UNLOCK_FOOTPRINT
);
msg
=
AddHotkeyName
(
_
(
"Unlock Module"
),
s_Board_Editor_Hokeys_Descr
,
HK_LOCK_UNLOCK_FOOTPRINT
);
ADD_MENUITEM
(
aPopMenu
,
ID_POPUP_PCB_AUTOPLACE_FREE_MODULE
,
msg
,
Unlocked_xpm
);
}
...
...
@@ -430,6 +442,7 @@ void WinEDA_PcbFrame::OnRightClick( const wxPoint& aMousePos, wxMenu* aPopMenu )
}
DrawPanel
->
CursorOn
(
&
dc
);
return
true
;
}
...
...
pcbnew/pcbnew.h
View file @
1f842ae1
...
...
@@ -147,7 +147,7 @@ bool inline IsModuleLayerVisible( int layer )
if
(
layer
==
CMP_N
)
return
DisplayOpt
.
Show_Modules_Cmp
;
else
if
(
layer
==
C
UIVRE
_N
)
else
if
(
layer
==
C
OPPER_LAYER
_N
)
return
DisplayOpt
.
Show_Modules_Cu
;
else
...
...
pcbnew/pcbtexte.cpp
View file @
1f842ae1
...
...
@@ -351,7 +351,7 @@ TEXTE_PCB* WinEDA_PcbFrame::Create_Texte_Pcb( wxDC* DC )
TextePcb
->
m_Flags
=
IS_NEW
;
TextePcb
->
SetLayer
(
GetScreen
()
->
m_Active_Layer
);
TextePcb
->
m_Miroir
=
1
;
if
(
TextePcb
->
GetLayer
()
==
C
UIVRE
_N
)
if
(
TextePcb
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
TextePcb
->
m_Miroir
=
0
;
TextePcb
->
m_Size
=
g_DesignSettings
.
m_PcbTextSize
;
...
...
pcbnew/plotgerb.cpp
View file @
1f842ae1
...
...
@@ -94,7 +94,7 @@ int tracevia = 1;
switch
(
Layer
)
{
case
C
UIVRE
_N
:
case
C
OPPER_LAYER
_N
:
case
LAYER_N_2
:
case
LAYER_N_3
:
case
LAYER_N_4
:
...
...
pcbnew/plothpgl.cpp
View file @
1f842ae1
...
...
@@ -136,7 +136,7 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer )
switch
(
Layer
)
{
case
C
UIVRE
_N
:
case
C
OPPER_LAYER
_N
:
case
LAYER_N_2
:
case
LAYER_N_3
:
case
LAYER_N_4
:
...
...
pcbnew/plotps.cpp
View file @
1f842ae1
...
...
@@ -178,7 +178,7 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer )
Plot_Layer_PS
(
dest
,
layer_mask
,
0
,
1
,
modetrace
);
break
;
case
C
UIVRE
_N
:
case
C
OPPER_LAYER
_N
:
case
LAYER_N_2
:
case
LAYER_N_3
:
case
LAYER_N_4
:
...
...
pcbnew/router.cpp
View file @
1f842ae1
...
...
@@ -392,7 +392,7 @@ static void GenExistantTracks( BOARD* Pcb, FILE* outfile,
else
via_max_layer
++
;
if
(
via_min_layer
==
C
UIVRE
_N
)
if
(
via_min_layer
==
C
OPPER_LAYER
_N
)
via_min_layer
=
min_layer
;
else
via_min_layer
++
;
...
...
@@ -615,7 +615,7 @@ void WinEDA_PcbFrame::ReadAutoroutedTracks( wxDC* DC )
case
'T'
:
// Track list start: fmt = T image layer t_count
sscanf
(
Line
+
2
,
"%d %d %d"
,
&
image
,
&
track_layer
,
&
track_count
);
track_layer
--
;
if
(
(
track_layer
!=
C
UIVRE
_N
)
&&
(
track_layer
==
max_layer
-
1
)
)
if
(
(
track_layer
!=
C
OPPER_LAYER
_N
)
&&
(
track_layer
==
max_layer
-
1
)
)
track_layer
=
CMP_N
;
// Read corners: fmt = C x_pos y_pos
...
...
pcbnew/set_color.cpp
View file @
1f842ae1
...
...
@@ -53,8 +53,8 @@ static ColorButton Msg_Layers_Cu =
static
ColorButton
Layer_1_Butt
=
{
wxEmptyString
,
C
UIVRE
_N
,
/* Title */
ADR
(
C
UIVRE
_N
),
/* adr du parametre optionnel */
C
OPPER_LAYER
_N
,
/* Title */
ADR
(
C
OPPER_LAYER
_N
),
/* adr du parametre optionnel */
TRUE
// toggle bit ITEM_NOT_SHOW of the color variable
};
...
...
pcbnew/tracepcb.cpp
View file @
1f842ae1
...
...
@@ -129,7 +129,7 @@ void WinEDA_PcbFrame::Trace_Pcb( wxDC* DC, int mode )
}
if
(
!
DisplayOpt
.
Show_Modules_Cu
)
{
if
(
Module
->
GetLayer
()
==
C
UIVRE
_N
)
if
(
Module
->
GetLayer
()
==
C
OPPER_LAYER
_N
)
display
=
FALSE
;
MaskLay
&=
~
CUIVRE_LAYER
;
}
...
...
share/drawpanel.cpp
View file @
1f842ae1
...
...
@@ -688,10 +688,11 @@ void WinEDA_DrawPanel::m_Draw_Auxiliary_Axis( wxDC* DC, int drawmode )
/*******************************************************/
void
WinEDA_DrawPanel
::
OnRightClick
(
wxMouseEvent
&
event
)
bool
WinEDA_DrawPanel
::
OnRightClick
(
wxMouseEvent
&
event
)
/*******************************************************/
/* Build and display a Popup menu on a right mouse button click
/** Build and display a Popup menu on a right mouse button click
* @return true if a popup menu is shown, or false
*/
{
wxPoint
pos
;
...
...
@@ -700,7 +701,8 @@ void WinEDA_DrawPanel::OnRightClick( wxMouseEvent& event )
pos
.
x
=
event
.
GetX
();
pos
.
y
=
event
.
GetY
();
m_Parent
->
OnRightClick
(
pos
,
&
MasterMenu
);
if
(
!
m_Parent
->
OnRightClick
(
pos
,
&
MasterMenu
)
)
return
false
;
AddMenuZoom
(
&
MasterMenu
);
...
...
@@ -708,6 +710,8 @@ void WinEDA_DrawPanel::OnRightClick( wxMouseEvent& event )
PopupMenu
(
&
MasterMenu
,
pos
);
MouseToCursorSchema
();
m_IgnoreMouseEvents
=
FALSE
;
return
true
;
}
...
...
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