libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
psmneweval.cpp
Go to the documentation of this file.
1/**
2 * \file pappsomspp/processing/cbor/psm/evalscan/psmneweval.cpp
3 * \date 21/08/2025
4 * \author Olivier Langella
5 * \brief add any new eval contained in a double vector
6 */
7
8/*******************************************************************************
9 * Copyright (c) 2025 Olivier Langella <Olivier.Langella@universite-paris-saclay.fr>.
10 *
11 * This file is part of PAPPSOms-tools.
12 *
13 * PAPPSOms-tools is free software: you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation, either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * PAPPSOms-tools is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with PAPPSOms-tools. If not, see <http://www.gnu.org/licenses/>.
25 *
26 ******************************************************************************/
27
28#include "psmneweval.h"
29#include "../cborscanmapbase.h"
30
31pappso::cbor::psm::PsmNewEval::PsmNewEval(std::size_t buffer_scan_size,
32 CborStreamWriter *cbor_output_p,
33 const QString &eval_name,
34 const QJsonObject &parameters)
35 : PsmFileScanProcessAndCopy(buffer_scan_size, cbor_output_p, QString("add %1").append(eval_name))
36{
37 qDebug();
38 m_newEvalParameters = parameters;
39 m_evalName = eval_name;
40 qDebug();
41}
42
46
49{
50 CborScanMapBase *p_cbor_scan_map = new CborScanMapBase(*this);
51 value_it = p_cbor_scan_map->addPsmEvalVectorDouble(
53 return p_cbor_scan_map;
54}
55
56void
57pappso::cbor::psm::PsmNewEval::addEvalDoubleVector(const QString &eval_key_value_name,
58 std::vector<double> arr_values)
59{
60 m_evalKeyValueName = eval_key_value_name;
61 m_psmEvalValues = arr_values;
62}
63
64void
66 [[maybe_unused]])
67{
68 qDebug();
69 QCborMap cbor_neweval_parameters = QCborValue::fromJsonValue(m_newEvalParameters).toMap();
70
71
72 m_cborParameterMap.insert(m_evalName, cbor_neweval_parameters);
73
74
75 mp_cborOutput->append("parameter_map");
76 mp_cborOutput->writeCborMap(m_cborParameterMap);
77 qDebug();
78}
std::vector< double >::iterator addPsmEvalVectorDouble(const QString &eval_name, const QString &eval_value_key, std::vector< double >::iterator begin, std::vector< double >::const_iterator end)
add a new eval key and double values (from a vector) to each PSM
PsmFileScanProcessAndCopy(std::size_t buffer_scan_size, CborStreamWriter *cbor_output_p, const QString &operation)
void parameterMapReady(pappso::UiMonitorInterface &monitor) override
std::vector< double >::iterator value_it
Definition psmneweval.h:62
void addEvalDoubleVector(const QString &eval_key_value_name, std::vector< double > arr_values)
pappso::cbor::psm::CborScanMapBase * newCborScanMap() override
std::vector< double > m_psmEvalValues
Definition psmneweval.h:60
PsmNewEval(std::size_t buffer_scan_size, CborStreamWriter *cbor_output_p, const QString &eval_name, const QJsonObject &parameters)