TEMPLATE = app
unix {
- LIBS += -ldl
QMAKE_CXXFLAGS += -std=c++11 -Wall -Wextra
}
win32 {
SOURCES += windows_defines.h
}
-INCLUDEPATH += libAGRE
# Add project root directory to work around VC11 include path scheme
INCLUDEPATH += "./"
SOURCES += main.cpp\
datafilesloader.cpp \
- agreinterface.cpp \
datamanager.cpp \
signal.cpp \
singlerundata.cpp \
gui/exportgraphtoimagedialog.cpp \
imagedrawer.cpp \
signaldrawer.cpp \
- jsonserializable.cpp
+ jsonserializable.cpp \
+ libHPCS/libhpcs.c
HEADERS += \
datafilesloader.h \
- agreinterface.h \
datamanager.h \
signal.h \
singlerundata.h \
signaldrawer.h \
enumflags.h \
jsonserializable.h \
- helpers.h
+ helpers.h \
+ libHPCS/libhpcs.h
FORMS += \
gui/mainwindow.ui \
RESOURCES += \
imgresources.qrc
+
+DEFINES += _HPCS_LITTLE_ENDIAN
+++ /dev/null
-/*
- Copyright (c) 2013 Michal Malý <madcatxster@prifuk.cz>
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-*/
-
-
-#include "agreinterface.h"
-#include "logger.h"
-#include <QDebug>
-#ifdef Q_OS_UNIX
-#include <dlfcn.h>
-#elif defined Q_OS_WIN32
-#include <windows.h>
-#endif
-
-#ifdef Q_OS_UNIX
-#define __LIBRARY_NAME "libAGRE.so"
-#elif defined Q_OS_WIN
-#define __LIBRARY_NAME "libAGRE.dll"
-#endif
-
-#ifdef Q_OS_UNIX
-IAGRE_Reader* (*AGREInterface::m_create_reader)(bool)(nullptr);
-#elif defined Q_OS_WIN
-IAGRE_Reader* (__cdecl* AGREInterface::m_create_reader)(bool)(NULL);
-#endif
-AGREInterface* AGREInterface::m_instance(nullptr);
-
-const QString AGREInterface::AGRE_LIBRARY_NAME(__LIBRARY_NAME);
-const QString AGREInterface::ME_SENDER_STR("AGREInterface");
-
-/* Public static methods */
-
-AGREInterface* AGREInterface::instance()
-{
- if (m_instance == nullptr)
- m_instance = new AGREInterface();
- return m_instance;
-}
-
-AGREInterface::AGREInterface(QObject* parent) :
- QObject(parent),
- m_inited(false),
- m_lastAGREError(AGRE_ReturnCode::SUCCESS),
- m_readerIFace(nullptr)
-{
-}
-
-AGREInterface::ReturnCode AGREInterface::initialize()
-{
- if (m_inited)
- return ReturnCode::SUCCESS;
-
-#ifdef Q_OS_UNIX
- m_libagre_handle = dlopen(__LIBRARY_NAME, RTLD_LAZY);
- if (m_libagre_handle == nullptr) {
-#elif defined Q_OS_WIN
- m_libagre_handle = LoadLibrary(TEXT(__LIBRARY_NAME));
- if (m_libagre_handle == NULL) {
-#endif
- Logger::log(Logger::Level::CRITICAL, ME_SENDER_STR, "Library " + AGRE_LIBRARY_NAME + " could not have been loaded.");
- return ReturnCode::E_NO_LIBRARY;
- }
-
-#ifdef Q_OS_UNIX
- m_create_reader = (IAGRE_Reader* (*)(bool))dlsym(m_libagre_handle, "create_agre_reader");
- if (m_create_reader == nullptr) {
-#elif defined Q_OS_WIN
- m_create_reader = (IAGRE_Reader* (__cdecl*)(bool))GetProcAddress(static_cast<HINSTANCE>(m_libagre_handle), "create_agre_reader");
- if (m_create_reader == NULL) {
-#endif
- Logger::log(Logger::Level::CRITICAL, ME_SENDER_STR, "create_agre_reader symbol could not have been resloved.");
- return ReturnCode::E_CANNOT_RESOLVE;
- }
-
-
- m_readerIFace = m_create_reader(true);
- if (m_readerIFace == nullptr) {
- m_create_reader = nullptr;
-#ifdef Q_OS_UNIX
- dlclose(m_libagre_handle);
-#elif defined Q_OS_WIN
- FreeLibrary(static_cast<HINSTANCE>(m_libagre_handle));
-#endif
- return ReturnCode::E_CANNOT_GET_IFACE;
- }
-
- m_inited = true;
- return ReturnCode::SUCCESS;
-}
-
-/* ENDOF public static methods */
-
-/* Public methods */
-
-const std::vector<std::string>& AGREInterface::debugAGREInfo()
-{
- if (!m_inited)
- throw std::bad_exception();
-
- return m_readerIFace->debug_info_list();
-}
-
-AGREInterface::ReturnCode AGREInterface::readFile(const std::string& fileName, std::shared_ptr<AGRE_MeasurementInfo>& minfo)
-{
- AGRE_ReturnCode ret;
-
- if (!m_inited)
- return ReturnCode::E_NOT_INITED;
- ret = m_readerIFace->read_file(fileName, minfo);
- if (ret != AGRE_ReturnCode::SUCCESS) {
- m_lastAGREError = ret;
- return ReturnCode::E_CANNOT_READ_FILE;
- }
-
- return ReturnCode::SUCCESS;
-}
-
-AGREInterface::~AGREInterface()
-{
- m_inited = false;
-
- m_readerIFace->destroy_agre_reader();
-#ifdef Q_OS_UNIX
- dlclose(m_libagre_handle);
-#elif defined Q_OS_WIN
- FreeLibrary(static_cast<HMODULE>(m_libagre_handle));
-#endif
-}
+++ /dev/null
-/*
- Copyright (c) 2013 Michal Malý <madcatxster@prifuk.cz>
-
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
-*/
-
-
-#ifndef AGREINTERFACE_H
-#define AGREINTERFACE_H
-
-#include <iagre_reader.h>
-#include <QtCore/QObject>
-
-class AGREInterface : public QObject
-{
- Q_OBJECT
- Q_DISABLE_COPY(AGREInterface)
-
-public:
- enum class ReturnCode {
- SUCCESS,
- E_NO_LIBRARY,
- E_CANNOT_RESOLVE,
- E_CANNOT_GET_IFACE,
- E_NOT_INITED,
- E_CANNOT_READ_FILE
- };
-
- const std::vector<std::string>& debugAGREInfo();
- AGRE_ReturnCode lastAGREError() { AGRE_ReturnCode r = m_lastAGREError; m_lastAGREError = AGRE_ReturnCode::SUCCESS; return r; }
- ReturnCode initialize();
- static AGREInterface* instance();
- ReturnCode readFile(const std::string& fileName, std::shared_ptr<AGRE_MeasurementInfo>& minfo);
-
- static const QString AGRE_LIBRARY_NAME;
- static const QString ME_SENDER_STR;
-
-private:
- explicit AGREInterface(QObject* parent = 0);
- ~AGREInterface();
-
- bool m_inited;
- AGRE_ReturnCode m_lastAGREError;
- IAGRE_Reader* m_readerIFace;
-
-#ifdef Q_OS_UNIX
- static IAGRE_Reader* (*m_create_reader)(bool collect_debug);
-#elif defined Q_OS_WIN
- static IAGRE_Reader* (__cdecl* m_create_reader)(bool collect_debug);
-#endif
- void* m_libagre_handle;
-
- static AGREInterface* m_instance;
-
-signals:
-
-public slots:
-
-};
-
-#endif // AGREINTERFACE_H
m_supportedFileTypes << "*.ch";
}
-DataFilesLoader::ReturnCode DataFilesLoader::loadSingleRun(const QDir& path, std::vector<std::shared_ptr<AGRE_MeasurementInfo>>& dataFiles)
+DataFilesLoader::ReturnCode DataFilesLoader::loadSingleRun(const QDir& path, std::vector<struct HPCS_MeasuredData*>& loadedData)
{
+ ReturnCode ret = ReturnCode::SUCCESS;
+
for (const QString& s : path.entryList(m_supportedFileTypes, QDir::Files | QDir::NoDotAndDotDot)) {
- std::shared_ptr<AGRE_MeasurementInfo> minfo = nullptr;
+ struct HPCS_MeasuredData* mdata = hpcs_alloc();
+ if (mdata == nullptr) {
+ ret = ReturnCode::E_FATAL;
+ break;
+ }
+
QString absPath = path.absoluteFilePath(s);
+ qDebug() << absPath << absPath.toStdString().c_str();
- AGREInterface::ReturnCode ret = AGREInterface::instance()->readFile(absPath.toStdString(), minfo);
- if (ret == AGREInterface::ReturnCode::SUCCESS)
- dataFiles.push_back(minfo);
- else if (ret == AGREInterface::ReturnCode::E_NOT_INITED) {
- Logger::log(Logger::Level::CRITICAL, ME_SENDER_STR, "AGREInterface has not been initialized.");
- QMessageBox::critical(nullptr, "AGREInterface error", "AGRE interface has not been initialized. This should not happen!\n"
- "Application cannot continue.");
- exit(1);
- } else {
- QString errDesc = errorToString(AGREInterface::instance()->lastAGREError());
+ HPCS_RetCode iret = hpcs_read_file(absPath.toStdString().c_str(), mdata);
+ if (iret == HPCS_OK)
+ loadedData.push_back(mdata);
+ else {
+ QString errDesc = hpcs_error_to_string(iret);
Logger::log(Logger::Level::DEBUG, ME_SENDER_STR, "Error reading file '" + s + "'" + errDesc);
- try {
- const std::vector<std::string>& dbgMsgs = AGREInterface::instance()->debugAGREInfo();
- for (const std::string& s : dbgMsgs)
- Logger::log(Logger::Level::INFO, ME_SENDER_STR, QString("AGRE debug:") + QString(s.c_str()));
- } catch (std::bad_exception& ) {
- Logger::log(Logger::Level::CRITICAL, ME_SENDER_STR, "Null pointer to debug messages list. This should not happen!\n");
- }
QMessageBox::warning(nullptr, "Error reading file '" + s + "'", errDesc);
- return ReturnCode::E_READ_ERROR;
+
+ hpcs_free(mdata);
+ ret = ReturnCode::E_READ_ERROR;
+ break;
}
}
- if (dataFiles.size() == 0)
- return ReturnCode::E_NO_FILES;
-
- Logger::log(Logger::Level::DEBUG, ME_SENDER_STR, QString::number(dataFiles.size()) + " files were found and successfully parsed");
+ if (ret != ReturnCode::SUCCESS) {
+ for (struct HPCS_MeasuredData* md : loadedData)
+ hpcs_free(md);
+ } else {
+ if (loadedData.size() == 0)
+ return ReturnCode::E_NO_FILES;
+ }
- return ReturnCode::SUCCESS;
-}
+ Logger::log(Logger::Level::DEBUG, ME_SENDER_STR, QString::number(loadedData.size()) + " files were found and successfully parsed");
-QString DataFilesLoader::errorToString(const AGRE_ReturnCode errorCode)
-{
- switch (errorCode) {
- case AGRE_ReturnCode::E_CANNOT_OPEN_FILE:
- return "Cannot open file.";
- case AGRE_ReturnCode::E_CORRUPTED_FILE:
- return "File is corrupted.";
- case AGRE_ReturnCode::E_INVALID_FILE:
- return "File does not appear to be a ChemStation data file.";
- case AGRE_ReturnCode::E_OUT_OF_RANGE:
- return "File is too short to be a ChemStation data file.";
- case AGRE_ReturnCode::E_READ_FAILED:
- return "An error occured during reading.";
- default:
- return "Unspecified error " + QString::number(static_cast<int>(errorCode));
- }
+ return ret;
}
#ifndef DATAFILESLOADER_H
#define DATAFILESLOADER_H
-#include "agreinterface.h"
+#include "libHPCS/libhpcs.h"
#include <QtCore/QDir>
#include <QtCore/QObject>
};
explicit DataFilesLoader(QObject* parent = nullptr);
- ReturnCode loadSingleRun(const QDir& path, std::vector<std::shared_ptr<AGRE_MeasurementInfo>>& dataFiles);
+ ReturnCode loadSingleRun(const QDir& path, std::vector<struct HPCS_MeasuredData* >& loadedData);
private:
QStringList m_supportedFileTypes;
- QString errorToString(const AGRE_ReturnCode errorCode);
-
static const QString ME_SENDER_STR;
signals:
#include <QDebug>
const QString DataManager::ME_SENDER_STR("DataManager");
-const char DataManager::UNIT_KILOVOLTS_TEXT[] = {0x4B, 0x56, 0x00};
-const char DataManager::UNIT_MICROAMPERES_TEXT[] = {static_cast<char>(0xB5), 0x41, 0x00};
-const char DataManager::UNIT_MILLIAU_TEXT[] = {0x6D, 0x41, 0x55, 0x00};
-const char DataManager::UNIT_MILLIVOLTS_TEXT[] = {0x6D, 0x56, 0x00};
-const char DataManager::UNIT_WATTS_TEXT[] = {0x57, 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_MILLIAU_TEXT = QString::fromLatin1((const char[]){0x6D, 0x41, 0x55, 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";
const QString DataManager::S_RES_DATAEXPORT("Error while exporting data to file");
const QString DataManager::S_RES_IMGEXPORT("Error while exporting graph to image");
return -1;
}
-Signal::Equipment DataManager::equipmentFromFiletype(AGRE_Filetype filetype)
+Signal::Equipment DataManager::equipmentFromFiletype(HPCS_File_Type filetype)
{
switch (filetype) {
- case AGRE_Filetype::CE_CCD:
- case AGRE_Filetype::CE_CURRENT:
- case AGRE_Filetype::CE_DAD:
- case AGRE_Filetype::CE_POWER:
- case AGRE_Filetype::CE_VOLTAGE:
+ case HPCS_TYPE_CE_CCD:
+ case HPCS_TYPE_CE_CURRENT:
+ case HPCS_TYPE_CE_DAD:
+ case HPCS_TYPE_CE_POWER:
+ case HPCS_TYPE_CE_VOLTAGE:
return Signal::Equipment::CE;
default:
throw std::invalid_argument("Invalid type of file");
} while (ret == 1);
}
-Signal::Resource DataManager::resourceFromFiletype(AGRE_Filetype filetype)
+Signal::Resource DataManager::resourceFromFiletype(HPCS_File_Type filetype)
{
switch (filetype) {
- case AGRE_Filetype::CE_CCD:
+ case HPCS_TYPE_CE_CCD:
return Signal::Resource::CE_CCD;
- case AGRE_Filetype::CE_CURRENT:
+ case HPCS_TYPE_CE_CURRENT:
return Signal::Resource::CE_CURRENT;
- case AGRE_Filetype::CE_DAD:
+ case HPCS_TYPE_CE_DAD:
return Signal::Resource::CE_DAD;
- case AGRE_Filetype::CE_POWER:
+ case HPCS_TYPE_CE_POWER:
return Signal::Resource::CE_POWER;
- case AGRE_Filetype::CE_VOLTAGE:
+ case HPCS_TYPE_CE_VOLTAGE:
return Signal::Resource::CE_VOLTAGE;
default:
throw std::invalid_argument("Invalid type of signal");
return std::string(main.toStdString() + "_" + resource.toStdString());
}
-Signal::YUnit DataManager::yunitFromUnitStr(const std::string& unit_str)
+Signal::YUnit DataManager::yunitFromUnitStr(const char* unit_str)
{
- static const QString LATIN_KILOVOLTS = QString::fromLatin1(DataManager::UNIT_KILOVOLTS_TEXT);
- static const QString LATIN_MICROAMPERS = QString::fromLatin1(DataManager::UNIT_MICROAMPERES_TEXT);
- static const QString LATIN_MILLIAU = QString::fromLatin1(DataManager::UNIT_MILLIAU_TEXT);
- static const QString LATIN_MILLIVOLTS = QString::fromLatin1(DataManager::UNIT_MILLIVOLTS_TEXT);
- static const QString LATIN_WATTS = QString::fromLatin1(DataManager::UNIT_WATTS_TEXT);
- QString str = m_sigNameCodec->toUnicode(unit_str.c_str());
-
- if (QString::compare(str, LATIN_MILLIVOLTS) == 0)
+ QString str = m_sigNameCodec->toUnicode(unit_str);
+
+ if (QString::compare(str, UNIT_MILLIVOLTS_TEXT) == 0)
return Signal::YUnit::MILLIVOLTS;
- else if (QString::compare(str, LATIN_KILOVOLTS) == 0)
+ else if (QString::compare(str, UNIT_KILOVOLTS_TEXT) == 0)
return Signal::YUnit::KILOVOLTS;
- else if (QString::compare(str, LATIN_MICROAMPERS) == 0)
+ else if (QString::compare(str, UNIT_MICROAMPERES_TEXT) == 0)
return Signal::YUnit::MICROAMPERES;
- else if (QString::compare(str, LATIN_MILLIAU) == 0)
+ else if (QString::compare(str, UNIT_MILLIAU_TEXT) == 0)
return Signal::YUnit::MILLIAU;
- else if (QString::compare(str, LATIN_WATTS) == 0)
+ else if (QString::compare(str, UNIT_WATTS_TEXT) == 0)
return Signal::YUnit::WATTS;
else
throw std::invalid_argument(str.toStdString());
std::shared_ptr<SingleRunData> DataManager::loadSingleRun(QDir& dir)
{
- std::vector<std::shared_ptr<AGRE_MeasurementInfo>> dataFiles;
+ std::vector<struct HPCS_MeasuredData* > measuredData;
std::shared_ptr<SingleRunData> singleRun;
SignalsMap sigs;
SignalControllersMap ctrls;
LocalLoggerPtr llog = Logger::createLocalLog();
llog->setPrintLevel(Logger::Level::WARNING);
- ret = m_dfl.loadSingleRun(dir, dataFiles);
+ ret = m_dfl.loadSingleRun(dir, measuredData);
if (ret == DataFilesLoader::ReturnCode::E_NO_FILES) {
QMessageBox::warning(nullptr, "Data loading", "Directory '" + dir.path() + "' does not seem to contain ChemStation run data.");
return nullptr;
}
- if (ret != DataFilesLoader::ReturnCode::SUCCESS) {
+ if (ret != DataFilesLoader::ReturnCode::SUCCESS)
return nullptr;
- }
QStringList operatorNames;
QStringList methodNames;
QStringList sampleInfos;
QList<QDate> dates;
QList<QTime> times;
- for (std::shared_ptr<AGRE_MeasurementInfo> mi : dataFiles) {
+ for (struct HPCS_MeasuredData* md : measuredData) {
std::shared_ptr<Signal> _s;
std::shared_ptr<SignalController> _c;
Signal::Equipment eqp;
Signal::Resource res;
double samplingRate;
Signal::YUnit yu;
- QDate date(mi->year, mi->month, mi->day);
- QTime time(mi->hour, mi->minute, mi->second);
+ QDate date(md->date.year, md->date.month, md->date.day);
+ QTime time(md->date.hour, md->date.minute, md->date.second);
QString operatorName;
QString methodName;
QString sampleInfo;
- operatorName = QString::fromStdString(mi->operator_name);
- methodName = QString::fromStdString(mi->method_name);
- sampleInfo = QString::fromStdString(mi->sample_info);
+ operatorName = QString::fromLatin1(md->operator_name);
+ methodName = QString::fromLatin1(md->method_name);
+ sampleInfo = QString::fromLatin1(md->sample_info);
try {
- eqp = equipmentFromFiletype(mi->file_type);
+ eqp = equipmentFromFiletype(md->file_type);
} catch (std::invalid_argument& ia) {
llog->log(Logger::ERROR, ME_SENDER_STR, ia.what());
+ delete md;
continue;
}
try {
- res = resourceFromFiletype(mi->file_type);
+ res = resourceFromFiletype(md->file_type);
} catch (std::invalid_argument& ia) {
llog->log(Logger::ERROR, ME_SENDER_STR, ia.what());
+ delete md;
continue;
+
}
try {
- yu = yunitFromUnitStr(mi->y_units);
+ yu = yunitFromUnitStr(md->y_units);
} catch (std::invalid_argument& ia) {
llog->log(Logger::ERROR, ME_SENDER_STR, QString("Invalid units ") + ia.what());
+ delete md;
continue;
}
- samplingRate = mi->sampling_rate;
+ samplingRate = md->sampling_rate;
/* Fill values */
std::vector<Signal::TimeValuePair> values;
- for (const AGRE_TimeValuePair& tvp : mi->val_tbl) {
- Signal::TimeValuePair stvp(tvp.first, tvp.second);
+ for (size_t idx = 0; idx < md->data_count; idx++) {
+ Signal::TimeValuePair stvp(md->data[idx].time, md->data[idx].value);
values.push_back(stvp);
}
-
- _s = std::shared_ptr<Signal>(new Signal(eqp, res, samplingRate, yu, mi->dad_wavelength_abs, mi->dad_wavelength_ref, values));
+ _s = std::shared_ptr<Signal>(new Signal(eqp, res, samplingRate, yu, md->dad_wavelength_msr, md->dad_wavelength_ref, values));
if (!date.isValid()) {
llog->log(Logger::WARNING, ME_SENDER_STR, QString("Date ") + date.toString() + QString("is invalid."));
sigs[_s->descriptiveName()] = _s;
ctrls[_s->descriptiveName()] = _c;
+ hpcs_free(md);
}
/* Check that all common run informaton are the same */
SingleRunsSelectorModel* singleRunsSelectorModel() { return &m_singleSelModel; }
private:
- Signal::Equipment equipmentFromFiletype(AGRE_Filetype filetype);
+ Signal::Equipment equipmentFromFiletype(HPCS_File_Type 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(AGRE_Filetype filetype);
+ Signal::Resource resourceFromFiletype(HPCS_File_Type filetype);
bool saveSingleRunUserData(std::shared_ptr<SingleRunData> sr);
std::string signalControllerKey(const QString& main, const QString& resource);
void showOneSignal(std::shared_ptr<SignalController> ctrl);
- Signal::YUnit yunitFromUnitStr(const std::string& unit_str);
+ Signal::YUnit yunitFromUnitStr(const char* unit_str);
std::shared_ptr<Sequence> m_activeSequence;
QString m_prevSequenceKey;
ExportGraphToImageDialog::Parameters m_oldExportToImageParams;
static const QString ME_SENDER_STR;
- static const char UNIT_KILOVOLTS_TEXT[];
- static const char UNIT_MICROAMPERES_TEXT[];
- static const char UNIT_MILLIAU_TEXT[];
- static const char UNIT_MILLIVOLTS_TEXT[];
- static const char UNIT_WATTS_TEXT[];
+ static const QString UNIT_KILOVOLTS_TEXT;
+ static const QString UNIT_MICROAMPERES_TEXT;
+ static const QString UNIT_MILLIAU_TEXT;
+ static const QString UNIT_MILLIVOLTS_TEXT;
+ static const QString UNIT_WATTS_TEXT;
static const QStringList DATA_DIR_SUFFIX;
std::unique_ptr<DataManager> dMgr;
std::unique_ptr<MainWindow> mWin;
- AGREInterface::ReturnCode aRet = AGREInterface::instance()->initialize();
- if (aRet == AGREInterface::ReturnCode::E_NO_LIBRARY) {
- QMessageBox::critical(nullptr, "Dependencies error", "Library " + AGREInterface::AGRE_LIBRARY_NAME + " could not have been found.\n"
- "The application cannot continue.");
- return 1;
- } else if (aRet == AGREInterface::ReturnCode::E_CANNOT_RESOLVE) {
- QMessageBox::critical(nullptr, "libAGRE error", "Some symbols from " + AGREInterface::AGRE_LIBRARY_NAME + " could not have been resolved.\n"
- "The application cannot continue.");
- return 1;
- } else if (aRet == AGREInterface::ReturnCode::E_CANNOT_GET_IFACE) {
- QMessageBox::critical(nullptr, "libAGRE error", "An error occured during data reader initialization.\nThe application cannot continue.");
- return 1;
- }
-
dMgr = std::unique_ptr<DataManager>(new DataManager);
mWin = std::unique_ptr<MainWindow>(new MainWindow);
mWin->setSequenceListModel(dMgr->sequenceSelectorModel());