| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
#ifndef CURVE_H |
| 25 |
#define CURVE_H |
| 26 |
|
| 27 |
|
| 28 |
#include <QMutex> |
| 29 |
#include "types.h" |
| 30 |
|
| 31 |
enum Polarity { |
| 32 |
POLARITY_NOPOL, |
| 33 |
POLARITY_NEGPOL, |
| 34 |
POLARITY_POSPOL, |
| 35 |
POLARITY_BIPOL |
| 36 |
}; |
| 37 |
|
| 38 |
enum CurveType { |
| 39 |
CURVE_FTABLE=1, |
| 40 |
CURVE_AUDIOSIGNAL=2, |
| 41 |
CURVE_SPECTRUM=3 |
| 42 |
}; |
| 43 |
|
| 44 |
|
| 45 |
class Curve |
| 46 |
{ |
| 47 |
public: |
| 48 |
Curve(MYFLT *, size_t, const QString&, Polarity, |
| 49 |
MYFLT, MYFLT, MYFLT, MYFLT, bool, WINDAT *original); |
| 50 |
Curve(const Curve&); |
| 51 |
Curve &operator=(const Curve&); |
| 52 |
~Curve(); |
| 53 |
|
| 54 |
|
| 55 |
MYFLT get_data(int index); |
| 56 |
size_t get_size() const; |
| 57 |
QString get_caption() const; |
| 58 |
Polarity get_polarity() const; |
| 59 |
MYFLT get_max() const; |
| 60 |
MYFLT get_min() const; |
| 61 |
MYFLT get_absmax() const; |
| 62 |
MYFLT get_y_scale() const; |
| 63 |
CurveType get_type() const; |
| 64 |
WINDAT * getOriginal(); |
| 65 |
|
| 66 |
|
| 67 |
void set_data(MYFLT * data); |
| 68 |
void set_size(size_t size); |
| 69 |
void set_caption(QString caption); |
| 70 |
void set_polarity(Polarity polarity); |
| 71 |
void set_max(MYFLT max); |
| 72 |
void set_min(MYFLT min); |
| 73 |
void set_absmax(MYFLT absmax); |
| 74 |
void set_y_scale(MYFLT y_scale); |
| 75 |
void setOriginal(WINDAT *windat); |
| 76 |
|
| 77 |
bool is_divider_dotted() const; |
| 78 |
bool has_same_caption(Curve *) const; |
| 79 |
private: |
| 80 |
|
| 81 |
MYFLT *m_data; |
| 82 |
WINDAT *m_original; |
| 83 |
size_t m_size; |
| 84 |
QString m_caption; |
| 85 |
QString m_title; |
| 86 |
Polarity m_polarity; |
| 87 |
MYFLT m_max, m_min, m_absmax, m_y_scale; |
| 88 |
bool m_dotted_divider; |
| 89 |
void copy(size_t, MYFLT *); |
| 90 |
void destroy(); |
| 91 |
CurveType m_curveType; |
| 92 |
|
| 93 |
QMutex mutex; |
| 94 |
}; |
| 95 |
|
| 96 |
#endif |