libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
massspectraceplotcontext.cpp
Go to the documentation of this file.
1// Copyright 2021 Filippo Rusconi
2// GPLv3+
3
4/////////////////////// StdLib includes
5
6
7/////////////////////// Qt includes
8#include <QString>
9
10
11/////////////////////// Local includes
13
14namespace pappso
15{
16
17
21
25
28{
30
31 copy_p->initialize(*const_cast<const MassSpecTracePlotContext *>(this));
32
33 copy_p->m_lastZ = m_lastZ;
34 copy_p->m_lastMz = m_lastMz;
36 copy_p->m_lastMr = m_lastMr;
38
39 return copy_p;
40}
41
42void
47
48void
59
60
61void
63{
64 m_lastZ = std::numeric_limits<quint16>::max();
65 m_lastMz = qQNaN();
66 m_lastMr = qQNaN();
67}
68
69QString
71{
72 QString text("Base context:\n");
73
75
76 text += "\n";
77
78 text += "Mass spectrum trace plot context\n";
79
80 text += QString("last z: %1").arg(m_lastZ);
81 text += QString(" -- last m/z: %1").arg(m_lastMz, 0, 'f', 6);
82 text += QString(" -- last TIC intensity: %1").arg(m_lastTicIntensity, 0, 'f', 0);
83 text += QString(" -- last Mr: %1").arg(m_lastMr, 0, 'f', 6);
84 text += QString(" -- last resolving power: %1").arg(m_lastResolvingPower, 0, 'f', 0);
85
86 text += "\n";
87
88 return text;
89}
90
91void
93{
94 if(!engine)
95 {
96 qWarning() << "Cannot register class: engine is null";
97 return;
98 }
99
100 // Register the meta object as a constructor
101 QJSValue jsMetaObject = engine->newQMetaObject(&MassSpecTracePlotContext::staticMetaObject);
102 engine->globalObject().setProperty("MassSpecTracePlotContext", jsMetaObject);
103}
104
105} // namespace pappso
Q_INVOKABLE BasePlotContext(QObject *parent=nullptr)
Q_INVOKABLE void initialize(const BasePlotContext &other)
Q_INVOKABLE QString toString() const
Q_INVOKABLE MassSpecTracePlotContext * clone(QObject *parent=nullptr)
Q_INVOKABLE void initialize(const BasePlotContext &other)
Q_INVOKABLE MassSpecTracePlotContext(QObject *parent=nullptr)
static void registerJsConstructor(QJSEngine *engine)
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39