-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwidget.cpp
More file actions
109 lines (92 loc) · 2.59 KB
/
Copy pathwidget.cpp
File metadata and controls
109 lines (92 loc) · 2.59 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
#include "pmd.hpp"
#include "widget.hpp"
#include <mutex>
void Widget::setupSpinbox(QSpinBox *box, bool enabled, int value)
{
box->setValue(value);
box->setEnabled(enabled);
}
void Widget::updateConfig(PMDHandle _hnd)
{
hnd=_hnd;
PMD::configuration &config=PMD::config();
integ_time->setValue(config.integ_time[0]);
isAveraging->setChecked(config.averaging);
isThrottling->setChecked(config.throttling);
isBilat->setChecked(config.bilat_filter);
setupSpinbox(numAveraging,config.averaging,config.averaging_frames);
setupSpinbox(numThrott,config.throttling,config.throttle_frames);
setupSpinbox(numBilat,config.bilat_filter,config.bilat_filtersize);
}
Widget::Widget(QWidget *parent): QWidget(parent)
{
setupUi(this);
}
void Widget::on_integ_time_valueChanged(int value)
{
unsigned result;
if(PMD::isOK(hnd,pmdGetValidIntegrationTime(hnd,&result,0,CloseTo,value),"oops")){
PMD::configuration &conf=PMD::config();
if(conf.integ_time[0]!=result){
conf.integ_time[0]=result;
conf.changed=true;
}
}
integ_time->setValue(result);
}
void Widget::on_isAveraging_toggled(bool checked)
{
if(PMD::config().averaging!=checked){
PMD::config().averaging=checked;
PMD::config().changed=true;
}
}
void Widget::on_numAveraging_valueChanged(int arg1)
{
if(PMD::config().averaging_frames!=unsigned(arg1)){
PMD::config().averaging_frames=unsigned(arg1);
PMD::config().changed=true;
}
}
void Widget::on_isThrottling_toggled(bool checked)
{
if(PMD::config().throttling!=checked){
PMD::config().throttling=checked;
PMD::config().changed=true;
}
}
void Widget::on_numThrott_valueChanged(int arg1)
{
if(PMD::config().throttle_frames!=unsigned(arg1)){
PMD::config().throttle_frames=unsigned(arg1);
PMD::config().changed=true;
}
}
void Widget::on_isBilat_toggled(bool checked)
{
if(PMD::config().bilat_filter!=checked){
PMD::config().bilat_filter=checked;
PMD::config().changed=true;
}
}
void Widget::on_numBilat_valueChanged(int arg1)
{
if(PMD::config().bilat_filtersize!=unsigned(arg1)){
PMD::config().bilat_filtersize=unsigned(arg1);
PMD::config().changed=true;
}
}
void Widget::on_bottomCap_valueChanged(int arg1)
{
if(PMD::config().bottomCap!=unsigned(arg1)){
PMD::config().bottomCap=unsigned(arg1);
PMD::config().changed=true;
}
}
void Widget::on_topCap_valueChanged(int arg1)
{
if(PMD::config().topCap!=unsigned(arg1)){
PMD::config().topCap=unsigned(arg1);
PMD::config().changed=true;
}
}