]> Devoid-pointer.net GitWeb - anyanka.git/commitdiff
Recognize "kV" unit
authorMichal Malý <madcatxster@devoid-pointer.net>
Thu, 31 Jul 2014 15:57:24 +0000 (17:57 +0200)
committerMichal Malý <madcatxster@devoid-pointer.net>
Thu, 31 Jul 2014 15:57:24 +0000 (17:57 +0200)
datamanager.cpp
datamanager.h

index e941a3f99ebb3406d4860464f69a1be9c1898557..5f3e4f58596a4cabc2dc737958ca03c748cbf875 100644 (file)
@@ -30,6 +30,7 @@
 const QString DataManager::ME_SENDER_STR("DataManager");
 const QString DataManager::UNIT_DEGREES_CELSIUS_TEXT = QString::fromLatin1((const char[]){static_cast<char>(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<char>(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)
index 507bffc1de1b89e62aa911e2fea61bfa06bf94ab..020f85871ce5de1b6f8a66b0a2787d3e5dfd1a6a 100644 (file)
@@ -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;