-
Notifications
You must be signed in to change notification settings - Fork 0
/
receiverrect.h
64 lines (47 loc) · 1.27 KB
/
receiverrect.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
#ifndef RECEIVERRECT_H
#define RECEIVERRECT_H
#include <QGraphicsItem>
#include <QPen>
#include <QtWidgets>
#include <complex>
namespace RectState {
enum RectState {
Power,
SNR,
Rice,
DelaySpread
};
}
class ReceiverRect : public QGraphicsRectItem
{
public:
ReceiverRect(int x,int y, int w, int h, QGraphicsItem* parent=nullptr);
qreal power;
qreal SNR;
qreal rice;
qreal delayspread;
bool mouseOver=false;
QColor rectColor;
int debitBin;
void debit ();
void setPower(qreal power);
void setSNR(qreal SNR);
void colorRect();
float x;
float y;
static void changeState(RectState::RectState state);
static RectState::RectState rect_state;
static const int powMax=-40;
static const int powMin=-150;
static const int SNRMax=30;
static const int SNRMin=-100;
static const int riceMax=10;
static const int riceMin=-10;
static qreal dsMax;
static constexpr qreal dsMin=0;
static const int target_SNR=2;
protected:
// void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
// void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
};
#endif // RECEIVERRECT_H