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
8de0bf46
Commit
8de0bf46
authored
Jan 05, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
exploring custom layer names
parent
73b23e3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
0 deletions
+65
-0
common.cpp
common/common.cpp
+65
-0
No files found.
common/common.cpp
View file @
8de0bf46
...
...
@@ -13,6 +13,7 @@
#include "macros.h"
#include "build_version.h"
/*****************************/
wxString
GetBuildVersion
()
/*****************************/
...
...
@@ -264,6 +265,8 @@ void MyFree( void* pt_mem )
}
/**************************************************************/
wxString
ReturnPcbLayerName
(
int
layer_number
,
bool
omitSpacePadding
)
/**************************************************************/
...
...
@@ -273,6 +276,65 @@ wxString ReturnPcbLayerName( int layer_number, bool omitSpacePadding )
* (not internatinalized, no space)
*/
{
#if 0 || defined(DEBUG)
// Dick: this code is working fine, but we have no place to store the layer names yet.
const unsigned LAYER_LIMIT = 29;
// @todo: these layer names should be configurable on a per project basis.
// In anticipation of that enhancement, here is a different strategy for
// deriving the file names from the "configured" layer names.
// The main idea is to use a single array of names, and then remove
// spaces on the fly from the names when writing to disk.
#if 1 // my specific layer names
static const wxString layer_name_list[] = {
_( "H2 Bottom" ), _( "Power" ), _( "V2 Signal" ), _( "H1 Signal" ),
_( "Ground" ), _( "Inner L5 " ), _( "Inner L6 " ), _( "Inner L7 " ),
_( "Inner L8 " ), _( "Inner L9 " ), _( "Inner L10" ), _( "Inner L11" ),
_( "Inner L12" ), _( "Inner L13" ), _( "Inner L14" ), _( "Component" ),
_( "Adhes Cop" ), _( "Adhes Cmp" ), _( "SoldP Cop" ), _( "SoldP Cmp" ),
_( "SilkS Cop" ), _( "SilkS Cmp" ), _( "Mask Cop " ), _( "Mask Cmp " ),
_( "Drawings " ), _( "Comments " ), _( "Eco1 " ), _( "Eco2 " ),
_( "Edges Pcb" ), _( "BAD INDEX" ),
};
#else
static const wxString layer_name_list[] = {
_( "Copper " ), _( "Inner L1 " ), _( "Inner L2 " ), _( "Inner L3 " ),
_( "Inner L4 " ), _( "Inner L5 " ), _( "Inner L6 " ), _( "Inner L7 " ),
_( "Inner L8 " ), _( "Inner L9 " ), _( "Inner L10" ), _( "Inner L11" ),
_( "Inner L12" ), _( "Inner L13" ), _( "Inner L14" ), _( "Component" ),
_( "Adhes Cop" ), _( "Adhes Cmp" ), _( "SoldP Cop" ), _( "SoldP Cmp" ),
_( "SilkS Cop" ), _( "SilkS Cmp" ), _( "Mask Cop " ), _( "Mask Cmp " ),
_( "Drawings " ), _( "Comments " ), _( "Eco1 " ), _( "Eco2 " ),
_( "Edges Pcb" ), _( "BAD INDEX" ),
};
#endif
if
(
(
unsigned
)
layer_number
>
LAYER_LIMIT
)
layer_number
=
LAYER_LIMIT
;
const
wxString
*
p
=
&
layer_name_list
[
layer_number
];
if
(
omitSpacePadding
)
{
wxString
ret
=
*
p
;
// copy the string
// modify the copy
ret
.
Trim
();
ret
.
Replace
(
wxT
(
" "
),
wxT
(
"_"
)
);
return
ret
;
}
else
return
*
p
;
#else // long standing established code:
static
const
wxString
layer_name_list
[]
=
{
_
(
"Copper "
),
_
(
"Inner L1 "
),
_
(
"Inner L2 "
),
_
(
"Inner L3 "
),
_
(
"Inner L4 "
),
_
(
"Inner L5 "
),
_
(
"Inner L6 "
),
_
(
"Inner L7 "
),
...
...
@@ -296,6 +358,7 @@ wxString ReturnPcbLayerName( int layer_number, bool omitSpacePadding )
wxT
(
"Drawings"
),
wxT
(
"Comments"
),
wxT
(
"Eco1"
),
wxT
(
"Eco2"
),
wxT
(
"EdgesPcb"
),
wxT
(
"---"
),
wxT
(
"---"
),
wxT
(
"---"
)
};
if
(
(
unsigned
)
layer_number
>=
31u
)
layer_number
=
31
;
...
...
@@ -303,6 +366,8 @@ wxString ReturnPcbLayerName( int layer_number, bool omitSpacePadding )
return
omitSpacePadding
?
layer_name_list_for_filename
[
layer_number
]
:
layer_name_list
[
layer_number
];
#endif
}
...
...
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