Loading...
Searching...
No Matches
pappso::cbor::mzcbor::Scan Struct Reference

`#include <scan.h>`

## Public Member Functions

void | fromCbor (CborStreamReader &reader)
QJsonObject | toJsonObject () const
| write the structure to a JSON object
double | getRtInSeconds () const

## Public Attributes

CvParamMap | cvParamMap

## Detailed Description

Todo
  write docs

Definition at line 44 of file scan.h.

## Member Function Documentation

## fromCbor()

void pappso::cbor::mzcbor::Scan::fromCbor | ( | CborStreamReader & | reader | ) |

Definition at line 57 of file scan.cpp.

{
QString txt_value;
reader.enterContainer();
qDebug() << txt_value;
while(reader.hasNext() && (!reader.isInvalid()))
{
if(reader.isString())
{
if(reader.decodeString(txt_value))
{
qDebug() << txt_value;
if(txt_value == "cvParam")
{
// precursorListCvParamMap = CvParam::getCvParamsMapFromCbor(reader);
cvParamMap.fromCbor(reader);
}
else
{
reader.next();
}
}
else
{
reader.next();
}
}
else
{
reader.next();
}
}
reader.leaveContainer();
}
pappso::cbor::mzcbor::Scan::cvParamMap
CvParamMap cvParamMap
Definition scan.h:55

References cvParamMap, and pappso::cbor::CborStreamReader::decodeString().

Referenced by pappso::cbor::mzcbor::Spectrum::fromCbor().

## getRtInSeconds()

double pappso::cbor::mzcbor::Scan::getRtInSeconds | ( |  | ) | const

Definition at line 34 of file scan.cpp.

{
// <cvParam cvRef="MS" accession="MS:1000016" value="0.0048758833" name="scan start
// time" unitAccession="UO:0000031" unitName="minute" unitCvRef="UO" />
auto it = cvParamMap.find("MS:1000016");
if(it == cvParamMap.end())
{
throw pappso::ExceptionNotFound(QObject::tr("retention time not found in cvParam map"));
}
double rt_seconds = it->second.valueDouble;
if(it->second.unitAccession == "UO:0000031")
{
// // minutes
rt_seconds = rt_seconds * 60;
}
// <cvParam cvRef="MS" accession="MS:1000016" value="0" name="scan start time"
// unitAccession="UO:0000031" unitName="minute" unitCvRef="UO" />
return rt_seconds;
}

References cvParamMap.

## toJsonObject()

QJsonObject pappso::cbor::mzcbor::Scan::toJsonObject | ( |  | ) | const

write the structure to a JSON object

Returns
  QJsonObject

Definition at line 95 of file scan.cpp.

{
QJsonObject scan;
scan.insert("cvParam", cvParamMap.toJsonArray());
return scan;
}

References cvParamMap.

## Member Data Documentation

## cvParamMap

CvParamMap pappso::cbor::mzcbor::Scan::cvParamMap

Definition at line 55 of file scan.h.

Referenced by fromCbor(), getRtInSeconds(), and toJsonObject().

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

- pappsomspp/core/processing/cbor/mzcbor/scan.h
- pappsomspp/core/processing/cbor/mzcbor/scan.cpp