QCodeEditor: Update to current cpeditor/QCodeEditor fork, commit ed1196a
[smuview.git] / src / channels / integratechannel.hpp
blobf99345901ab282f5a36101b7654c8bed36fe0973
1 /*
2 * This file is part of the SmuView project.
4 * Copyright (C) 2018-2021 Frank Stettner <frank-stettner@gmx.net>
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef CHANNELS_INTEGRATECHANNEL_HPP
21 #define CHANNELS_INTEGRATECHANNEL_HPP
23 #include <memory>
24 #include <set>
25 #include <string>
27 #include <QObject>
29 #include "src/channels/basechannel.hpp"
30 #include "src/channels/mathchannel.hpp"
31 #include "src/data/datautil.hpp"
33 using std::set;
34 using std::shared_ptr;
35 using std::string;
37 namespace sv {
39 namespace data {
40 class AnalogTimeSignal;
43 namespace devices {
44 class BaseDevice;
47 namespace channels {
49 class IntegrateChannel : public MathChannel
51 Q_OBJECT
53 public:
54 IntegrateChannel(
55 data::Quantity quantity,
56 const set<data::QuantityFlag> &quantity_flags,
57 data::Unit unit,
58 shared_ptr<data::AnalogTimeSignal> int_signal,
59 shared_ptr<devices::BaseDevice> parent_device,
60 const set<string> &channel_group_names,
61 const string &channel_name,
62 double channel_start_timestamp);
64 private:
65 shared_ptr<data::AnalogTimeSignal> int_signal_;
66 size_t next_int_signal_pos_;
67 double last_timestamp_;
68 double last_value_;
70 private Q_SLOTS:
71 void on_channel_start_timestamp_changed(double timestamp);
72 void on_sample_appended();
76 } // namespace channels
77 } // namespace sv
79 #endif // CHANNELS_INTEGRATECHANNEL_HPP