]> Devoid-pointer.net GitWeb - anyanka.git/commitdiff
- Fix rendering in baseline integration mode
authorMichal Malý <madcatxster@devoid-pointer.net>
Thu, 31 Jul 2014 10:26:44 +0000 (12:26 +0200)
committerMichal Malý <madcatxster@devoid-pointer.net>
Thu, 31 Jul 2014 10:26:44 +0000 (12:26 +0200)
- Adjust to renamed HPCS structure

datafilesloader.cpp
datamanager.cpp
datamanager.h
gui/graphview.cpp

index 31240941a0df039a0e00bda6cf5c8cbacb2e2019..f116e1690c006c98b2f9c0aff1af09070f5a9f4c 100644 (file)
@@ -36,13 +36,12 @@ DataFilesLoader::DataFilesLoader(QObject *parent) :
 
 DataFilesLoader::ReturnCode DataFilesLoader::loadSingleRun(const QDir& path, std::vector<struct HPCS_MeasuredData* >& loadedData)
 {
-  ReturnCode ret = ReturnCode::SUCCESS;
   std::vector<CQStringPair> failedFiles;
 
   for (const QString& s : path.entryList(m_supportedFileTypes, QDir::Files | QDir::NoDotAndDotDot)) {
     struct HPCS_MeasuredData* mdata = hpcs_alloc();
     if (mdata == nullptr) {
-      ret = ReturnCode::E_FATAL;
+      return ReturnCode::E_FATAL;
       break;
     }
 
index 7e655926c79a696b4d12dd383455910b672fe202..e941a3f99ebb3406d4860464f69a1be9c1898557 100644 (file)
@@ -172,7 +172,7 @@ int DataManager::sequenceIdxByKey(const QString& key)
   return -1;
 }
 
-Signal::Equipment DataManager::equipmentFromFiletype(HPCS_File_Type filetype)
+Signal::Equipment DataManager::equipmentFromFiletype(HPCS_FileType filetype)
 {
   switch (filetype) {
     case HPCS_TYPE_CE_CCD:
@@ -237,7 +237,7 @@ void DataManager::processDataExport(GeneratorFunc genfunc)
    } while (ret == 1);
 }
 
-Signal::Resource DataManager::resourceFromFiletype(HPCS_File_Type filetype)
+Signal::Resource DataManager::resourceFromFiletype(HPCS_FileType filetype)
 {
   switch (filetype) {
     case HPCS_TYPE_CE_CCD:
index 7756b05fe168d48ed34be068a6984cdf74c84707..507bffc1de1b89e62aa911e2fea61bfa06bf94ab 100644 (file)
@@ -51,14 +51,14 @@ public:
   SingleRunsSelectorModel* singleRunsSelectorModel() { return &m_singleSelModel; }
 
 private:
-  Signal::Equipment equipmentFromFiletype(HPCS_File_Type filetype);
+  Signal::Equipment equipmentFromFiletype(HPCS_FileType filetype);
   void generateIntegDataWriteList(DataFileExporter::WriteList& writeList, const std::shared_ptr<SingleRunData> sr, const std::vector<std::string>& keys);
   void generateRawDataWriteList(DataFileExporter::WriteList& writeList, const std::shared_ptr<SingleRunData> sr, const std::vector<std::string>& keys);
   std::shared_ptr<Sequence> sequenceByKey(const QString& key);
   int sequenceIdxByKey(const QString& key);
   std::shared_ptr<SingleRunData> loadSingleRun(QDir& dir);
   void processDataExport(GeneratorFunc genfunc);
-  Signal::Resource resourceFromFiletype(HPCS_File_Type filetype);
+  Signal::Resource resourceFromFiletype(HPCS_FileType filetype);
   bool saveSingleRunUserData(std::shared_ptr<SingleRunData> sr);
   std::string signalControllerKey(const QString& main, const QString& resource);
   void showOneSignal(std::shared_ptr<SignalController> ctrl);
index 5b9a64385dad1764e64a25e186a87739fe3977ea..fc80654d299815c8a6044634fa53871b6527b7b4 100644 (file)
@@ -241,14 +241,16 @@ void GraphView::drawIntegrationBaseline(const int x, const int y)
 
   if (m_integrationType == IntegrationType::BASELINE) {
       m_integrateStopBLYPix = relToYPix(m_controller->valueToRel(m_controller->getXYValues(xPixToRel(x)).second));
+      double vstarty = std::min(m_integrateStartBLYPix, m_integrateStartYPix);
+      double vstopy = std::min(m_integrateStopBLYPix, y);
 
       p.begin(m_pixmap);
       p.setPen(Qt::black);
       p.drawLine(m_integrateStartXPix, m_integrateStartYPix, m_integrateStartXPix, m_integrateStartBLYPix);
       p.drawLine(x, y, x, m_integrateStopBLYPix);
       p.end();
-      reg += QRect(m_integrateStartXPix, m_integrateStopXPix, m_integrateStartXPix, m_integrateStopBLYPix);
-      reg += QRect(x, y, x, m_integrateStopBLYPix);
+      reg += QRect(m_integrateStartXPix, vstarty, 1, abs(m_integrateStopBLYPix - m_integrateStartXPix) + 1);
+      reg += QRect(x, vstopy, 1, abs(m_integrateStopBLYPix - x) + 1);
   }
 
   if (m_integrateStartXPix > m_integrateStopXPix) {