Read versions of JSON files installed on PSA (DC!).

If version is available, use as blob-value to be visible
in ISMAS.
This commit is contained in:
Gerhard Hoffmann 2024-05-15 14:57:15 +02:00
parent 5876c50a32
commit cafd16a744

View File

@ -1345,20 +1345,36 @@ PSAInstalled Worker::getPSAInstalled() {
psaInstalled.pluginVersion.prmCalculatePriceConfigUi = m_pluginVersionPrmCalcConfig; psaInstalled.pluginVersion.prmCalculatePriceConfigUi = m_pluginVersionPrmCalcConfig;
psaInstalled.pluginVersion.tcpZVT = m_pluginVersionTcpZvt; psaInstalled.pluginVersion.tcpZVT = m_pluginVersionTcpZvt;
// key: conf-json-filename; value: installed version on DC
QMap<QString, QString> map;
if (m_update) {
map = m_update->getInstalledJsonVersions();
}
psaInstalled.cash.name = "DC2C_cash.json"; psaInstalled.cash.name = "DC2C_cash.json";
absPathName = QDir::cleanPath(printSysDir + QDir::separator() + psaInstalled.cash.name); absPathName = QDir::cleanPath(printSysDir + QDir::separator() + psaInstalled.cash.name);
psaInstalled.cash.blob = m_gc.gitBlob(absPathName); psaInstalled.cash.blob = m_gc.gitBlob(absPathName);
psaInstalled.cash.size = getFileSize(absPathName); psaInstalled.cash.size = getFileSize(absPathName);
if (map.contains("DC2C_cash.json")) {
psaInstalled.cash.blob = map.value("DC2C_cash.json", "inst.vers.not.avail");
}
psaInstalled.conf.name = "DC2C_conf.json"; psaInstalled.conf.name = "DC2C_conf.json";
absPathName = QDir::cleanPath(printSysDir + QDir::separator() + psaInstalled.conf.name); absPathName = QDir::cleanPath(printSysDir + QDir::separator() + psaInstalled.conf.name);
psaInstalled.conf.blob = m_gc.gitBlob(absPathName); psaInstalled.conf.blob = m_gc.gitBlob(absPathName);
psaInstalled.conf.size = getFileSize(absPathName); psaInstalled.conf.size = getFileSize(absPathName);
if (map.contains("DC2C_conf.json")) {
psaInstalled.conf.blob = map.value("DC2C_conf.json", "inst.vers.not.avail");
}
psaInstalled.device.name = "DC2C_device.json"; psaInstalled.device.name = "DC2C_device.json";
absPathName = QDir::cleanPath(printSysDir + QDir::separator() + psaInstalled.device.name); absPathName = QDir::cleanPath(printSysDir + QDir::separator() + psaInstalled.device.name);
psaInstalled.device.blob = m_gc.gitBlob(absPathName); psaInstalled.device.blob = m_gc.gitBlob(absPathName);
psaInstalled.device.size = getFileSize(absPathName); psaInstalled.device.size = getFileSize(absPathName);
if (map.contains("DC2C_device.json")) {
psaInstalled.device.blob = map.value("DC2C_device.json", "inst.vers.not.avail");
}
for (int i=0; i < 32; ++i) { for (int i=0; i < 32; ++i) {
QString const &n = QString("%1").arg(i+1).rightJustified(2, '0'); QString const &n = QString("%1").arg(i+1).rightJustified(2, '0');
@ -1366,6 +1382,9 @@ PSAInstalled Worker::getPSAInstalled() {
absPathName = QDir::cleanPath(printSysDir + QDir::separator() + psaInstalled.print[i].name); absPathName = QDir::cleanPath(printSysDir + QDir::separator() + psaInstalled.print[i].name);
psaInstalled.print[i].blob = m_gc.gitBlob(absPathName); psaInstalled.print[i].blob = m_gc.gitBlob(absPathName);
psaInstalled.print[i].size = getFileSize(absPathName); psaInstalled.print[i].size = getFileSize(absPathName);
if (map.contains(psaInstalled.print[i].name)) {
psaInstalled.print[i].blob = map.value(psaInstalled.print[i].name, "inst.vers.not.avail");
}
} }
return psaInstalled; return psaInstalled;