38 for(
auto it_binarr = cbor_map.cbegin(); it_binarr != cbor_map.cend(); it_binarr++)
40 txt_value = it_binarr.key().toString();
41 qDebug() << txt_value;
42 if(txt_value ==
"cvParam")
44 cvParamMap.fromQCborArray(it_binarr.value().toArray());
53 reader.enterContainer();
54 qDebug() << txt_value;
55 while(reader.hasNext() && (!reader.isInvalid()))
61 qDebug() << txt_value;
62 if(txt_value ==
"cvParam")
82 reader.leaveContainer();
93 QObject::tr(
"isolation window target m/z MS:1000827 not found in cvParam map"));
96 if(std::isnan(it->second.valueDouble))
98 return (
double)it->second.valueInt;
100 return it->second.valueDouble;
113 QObject::tr(
"isolation window lower offset MS:1000828 not found in cvParam map"));
116 if(std::isnan(it->second.valueDouble))
118 return mz - (double)it->second.valueInt;
120 return mz - it->second.valueDouble;
126 QJsonObject isolationWindow;
127 isolationWindow.insert(
"cvParam",
cvParamMap.toJsonArray());
128 return isolationWindow;
133 QJsonObject precursor;
151 QObject::tr(
"isolation window upper offset MS:1000829 not found in cvParam map"));
154 if(std::isnan(it->second.valueDouble))
156 return mz + (double)it->second.valueInt;
158 return mz + it->second.valueDouble;
165 for(
auto it_binarr = cbor_map.cbegin(); it_binarr != cbor_map.cend(); it_binarr++)
167 txt_value = it_binarr.key().toString();
168 qDebug() << txt_value;
169 if(txt_value ==
"cvParam")
171 cvParamMap.fromQCborArray(it_binarr.value().toArray());
180 reader.enterContainer();
181 qDebug() << txt_value;
182 while(reader.hasNext() && (!reader.isInvalid()))
184 if(reader.isString())
188 qDebug() << txt_value;
189 if(txt_value ==
"cvParam")
209 reader.leaveContainer();
223 QObject::tr(
"Charge state not found in SelectedIon cvParam map"));
225 qDebug() << it->first <<
" " << it->second.valueInt;
226 return it->second.valueInt;
244 qDebug() << it->first <<
" " << it->second.valueDouble;
245 double intensity = it->second.valueDouble;
247 if(std::isnan(intensity))
249 return it->second.valueInt;
266 qDebug() << it->first <<
" " << it->second.valueDouble;
267 return it->second.valueDouble;
276 reader.enterContainer();
277 qDebug() << txt_value;
278 while(reader.hasNext() && (!reader.isInvalid()))
280 if(reader.isString())
284 qDebug() << txt_value;
285 if(txt_value ==
"cvParam")
290 else if(txt_value ==
"isolationWindow")
294 else if(txt_value ==
"selectedIonList")
297 reader.enterContainer();
299 while(reader.hasNext() && (!reader.isInvalid()))
301 if(reader.isString())
305 qDebug() << txt_value;
306 if(txt_value ==
"cvParam")
310 else if(txt_value ==
"selectedIon")
313 reader.enterContainer();
315 while(reader.hasNext() && (!reader.isInvalid()))
321 reader.leaveContainer();
338 reader.leaveContainer();
340 else if(txt_value ==
"activation")
346 else if(txt_value ==
"spectrumRef")
349 qDebug() << txt_value;
367 reader.leaveContainer();
simple override of the raw QCborStreamReader This adds convenient functions to put CBOR data into C++...
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 precursor object for mzML/mzCBOR.
double getUpperMz() const
compute isolation window upper m/z given cvParam informations
double getLowerMz() const
compute isolation window lower m/z given cvParam informations
double getTargetMz() const
get isolation window target m/z given cvParam informations
QJsonObject toJsonObject() const
write the structure to a JSON object
void fromQCborMap(const QCborMap &reader)
void fromCbor(CborStreamReader &reader)
IsolationWindow isolationWindow
QJsonObject toJsonObject() const
write the structure to a JSON object
std::vector< SelectedIon > selectedIonList
CvParamMap selectedIonListCvParamMap
void fromCbor(CborStreamReader &reader)
void fromQCborMap(const QCborMap &reader)
int getChargeState() const
void fromCbor(CborStreamReader &reader)
double getIntensity(bool *isok) const