From 9aeca5ca2c66abdf02e2e5bcce12c0f1de65cb60 Mon Sep 17 00:00:00 2001 From: Spiros Date: Tue, 6 Aug 2024 14:24:15 +0300 Subject: [PATCH] Parse reads and writes for SCSI devices --- src/mainwindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 00bbe6b..a945d55 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -373,9 +373,12 @@ void MainWindow::populateWindow(const QJsonObject &localObj, const QString &heal bool isScsi = (protocol == "SCSI"); if (isScsi) { + QJsonObject scsiErrorCounterLog = localObj.value("scsi_error_counter_log").toObject(); modelName = localObj["scsi_model_name"].toString(); - powerCycleCountInt = localObj["scsi_start_stop_cycle_counter"].toObject().value("accumulated_load_unload_cycles").toInt(-1); + powerCycleCountInt = localObj["scsi_start_stop_cycle_counter"].toObject().value("accumulated_load_unload_cycles").toInt(); firmwareVersion = localObj["scsi_revision"].toString("----"); + totalReadsInt = scsiErrorCounterLog.value("read").toObject().value("gigabytes_processed").toString().split(",").first().toInt(); + totalWritesInt = scsiErrorCounterLog.value("write").toObject().value("gigabytes_processed").toString().split(",").first().toInt(); } bool nvmeHasSelfTest = false;