59 lines
1.6 KiB
C
59 lines
1.6 KiB
C
|
|
||
|
#ifndef GTL_MATH_SPEC_MEAS_H
|
||
|
#define GTL_MATH_SPEC_MEAS_H
|
||
|
|
||
|
#include <QObject>
|
||
|
#include <QSharedPointer>
|
||
|
#include <QList>
|
||
|
|
||
|
#include "core/gtl_analog_data.h"
|
||
|
#include "math_global.h"
|
||
|
|
||
|
namespace gtl {
|
||
|
namespace math {
|
||
|
|
||
|
class MATH_EXPORT spec_meas
|
||
|
{
|
||
|
Q_GADGET
|
||
|
public:
|
||
|
spec_meas();
|
||
|
|
||
|
enum class types
|
||
|
{
|
||
|
rms,
|
||
|
max,
|
||
|
freq_max
|
||
|
};
|
||
|
Q_ENUM(types)
|
||
|
|
||
|
struct params
|
||
|
{
|
||
|
int id;
|
||
|
QString chan;
|
||
|
spec_meas::types type;
|
||
|
qreal value;
|
||
|
gtl::analog_data* ad;
|
||
|
explicit params()
|
||
|
{
|
||
|
chan = "";
|
||
|
type = math::spec_meas::types::rms;
|
||
|
value = 0;
|
||
|
id = 0;
|
||
|
ad = nullptr;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
static qreal rms(const std::vector<qreal>::iterator& begin, const std::vector<qreal>::iterator& end);
|
||
|
static qreal max(const std::vector<qreal>::iterator& begin, const std::vector<qreal>::iterator& end);
|
||
|
static qreal freq_max(const std::vector<qreal>::iterator& begin, const std::vector<qreal>::iterator& end, const qreal resolution);
|
||
|
};
|
||
|
} // namespace math
|
||
|
} // namespace gtl
|
||
|
|
||
|
Q_DECLARE_METATYPE(gtl::math::spec_meas::params)
|
||
|
typedef QList<gtl::math::spec_meas::params> QListSpecMeasParams;
|
||
|
typedef QSharedPointer<QListSpecMeasParams> SpecMeasParamsListPtr;
|
||
|
Q_DECLARE_METATYPE(SpecMeasParamsListPtr)
|
||
|
|
||
|
#endif // GTL_MATH_SPEC_MEAS_H
|