Compare commits
3 Commits
cbe1fd387d
...
a803907449
Author | SHA1 | Date | |
---|---|---|---|
a803907449 | |||
afd31f1b27 | |||
f8fef38009 |
@ -432,6 +432,13 @@ QString IsmasClient::updateOfPSASendVersion(PSAInstalled const &psa) {
|
|||||||
"\"ZONE\" : %d,"
|
"\"ZONE\" : %d,"
|
||||||
"\"INFO\" : \"%s\","
|
"\"INFO\" : \"%s\","
|
||||||
"\"BLOB\" : \"%s\","
|
"\"BLOB\" : \"%s\","
|
||||||
|
"\"LAST-COMMIT\" : \"%s\","
|
||||||
|
"\"SIZE\" : %d,"
|
||||||
|
"\"LOADED\" : \"%s\""
|
||||||
|
"},"
|
||||||
|
"\"OPKG_COMMANDS\" : {"
|
||||||
|
"\"BLOB\" : \"%s\","
|
||||||
|
"\"LAST-COMMIT\" : \"%s\","
|
||||||
"\"SIZE\" : %d,"
|
"\"SIZE\" : %d,"
|
||||||
"\"LOADED\" : \"%s\""
|
"\"LOADED\" : \"%s\""
|
||||||
"},"
|
"},"
|
||||||
@ -639,9 +646,15 @@ QString IsmasClient::updateOfPSASendVersion(PSAInstalled const &psa) {
|
|||||||
psa.tariff.zone,
|
psa.tariff.zone,
|
||||||
psa.tariff.info.toStdString().c_str(),
|
psa.tariff.info.toStdString().c_str(),
|
||||||
psa.tariff.blob.toStdString().c_str(),
|
psa.tariff.blob.toStdString().c_str(),
|
||||||
|
psa.tariff.lastCommit.toStdString().c_str(),
|
||||||
psa.tariff.size,
|
psa.tariff.size,
|
||||||
psa.tariff.loadTime.toStdString().c_str(),
|
psa.tariff.loadTime.toStdString().c_str(),
|
||||||
|
|
||||||
|
psa.opkg.blob.toStdString().c_str(),
|
||||||
|
psa.opkg.lastCommit.toStdString().c_str(),
|
||||||
|
psa.opkg.size,
|
||||||
|
psa.opkg.loadTime.toStdString().c_str(),
|
||||||
|
|
||||||
psa.cash.blob.toStdString().c_str(),
|
psa.cash.blob.toStdString().c_str(),
|
||||||
psa.cash.size,
|
psa.cash.size,
|
||||||
psa.conf.blob.toStdString().c_str(),
|
psa.conf.blob.toStdString().c_str(),
|
||||||
|
@ -30,6 +30,13 @@ struct PSAInstalled {
|
|||||||
QString cpuSerial;
|
QString cpuSerial;
|
||||||
} hw;
|
} hw;
|
||||||
|
|
||||||
|
struct Opkg {
|
||||||
|
int size;
|
||||||
|
QString blob;
|
||||||
|
QString lastCommit;
|
||||||
|
QString loadTime;
|
||||||
|
} opkg;
|
||||||
|
|
||||||
struct DC {
|
struct DC {
|
||||||
QString versionHW;
|
QString versionHW;
|
||||||
QString versionSW;
|
QString versionSW;
|
||||||
@ -79,6 +86,11 @@ struct PSAInstalled {
|
|||||||
hw.linuxVersion = "N/A";
|
hw.linuxVersion = "N/A";
|
||||||
hw.cpuSerial = "N/A";
|
hw.cpuSerial = "N/A";
|
||||||
|
|
||||||
|
opkg.size = -1;
|
||||||
|
opkg.blob = "N/A";
|
||||||
|
opkg.lastCommit = "N/A";
|
||||||
|
opkg.loadTime = "N/A";
|
||||||
|
|
||||||
dc.versionHW = "N/A";
|
dc.versionHW = "N/A";
|
||||||
dc.versionSW = "N/A";
|
dc.versionSW = "N/A";
|
||||||
dc.gitBlob = "N/A";
|
dc.gitBlob = "N/A";
|
||||||
|
18
worker.cpp
18
worker.cpp
@ -509,13 +509,18 @@ bool Worker::updateTriggerSet() {
|
|||||||
int const startMs = QTime::currentTime().msecsSinceStartOfDay();
|
int const startMs = QTime::currentTime().msecsSinceStartOfDay();
|
||||||
|
|
||||||
for (int repeat = 1; repeat <= 100; ++repeat) {
|
for (int repeat = 1; repeat <= 100; ++repeat) {
|
||||||
|
|
||||||
qInfo() << "UPDATE TRIGGER SET -> REPEAT" << repeat;
|
qInfo() << "UPDATE TRIGGER SET -> REPEAT" << repeat;
|
||||||
|
|
||||||
if (repeat > 1) {
|
if (repeat > 1) {
|
||||||
int const durationMs = QTime::currentTime().msecsSinceStartOfDay() - startMs;
|
int const durationMs = QTime::currentTime().msecsSinceStartOfDay() - startMs;
|
||||||
qInfo() << "REPEAT" << repeat
|
QString const &msg = QString("[%1] time: %2.%3s").arg(repeat).arg(durationMs / 1000).arg(durationMs % 1000);
|
||||||
<< QString("DURATION: %1.%2s").arg(durationMs / 1000).arg(durationMs % 1000);
|
qInfo() << "REPEAT" << msg;
|
||||||
|
emit showErrorMessage("check update trigger", msg);
|
||||||
|
} else {
|
||||||
|
emit showErrorMessage("check update trigger", QString("[%1]").arg(repeat));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((repeat % 10) == 0) {
|
if ((repeat % 10) == 0) {
|
||||||
qInfo() << "CHECK UPDATE TRIGGER. RESTART APISM ...";
|
qInfo() << "CHECK UPDATE TRIGGER. RESTART APISM ...";
|
||||||
Command c("systemctl restart apism");
|
Command c("systemctl restart apism");
|
||||||
@ -1142,6 +1147,10 @@ PSAInstalled Worker::getPSAInstalled() {
|
|||||||
QString printSysDir("/etc/psa_config");
|
QString printSysDir("/etc/psa_config");
|
||||||
QString tariffSysDir("/etc/psa_tariff");
|
QString tariffSysDir("/etc/psa_tariff");
|
||||||
QString tariffRepoDir("etc/psa_tariff");
|
QString tariffRepoDir("etc/psa_tariff");
|
||||||
|
QString opkgSysDir("/etc/psa_update");
|
||||||
|
QString opkgRepoDir("etc/psa_update");
|
||||||
|
QString const &absPathNameOpkg = QDir::cleanPath(opkgSysDir + QDir::separator() + "opkg_commands");
|
||||||
|
QString const &absPathNameRepositoryOpkg = QDir::cleanPath(opkgRepoDir + QDir::separator() + "opkg_commands");
|
||||||
QString absPathName;
|
QString absPathName;
|
||||||
QString absPathNameRepository;
|
QString absPathNameRepository;
|
||||||
|
|
||||||
@ -1174,6 +1183,11 @@ PSAInstalled Worker::getPSAInstalled() {
|
|||||||
psaInstalled.hw.linuxVersion = m_osVersion;
|
psaInstalled.hw.linuxVersion = m_osVersion;
|
||||||
psaInstalled.hw.cpuSerial = m_cpuSerial;
|
psaInstalled.hw.cpuSerial = m_cpuSerial;
|
||||||
|
|
||||||
|
psaInstalled.opkg.blob = m_gc.gitBlob(absPathNameOpkg);
|
||||||
|
psaInstalled.opkg.size = getFileSize(absPathNameOpkg);
|
||||||
|
psaInstalled.opkg.loadTime = Utils::getTariffLoadTime(absPathNameOpkg);
|
||||||
|
psaInstalled.opkg.lastCommit = m_gc.gitLastCommit(absPathNameRepositoryOpkg);
|
||||||
|
|
||||||
psaInstalled.dc.versionHW = deviceControllerVersionHW;
|
psaInstalled.dc.versionHW = deviceControllerVersionHW;
|
||||||
psaInstalled.dc.versionSW = deviceControllerVersionSW;
|
psaInstalled.dc.versionSW = deviceControllerVersionSW;
|
||||||
psaInstalled.dc.gitBlob = "N/A";
|
psaInstalled.dc.gitBlob = "N/A";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user