#ifndef GTL_MATH_OSC_MEAS_H #define GTL_MATH_OSC_MEAS_H #include #include #include #include "core/gtl_analog_data.h" #include "math_global.h" namespace gtl { namespace math { class MATH_EXPORT osc_meas { Q_GADGET public: osc_meas(); enum class types { min, max, offset, peak, peak_to_peak, rms, freq, period, kurt }; Q_ENUM(types) struct params { int id; QString chan; osc_meas::types type; qreal value; gtl::analog_data* ad; explicit params() { chan = ""; type = math::osc_meas::types::min; value = 0; id = 0; ad = nullptr; } }; static qreal min(const std::vector::iterator& begin, const std::vector::iterator& end); static qreal max(const std::vector::iterator& begin, const std::vector::iterator& end); static qreal offset(const std::vector::iterator& begin, const std::vector::iterator& end); static qreal peak(const std::vector::iterator& begin, const std::vector::iterator& end); static qreal peak_to_peak(const std::vector::iterator& begin, const std::vector::iterator& end); static qreal rms(const std::vector::iterator& begin, const std::vector::iterator& end); static qreal freq(const std::vector::iterator& begin, const std::vector::iterator& end, qreal f_sample); static qreal period(const std::vector::iterator& begin, const std::vector::iterator& end, qreal f_sample); static qreal kurt(const std::vector::iterator& begin, const std::vector::iterator& end); }; } // namespace math } // namespace gtl Q_DECLARE_METATYPE(gtl::math::osc_meas::params) typedef QList QListOscMeasParams; typedef QSharedPointer OscMeasParamsListPtr; Q_DECLARE_METATYPE(OscMeasParamsListPtr) #endif // GTL_MATH_OSC_MEAS_H