upravy čištění
This commit is contained in:
@@ -9,6 +9,9 @@
|
|||||||
/// @return
|
/// @return
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
/* code */
|
||||||
// unordered_map<string, string> arguments = getArguments(argc, argv);
|
// unordered_map<string, string> arguments = getArguments(argc, argv);
|
||||||
// LicenceGenerator generatorOld = LicenceGenerator(arguments["-uid"], arguments["-cid"], arguments["-csd"], arguments["-configFileName"]);
|
// LicenceGenerator generatorOld = LicenceGenerator(arguments["-uid"], arguments["-cid"], arguments["-csd"], arguments["-configFileName"]);
|
||||||
// generatorOld.createLicenceFile();
|
// generatorOld.createLicenceFile();
|
||||||
@@ -17,7 +20,7 @@ int main(int argc, char *argv[])
|
|||||||
LicenceGenerator licenceGenerator = LicenceGenerator();
|
LicenceGenerator licenceGenerator = LicenceGenerator();
|
||||||
|
|
||||||
InitStructure initStructure;
|
InitStructure initStructure;
|
||||||
initStructure.elcType = 1;
|
initStructure.elcType = 2;
|
||||||
initStructure.licenceType = (int)LicenceType::EOS_EOV;
|
initStructure.licenceType = (int)LicenceType::EOS_EOV;
|
||||||
initStructure.licenceVersion = 1;
|
initStructure.licenceVersion = 1;
|
||||||
initStructure.licenceIndex = 0;
|
initStructure.licenceIndex = 0;
|
||||||
@@ -45,10 +48,10 @@ int main(int argc, char *argv[])
|
|||||||
// cerr << "Došlo k chybě: " << licenceGenerator.error.message;
|
// 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))
|
if (licenceGenerator.initread(initStructure))
|
||||||
{
|
{
|
||||||
int protocolId = 1;
|
int protocolId = 888;
|
||||||
|
|
||||||
LicenceItem21 info; // podle ELC a kompatibility určit strukuru (LicenceInfo11, LicenceInfo21, LicenceInfo31)
|
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;
|
cerr << "Došlo k chybě: " << licenceGenerator.error.message;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
cerr << "Obecná chyba\n";
|
||||||
|
}
|
||||||
|
|
||||||
system("pause");
|
system("pause");
|
||||||
return SUCCES;
|
return SUCCES;
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ LicenceELC11::LicenceELC11()
|
|||||||
}
|
}
|
||||||
|
|
||||||
LicenceELC11::LicenceELC11(LicenceIdentification &licIdentification)
|
LicenceELC11::LicenceELC11(LicenceIdentification &licIdentification)
|
||||||
|
: lIdentification(licIdentification)
|
||||||
{
|
{
|
||||||
lIdentification = licIdentification;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LicenceELC11::LicenceELC11(string cisArg, string csdArg, string binaryType, string dataFileName)
|
LicenceELC11::LicenceELC11(string cisArg, string csdArg, string binaryType, string dataFileName)
|
||||||
|
|||||||
@@ -252,12 +252,11 @@ bool LicenceGenerator::getLicenceItemInfo(int protocolId, void *returnItemStruct
|
|||||||
case 11:
|
case 11:
|
||||||
{ // old eoseov
|
{ // old eoseov
|
||||||
LicenceItem11 *resultPtr = static_cast<LicenceItem11 *>(returnItemStructure);
|
LicenceItem11 *resultPtr = static_cast<LicenceItem11 *>(returnItemStructure);
|
||||||
resultPtr->protocolId = protocolId; // protocolId;
|
resultPtr->protocolId = protocolId;
|
||||||
if (this->licenceInfo.licences.count(protocolId))
|
if (this->licenceInfo.licences.count(protocolId))
|
||||||
resultPtr->dataPointsCount = this->licenceInfo.licences.at(protocolId);
|
resultPtr->dataPointsCount = this->licenceInfo.licences.at(protocolId);
|
||||||
else
|
else
|
||||||
resultPtr->dataPointsCount = 0;
|
resultPtr->dataPointsCount = 0;
|
||||||
// licence21->getLicenceItemInfo(protocolId, returnItemStructure); stará verze, nová má k dispozici polozky z readLicence
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 21:
|
case 21:
|
||||||
@@ -269,7 +268,6 @@ bool LicenceGenerator::getLicenceItemInfo(int protocolId, void *returnItemStruct
|
|||||||
resultPtr->dataPointsCount = this->licenceInfo.licences.at(protocolId);
|
resultPtr->dataPointsCount = this->licenceInfo.licences.at(protocolId);
|
||||||
else
|
else
|
||||||
resultPtr->dataPointsCount = 0;
|
resultPtr->dataPointsCount = 0;
|
||||||
// licence21->getLicenceItemInfo(protocolId, returnItemStructure); stará verze, nová má k dispozici polozky z readLicence
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 31:
|
case 31:
|
||||||
|
|||||||
@@ -12,19 +12,22 @@ LicenceELC21::LicenceELC21()
|
|||||||
}
|
}
|
||||||
|
|
||||||
LicenceELC21::LicenceELC21(LicenceIdentification &licIdentification, LicData &licData)
|
LicenceELC21::LicenceELC21(LicenceIdentification &licIdentification, LicData &licData)
|
||||||
|
: lIdentification(licIdentification), lData(licData)
|
||||||
{
|
{
|
||||||
lIdentification = licIdentification;
|
// lIdentification = licIdentification;
|
||||||
lData = licData;
|
// lData = licData;
|
||||||
}
|
}
|
||||||
|
|
||||||
LicenceELC21::LicenceELC21(LicenceIdentification &licIdentification)
|
LicenceELC21::LicenceELC21(LicenceIdentification &licIdentification)
|
||||||
|
: lIdentification(licIdentification)
|
||||||
{
|
{
|
||||||
lIdentification = licIdentification;
|
// lIdentification = licIdentification;
|
||||||
}
|
}
|
||||||
|
|
||||||
LicenceELC21::LicenceELC21(LicData &licData)
|
LicenceELC21::LicenceELC21(LicData &licData)
|
||||||
|
: lData(licData)
|
||||||
{
|
{
|
||||||
lData = licData;
|
// lData = licData;
|
||||||
processInputConfiguration();
|
processInputConfiguration();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -41,12 +44,10 @@ bool LicenceELC21::createLicence()
|
|||||||
this->licBody.licenceIdentHeader.licItemCount = this->licBody.privateContent.dataItems.size();
|
this->licBody.licenceIdentHeader.licItemCount = this->licBody.privateContent.dataItems.size();
|
||||||
this->licBody.licenceIdentHeader.publicHeaderLength = this->licBody.publicHeader.length();
|
this->licBody.licenceIdentHeader.publicHeaderLength = this->licBody.publicHeader.length();
|
||||||
|
|
||||||
vector<unsigned char> publicContent;
|
vector<unsigned char> publicContent(1000);
|
||||||
publicContent.reserve(1000);
|
vector<unsigned char> privateContent(1000);
|
||||||
vector<unsigned char> privateContent;
|
vector<unsigned char> privateContentEncrypted(1000);
|
||||||
privateContent.reserve(1000);
|
|
||||||
vector<unsigned char> privateContentEncrypted;
|
|
||||||
privateContentEncrypted.reserve(1000);
|
|
||||||
|
|
||||||
publicContent.push_back(this->licBody.licId.licIdent[0]);
|
publicContent.push_back(this->licBody.licId.licIdent[0]);
|
||||||
publicContent.push_back(this->licBody.licId.licIdent[1]);
|
publicContent.push_back(this->licBody.licId.licIdent[1]);
|
||||||
@@ -260,7 +261,7 @@ bool LicenceELC21::readLicence(LicenceInfoGeneral * licences)
|
|||||||
licDataItem item;
|
licDataItem item;
|
||||||
item.protoId = bytesToWord(privateContentDecrypted[index], privateContentDecrypted[index + 1]);
|
item.protoId = bytesToWord(privateContentDecrypted[index], privateContentDecrypted[index + 1]);
|
||||||
item.licCount = bytesToWord(privateContentDecrypted[index + 2], privateContentDecrypted[index + 3]);
|
item.licCount = bytesToWord(privateContentDecrypted[index + 2], privateContentDecrypted[index + 3]);
|
||||||
index = index + sizeof(licDataItem);
|
index += sizeof(licDataItem);
|
||||||
this->licBody.privateContent.dataItems.push_back(item);
|
this->licBody.privateContent.dataItems.push_back(item);
|
||||||
this->licenceInfo.licences.insert(pair<int, int>(item.protoId, item.licCount));
|
this->licenceInfo.licences.insert(pair<int, int>(item.protoId, item.licCount));
|
||||||
licences->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