45 static const wxString alphaNumeric = wxS(
"0123456789" );
46 static const wxString alphaHex = wxS(
"0123456789ABCDEF" );
47 static const wxString alphaFull = wxS(
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" );
48 static const wxString alphaNoIOSQXZ = wxS(
"ABCDEFGHJKLMNPRTUVWY" );
67 if( str.length() == 0 )
68 return std::optional<int>{};
73 const int radix = alphabet.length();
75 for(
unsigned i = 0; i < str.length(); i++ )
77 int chIndex = alphabet.Find( str[i],
false );
79 if( chIndex == wxNOT_FOUND )
80 return std::optional<int>{};
85 if( start0 && i < str.length() - 1 )
92 return std::optional<int>{ offset };
140 bool firstRound =
true;
141 int radix = alphabet.Length();
147 int modN = n % radix;
149 if( nonUnitColsStartAt0 && !firstRound )
152 itemNum.insert( 0, 1, alphabet[modN] );
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.