YAML storage (#7071)

YAML storage
This commit is contained in:
Raphael Coeffic
2019-11-12 14:50:05 +01:00
committed by Bertrand Songis
parent bb2ca31dad
commit 8b4d2b698d
69 changed files with 5577 additions and 425 deletions
+19 -1
View File
@@ -23,7 +23,11 @@
#include <stdint.h>
#include <list>
#include "sdcard.h"
#if !defined(SDCARD_YAML)
#include "sdcard_raw.h"
#endif
#define MODELCELL_WIDTH 172
#define MODELCELL_HEIGHT 59
@@ -48,11 +52,13 @@ class ModelCell
SimpleModuleData moduleData[NUM_MODULES];
explicit ModelCell(const char * name);
explicit ModelCell(const char * name, uint8_t len);
~ModelCell();
void save(FIL* file);
void setModelName(char* name);
void setModelName(char* name, uint8_t len);
void setRfData(ModelData* model);
void setModelId(uint8_t moduleIdx, uint8_t id);
@@ -69,11 +75,13 @@ public:
char name[LEN_MODEL_FILENAME+1];
explicit ModelsCategory(const char * name);
explicit ModelsCategory(const char * name, uint8_t len);
~ModelsCategory();
ModelCell * addModel(const char * name);
void removeModel(ModelCell * model);
void moveModel(ModelCell * model, int8_t step);
void save(FIL * file);
};
@@ -100,6 +108,11 @@ public:
{
return categories;
}
std::list<ModelsCategory *>& getCategories()
{
return categories;
}
void setCurrentCategorie(ModelsCategory * cat);
@@ -115,6 +128,10 @@ public:
return currentModel;
}
void incModelsCount() {
modelsCount++;
}
unsigned int getModelsCount() const
{
return modelsCount;
@@ -122,7 +139,8 @@ public:
bool readNextLine(char * line, int maxlen);
ModelsCategory * createCategory();
ModelsCategory * createCategory(bool save=true);
ModelsCategory * createCategory(const char * name, bool save=true);
void removeCategory(ModelsCategory * category);
ModelCell * addModel(ModelsCategory * category, const char * name);