-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathwaterfallviewerwindow.cpp
More file actions
153 lines (128 loc) · 4.49 KB
/
waterfallviewerwindow.cpp
File metadata and controls
153 lines (128 loc) · 4.49 KB
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#include "waterfallviewerwindow.h"
#include "ui_waterfallviewerwindow.h"
waterfallViewerWindow::waterfallViewerWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::waterfallViewerWindow)
{
ui->setupUi(this);
wf = ui->waterfallWidget;
connect(ui->wflengthSlider, SIGNAL(valueChanged(int)), wf, SLOT(changeWFLength(int)));
connect(wf, &waterfall::statusMessageOut, [=](const QString message) {
emit statusMessageOutSig(message);
});
wf->setSecondaryWF(true);
// Boarder goes around the handle square.
// By setting a background, you fill in the square.
// The square seems to always span the width of the widget
// handle::vertical is only be for the vertical slider orientation.
// groove:vertical, set width for wider handle basically.
sliderStylesheet = QString("\
.QSlider::handle:vertical {\
background: #22B14C;\
border: 5px solid #B5E61D;\
width: 1px;\
height: 10px;\
}\
.QSlider::groove:vertical {\
border: 1px solid #262626;\
width: 50px;\
background: #393939;\
margin: 0 1px;\
}\
");
ui->wflengthSlider->setStyleSheet(sliderStylesheet);
}
waterfallViewerWindow::~waterfallViewerWindow()
{
delete ui;
}
void waterfallViewerWindow::setup(frameWorker *fw, int vSize, int hSize, startupOptionsType options) {
wf->setup(fw, vSize, hSize, true, options);
wf->changeWFLength(ui->wflengthSlider->value());
}
void waterfallViewerWindow::setSecondaryWF(bool isSecondary) {
wf->setSecondaryWF(isSecondary);
}
void waterfallViewerWindow::setSpecImage(QImage *specImage) {
wf->setSpecImage(specImage);
}
void waterfallViewerWindow::setSpecImageBuffer(specImageBuff_t *buff) {
wf->setSpecImageBuffer(buff);
}
void waterfallViewerWindow::changeRGB(int r, int g, int b) {
// Row numbers
//wf->changeRGB(r,g,b);
}
void waterfallViewerWindow::setRGBLevels(double r, double g, double b, double gamma, bool reprocess) {
//wf->setRGBLevels(r,g,b,gamma,reprocess);
}
void waterfallViewerWindow::setRGBLevelsAndReprocess(double r, double g, double b, double gamma) {
//wf->setRGBLevelsAndReprocess(r,g,b,gamma);
}
void waterfallViewerWindow::changeWFLength(int length) {
// We might disable this for independent control
//if(!independentLengthControl)
ui->wflengthSlider->blockSignals(true);
ui->wflengthSlider->setValue(length);
ui->wflengthSlider->blockSignals(false);
wf->changeWFLength(length);
}
void waterfallViewerWindow::resetFPS(int targetFPS) {
wf->resetFPS(targetFPS);
}
void waterfallViewerWindow::setSpecOpacity(unsigned char opacity) {
//wf->setSpecOpacity(opacity);
}
void waterfallViewerWindow::updateCeiling(int c) {
//wf->updateCeiling(c);
}
void waterfallViewerWindow::updateFloor(int f) {
//wf->updateFloor(f);
}
void waterfallViewerWindow::setUseDSF(bool useDSF) {
//wf->setUseDSF(useDSF);
}
void waterfallViewerWindow::setRecordWFImage(bool recordImageOn) {
//wf->setRecordWFImage(recordImageOn);
}
void waterfallViewerWindow::debugThis() {
wf->debugThis();
}
void waterfallViewerWindow::useEntireScreen() {
ui->showWindowBoarderBtn->setChecked(false);
on_showWindowBoarderBtn_clicked(false);
this->showMaximized();
ui->maximizeBtn->setText("N");
}
void waterfallViewerWindow::on_closeBtn_clicked()
{
setWindowFlags((Qt::WindowType)(Qt::Window & ~Qt::FramelessWindowHint));
ui->showWindowBoarderBtn->blockSignals(true);
ui->showWindowBoarderBtn->setChecked(true);
ui->showWindowBoarderBtn->blockSignals(false);
this->close();
}
void waterfallViewerWindow::on_showWindowBoarderBtn_clicked(bool checked)
{
if(checked) {
hide();
setWindowFlags((Qt::WindowType)(Qt::Window & ~Qt::FramelessWindowHint));
show();
} else {
hide();
setWindowFlags(Qt::Window
| Qt::FramelessWindowHint);
show();
this->raise();
}
}
void waterfallViewerWindow::on_maximizeBtn_clicked()
{
if(this->isMaximized()) {
this->showNormal();
ui->maximizeBtn->setText("+");
} else {
this->showMaximized();
ui->maximizeBtn->setText("N");
}
}