]> Devoid-pointer.net GitWeb - anyanka.git/commitdiff
Add support for new HPCS file types.
authorMichal Malý <madcatxster@devoid-pointer.net>
Fri, 11 Jul 2014 23:24:46 +0000 (01:24 +0200)
committerMichal Malý <madcatxster@devoid-pointer.net>
Fri, 11 Jul 2014 23:24:46 +0000 (01:24 +0200)
datamanager.cpp
datamanager.h
signal.cpp
signal.h

index 4aa16184afc576cc5e9b54cdbe320668c3b5591b..973bc18ced6771558b1a4e9dfa6f75a6201f32a8 100644 (file)
 #include <QDebug>
 
 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_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});
+const QString DataManager::UNIT_MILLIBARS_TEXT = QString::fromLatin1((const char[]){0x6D, 0x62, 0x61, 0x72, 0x00});
 const QString DataManager::UNIT_MILLIVOLTS_TEXT = QString::fromLatin1((const char[]){0x6D, 0x56, 0x00});
 const QString DataManager::UNIT_WATTS_TEXT = QString::fromLatin1((const char[]){0x57, 0x00});
 const QStringList DataManager::DATA_DIR_SUFFIX = QStringList() << "*.D";
@@ -177,6 +180,8 @@ Signal::Equipment DataManager::equipmentFromFiletype(HPCS_File_Type filetype)
     case HPCS_TYPE_CE_CURRENT:
     case HPCS_TYPE_CE_DAD:
     case HPCS_TYPE_CE_POWER:
+    case HPCS_TYPE_CE_PRESSURE:
+    case HPCS_TYPE_CE_TEMPERATURE:
     case HPCS_TYPE_CE_VOLTAGE:
       return Signal::Equipment::CE;
     default:
@@ -244,6 +249,10 @@ Signal::Resource DataManager::resourceFromFiletype(HPCS_File_Type filetype)
       return Signal::Resource::CE_DAD;
     case HPCS_TYPE_CE_POWER:
       return Signal::Resource::CE_POWER;
+    case HPCS_TYPE_CE_PRESSURE:
+      return Signal::Resource::CE_PRESSURE;
+    case HPCS_TYPE_CE_TEMPERATURE:
+      return Signal::Resource::CE_TEMPERATURE;
     case HPCS_TYPE_CE_VOLTAGE:
       return Signal::Resource::CE_VOLTAGE;
     default:
@@ -265,14 +274,19 @@ Signal::YUnit DataManager::yunitFromUnitStr(const char* unit_str)
 {
   QString str = m_sigNameCodec->toUnicode(unit_str);
 
-  if (QString::compare(str, UNIT_MILLIVOLTS_TEXT) == 0)
-    return Signal::YUnit::MILLIVOLTS;
+  if (QString::compare(str, UNIT_DEGREES_CELSIUS_TEXT) == 0)
+    return Signal::YUnit::DEGREES_CELSIUS;
   else if (QString::compare(str, UNIT_KILOVOLTS_TEXT) == 0)
     return Signal::YUnit::KILOVOLTS;
-  else if (QString::compare(str, UNIT_MICROAMPERES_TEXT) == 0)
+  else if (QString::compare(str, UNIT_MICROAMPERES_TEXT) == 0 ||
+           QString::compare(str, UNIT_MICROAMPERES_ALT1_TEXT) == 0)
     return Signal::YUnit::MICROAMPERES;
   else if (QString::compare(str, UNIT_MILLIAU_TEXT) == 0)
     return Signal::YUnit::MILLIAU;
+  else if (QString::compare(str, UNIT_MILLIBARS_TEXT) == 0)
+    return Signal::YUnit::MILLIBARS;
+  else if (QString::compare(str, UNIT_MILLIVOLTS_TEXT) == 0)
+    return Signal::YUnit::MILLIVOLTS;
   else if (QString::compare(str, UNIT_WATTS_TEXT) == 0)
     return Signal::YUnit::WATTS;
   else
index 538e966fad5519e10ad2abddab430454e57d2a4d..fc1a740f1013d5e6477c3c09033c675b1b3112e9 100644 (file)
@@ -77,9 +77,12 @@ private:
   ExportGraphToImageDialog::Parameters m_oldExportToImageParams;
 
   static const QString ME_SENDER_STR;
+  static const QString UNIT_DEGREES_CELSIUS_TEXT;
   static const QString UNIT_KILOVOLTS_TEXT;
   static const QString UNIT_MICROAMPERES_TEXT;
+  static const QString UNIT_MICROAMPERES_ALT1_TEXT;
   static const QString UNIT_MILLIAU_TEXT;
+  static const QString UNIT_MILLIBARS_TEXT;
   static const QString UNIT_MILLIVOLTS_TEXT;
   static const QString UNIT_WATTS_TEXT;
 
index d6deaf9926daef74910a276ba1b66647705662f9..b520ce20919509d1092a0243852ea57a5cf0a674 100644 (file)
@@ -27,10 +27,14 @@ const QString Signal::RES_CCD("CCD");
 const QString Signal::RES_CURRENT("Current");
 const QString Signal::RES_DAD("Absorbance");
 const QString Signal::RES_POWER("Power");
+const QString Signal::RES_PRESSURE("Pressure");
+const QString Signal::RES_TEMPERATURE("Temperature");
 const QString Signal::RES_VOLTAGE("Voltage");
+const QString Signal::DEGREES_CELSIUS_SI("\u00B0C");
 const QString Signal::KILOVOTLS_SI("KV");
 const QString Signal::MICROAMPERES_SI("\u03BCA");
 const QString Signal::MILLIAU_SI("mAU");
+const QString Signal::MILLIBARS_SI("mbar");
 const QString Signal::MILLIVOLTS_SI("mV");
 const QString Signal::WATTS_SI("W");
 
@@ -87,6 +91,10 @@ QString Signal::resourceAsString() const {
       return RES_DAD;
     case Resource::CE_POWER:
       return RES_POWER;
+    case Resource::CE_PRESSURE:
+      return RES_PRESSURE;
+    case Resource::CE_TEMPERATURE:
+      return RES_TEMPERATURE;
     case Resource::CE_VOLTAGE:
       return RES_VOLTAGE;
     default:
@@ -128,12 +136,16 @@ QString Signal::xunitAsString() const
 QString Signal::yunitAsString() const
 {
   switch (m_yunit) {
+    case YUnit::DEGREES_CELSIUS:
+      return DEGREES_CELSIUS_SI;
     case YUnit::KILOVOLTS:
       return KILOVOTLS_SI;
     case YUnit::MICROAMPERES:
       return MICROAMPERES_SI;
     case YUnit::MILLIAU:
       return MILLIAU_SI;
+    case YUnit::MILLIBARS:
+      return MILLIBARS_SI;
     case YUnit::MILLIVOLTS:
       return MILLIVOLTS_SI;
     case YUnit::WATTS:
index 2013b17db2957fcdab1458c552fcef4b3dd94aa9..087a4fb34d59c17b178d685ef24676427f4f085b 100644 (file)
--- a/signal.h
+++ b/signal.h
@@ -41,15 +41,19 @@ public:
     CE_CURRENT,
     CE_DAD,
     CE_POWER,
+    CE_PRESSURE,
+    CE_TEMPERATURE,
     CE_VOLTAGE
   };
   enum class XUnit {
     MINUTE
   };
   enum class YUnit {
+    DEGREES_CELSIUS,
     KILOVOLTS,
     MICROAMPERES,
     MILLIAU,
+    MILLIBARS,
     MILLIVOLTS,
     WATTS
   };
@@ -99,10 +103,14 @@ private:
   static const QString RES_CURRENT;
   static const QString RES_DAD;
   static const QString RES_POWER;
+  static const QString RES_PRESSURE;
+  static const QString RES_TEMPERATURE;
   static const QString RES_VOLTAGE;
+  static const QString DEGREES_CELSIUS_SI;
   static const QString KILOVOTLS_SI;
   static const QString MICROAMPERES_SI;
   static const QString MILLIAU_SI;
+  static const QString MILLIBARS_SI;
   static const QString MILLIVOLTS_SI;
   static const QString WATTS_SI;