X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fviews%2Ftrace%2Fmathsignal.hpp;fp=pv%2Fviews%2Ftrace%2Fmathsignal.hpp;h=461fd4b724cad2e713321907e5c0abc3b1cdb591;hp=0000000000000000000000000000000000000000;hb=4640a84e926ac4b82e2a1b6ef9fc80ef44c2bd3c;hpb=fe1e6ad6ae644edd29ab226573e40561c9974694;ds=sidebyside diff --git a/pv/views/trace/mathsignal.hpp b/pv/views/trace/mathsignal.hpp new file mode 100644 index 00000000..461fd4b7 --- /dev/null +++ b/pv/views/trace/mathsignal.hpp @@ -0,0 +1,63 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2020 Soeren Apel + * + * 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 2 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 . + */ + +#ifndef PULSEVIEW_PV_VIEWS_TRACE_MATHSIGNAL_HPP +#define PULSEVIEW_PV_VIEWS_TRACE_MATHSIGNAL_HPP + +#include +#include +#include + +#include +#include + +using std::shared_ptr; + +namespace pv { +namespace views { +namespace trace { + +class MathSignal : public AnalogSignal +{ + Q_OBJECT + +public: + MathSignal(pv::Session &session, shared_ptr base); + +protected: + void populate_popup_form(QWidget *parent, QFormLayout *form); + + shared_ptr math_signal_; + +private Q_SLOTS: + void on_expression_changed(const QString &text); + void on_sample_count_changed(const QString &text); + +private: + QLineEdit *expression_edit_; + QComboBox *sample_count_cb_, *sample_rate_cb_; + QString sample_count_text_, sample_rate_text_; + QTimer delayed_expr_updater_, delayed_count_updater_, delayed_rate_updater_; +}; + +} // namespace trace +} // namespace views +} // namespace pv + +#endif // PULSEVIEW_PV_VIEWS_TRACE_MATHSIGNAL_HPP