2 * This file is part of the PulseView project.
4 * Copyright (C) 2020 Soeren Apel <soeren@apelpie.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 2 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/>.
24 #include "mathsignal.hpp"
26 #include <pv/globalsettings.hpp>
27 #include <pv/session.hpp>
28 #include <pv/data/analogsegment.hpp>
29 #include <pv/data/signalbase.hpp>
31 using std::make_shared;
36 const int64_t MathSignal::ChunkLength = 256 * 1024;
39 MathSignal::MathSignal(pv::Session &session) :
40 SignalBase(nullptr, SignalBase::MathChannel),
43 shared_ptr<data::Analog> data(new data::Analog());
46 shared_ptr<data::AnalogSegment> segment = make_shared<data::AnalogSegment>(
47 *data, data->get_segment_count(), session.get_samplerate());
49 data->push_segment(segment);
52 MathSignal::~MathSignal()
56 void MathSignal::save_settings(QSettings &settings) const
61 void MathSignal::restore_settings(QSettings &settings)