libpappsomspp
Library for mass spectrometry
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 85 of file precursor.h.

Member Function Documentation

◆ fromCbor()

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

Definition at line 272 of file precursor.cpp.

273{
274
275 QString txt_value;
276 reader.enterContainer();
277 qDebug() << txt_value;
278 while(reader.hasNext() && (!reader.isInvalid()))
279 {
280 if(reader.isString())
281 {
282 if(reader.decodeString(txt_value))
283 {
284 qDebug() << txt_value;
285 if(txt_value == "cvParam")
286 {
287 // precursorListCvParamMap = CvParam::getCvParamsMapFromCbor(reader);
288 reader.next();
289 }
290 else if(txt_value == "isolationWindow")
291 {
292 isolationWindow.fromCbor(reader);
293 }
294 else if(txt_value == "selectedIonList")
295 {
296
297 reader.enterContainer();
298
299 while(reader.hasNext() && (!reader.isInvalid()))
300 {
301 if(reader.isString())
302 {
303 if(reader.decodeString(txt_value))
304 {
305 qDebug() << txt_value;
306 if(txt_value == "cvParam")
307 {
308 selectedIonListCvParamMap.fromCbor(reader);
309 }
310 else if(txt_value == "selectedIon")
311 {
312
313 reader.enterContainer(); // array
314
315 while(reader.hasNext() && (!reader.isInvalid()))
316 {
317 SelectedIon selected_ion;
318 selected_ion.fromCbor(reader);
319 selectedIonList.emplace_back(selected_ion);
320 }
321 reader.leaveContainer(); // array
322 }
323 else
324 {
325 reader.next();
326 }
327 }
328 else
329 {
330 reader.next();
331 }
332 }
333 else
334 {
335 reader.next();
336 }
337 }
338 reader.leaveContainer();
339 }
340 else if(txt_value == "activation")
341 {
342 qDebug();
343 reader.next();
344 }
345
346 else if(txt_value == "spectrumRef")
347 {
348 reader.decodeString(txt_value);
349 qDebug() << txt_value;
350 spectrumRef = txt_value;
351 }
352 else
353 {
354 reader.next();
355 }
356 }
357 else
358 {
359 reader.next();
360 }
361 }
362 else
363 {
364 reader.next();
365 }
366 }
367 reader.leaveContainer();
368}
IsolationWindow isolationWindow
Definition precursor.h:96
std::vector< SelectedIon > selectedIonList
Definition precursor.h:100

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 131 of file precursor.cpp.

132{
133 QJsonObject precursor;
134 if(!spectrumRef.isEmpty())
135 precursor.insert("spectrumRef", spectrumRef);
136 precursor.insert("isolationWindow", isolationWindow.toJsonObject());
137 return precursor;
138}

References isolationWindow, and spectrumRef.

Member Data Documentation

◆ isolationWindow

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

Definition at line 96 of file precursor.h.

Referenced by fromCbor(), and toJsonObject().

◆ selectedIonList

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

Definition at line 100 of file precursor.h.

Referenced by fromCbor().

◆ selectedIonListCvParamMap

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

Definition at line 98 of file precursor.h.

Referenced by fromCbor().

◆ spectrumRef

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

Definition at line 94 of file precursor.h.

Referenced by fromCbor(), and toJsonObject().


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