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
e460b4a5
Commit
e460b4a5
authored
Jun 30, 2014
by
Dick Hollenbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix export_gencad.cpp
parent
516c386a
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
142 additions
and
154 deletions
+142
-154
layers_id_colors_and_visibility.h
include/layers_id_colors_and_visibility.h
+2
-1
class_board.cpp
pcbnew/class_board.cpp
+1
-4
class_board.h
pcbnew/class_board.h
+1
-1
dialog_copper_zones.cpp
pcbnew/dialogs/dialog_copper_zones.cpp
+3
-1
export_gencad.cpp
pcbnew/exporters/export_gencad.cpp
+125
-138
pcb_plot_params.cpp
pcbnew/pcb_plot_params.cpp
+7
-8
zones_non_copper_type_functions.cpp
pcbnew/zones_non_copper_type_functions.cpp
+3
-1
No files found.
include/layers_id_colors_and_visibility.h
View file @
e460b4a5
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2014 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2010 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2007 KiCad Developers, see change_log.txt for contributors.
*
...
...
@@ -106,7 +107,7 @@ enum LAYER_ID
Edge_Cuts
,
Margin
,
F_CrtYd
,
// CrtYd &
Body
are footprint only
F_CrtYd
,
// CrtYd &
Fab
are footprint only
B_CrtYd
,
F_Fab
,
B_Fab
,
...
...
pcbnew/class_board.cpp
View file @
e460b4a5
...
...
@@ -323,11 +323,8 @@ bool BOARD::SetLayer( LAYER_ID aIndex, const LAYER& aLayer )
}
wxString
BOARD
::
GetLayerName
(
LAYER_ID
aLayer
)
const
const
wxString
BOARD
::
GetLayerName
(
LAYER_ID
aLayer
)
const
{
if
(
!
IsPcbLayer
(
aLayer
)
)
return
wxEmptyString
;
// All layer names are stored in the BOARD.
if
(
IsLayerEnabled
(
aLayer
)
)
{
...
...
pcbnew/class_board.h
View file @
e460b4a5
...
...
@@ -644,7 +644,7 @@ public:
* @return wxString - the layer name, which for copper layers may
* be custom, else standard.
*/
wxString
GetLayerName
(
LAYER_ID
aLayer
)
const
;
const
wxString
GetLayerName
(
LAYER_ID
aLayer
)
const
;
/**
* Function SetLayerName
...
...
pcbnew/dialogs/dialog_copper_zones.cpp
View file @
e460b4a5
...
...
@@ -262,7 +262,9 @@ void DIALOG_COPPER_ZONE::initDialog()
m_LayerId
.
push_back
(
layer
);
msg
=
board
->
GetLayerName
(
layer
).
Trim
();
msg
=
board
->
GetLayerName
(
layer
);
msg
.
Trim
();
EDA_COLOR_T
layerColor
=
board
->
GetLayerColor
(
layer
);
...
...
pcbnew/exporters/export_gencad.cpp
View file @
e460b4a5
...
...
@@ -99,24 +99,20 @@ static const wxString GenCADLayerNameFlipped[32] =
static
std
::
string
GenCADLayerName
(
int
aCuCount
,
LAYER_ID
aId
)
{
char
tmp
[
60
];
if
(
IsCopperLayer
(
aId
)
)
{
if
(
aId
==
F_Cu
)
return
"TOP"
;
else
if
(
aId
==
B_Cu
)
return
"BOTTO
N
"
;
return
"BOTTO
M
"
;
else
if
(
aId
<=
14
)
{
int
len
=
sprintf
(
tmp
,
"INNER%d"
,
aCuCount
-
aId
);
return
std
::
string
(
tmp
,
len
);
return
StrPrintf
(
"INNER%d"
,
aCuCount
-
aId
-
1
);
}
else
{
int
len
=
sprintf
(
tmp
,
"LAYER%d"
,
aId
);
return
std
::
string
(
tmp
,
len
);
return
StrPrintf
(
"LAYER%d"
,
aId
);
}
}
...
...
@@ -161,73 +157,65 @@ static std::string GenCADLayerName( int aCuCount, LAYER_ID aId )
};
static
const
LAYER_ID
gc_seq
[]
=
{
B_Cu
,
In30_Cu
,
In29_Cu
,
In28_Cu
,
In27_Cu
,
In26_Cu
,
In25_Cu
,
In24_Cu
,
In23_Cu
,
In22_Cu
,
In21_Cu
,
In20_Cu
,
In19_Cu
,
In18_Cu
,
In17_Cu
,
In16_Cu
,
In15_Cu
,
In14_Cu
,
In13_Cu
,
In12_Cu
,
In11_Cu
,
In10_Cu
,
In9_Cu
,
In8_Cu
,
In7_Cu
,
In6_Cu
,
In5_Cu
,
In4_Cu
,
In3_Cu
,
In2_Cu
,
In1_Cu
,
F_Cu
,
};
// flipped layer name for Gencad export (to make CAM350 imports correct)
static
std
::
string
GenCADLayerNameFlipped
(
int
aCuCount
,
LAYER_ID
aId
)
{
char
tmp
[
60
];
if
(
IsCopperLayer
(
aId
)
)
if
(
1
<=
aId
&&
aId
<=
14
)
{
if
(
aId
==
F_Cu
)
return
"BOTTOM"
;
else
if
(
aId
==
B_Cu
)
return
"TOP"
;
else
if
(
aId
<=
14
)
{
int
len
=
sprintf
(
tmp
,
"INNER%d"
,
aId
);
return
std
::
string
(
tmp
,
len
);
}
else
{
int
len
=
sprintf
(
tmp
,
"LAYER%d"
,
aId
);
// this is probably wrong, need help.
return
std
::
string
(
tmp
,
len
);
}
}
else
{
const
char
*
txt
;
// using a switch to clearly show mapping & catch out of bounds index.
switch
(
aId
)
{
// Technicals
case
F_Adhes
:
txt
=
"B.Adhes"
;
break
;
case
B_Adhes
:
txt
=
"F.Adhes"
;
break
;
case
F_Paste
:
txt
=
"SOLDERPASTE_BOTTOM"
;
break
;
case
B_Paste
:
txt
=
"SOLDERPASTE_TOP"
;
break
;
case
F_SilkS
:
txt
=
"SILKSCREEN_BOTTOM"
;
break
;
case
B_SilkS
:
txt
=
"SILKSCREEN_TOP"
;
break
;
case
F_Mask
:
txt
=
"SOLDERMASK_BOTTOM"
;
break
;
case
B_Mask
:
txt
=
"SOLDERMASK_TOP"
;
break
;
// Users
case
Dwgs_User
:
txt
=
"Dwgs.User"
;
break
;
case
Cmts_User
:
txt
=
"Cmts.User"
;
break
;
case
Eco1_User
:
txt
=
"Eco1.User"
;
break
;
case
Eco2_User
:
txt
=
"Eco2.User"
;
break
;
case
Edge_Cuts
:
txt
=
"Edge.Cuts"
;
break
;
case
Margin
:
txt
=
"Margin"
;
break
;
// Footprint
case
B_CrtYd
:
txt
=
"F_CrtYd"
;
break
;
case
F_CrtYd
:
txt
=
"B_CrtYd"
;
break
;
case
B_Fab
:
txt
=
"F_Fab"
;
break
;
case
F_Fab
:
txt
=
"B_Fab"
;
break
;
default
:
wxASSERT_MSG
(
0
,
wxT
(
"aId UNEXPECTED"
)
);
txt
=
"BAD-INDEX!"
;
break
;
return
StrPrintf
(
"INNER%d"
,
14
-
aId
);
}
return
txt
;
}
return
GenCADLayerName
(
aCuCount
,
aId
);
};
#endif
static
std
::
string
fmt_mask
(
LSET
aSet
)
{
#if 0
return aSet.FmtHex();
#else
return
StrPrintf
(
"%08x"
,
(
unsigned
)
(
aSet
&
LSET
::
AllCuMask
()
).
to_ulong
()
);
#endif
}
// These are the export origin (the auxiliary axis)
static
int
GencadOffsetX
,
GencadOffsetY
;
...
...
@@ -255,9 +243,6 @@ static double MapYTo( int aY )
/* Driver function: processing starts here */
void
PCB_EDIT_FRAME
::
ExportToGenCAD
(
wxCommandEvent
&
aEvent
)
{
#if 0 // working on this 30-Jun-14, not ready yet, failed the initial testing.
wxFileName
fn
=
GetBoard
()
->
GetFileName
();
FILE
*
file
;
...
...
@@ -347,8 +332,6 @@ void PCB_EDIT_FRAME::ExportToGenCAD( wxCommandEvent& aEvent )
module
->
SetFlag
(
0
);
}
}
#endif
}
...
...
@@ -426,9 +409,11 @@ static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb )
// Emit vias pads
TRACK
*
old_via
=
0
;
for
(
unsigned
i
=
0
;
i
<
vias
.
size
();
i
++
)
{
VIA
*
via
=
vias
[
i
];
if
(
old_via
&&
0
==
ViaSort
(
&
old_via
,
&
via
)
)
continue
;
...
...
@@ -436,7 +421,7 @@ static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb )
viastacks
.
push_back
(
via
);
fprintf
(
aFile
,
"PAD V%d.%d.%s ROUND %g
\n
CIRCLE 0 0 %g
\n
"
,
via
->
GetWidth
(),
via
->
GetDrillValue
(),
via
->
GetLayerSet
().
FmtHex
(
).
c_str
(),
fmt_mask
(
via
->
GetLayerSet
()
).
c_str
(),
via
->
GetDrillValue
()
/
SCALE_FACTOR
,
via
->
GetWidth
()
/
(
SCALE_FACTOR
*
2
)
);
}
...
...
@@ -557,8 +542,8 @@ static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb )
pad
->
GetOffset
().
x
/
SCALE_FACTOR
,
(
-
pad
->
GetOffset
().
y
-
dr
)
/
SCALE_FACTOR
);
}
break
;
}
break
;
case
PAD_TRAPEZOID
:
fprintf
(
aFile
,
" POLYGON %g
\n
"
,
...
...
@@ -583,16 +568,16 @@ static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb )
fprintf
(
aFile
,
"PADSTACK VIA%d.%d.%s %g
\n
"
,
via
->
GetWidth
(),
via
->
GetDrillValue
(),
mask
.
FmtHex
(
).
c_str
(),
fmt_mask
(
mask
).
c_str
(),
via
->
GetDrillValue
()
/
SCALE_FACTOR
);
for
(
LSEQ
seq
=
mask
.
Seq
();
seq
;
++
seq
)
for
(
LSEQ
seq
=
mask
.
Seq
(
gc_seq
,
DIM
(
gc_seq
)
);
seq
;
++
seq
)
{
LAYER_ID
layer
=
*
seq
;
fprintf
(
aFile
,
"PAD V%d.%d.%s %s 0 0
\n
"
,
via
->
GetWidth
(),
via
->
GetDrillValue
(),
mask
.
FmtHex
(
).
c_str
(),
fmt_mask
(
mask
).
c_str
(),
GenCADLayerName
(
cu_count
,
layer
).
c_str
()
);
}
...
...
@@ -612,7 +597,8 @@ static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb )
LSET
pad_set
=
pad
->
GetLayerSet
()
&
master_layermask
;
for
(
LSEQ
seq
=
pad_set
.
Seq
();
seq
;
++
seq
)
// the special gc_seq
for
(
LSEQ
seq
=
pad_set
.
Seq
(
gc_seq
,
DIM
(
gc_seq
)
);
seq
;
++
seq
)
{
LAYER_ID
layer
=
*
seq
;
...
...
@@ -622,6 +608,7 @@ static void CreatePadsShapesSection( FILE* aFile, BOARD* aPcb )
// Flipped padstack
fprintf
(
aFile
,
"PADSTACK PAD%dF %g
\n
"
,
i
,
pad
->
GetDrillSize
().
x
/
SCALE_FACTOR
);
// the normal LAYER_ID sequence is inverted from gc_seq[]
for
(
LSEQ
seq
=
pad_set
.
Seq
();
seq
;
++
seq
)
{
LAYER_ID
layer
=
*
seq
;
...
...
@@ -990,7 +977,7 @@ static void CreateRoutesSection( FILE* aFile, BOARD* aPcb )
fprintf
(
aFile
,
"VIA VIA%d.%d.%s %g %g ALL %g via%d
\n
"
,
via
->
GetWidth
(),
via
->
GetDrillValue
(),
vset
.
FmtHex
(
).
c_str
(),
fmt_mask
(
vset
).
c_str
(),
MapXTo
(
via
->
GetStart
().
x
),
MapYTo
(
via
->
GetStart
().
y
),
via
->
GetDrillValue
()
/
SCALE_FACTOR
,
vianum
++
);
}
...
...
pcbnew/pcb_plot_params.cpp
View file @
e460b4a5
...
...
@@ -132,9 +132,6 @@ void PCB_PLOT_PARAMS::Format( OUTPUTFORMATTER* aFormatter,
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_usegerberextensions
),
m_useGerberExtensions
?
trueStr
:
falseStr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_usegerberextensions
),
m_useGerberExtensions
?
trueStr
:
falseStr
);
if
(
m_useGerberAttributes
)
// save this option only if active,
// to avoid incompatibility with older Pcbnew version
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %s)
\n
"
,
getTokenName
(
T_usegerberattributes
),
trueStr
);
...
...
@@ -153,10 +150,12 @@ void PCB_PLOT_PARAMS::Format( OUTPUTFORMATTER* aFormatter,
m_useAuxOrigin
?
trueStr
:
falseStr
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %d)
\n
"
,
getTokenName
(
T_hpglpennumber
),
m_HPGLPenNum
);
// Obsolete parameter, pen speed is no more managed, because hpgl format
// is now an export format, and for this, pen speed has no meaning
// aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
// m_HPGLPenSpeed );
// Obsolete parameter, pen speed is no more managed, because hpgl format
// is now an export format, and for this, pen speed has no meaning
// aFormatter->Print( aNestLevel+1, "(%s %d)\n", getTokenName( T_hpglpenspeed ),
// m_HPGLPenSpeed );
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %d)
\n
"
,
getTokenName
(
T_hpglpenspeed
),
m_HPGLPenSpeed
);
aFormatter
->
Print
(
aNestLevel
+
1
,
"(%s %d)
\n
"
,
getTokenName
(
T_hpglpendiameter
),
...
...
pcbnew/zones_non_copper_type_functions.cpp
View file @
e460b4a5
...
...
@@ -105,7 +105,9 @@ void DIALOG_NON_COPPER_ZONES_EDITOR::Init()
{
LAYER_ID
layer
=
*
seq
;
wxString
msg
=
m_Parent
->
GetBoard
()
->
GetLayerName
(
layer
).
Trim
();
wxString
msg
=
m_Parent
->
GetBoard
()
->
GetLayerName
(
layer
);
msg
.
Trim
();
m_LayerSelectionCtrl
->
InsertItems
(
1
,
&
msg
,
ii
);
...
...
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