pappso::MzCalibrationStore Class Reference

`#include <mzcalibrationstore.h>`

## Public Member Functions

| MzCalibrationStore ()
virtual | ~MzCalibrationStore ()
MzCalibrationInterfaceSPtr | getInstance (double T1_frame, double T2_frame, const QSqlRecord &mzcalibration_record)

## Private Attributes

std::map< QString, MzCalibrationInterfaceSPtr > | m_mapMzCalibrationSPtr

## Detailed Description

Todo:
  write docs

Definition at line 39 of file mzcalibrationstore.h.

## Constructor & Destructor Documentation

## MzCalibrationStore()

pappso::MzCalibrationStore::MzCalibrationStore | ( |  | ) |

Todo:
  write docs

Definition at line 37 of file mzcalibrationstore.cpp.

{
}

## ~MzCalibrationStore()

pappso::MzCalibrationStore::~MzCalibrationStore | ( |  | ) |

virtual

Todo:
  write docs

Definition at line 41 of file mzcalibrationstore.cpp.

{
}

## Member Function Documentation

## getInstance()

MzCalibrationInterfaceSPtr pappso::MzCalibrationStore::getInstance | ( | double | T1_frame,
|  | double | T2_frame,
|  | const QSqlRecord & | mzcalibration_record
| ) |  |

Definition at line 46 of file mzcalibrationstore.cpp.

{
//qDebug();
MzCalibrationInterfaceSPtr msp_mzCalibration = nullptr;
QString mz_calibration_key =
QString("%1-%2-%3-%4")
.arg(mz_calibration_record.value("Id").toInt())
.arg(mz_calibration_record.value("ModelType").toInt())
.arg(QString::number(T1_frame, 'g', 10))
.arg(QString::number(T2_frame, 'g', 10));
auto itmap = m_mapMzCalibrationSPtr.find(mz_calibration_key);
if(itmap != m_mapMzCalibrationSPtr.end())
{
//qDebug() << mz_calibration_key << " calibration object found";
msp_mzCalibration = itmap->second;
}
else
{
if(mz_calibration_record.value("ModelType").toInt() == 1)
{
msp_mzCalibration = std::make_shared<MzCalibrationModel1>(
T1_frame,
T2_frame,
mz_calibration_record.value("DigitizerTimebase")
.toDouble(), // MzCalibration.DigitizerTimebase
mz_calibration_record.value("DigitizerDelay")
.toDouble(), // MzCalibration.DigitizerDelay
mz_calibration_record.value("C0").toDouble(), // MzCalibration.C0
mz_calibration_record.value("C1").toDouble(), // MzCalibration.C1
mz_calibration_record.value("C2").toDouble(), // MzCalibration.C2
mz_calibration_record.value("C3").toDouble(), // MzCalibration.C3
mz_calibration_record.value("C4").toDouble(), // MzCalibration.C4
mz_calibration_record.value("T1").toDouble(),
mz_calibration_record.value("T2").toDouble(),
mz_calibration_record.value("dC1").toDouble(),
mz_calibration_record.value("dC2").toDouble());
}
else
{
//qDebug();
throw PappsoException(
QObject::tr(
"ERROR in MzCalibrationStore::getInstance : MzCalibration "
"ModelType \"%1\" not available")
.arg(mz_calibration_record.value("ModelType").toInt()));
}
m_mapMzCalibrationSPtr.insert(
std::pair<QString, MzCalibrationInterfaceSPtr>(mz_calibration_key,
msp_mzCalibration));
}
if(msp_mzCalibration == nullptr)
{
//qDebug();
throw PappsoException(QObject::tr(
"ERROR in MzCalibrationStore::getInstance MzCalibration is NULL"));
}
//qDebug();
return (msp_mzCalibration);
}
pappso::MzCalibrationStore::m_mapMzCalibrationSPtr
std::map< QString, MzCalibrationInterfaceSPtr > m_mapMzCalibrationSPtr
Definition: mzcalibrationstore.h:56
pappso::MzCalibrationInterfaceSPtr
std::shared_ptr< MzCalibrationInterface > MzCalibrationInterfaceSPtr
Definition: mzcalibrationinterface.h:37

References m_mapMzCalibrationSPtr.

Referenced by pappso::TimsData::getTimsFrameBaseCstSPtr(), and pappso::TimsData::getTimsFrameCstSPtr().

## Member Data Documentation

## m_mapMzCalibrationSPtr

std::map<QString, MzCalibrationInterfaceSPtr> pappso::MzCalibrationStore::m_mapMzCalibrationSPtr

private

Definition at line 56 of file mzcalibrationstore.h.

Referenced by getInstance().

The documentation for this class was generated from the following files:

- pappsomspp/vendors/tims/mzcalibration/mzcalibrationstore.h
- pappsomspp/vendors/tims/mzcalibration/mzcalibrationstore.cpp