forked from analogdevicesinc/scopy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdmm_api.hpp
129 lines (103 loc) · 3.59 KB
/
dmm_api.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*
* Copyright (c) 2019 Analog Devices Inc.
*
* This file is part of Scopy
* (see http://www.github.com/analogdevicesinc/scopy).
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DMM_API_HPP
#define DMM_API_HPP
#include "dmm.hpp"
namespace adiscope {
class DMM_API : public ApiObject
{
friend class ToolLauncher_API;
Q_OBJECT
Q_PROPERTY(bool mode_ac_ch1
READ get_mode_ac_ch1 WRITE set_mode_ac_ch1);
Q_PROPERTY(bool mode_ac_ch2
READ get_mode_ac_ch2 WRITE set_mode_ac_ch1);
Q_PROPERTY(bool running READ running WRITE run STORED false);
Q_PROPERTY(bool histogram_ch1
READ get_histogram_ch1
WRITE set_histogram_ch1);
Q_PROPERTY(bool histogram_ch2
READ get_histogram_ch2
WRITE set_histogram_ch2);
Q_PROPERTY(int history_ch1_size_idx
READ get_history_ch1_size_idx
WRITE set_history_ch1_size_idx);
Q_PROPERTY(int history_ch2_size_idx
READ get_history_ch2_size_idx
WRITE set_history_ch2_size_idx);
Q_PROPERTY(float line_thickness_ch1
READ get_line_thickness_ch1
WRITE set_line_thickness_ch1);
Q_PROPERTY(float line_thickness_ch2
READ get_line_thickness_ch2
WRITE set_line_thickness_ch2);
Q_PROPERTY(double value_ch1 READ read_ch1);
Q_PROPERTY(double value_ch2 READ read_ch2);
Q_PROPERTY(bool data_logging_en READ getDataLoggingEn
WRITE setDataLoggingEn)
Q_PROPERTY(double data_logging_timer READ getDataLoggingTimer
WRITE setDataLoggingTimer)
Q_PROPERTY(bool data_logging_append READ getDataLoggingAppend
WRITE setDataLoggingAppend)
Q_PROPERTY(bool peak_hold_en READ getPeakHoldEn
WRITE setPeakHoldEn)
Q_PROPERTY(QString notes READ getNotes WRITE setNotes)
Q_PROPERTY(QVector<int> gainModes READ getGainModes WRITE setGainModes)
public:
bool get_mode_ac_ch1() const;
bool get_mode_ac_ch2() const;
void set_mode_ac_ch1(bool en);
void set_mode_ac_ch2(bool en);
bool get_histogram_ch1() const;
bool get_histogram_ch2() const;
void set_histogram_ch1(bool en);
void set_histogram_ch2(bool en);
float get_line_thickness_ch1() const;
float get_line_thickness_ch2() const;
void set_line_thickness_ch1(float thickness);
void set_line_thickness_ch2(float thickness);
int get_history_ch1_size_idx() const;
int get_history_ch2_size_idx() const;
void set_history_ch1_size_idx(int idx);
void set_history_ch2_size_idx(int idx);
double read_ch1() const;
double read_ch2() const;
bool running() const;
void run(bool en);
bool getDataLoggingEn() const;
void setDataLoggingEn(bool);
double getDataLoggingTimer() const;
void setDataLoggingTimer(double);
bool getDataLoggingAppend() const;
void setDataLoggingAppend(bool);
bool getPeakHoldEn() const;
void setPeakHoldEn(bool);
QString getNotes();
void setNotes(QString);
QVector<int> getGainModes() const;
void setGainModes(const QVector<int> &gainModes);
Q_INVOKABLE void show();
explicit DMM_API(DMM *dmm) : ApiObject(), dmm(dmm) {}
~DMM_API() {}
private:
DMM *dmm;
};
}
#endif // DMM_API_HPP