upravy čištění
This commit is contained in:
@@ -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;
|
||||
@@ -48,7 +51,7 @@ int main(int argc, char *argv[])
|
||||
// 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;
|
||||
|
||||
@@ -58,8 +58,8 @@ LicenceELC11::LicenceELC11()
|
||||
}
|
||||
|
||||
LicenceELC11::LicenceELC11(LicenceIdentification &licIdentification)
|
||||
: lIdentification(licIdentification)
|
||||
{
|
||||
lIdentification = licIdentification;
|
||||
}
|
||||
|
||||
LicenceELC11::LicenceELC11(string cisArg, string csdArg, string binaryType, string dataFileName)
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user