From bbc12b46576d6dd9ecfadf835db006b9ff9d873c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Thu, 31 Jul 2014 17:57:24 +0200 Subject: [PATCH] Recognize "kV" unit --- datamanager.cpp | 4 +++- datamanager.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/datamanager.cpp b/datamanager.cpp index e941a3f..5f3e4f5 100644 --- a/datamanager.cpp +++ b/datamanager.cpp @@ -30,6 +30,7 @@ const QString DataManager::ME_SENDER_STR("DataManager"); const QString DataManager::UNIT_DEGREES_CELSIUS_TEXT = QString::fromLatin1((const char[]){static_cast(0xB0), 0x43, 0x00}); const QString DataManager::UNIT_KILOVOLTS_TEXT = QString::fromLatin1((const char[]){0x4B, 0x56, 0x00}); +const QString DataManager::UNIT_KILOVOLTS_ALT1_TEXT = QString::fromLatin1((const char[]){0x6B, 0x56, 0x00}); const QString DataManager::UNIT_MICROAMPERES_TEXT = QString::fromLatin1((const char[]){static_cast(0xB5), 0x41, 0x00}); const QString DataManager::UNIT_MICROAMPERES_ALT1_TEXT = QString::fromLatin1((const char[]){0x75, 0x41, 0x00}); const QString DataManager::UNIT_MILLIAU_TEXT = QString::fromLatin1((const char[]){0x6D, 0x41, 0x55, 0x00}); @@ -275,7 +276,8 @@ Signal::YUnit DataManager::yunitFromUnitStr(const char* unit_str) if (QString::compare(str, UNIT_DEGREES_CELSIUS_TEXT) == 0) return Signal::YUnit::DEGREES_CELSIUS; - else if (QString::compare(str, UNIT_KILOVOLTS_TEXT) == 0) + else if (QString::compare(str, UNIT_KILOVOLTS_TEXT) == 0 || + QString::compare(str, UNIT_KILOVOLTS_ALT1_TEXT) == 0) return Signal::YUnit::KILOVOLTS; else if (QString::compare(str, UNIT_MICROAMPERES_TEXT) == 0 || QString::compare(str, UNIT_MICROAMPERES_ALT1_TEXT) == 0) diff --git a/datamanager.h b/datamanager.h index 507bffc..020f858 100644 --- a/datamanager.h +++ b/datamanager.h @@ -79,6 +79,7 @@ private: static const QString ME_SENDER_STR; static const QString UNIT_DEGREES_CELSIUS_TEXT; static const QString UNIT_KILOVOLTS_TEXT; + static const QString UNIT_KILOVOLTS_ALT1_TEXT; static const QString UNIT_MICROAMPERES_TEXT; static const QString UNIT_MICROAMPERES_ALT1_TEXT; static const QString UNIT_MILLIAU_TEXT; -- 2.43.5