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< SelectedIonselectedIonList

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.

230{
231
232 QString txt_value;
233 reader.enterContainer();
234 qDebug() << txt_value;
235 while(reader.hasNext() && (!reader.isInvalid()))
236 {
237 if(reader.isString())
238 {
239 if(reader.decodeString(txt_value))
240 {
241 qDebug() << txt_value;
242 if(txt_value == "cvParam")
243 {
244 // precursorListCvParamMap = CvParam::getCvParamsMapFromCbor(reader);
245 reader.next();
246 }
247 else if(txt_value == "isolationWindow")
248 {
249 isolationWindow.fromCbor(reader);
250 }
251 else if(txt_value == "selectedIonList")
252 {
253
254 reader.enterContainer();
255
256 while(reader.hasNext() && (!reader.isInvalid()))
257 {
258 if(reader.isString())
259 {
260 if(reader.decodeString(txt_value))
261 {
262 qDebug() << txt_value;
263 if(txt_value == "cvParam")
264 {
265 selectedIonListCvParamMap.fromCbor(reader);
266 }
267 else if(txt_value == "selectedIon")
268 {
269
270 reader.enterContainer(); // array
271
272 while(reader.hasNext() && (!reader.isInvalid()))
273 {
274 SelectedIon selected_ion;
275 selected_ion.fromCbor(reader);
276 selectedIonList.emplace_back(selected_ion);
277 }
278 reader.leaveContainer(); // array
279 }
280 else
281 {
282 reader.next();
283 }
284 }
285 else
286 {
287 reader.next();
288 }
289 }
290 else
291 {
292 reader.next();
293 }
294 }
295 reader.leaveContainer();
296 }
297 else if(txt_value == "activation")
298 {
299 qDebug();
300 reader.next();
301 }
302
303 else if(txt_value == "spectrumRef")
304 {
305 reader.decodeString(txt_value);
306 qDebug() << txt_value;
307 spectrumRef = txt_value;
308 }
309 else
310 {
311 reader.next();
312 }
313 }
314 else
315 {
316 reader.next();
317 }
318 }
319 else
320 {
321 reader.next();
322 }
323 }
324 reader.leaveContainer();
325}
IsolationWindow isolationWindow
Definition precursor.h:93
std::vector< SelectedIon > selectedIonList
Definition precursor.h:97

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.

108{
109 QJsonObject precursor;
110 if(!spectrumRef.isEmpty())
111 precursor.insert("spectrumRef", spectrumRef);
112 precursor.insert("isolationWindow", isolationWindow.toJsonObject());
113 return precursor;
114}

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: