Oddělení ELC1 generatoru a readeru

This commit is contained in:
2024-01-31 14:19:23 +01:00
parent a7fc519138
commit c0b36e9068
35 changed files with 1528 additions and 81 deletions

View File

@@ -37,9 +37,24 @@ enum class GeneralError
EncryptError = 10,
DecryptError = 11,
ParamMissing = 12,
IvanlidParam = 13
IvanlidParam = 13,
SDCardReadError = 50,
LicenceReadError = 51,
LicenceSizeMismatch = 52,
LicenceSizeCardMismatch = 53,
LicenceMismatch = 54,
ItemsCountMismatch = 61
};
// unordered_map<GeneralError, string> mapGeneralErrors = {
// {GeneralError::SDCardReadError, "Nepodařilo se načíst SD kartu."},
// {GeneralError::ItemsCountMismatch, "Nesouhlasí počet položek licence."},
// {GeneralError::LicenceSizeMismatch, "Nesouhlasí velikost souboru licence."},
// {GeneralError::LicenceSizeCardMismatch, "Nesouhlasí velikost SD karty."},
// {GeneralError::LicenceMismatch, "Nesouhlasí licence."},
// {GeneralError::ItemsCountMismatch, "Nesouhlasí počet položek licence."}
// };
enum class ELCType
{
ELC1 = 1,
@@ -112,24 +127,35 @@ struct LicenceIdentification
string licenceFilePath = "";
};
// struct LicData
// {
// string station = "";
// string distributor = "";
// string licenceName = "";
// string projectDescription = "";
// string cid = ""; // CID z SD karty
// string csd = ""; // CSD z SD karty
// string uid = ""; // jedinečný identifikátor z jiného systému
// pugi::xml_document *doc;
// };
/// @brief obecná struktura polozky licence, defaultní kompatibilita
struct LicenceItem
{
int protocolId = -1;
int dataPointsCount = 0;
};
/// @brief struktura polozky licence, kompatibilita 1
struct LicenceItemCompatibility1
{
int protocolId = -1;
int dataPointsCount = 0;
};
/// @brief struktura polozky licence, kompatibilita 2
struct LicenceItemCompatibility2
{
int protocolId = -1;
int dataPointsCount = 0;
};
/// @brief struktura polozky licence, kompatibilita 3
struct LicenceItemCompatibility3
{
int protocolId = -1;
int dataPointsCount = 0;
};
struct LicenceItem11
{
int protocolId = -1;
@@ -148,12 +174,34 @@ struct LicenceItem31
int dataPointsCount = 0;
};
/// @brief základní struktura, seznam polozek licencí
struct LicenceInfo
{
int reqDataPointsCount = 0;
map<int, int> licences = {};
};
/// @brief základní struktura, seznam polozek licencí, kompatibilita 1
struct LicenceInfoCompatibility1
{
int reqDataPointsCount = 0;
map<int, int> licences = {};
};
/// @brief základní struktura, seznam polozek licencí, kompatibilita 1
struct LicenceInfoCompatibility2
{
int reqDataPointsCount = 0;
map<int, int> licences = {};
};
/// @brief základní struktura, seznam polozek licencí, kompatibilita 3
struct LicenceInfoCompatibility3
{
int reqDataPointsCount = 0;
map<int, int> licences = {};
};
struct LicenceInfo11
{
int reqDataPointsCount = 0;