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
fd0a89c2
Commit
fd0a89c2
authored
Nov 22, 2007
by
g_harland
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug in GerbView's Export to Pcbnew command
parent
6d0a8f2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
10 deletions
+11
-10
export_to_pcbnew.cpp
gerbview/export_to_pcbnew.cpp
+5
-5
select_layers_to_pcb.cpp
gerbview/select_layers_to_pcb.cpp
+6
-5
No files found.
gerbview/export_to_pcbnew.cpp
View file @
fd0a89c2
...
...
@@ -29,10 +29,10 @@ void WinEDA_GerberFrame::ExportDataInPcbnewFormat( wxCommandEvent& event )
bool
no_used_layers
=
true
;
// Changed to false if any used layer found
// Check whether any of the Gerber layers are actually currently used
while
(
no_used_layers
&&
ii
<
32
)
{
if
(
g_GERBER_Descr_List
[
ii
]
!=
NULL
)
no_used_layers
=
false
;
while
(
no_used_layers
&&
ii
<
32
)
{
if
(
g_GERBER_Descr_List
[
ii
]
!=
NULL
)
no_used_layers
=
false
;
ii
++
;
}
...
...
@@ -150,7 +150,7 @@ static int SavePcbFormatAscii( WinEDA_GerberFrame* frame, FILE* aFile,
{
int
layer
=
track
->
GetLayer
();
int
pcb_layer_number
=
LayerLookUpTable
[
layer
];
if
(
pcb_layer_number
<
0
)
if
(
pcb_layer_number
<
0
||
pcb_layer_number
>
LAST_NO_COPPER_LAYER
)
continue
;
if
(
pcb_layer_number
>
LAST_COPPER_LAYER
)
...
...
gerbview/select_layers_to_pcb.cpp
View file @
fd0a89c2
...
...
@@ -13,6 +13,7 @@
#include "wx/statline.h"
/* Variables locales */
#define LAYER_UNSELECTED NB_LAYERS
static
int
ButtonTable
[
32
];
// Indexes buttons to Gerber layers
static
int
LayerLookUpTable
[
32
];
// Indexes Gerber layers to PCB file layers
wxStaticText
*
layer_list
[
32
];
// Indexes text strings to buttons
...
...
@@ -57,7 +58,7 @@ private:
/* Table des evenements pour WinEDA_SwapLayerFrame */
BEGIN_EVENT_TABLE
(
WinEDA_SwapLayerFrame
,
wxDialog
)
EVT_COMMAND_RANGE
(
ID_BUTTON_0
,
ID_BUTTON_0
+
NB_LAYERS
-
1
,
EVT_COMMAND_RANGE
(
ID_BUTTON_0
,
ID_BUTTON_0
+
3
1
,
wxEVT_COMMAND_BUTTON_CLICKED
,
WinEDA_SwapLayerFrame
::
Sel_Layer
)
EVT_BUTTON
(
wxID_OK
,
WinEDA_SwapLayerFrame
::
OnOkClick
)
...
...
@@ -131,7 +132,7 @@ WinEDA_SwapLayerFrame::WinEDA_SwapLayerFrame(WinEDA_GerberFrame *parent) :
// Specify the default value for each member of these arrays.
ButtonTable
[
ii
]
=
-
1
;
LayerLookUpTable
[
ii
]
=
NB_LAYERS
;
// Value associated with deselected Gerber layer
LayerLookUpTable
[
ii
]
=
LAYER_UNSELECTED
;
// Value associated with deselected Gerber layer
}
int
pcb_layer_number
=
0
;
...
...
@@ -312,17 +313,17 @@ void WinEDA_SwapLayerFrame::Sel_Layer(wxCommandEvent& event)
ii
=
event
.
GetId
()
-
ID_BUTTON_0
;
jj
=
LayerLookUpTable
[
ButtonTable
[
ii
]];
if
(
(
jj
<
0
)
||
(
jj
>
NB_LAYERS
)
)
if
(
(
jj
<
0
)
||
(
jj
>
LAYER_UNSELECTED
)
)
jj
=
0
;
// (Defaults to "Copper" layer.)
jj
=
m_Parent
->
SelectLayer
(
jj
,
-
1
,
-
1
,
true
);
if
(
(
jj
<
0
)
||
(
jj
>
NB_LAYERS
)
)
if
(
(
jj
<
0
)
||
(
jj
>
LAYER_UNSELECTED
)
)
return
;
if
(
jj
!=
LayerLookUpTable
[
ButtonTable
[
ii
]]
)
{
LayerLookUpTable
[
ButtonTable
[
ii
]]
=
jj
;
if
(
jj
==
NB_LAYERS
)
if
(
jj
==
LAYER_UNSELECTED
)
{
layer_list
[
ii
]
->
SetLabel
(
_
(
"Do not export"
)
);
// Change the text color to blue (to highlight
...
...
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