-
Notifications
You must be signed in to change notification settings - Fork 10
/
doublespinboxcontainer.h
81 lines (64 loc) · 2.49 KB
/
doublespinboxcontainer.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
#ifndef DOUBLESPINBOXCONTAINER_H
#define DOUBLESPINBOXCONTAINER_H
#include <QDoubleSpinBox>
#include <QTreeWidgetItem>
#include "parametercontainer.h"
#include "imageacquisition.h"
#ifndef __APPLE__
# include "HalconCpp.h"
# include "Halcon.h"
# include "HFramegrabber.h"
#else
# ifndef HC_LARGE_IMAGES
# include <HALCONCpp/HalconCpp.h>
# else
# include <HALCONCppxl/HalconCpp.h>
# endif
#endif
#include "doubleslider.h"
class DoubleSpinboxContainer : public QDoubleSpinBox, public ParameterContainer
{
Q_OBJECT
public:
DoubleSpinboxContainer(double defaultParameterValue, std::string cameraParameterName, std::string uiDisplayName, double minVal, double maxVal, double step, double multiplierForSlider, ImageAcquisition* imageAcquisitionThread, QWidget *parent = nullptr);
void updateParamValue() override;
void displayParamValue() override;
void setValueInHardware(int) override;
void setValueInHardware(double) override;
void setValueInHardware(std::string) override;
void setValueInHardware(bool) override;
ImageAcquisition *getImageAcquisitionThread() const;
void setImageAcquisitionThread(ImageAcquisition *value);
QTreeWidgetItem *getQTreeWidgetItem() const;
void setQTreeWidgetItem(QTreeWidgetItem *value);
std::string getCameraParameterName() const;
void setCameraParameterName(const std::string &value);
std::string getUiDisplayName() const;
void setUiDisplayName(const std::string &value);
double getParamValue() const;
void setParamValue(double value);
QDoubleSpinBox *getUiElement() const;
void setUiElement(QDoubleSpinBox *value);
double getMinVal() const;
void setMinVal(double value);
double getMaxVal() const;
void setMaxVal(double value);
double getStep() const;
void setStep(double value);
DoubleSlider *getDoubleSlider() const;
void setDoubleSlider(DoubleSlider *value);
double getMultiplierForSlider() const;
void setMultiplierForSlider(double value);
private:
double paramValue;
std::string cameraParameterName, uiDisplayName;
ImageAcquisition *imageAcquisitionThread;
QDoubleSpinBox *uiElement;
QTreeWidgetItem *qTreeWidgetItem;
double maxVal, minVal, step;
QOverload<double> qOverloadDouble;
HalconCpp::HTuple val;
DoubleSlider *doubleSlider;
double multiplierForSlider; // This is required because QT does not support setting double values for sliders, so a multiplying factor is taken into account
};
#endif // DOUBLESPINBOXCONTAINER_H