47 static const wxString alphaNumeric = wxS(
"0123456789" );
48 static const wxString alphaHex = wxS(
"0123456789ABCDEF" );
49 static const wxString alphaFull = wxS(
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" );
50 static const wxString alphaNoIOSQXZ = wxS(
"ABCDEFGHJKLMNPRTUVWY" );
69 if( str.length() == 0 )
70 return std::optional<int>{};
75 const int radix = alphabet.length();
77 for(
unsigned i = 0; i < str.length(); i++ )
79 int chIndex = alphabet.Find( str[i],
false );
81 if( chIndex == wxNOT_FOUND )
82 return std::optional<int>{};
87 if( start0 && i < str.length() - 1 )
94 return std::optional<int>{ offset };
static bool schemeNonUnitColsStartAt0(ARRAY_AXIS::NUMBERING_TYPE type)
bool SetOffset(const wxString &aOffsetName)
Set the axis start (as a string, which should decode to a valid index in the alphabet)
int m_offset
Skip every 'n' numbers.
wxString GetItemNumber(int n) const
Get the position number (name) for the n'th axis point.
const wxString & GetAlphabet() const
Get the alphabet for the current numbering scheme.
void SetAxisType(NUMBERING_TYPE aType)
Set the axis numbering type.
@ NUMBERING_NUMERIC
Arabic numerals: 0,1,2,3,4,5,6,7,8,9,10,11...
@ NUMBERING_ALPHA_NO_IOSQXZ
@ NUMBERING_ALPHA_FULL
Full 26-character alphabet.
std::optional< int > getNumberingOffset(const wxString &str) const
Get the numbering offset for a given numbering string.
void SetStep(int aStep)
Set the skip between consecutive numbers (useful when doing a partial array, e.g.
int GetOffset() const
Get the numbering offset for the axis.
wxString KICOMMON_API AlphabeticFromIndex(size_t aN, const wxString &aAlphabet, bool aZeroBasedNonUnitCols)
Get an alphabetic string like A, B, ... Z, AA, AB, ... ZZ, AAA, ...