From: Michal MalĂ˝ Date: Thu, 31 Jul 2014 10:26:44 +0000 (+0200) Subject: - Fix rendering in baseline integration mode X-Git-Tag: 0.3a~6 X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=49f5d38caa4efe187fd175c2475cb6a1b2401192;p=anyanka.git - Fix rendering in baseline integration mode - Adjust to renamed HPCS structure --- diff --git a/datafilesloader.cpp b/datafilesloader.cpp index 3124094..f116e16 100644 --- a/datafilesloader.cpp +++ b/datafilesloader.cpp @@ -36,13 +36,12 @@ DataFilesLoader::DataFilesLoader(QObject *parent) : DataFilesLoader::ReturnCode DataFilesLoader::loadSingleRun(const QDir& path, std::vector& loadedData) { - ReturnCode ret = ReturnCode::SUCCESS; std::vector 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; } diff --git a/datamanager.cpp b/datamanager.cpp index 7e65592..e941a3f 100644 --- a/datamanager.cpp +++ b/datamanager.cpp @@ -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: diff --git a/datamanager.h b/datamanager.h index 7756b05..507bffc 100644 --- a/datamanager.h +++ b/datamanager.h @@ -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 sr, const std::vector& keys); void generateRawDataWriteList(DataFileExporter::WriteList& writeList, const std::shared_ptr sr, const std::vector& keys); std::shared_ptr sequenceByKey(const QString& key); int sequenceIdxByKey(const QString& key); std::shared_ptr 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 sr); std::string signalControllerKey(const QString& main, const QString& resource); void showOneSignal(std::shared_ptr ctrl); diff --git a/gui/graphview.cpp b/gui/graphview.cpp index 5b9a643..fc80654 100644 --- a/gui/graphview.cpp +++ b/gui/graphview.cpp @@ -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) {