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
57463862
Commit
57463862
authored
Nov 01, 2007
by
g_harland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added definitions for FIRST_COPPER_LAYER and LAST_COPPER_LAYER
parent
74b4e032
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
821 additions
and
699 deletions
+821
-699
3d_draw.cpp
3d-viewer/3d_draw.cpp
+317
-259
change_log.txt
change_log.txt
+10
-2
export_to_pcbnew.cpp
gerbview/export_to_pcbnew.cpp
+2
-2
select_layers_to_pcb.cpp
gerbview/select_layers_to_pcb.cpp
+3
-3
pcbstruct.h
include/pcbstruct.h
+3
-1
basepcbframe.cpp
pcbnew/basepcbframe.cpp
+1
-1
class_edge_mod.cpp
pcbnew/class_edge_mod.cpp
+1
-1
class_pcb_text.cpp
pcbnew/class_pcb_text.cpp
+2
-2
class_track.cpp
pcbnew/class_track.cpp
+2
-2
cotation.cpp
pcbnew/cotation.cpp
+4
-4
edgemod.cpp
pcbnew/edgemod.cpp
+2
-2
edit.cpp
pcbnew/edit.cpp
+2
-2
editedge.cpp
pcbnew/editedge.cpp
+1
-1
hotkeys.cpp
pcbnew/hotkeys.cpp
+7
-7
onleftclick.cpp
pcbnew/onleftclick.cpp
+5
-6
plotgerb.cpp
pcbnew/plotgerb.cpp
+455
-400
plothpgl.cpp
pcbnew/plothpgl.cpp
+2
-2
plotps.cpp
pcbnew/plotps.cpp
+2
-2
No files found.
3d-viewer/3d_draw.cpp
View file @
57463862
This diff is collapsed.
Click to expand it.
change_log.txt
View file @
57463862
...
...
@@ -4,6 +4,14 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
email address.
2007-Nov-01 UPDATE Geoff Harland <gharlandau@yahoo.com.au>
================================================================================
+ pcbnew
* Provided new definitions of FIRST_COPPER_LAYER and LAST_COPPER_LAYER within
include/pcbstruct.h, and used those definitions within various other files.
Beautified and generally refined 3d-viewer/3d_draw.cpp and pcbnew/plotgerb.cpp.
2007-Oct-31 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
+kicad:
...
...
@@ -401,8 +409,8 @@ email address.
field. (Refer to 2007-Oct-2 UPDATE notes for the relevance of this.)
* Beautification and house keeping.
+ eeschema
* The editpart.cpp and
edit
part.cpp files (which are no longer used) have been
removed, and replaced with editpart.cpp.notused and
edit
part.cpp.notused
* The editpart.cpp and
libed
part.cpp files (which are no longer used) have been
removed, and replaced with editpart.cpp.notused and
libed
part.cpp.notused
+ cvpcb
* Additional "OK", "Cancel", and "Apply" buttons have now been provided for the
"Options" dialog box which lists various display options for footprints.
...
...
gerbview/export_to_pcbnew.cpp
View file @
57463862
...
...
@@ -153,7 +153,7 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile,
if
(
pcb_layer_number
<
0
)
continue
;
if
(
pcb_layer_number
>
CMP_N
)
if
(
pcb_layer_number
>
LAST_COPPER_LAYER
)
{
DRAWSEGMENT
*
drawitem
=
new
DRAWSEGMENT
(
pcb
,
TYPEDRAWSEGMENT
);
...
...
@@ -169,7 +169,7 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile,
TRACK
*
newtrack
;
// replace spots with vias when possible
if
(
track
->
m_Shape
==
S_SPOT_CIRCLE
if
(
track
->
m_Shape
==
S_SPOT_CIRCLE
||
track
->
m_Shape
==
S_SPOT_RECT
||
track
->
m_Shape
==
S_SPOT_OVALE
)
{
...
...
gerbview/select_layers_to_pcb.cpp
View file @
57463862
...
...
@@ -266,7 +266,7 @@ bool AsCmpLayer = false;
AsCmpLayer
=
true
;
else
{
if
(
LayerLookUpTable
[
ii
]
>=
CMP_N
)
if
(
LayerLookUpTable
[
ii
]
>=
LAST_COPPER_LAYER
)
continue
;
// not a copper layer
if
(
LayerLookUpTable
[
ii
]
>=
g_DesignSettings
.
m_CopperLayerCount
)
g_DesignSettings
.
m_CopperLayerCount
++
;
...
...
@@ -275,8 +275,8 @@ bool AsCmpLayer = false;
if
(
AsCmpLayer
)
g_DesignSettings
.
m_CopperLayerCount
++
;
if
(
g_DesignSettings
.
m_CopperLayerCount
>
CMP_N
+
1
)
// should not occur.
g_DesignSettings
.
m_CopperLayerCount
=
CMP_N
+
1
;
if
(
g_DesignSettings
.
m_CopperLayerCount
>
NB_COPPER_LAYERS
)
// should not occur.
g_DesignSettings
.
m_CopperLayerCount
=
NB_COPPER_LAYERS
;
EndModal
(
1
);
}
include/pcbstruct.h
View file @
57463862
...
...
@@ -35,6 +35,7 @@
/* Layer identification (layer number) */
#define FIRST_COPPER_LAYER 0
#define COPPER_LAYER_N 0
#define LAYER_N_2 1
/* Numero layer 2 */
#define LAYER_N_3 2
/* Numero layer 3 */
...
...
@@ -52,7 +53,8 @@
#define LAYER_N_15 14
/* Numero layer 15 */
#define LAYER_CMP_N 15
#define CMP_N 15
#define NB_COPPER_LAYERS (CMP_N + 1)
#define LAST_COPPER_LAYER 15
#define NB_COPPER_LAYERS (LAST_COPPER_LAYER + 1)
#define FIRST_NO_COPPER_LAYER 16
#define ADHESIVE_N_CU 16
...
...
pcbnew/basepcbframe.cpp
View file @
57463862
...
...
@@ -181,7 +181,7 @@ void WinEDA_BasePcbFrame::SwitchLayer( wxDC* DC, int layer )
// Copper layers cannot be selected unconditionally; how many
// of those layers are currently enabled needs to be checked.
if
(
(
layer
>=
COPPER_LAYER_N
)
&&
(
layer
<=
CMP_N
)
)
if
(
(
layer
>=
FIRST_COPPER_LAYER
)
&&
(
layer
<=
LAST_COPPER_LAYER
)
)
{
// If only one copper layer is enabled, the only such layer
// that can be selected to is the "Copper" layer (so the
...
...
pcbnew/class_edge_mod.cpp
View file @
57463862
...
...
@@ -173,7 +173,7 @@ void EDGE_MODULE::Draw( WinEDA_DrawPanel* panel, wxDC* DC,
GRSetDrawMode
(
DC
,
draw_mode
);
typeaff
=
frame
->
m_DisplayModEdge
;
if
(
m_Layer
<=
CMP_N
)
if
(
m_Layer
<=
LAST_COPPER_LAYER
)
{
typeaff
=
frame
->
m_DisplayPcbTrackFill
;
if
(
!
typeaff
)
...
...
pcbnew/class_pcb_text.cpp
View file @
57463862
...
...
@@ -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
<
COPPER_LAYER_N
)
m_Layer
=
COPPER_LAYER_N
;
if
(
m_Layer
<
FIRST_COPPER_LAYER
)
m_Layer
=
FIRST_COPPER_LAYER
;
if
(
m_Layer
>
LAST_NO_COPPER_LAYER
)
m_Layer
=
LAST_NO_COPPER_LAYER
;
...
...
pcbnew/class_track.cpp
View file @
57463862
...
...
@@ -268,7 +268,7 @@ int TRACK::ReturnMaskLayer()
if
(
via_type
==
VIA_THROUGH
)
return
ALL_CU_LAYERS
;
// VIA_BLIND o
u
VIA_BURIED:
// VIA_BLIND o
r
VIA_BURIED:
int
bottom_layer
,
top_layer
;
...
...
@@ -720,7 +720,7 @@ void TRACK::Draw( WinEDA_DrawPanel* panel, wxDC* DC, int draw_mode )
}
/* Shows clearance (for tracks and vias, not for zone segments */
if
(
DisplayOpt
.
DisplayTrackIsol
&&
(
m_Layer
<=
CMP_N
)
if
(
DisplayOpt
.
DisplayTrackIsol
&&
(
m_Layer
<=
LAST_COPPER_LAYER
)
&&
(
Type
()
==
TYPETRACK
||
Type
()
==
TYPEVIA
)
)
{
GRCSegm
(
&
panel
->
m_ClipBox
,
DC
,
m_Start
.
x
,
m_Start
.
y
,
...
...
pcbnew/cotation.cpp
View file @
57463862
...
...
@@ -136,12 +136,12 @@ WinEDA_CotationPropertiesFrame::WinEDA_CotationPropertiesFrame( WinEDA_PcbFrame*
wxDefaultPosition
,
wxDefaultSize
);
LeftBoxSizer
->
Add
(
m_SelLayerBox
,
0
,
wxGROW
|
wxLEFT
|
wxRIGHT
|
wxBOTTOM
,
5
);
int
ii
;
for
(
ii
=
CMP_N
+
1
;
ii
<
NB_LAYERS
;
ii
++
)
for
(
ii
=
FIRST_NO_COPPER_LAYER
;
ii
<
NB_LAYERS
;
ii
++
)
{
m_SelLayerBox
->
Append
(
ReturnPcbLayerName
(
ii
)
);
}
m_SelLayerBox
->
SetSelection
(
Cotation
->
GetLayer
()
-
(
CMP_N
+
1
)
);
m_SelLayerBox
->
SetSelection
(
Cotation
->
GetLayer
()
-
FIRST_NO_COPPER_LAYER
);
GetSizer
()
->
Fit
(
this
);
GetSizer
()
->
SetSizeHints
(
this
);
...
...
@@ -175,8 +175,8 @@ void WinEDA_CotationPropertiesFrame::OnOkClick( wxCommandEvent& event )
m_TxtWidthCtrl
->
GetValue
();
CurrentCotation
->
m_Text
->
m_Miroir
=
(
m_Mirror
->
GetSelection
()
==
0
)
?
1
:
0
;
CurrentCotation
->
SetLayer
(
m_SelLayerBox
->
GetChoice
()
+
CMP_N
+
1
);
CurrentCotation
->
m_Text
->
SetLayer
(
m_SelLayerBox
->
GetChoice
()
+
CMP_N
+
1
);
CurrentCotation
->
SetLayer
(
m_SelLayerBox
->
GetChoice
()
+
FIRST_NO_COPPER_LAYER
);
CurrentCotation
->
m_Text
->
SetLayer
(
m_SelLayerBox
->
GetChoice
()
+
FIRST_NO_COPPER_LAYER
);
CurrentCotation
->
m_Text
->
CreateDrawData
();
...
...
pcbnew/edgemod.cpp
View file @
57463862
...
...
@@ -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
,
COPPER_LAYER_N
,
LAST_NO_COPPER_LAYER
);
new_layer
=
SelectLayer
(
new_layer
,
FIRST_COPPER_LAYER
,
LAST_NO_COPPER_LAYER
);
if
(
new_layer
<
0
)
return
;
if
(
new_layer
>=
COPPER_LAYER_N
&&
new_layer
<=
LAYER_CMP_N
)
if
(
new_layer
>=
FIRST_COPPER_LAYER
&&
new_layer
<=
LAST_COPPER_LAYER
)
/* 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"
)
)
)
...
...
pcbnew/edit.cpp
View file @
57463862
...
...
@@ -632,7 +632,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
break
;
case
ID_POPUP_PCB_SELECT_CU_LAYER
:
itmp
=
SelectLayer
(
GetScreen
()
->
m_Active_Layer
,
-
1
,
CMP_N
);
itmp
=
SelectLayer
(
GetScreen
()
->
m_Active_Layer
,
-
1
,
LAST_COPPER_LAYER
);
if
(
itmp
>=
0
)
GetScreen
()
->
m_Active_Layer
=
itmp
;
break
;
...
...
@@ -1005,7 +1005,7 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
// Copper layers cannot be selected unconditionally; how many
// of those layers are currently enabled needs to be checked.
if
(
(
layer
>=
COPPER_LAYER_N
)
&&
(
layer
<=
CMP_N
)
)
if
(
(
layer
>=
FIRST_COPPER_LAYER
)
&&
(
layer
<=
LAST_COPPER_LAYER
)
)
{
// If only one copper layer is enabled, the only such layer
// that can be selected to is the "Copper" layer (so the
...
...
pcbnew/editedge.cpp
View file @
57463862
...
...
@@ -162,7 +162,7 @@ void WinEDA_PcbFrame::Delete_Drawings_All_Layer( DRAWSEGMENT* Segment, wxDC* DC
COTATION
*
Cotation
;
int
layer
=
Segment
->
GetLayer
();
if
(
layer
<=
CMP_N
)
if
(
layer
<=
LAST_COPPER_LAYER
)
{
DisplayError
(
this
,
_
(
"Copper layer global delete not allowed!"
),
20
);
return
;
...
...
pcbnew/hotkeys.cpp
View file @
57463862
...
...
@@ -202,12 +202,12 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
case
HK_SWITCH_LAYER_TO_PREVIOUS
:
ll
=
GetScreen
()
->
m_Active_Layer
;
if
(
(
ll
<=
COPPER_LAYER_N
)
||
(
ll
>
CMP_N
)
)
if
(
(
ll
<=
FIRST_COPPER_LAYER
)
||
(
ll
>
LAST_COPPER_LAYER
)
)
break
;
if
(
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
<
2
)
// Single layer
ll
=
COPPER_LAYER_N
;
else
if
(
ll
==
CMP_N
)
ll
=
MAX
(
COPPER_LAYER_N
,
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
-
2
);
else
if
(
ll
==
LAST_COPPER_LAYER
)
ll
=
MAX
(
FIRST_COPPER_LAYER
,
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
-
2
);
else
ll
--
;
SwitchLayer
(
DC
,
ll
);
...
...
@@ -215,12 +215,12 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
case
HK_SWITCH_LAYER_TO_NEXT
:
ll
=
GetScreen
()
->
m_Active_Layer
;
if
(
(
ll
<
COPPER_LAYER_N
)
||
(
ll
>=
CMP_N
)
)
if
(
(
ll
<
FIRST_COPPER_LAYER
)
||
(
ll
>=
LAST_COPPER_LAYER
)
)
break
;
if
(
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
<
2
)
// Single layer
ll
=
COPPER_LAYER_N
;
else
if
(
ll
>=
m_Pcb
->
m_BoardSettings
->
m_CopperLayerCount
-
2
)
ll
=
CMP_N
;
ll
=
LAST_COPPER_LAYER
;
else
ll
++
;
SwitchLayer
(
DC
,
ll
);
...
...
@@ -299,7 +299,7 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey,
break
;
case
HK_BACK_SPACE
:
if
(
m_ID_current_state
==
ID_TRACK_BUTT
&&
GetScreen
()
->
m_Active_Layer
<=
CMP_N
)
if
(
m_ID_current_state
==
ID_TRACK_BUTT
&&
GetScreen
()
->
m_Active_Layer
<=
LAST_COPPER_LAYER
)
{
if
(
ItemFree
)
{
...
...
@@ -570,7 +570,7 @@ bool WinEDA_PcbFrame::OnHotkeyDeleteItem( wxDC* DC, EDA_BaseStruct* DrawStruct )
switch
(
m_ID_current_state
)
{
case
ID_TRACK_BUTT
:
if
(
GetScreen
()
->
m_Active_Layer
>
CMP_N
)
if
(
GetScreen
()
->
m_Active_Layer
>
LAST_COPPER_LAYER
)
return
FALSE
;
if
(
ItemFree
)
{
...
...
pcbnew/onleftclick.cpp
View file @
57463862
...
...
@@ -163,9 +163,9 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
if
(
m_ID_current_state
==
ID_PCB_ARC_BUTT
)
shape
=
S_ARC
;
if
(
GetScreen
()
->
m_Active_Layer
<=
CMP_N
)
if
(
GetScreen
()
->
m_Active_Layer
<=
LAST_COPPER_LAYER
)
{
DisplayError
(
this
,
_
(
"Graphic not autorized on Copper layers"
)
);
DisplayError
(
this
,
_
(
"Graphic not aut
h
orized on Copper layers"
)
);
break
;
}
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
...
...
@@ -186,7 +186,7 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
}
case
ID_TRACK_BUTT
:
if
(
GetScreen
()
->
m_Active_Layer
>
CMP_N
)
if
(
GetScreen
()
->
m_Active_Layer
>
LAST_COPPER_LAYER
)
{
DisplayError
(
this
,
_
(
"Tracks on Copper layers only "
)
);
break
;
...
...
@@ -262,9 +262,9 @@ void WinEDA_PcbFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
break
;
case
ID_PCB_COTATION_BUTT
:
if
(
GetScreen
()
->
m_Active_Layer
<=
CMP_N
)
if
(
GetScreen
()
->
m_Active_Layer
<=
LAST_COPPER_LAYER
)
{
DisplayError
(
this
,
_
(
"Cotation not autorized on Copper layers"
)
);
DisplayError
(
this
,
_
(
"Cotation not aut
h
orized on Copper layers"
)
);
break
;
}
if
(
(
DrawStruct
==
NULL
)
||
(
DrawStruct
->
m_Flags
==
0
)
)
...
...
@@ -426,4 +426,3 @@ void WinEDA_PcbFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
break
;
}
}
pcbnew/plotgerb.cpp
View file @
57463862
This diff is collapsed.
Click to expand it.
pcbnew/plothpgl.cpp
View file @
57463862
...
...
@@ -136,7 +136,7 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer )
switch
(
Layer
)
{
case
COPPER_LAYER_N
:
case
FIRST_COPPER_LAYER
:
case
LAYER_N_2
:
case
LAYER_N_3
:
case
LAYER_N_4
:
...
...
@@ -151,7 +151,7 @@ void WinEDA_BasePcbFrame::Genere_HPGL( const wxString& FullFileName, int Layer )
case
LAYER_N_13
:
case
LAYER_N_14
:
case
LAYER_N_15
:
case
CMP_N
:
case
LAST_COPPER_LAYER
:
Plot_Layer_HPGL
(
dest
,
layer_mask
,
0
,
1
,
modetrace
);
break
;
...
...
pcbnew/plotps.cpp
View file @
57463862
...
...
@@ -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
COPPER_LAYER_N
:
case
FIRST_COPPER_LAYER
:
case
LAYER_N_2
:
case
LAYER_N_3
:
case
LAYER_N_4
:
...
...
@@ -193,7 +193,7 @@ void WinEDA_BasePcbFrame::Genere_PS( const wxString& FullFileName, int Layer )
case
LAYER_N_13
:
case
LAYER_N_14
:
case
LAYER_N_15
:
case
CMP_N
:
case
LAST_COPPER_LAYER
:
Plot_Layer_PS
(
dest
,
layer_mask
,
0
,
1
,
modetrace
);
break
;
...
...
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