exploring custom layer names
This commit is contained in:
parent
73b23e3ab1
commit
8de0bf46a7
|
@ -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 " ),
|
||||
|
@ -297,12 +359,15 @@ wxString ReturnPcbLayerName( int layer_number, bool omitSpacePadding )
|
|||
wxT( "EdgesPcb" ), wxT( "---" ), wxT( "---" ), wxT( "---" )
|
||||
};
|
||||
|
||||
|
||||
if( (unsigned) layer_number >= 31u )
|
||||
layer_number = 31;
|
||||
|
||||
return omitSpacePadding ?
|
||||
layer_name_list_for_filename[layer_number] :
|
||||
layer_name_list[layer_number];
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue