forked from epasveer/seer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSeerArrayWidget.h
106 lines (86 loc) · 4.25 KB
/
SeerArrayWidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#pragma once
#include <QtWidgets/QTableWidget>
#include <QtCore/QByteArray>
#include <QtCore/QVector>
class SeerArrayWidget: public QTableWidget {
Q_OBJECT
public:
class DataStorage {
public:
virtual ~DataStorage() {};
virtual QByteArray getData(int position, int length) = 0;
virtual int size() = 0;
};
class DataStorageArray: public DataStorage {
public:
DataStorageArray(const QByteArray& arr);
virtual QByteArray getData(int position, int length);
virtual int size();
private:
QByteArray _data;
};
enum ArrayMode {
UnknownArrayMode = 0,
Int16ArrayMode = 1,
UInt16ArrayMode = 2,
Int32ArrayMode = 3,
UInt32ArrayMode = 4,
Int64ArrayMode = 5,
UInt64ArrayMode = 6,
Float32ArrayMode = 7,
Float64ArrayMode = 8
};
SeerArrayWidget(QWidget* parent = 0);
~SeerArrayWidget();
int elementsPerLine () const;
const QString& aAxis () const;
void setAAxis (const QString& axis);
const QString& aLabel () const;
void setAAddressOffset (unsigned long offset);
unsigned long aAddressOffset () const;
void setAAddressStride (unsigned long stride);
unsigned long aAddressStride () const;
unsigned long aSize () const;
unsigned long aElementSize () const;
void setAArrayMode (SeerArrayWidget::ArrayMode arrayMode);
SeerArrayWidget::ArrayMode aArrayMode () const;
QString aArrayModeString () const;
const QVector<double>& aArrayValues () const;
const QString& bAxis () const;
void setBAxis (const QString& axis);
const QString& bLabel () const;
void setBAddressOffset (unsigned long offset);
unsigned long bAddressOffset () const;
void setBAddressStride (unsigned long stride);
unsigned long bAddressStride () const;
unsigned long bSize () const;
unsigned long bElementSize () const;
void setBArrayMode (SeerArrayWidget::ArrayMode arrayMode);
SeerArrayWidget::ArrayMode bArrayMode () const;
QString bArrayModeString () const;
const QVector<double>& bArrayValues () const;
signals:
void dataChanged ();
public slots:
void setAData (const QString& label, DataStorage* pData);
void setBData (const QString& label, DataStorage* pData);
protected:
private:
void create ();
QString _aAxis;
QString _aLabel;
int _aColumnId;
DataStorage* _aData;
unsigned long _aAddressOffset;
unsigned long _aAddressStride;
SeerArrayWidget::ArrayMode _aArrayMode;
QVector<double> _aArrayValues;
QString _bAxis;
QString _bLabel;
int _bColumnId;
DataStorage* _bData;
unsigned long _bAddressOffset;
unsigned long _bAddressStride;
SeerArrayWidget::ArrayMode _bArrayMode;
QVector<double> _bArrayValues;
};