47 if(reader.isInvalid())
50 QObject::tr(
"ERROR in Spectrum::fromCbor :\ncbor is not valid"));
52 if(reader.enterContainer())
54 while(reader.hasNext() && (!reader.isInvalid()))
59 qDebug() << txt_value;
63 qDebug() << txt_value;
66 else if(txt_value ==
"index")
68 index = reader.toUnsignedInteger();
71 else if(txt_value ==
"defaultArrayLength")
76 else if(txt_value ==
"cvParam")
80 else if(txt_value ==
"scanList")
83 reader.enterContainer();
85 while(reader.hasNext() && (!reader.isInvalid()))
91 qDebug() << txt_value;
92 if(txt_value ==
"cvParam")
96 else if(txt_value ==
"scan")
99 reader.enterContainer();
100 while(reader.hasNext())
105 reader.leaveContainer();
118 reader.leaveContainer();
120 else if(txt_value ==
"precursorList")
123 reader.enterContainer();
125 while(reader.hasNext() && (!reader.isInvalid()))
127 if(reader.isString())
131 qDebug() << txt_value;
133 if(txt_value ==
"cvParam")
137 else if(txt_value ==
"precursor")
143 while(reader.hasNext() && (!reader.isInvalid()))
170 reader.leaveContainer();
172 else if(txt_value ==
"binaryDataArray")
177 reader.enterContainer();
179 while(reader.hasNext())
187 reader.leaveContainer();
202 reader.leaveContainer();
210 if(reader.lastError() != QCborError::NoError)
213 QObject::tr(
"ERROR in Spectrum::fromCbor :\n%1").arg(reader.lastError()));
218std::map<QString, pappso::cbor::mzcbor::CvParam>
221 std::map<QString, CvParam> cv_params;
222 reader.enterContainer();
225 while(reader.hasNext() && (!reader.isInvalid()))
227 if(reader.isString())
231 qDebug() << txt_value;
232 if(txt_value ==
"cvParam")
248 reader.leaveContainer();
263 qDebug() << it->first <<
" " << it->second.valueInt;
264 return it->second.valueInt;
278 qDebug() << it->first <<
" " << it->second.valueInt;
279 return it->second.valueInt;
293 double rt_seconds = it->second.valueDouble;
294 if(it->second.unitAccession ==
"UO:0000031")
297 rt_seconds = rt_seconds * 60;
308 std::vector<pappso_double> xVector;
309 std::vector<pappso_double> yVector;
312 if(binary_array.isIntensity())
316 else if(binary_array.isMz())
324 "error in pappso::cbor::mzcbor::Spectrum::decodeTrace: binary vector type not found"));
A simple container of DataPoint instances.
size_t initialize(const std::vector< pappso_double > &xVector, const std::vector< pappso_double > &yVector)
bool decodeString(QString &the_str)
decode the current cbor value as a string the point to the next value the current value is decoded as...
PSI spectrum object for mzML/mzCBOR.
void fromCbor(CborStreamReader &reader)
static std::map< QString, pappso::cbor::mzcbor::CvParam > getCvParamsMapFromCbor(CborStreamReader &reader)
void fromCbor(CborStreamReader &reader)
std::map< QString, pappso::cbor::mzcbor::CvParam > cvParamMap
void decodeTrace(pappso::Trace &trace)
static std::map< QString, pappso::cbor::mzcbor::CvParam > readScanCvParams(CborStreamReader &reader)
std::vector< Precursor > precursorList
QCborMap cborBinaryDataArray
void fromCbor(CborStreamReader &reader, bool want_binary_data)
double getRtInSeconds() const
std::map< QString, pappso::cbor::mzcbor::CvParam > scanListCvParamMap
std::map< QString, pappso::cbor::mzcbor::CvParam > scanCvParamMap
qint64 getTotalIonCount() const
std::vector< BinaryDataArray > binaryDataArrayList
std::map< QString, pappso::cbor::mzcbor::CvParam > precursorListCvParamMap
std::size_t defaultArrayLength