Move data field sorting to NamedField

This commit is contained in:
2023-05-24 01:01:48 +02:00
parent 9466290ff3
commit 1bbac4537d
5 changed files with 55 additions and 26 deletions

View File

@ -1,6 +1,7 @@
#ifndef NAMEDFIELD_HPP
#define NAMEDFIELD_HPP
#include "params.h"
#include "touchgfx/TypedText.hpp"
#include "touchgfx/Unicode.hpp"
#include <stddef.h>
@ -29,6 +30,13 @@ struct NamedFieldDescription {
extern NamedFieldDescription dataFieldDescs[];
extern NamedFieldDescription paramFieldDescs[];
extern DataFieldType dataFieldByAlphaIndex[];
extern size_t dataFieldAlphaIndexByField[];
extern ParamType paramByAlphaIndex[];
extern size_t paramAlphaIndexByParam[];
void namedFieldSort();
template <class T> class NamedField {
public:
NamedField(const NamedFieldDescription *fieldDescs);

View File

@ -52,8 +52,6 @@ private:
size_t selectedField;
size_t selectedFieldIndex;
DataFieldType fieldTypes[NUM_FIELDS];
size_t indexByFieldType[DataFieldType_COUNT];
DataFieldType fieldTypeByIndex[DataFieldType_COUNT];
touchgfx::Unicode::UnicodeChar r2dProgBuffer[16];
};