upravy čištění

This commit is contained in:
2023-12-18 08:01:34 +01:00
parent 3954e0f6a5
commit f260e92596
4 changed files with 68 additions and 60 deletions

View File

@@ -9,6 +9,9 @@
/// @return
int main(int argc, char *argv[])
{
try
{
/* code */
// unordered_map<string, string> arguments = getArguments(argc, argv);
// LicenceGenerator generatorOld = LicenceGenerator(arguments["-uid"], arguments["-cid"], arguments["-csd"], arguments["-configFileName"]);
// generatorOld.createLicenceFile();
@@ -17,7 +20,7 @@ int main(int argc, char *argv[])
LicenceGenerator licenceGenerator = LicenceGenerator();
InitStructure initStructure;
initStructure.elcType = 1;
initStructure.elcType = 2;
initStructure.licenceType = (int)LicenceType::EOS_EOV;
initStructure.licenceVersion = 1;
initStructure.licenceIndex = 0;
@@ -45,10 +48,10 @@ int main(int argc, char *argv[])
// cerr << "Došlo k chybě: " << licenceGenerator.error.message;
// }
//verze #2 : iterace pro kazdý bod zvlášť
// verze #2 : iterace pro kazdý bod zvlášť
if (licenceGenerator.initread(initStructure))
{
int protocolId = 1;
int protocolId = 888;
LicenceItem21 info; // podle ELC a kompatibility určit strukuru (LicenceInfo11, LicenceInfo21, LicenceInfo31)
@@ -63,6 +66,12 @@ int main(int argc, char *argv[])
{
cerr << "Došlo k chybě: " << licenceGenerator.error.message;
}
}
catch (...)
{
cerr << "Obecná chyba\n";
}
system("pause");
return SUCCES;

View File

@@ -58,8 +58,8 @@ LicenceELC11::LicenceELC11()
}
LicenceELC11::LicenceELC11(LicenceIdentification &licIdentification)
: lIdentification(licIdentification)
{
lIdentification = licIdentification;
}
LicenceELC11::LicenceELC11(string cisArg, string csdArg, string binaryType, string dataFileName)

View File

@@ -252,12 +252,11 @@ bool LicenceGenerator::getLicenceItemInfo(int protocolId, void *returnItemStruct
case 11:
{ // old eoseov
LicenceItem11 *resultPtr = static_cast<LicenceItem11 *>(returnItemStructure);
resultPtr->protocolId = protocolId; // protocolId;
resultPtr->protocolId = protocolId;
if (this->licenceInfo.licences.count(protocolId))
resultPtr->dataPointsCount = this->licenceInfo.licences.at(protocolId);
else
resultPtr->dataPointsCount = 0;
// licence21->getLicenceItemInfo(protocolId, returnItemStructure); stará verze, nová má k dispozici polozky z readLicence
break;
}
case 21:
@@ -269,7 +268,6 @@ bool LicenceGenerator::getLicenceItemInfo(int protocolId, void *returnItemStruct
resultPtr->dataPointsCount = this->licenceInfo.licences.at(protocolId);
else
resultPtr->dataPointsCount = 0;
// licence21->getLicenceItemInfo(protocolId, returnItemStructure); stará verze, nová má k dispozici polozky z readLicence
break;
}
case 31:

View File

@@ -12,19 +12,22 @@ LicenceELC21::LicenceELC21()
}
LicenceELC21::LicenceELC21(LicenceIdentification &licIdentification, LicData &licData)
: lIdentification(licIdentification), lData(licData)
{
lIdentification = licIdentification;
lData = licData;
// lIdentification = licIdentification;
// lData = licData;
}
LicenceELC21::LicenceELC21(LicenceIdentification &licIdentification)
: lIdentification(licIdentification)
{
lIdentification = licIdentification;
// lIdentification = licIdentification;
}
LicenceELC21::LicenceELC21(LicData &licData)
: lData(licData)
{
lData = licData;
// lData = licData;
processInputConfiguration();
}
@@ -41,12 +44,10 @@ bool LicenceELC21::createLicence()
this->licBody.licenceIdentHeader.licItemCount = this->licBody.privateContent.dataItems.size();
this->licBody.licenceIdentHeader.publicHeaderLength = this->licBody.publicHeader.length();
vector<unsigned char> publicContent;
publicContent.reserve(1000);
vector<unsigned char> privateContent;
privateContent.reserve(1000);
vector<unsigned char> privateContentEncrypted;
privateContentEncrypted.reserve(1000);
vector<unsigned char> publicContent(1000);
vector<unsigned char> privateContent(1000);
vector<unsigned char> privateContentEncrypted(1000);
publicContent.push_back(this->licBody.licId.licIdent[0]);
publicContent.push_back(this->licBody.licId.licIdent[1]);
@@ -260,7 +261,7 @@ bool LicenceELC21::readLicence(LicenceInfoGeneral * licences)
licDataItem item;
item.protoId = bytesToWord(privateContentDecrypted[index], privateContentDecrypted[index + 1]);
item.licCount = bytesToWord(privateContentDecrypted[index + 2], privateContentDecrypted[index + 3]);
index = index + sizeof(licDataItem);
index += sizeof(licDataItem);
this->licBody.privateContent.dataItems.push_back(item);
this->licenceInfo.licences.insert(pair<int, int>(item.protoId, item.licCount));
licences->licences.insert(pair<int, int>(item.protoId, item.licCount));