libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
massspectrumjs.cpp
Go to the documentation of this file.
1
/* BEGIN software license
2
*
3
* msXpertSuite - mass spectrometry software suite
4
* -----------------------------------------------
5
* Copyright(C) 2009,...,2018 Filippo Rusconi
6
*
7
* http://www.msxpertsuite.org
8
*
9
* This file is part of the msXpertSuite project.
10
*
11
* The msXpertSuite project is the successor of the massXpert project. This
12
* project now includes various independent modules:
13
*
14
* - massXpert, model polymer chemistries and simulate mass spectrometric data;
15
* - mineXpert, a powerful TIC chromatogram/mass spectrum viewer/miner;
16
*
17
* This program is free software: you can redistribute it and/or modify
18
* it under the terms of the GNU General Public License as published by
19
* the Free Software Foundation, either version 3 of the License, or
20
* (at your option) any later version.
21
*
22
* This program is distributed in the hope that it will be useful,
23
* but WITHOUT ANY WARRANTY; without even the implied warranty of
24
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25
* GNU General Public License for more details.
26
*
27
* You should have received a copy of the GNU General Public License
28
* along with this program. If not, see <http://www.gnu.org/licenses/>.
29
*
30
* END software license
31
*/
32
33
34
/////////////////////// Qt includes
35
36
37
/////////////////////// Local includes
38
#include "
massspectrumjs.h
"
39
#include "
jsclassregistrar.h
"
40
41
42
namespace
pappso
43
{
44
45
MassSpectrumJs::MassSpectrumJs
(QObject *parent) : QObject(parent)
46
{
47
}
48
49
50
MassSpectrumJs::~MassSpectrumJs
()
51
{
52
}
53
54
55
// For the invokable method
56
int
57
MassSpectrumJs::getCount
()
const
58
{
59
return
static_cast<
int
>
(
m_massSpectrum
.size());
60
}
61
62
// For the property
63
int
64
MassSpectrumJs::count
()
const
65
{
66
return
getCount
();
67
}
68
69
void
70
MassSpectrumJs::registerJsConstructor
(QJSEngine *engine)
71
{
72
if
(!engine)
73
{
74
qWarning() <<
"Cannot register class: engine is null"
;
75
return
;
76
}
77
78
// Register the meta object as a constructor
79
QJSValue jsMetaObject = engine->newQMetaObject(&MassSpectrumJs::staticMetaObject);
80
engine->globalObject().setProperty(
"MassSpectrum"
, jsMetaObject);
81
}
82
83
}
// namespace pappso
pappso::MassSpectrumJs::m_massSpectrum
MassSpectrum m_massSpectrum
Definition
massspectrumjs.h:80
pappso::MassSpectrumJs::~MassSpectrumJs
~MassSpectrumJs()
Definition
massspectrumjs.cpp:50
pappso::MassSpectrumJs::MassSpectrumJs
Q_INVOKABLE MassSpectrumJs(QObject *parent=nullptr)
Definition
massspectrumjs.cpp:45
pappso::MassSpectrumJs::registerJsConstructor
static void registerJsConstructor(QJSEngine *engine)
Definition
massspectrumjs.cpp:70
pappso::MassSpectrumJs::getCount
Q_INVOKABLE int getCount() const
Definition
massspectrumjs.cpp:57
pappso::MassSpectrumJs::count
int count
Definition
massspectrumjs.h:61
jsclassregistrar.h
massspectrumjs.h
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappsomspp
core
js_qml
massspectrumjs.cpp
Generated on Tue Sep 23 2025 09:36:34 for libpappsomspp by
1.13.2