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

`#include <precursor.h>`

## Public Member Functions

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

## Public Attributes

QString | spectrumRef
IsolationWindow | isolationWindow
CvParamMap | selectedIonListCvParamMap
std::vector< SelectedIon > | selectedIonList

## Detailed Description

Todo
  write docs

Definition at line 82 of file precursor.h.

## Member Function Documentation

## fromCbor()

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

Definition at line 229 of file precursor.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);
reader.next();
}
else if(txt_value == "isolationWindow")
{
isolationWindow.fromCbor(reader);
}
else if(txt_value == "selectedIonList")
{
reader.enterContainer();
while(reader.hasNext() && (!reader.isInvalid()))
{
if(reader.isString())
{
if(reader.decodeString(txt_value))
{
qDebug() << txt_value;
if(txt_value == "cvParam")
{
selectedIonListCvParamMap.fromCbor(reader);
}
else if(txt_value == "selectedIon")
{
reader.enterContainer(); // array
while(reader.hasNext() && (!reader.isInvalid()))
{
SelectedIon selected_ion;
selected_ion.fromCbor(reader);
selectedIonList.emplace_back(selected_ion);
}
reader.leaveContainer(); // array
}
else
{
reader.next();
}
}
else
{
reader.next();
}
}
else
{
reader.next();
}
}
reader.leaveContainer();
}
else if(txt_value == "activation")
{
qDebug();
reader.next();
}
else if(txt_value == "spectrumRef")
{
reader.decodeString(txt_value);
qDebug() << txt_value;
spectrumRef = txt_value;
}
else
{
reader.next();
}
}
else
{
reader.next();
}
}
else
{
reader.next();
}
}
reader.leaveContainer();
}
pappso::cbor::mzcbor::Precursor::isolationWindow
IsolationWindow isolationWindow
Definition precursor.h:93
pappso::cbor::mzcbor::Precursor::spectrumRef
QString spectrumRef
Definition precursor.h:91
pappso::cbor::mzcbor::Precursor::selectedIonList
std::vector< SelectedIon > selectedIonList
Definition precursor.h:97
pappso::cbor::mzcbor::Precursor::selectedIonListCvParamMap
CvParamMap selectedIonListCvParamMap
Definition precursor.h:95

References pappso::cbor::CborStreamReader::decodeString(), pappso::cbor::mzcbor::SelectedIon::fromCbor(), isolationWindow, selectedIonList, selectedIonListCvParamMap, and spectrumRef.

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

## toJsonObject()

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

write the structure to a JSON object

Returns
  QJsonObject

Definition at line 107 of file precursor.cpp.

{
QJsonObject precursor;
if(!spectrumRef.isEmpty())
precursor.insert("spectrumRef", spectrumRef);
precursor.insert("isolationWindow", isolationWindow.toJsonObject());
return precursor;
}

References isolationWindow, and spectrumRef.

## Member Data Documentation

## isolationWindow

IsolationWindow pappso::cbor::mzcbor::Precursor::isolationWindow

Definition at line 93 of file precursor.h.

Referenced by fromCbor(), and toJsonObject().

## selectedIonList

std::vector<SelectedIon> pappso::cbor::mzcbor::Precursor::selectedIonList

Definition at line 97 of file precursor.h.

Referenced by fromCbor().

## selectedIonListCvParamMap

CvParamMap pappso::cbor::mzcbor::Precursor::selectedIonListCvParamMap

Definition at line 95 of file precursor.h.

Referenced by fromCbor().

## spectrumRef

QString pappso::cbor::mzcbor::Precursor::spectrumRef

Definition at line 91 of file precursor.h.

Referenced by fromCbor(), and toJsonObject().

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

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