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

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