options fully working

master
Yorick GEOFFRE 2 years ago
parent b75ef82d2e
commit c5f3a3e18d

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

@ -30,8 +30,8 @@ Page {
TextField { TextField {
id: fpsPicker id: fpsPicker
width: parent.width - Theme.horizontalPageMargin * 2 width: parent.width - Theme.horizontalPageMargin * 2
placeholderText: "Enter FPS limit(1-60)" placeholderText: "Enter FPS limit(1-25)"
validator: IntValidator { bottom: 1; top: 60 } validator: IntValidator { bottom: 1; top: 25 }
onTextChanged: { onTextChanged: {
if (fpsPicker.acceptableInput) { if (fpsPicker.acceptableInput) {
polling_timer.timeout = (1000/parseInt(text, 10)) polling_timer.timeout = (1000/parseInt(text, 10))
@ -42,7 +42,8 @@ Page {
SectionHeader { text: "Display" } SectionHeader { text: "Display" }
Label { Label {
text: "Min-Max Value" id: lbl
text: "Smoothing factor: 0%"
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: Theme.horizontalPageMargin anchors.leftMargin: Theme.horizontalPageMargin
} }
@ -50,11 +51,12 @@ Page {
id: rangeSlider id: rangeSlider
width: parent.width - Theme.horizontalPageMargin * 2 width: parent.width - Theme.horizontalPageMargin * 2
stepSize: 1 stepSize: 1
value: 50 value: 98
minimumValue: 0 minimumValue: 50
maximumValue: 100 maximumValue: 99
onValueChanged: { onValueChanged: {
// handle value change lbl.text = "Ignore factor: " + value.toString() + "%"
thermalRenderer.setIgnorePerc(value)
} }
} }

@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/">
<file>icons/logo.png</file>
</qresource>
</RCC>

@ -17,8 +17,8 @@ void ThermalDataRenderer::receiveNewData(QVector<float> data) {
QVector<float> sortedData = data; QVector<float> sortedData = data;
std::sort(sortedData.begin(), sortedData.end()); std::sort(sortedData.begin(), sortedData.end());
const float lowerPercentile = 0.2f; const float lowerPercentile = lp/100.0f;
const float upperPercentile = 0.98f; const float upperPercentile = hp/100.0f;
int lowerIndex = static_cast<int>(lowerPercentile * sortedData.size()); int lowerIndex = static_cast<int>(lowerPercentile * sortedData.size());
int upperIndex = static_cast<int>(upperPercentile * sortedData.size()); int upperIndex = static_cast<int>(upperPercentile * sortedData.size());

@ -23,6 +23,8 @@ class ThermalDataRenderer : public QObject
float minValue = 0.0f; float minValue = 0.0f;
float maxValue = 1.0f; float maxValue = 1.0f;
bool takeCapture = false; bool takeCapture = false;
unsigned int hp = 98;
unsigned int lp = 2;
public: public:
Q_PROPERTY(QVector<std::shared_ptr<ColorAttributer>> attributers READ getAttributers NOTIFY attributersChanged) Q_PROPERTY(QVector<std::shared_ptr<ColorAttributer>> attributers READ getAttributers NOTIFY attributersChanged)
Q_PROPERTY(QStringList attributerNames READ getAttributerNames NOTIFY attributerNamesChanged) Q_PROPERTY(QStringList attributerNames READ getAttributerNames NOTIFY attributerNamesChanged)
@ -35,6 +37,11 @@ public:
return names; return names;
} }
Q_INVOKABLE void setIgnorePerc(const int& i){
lp = i;
hp = 100-i;
}
QThread workerThread; QThread workerThread;
ThermalDataRenderer() : renderBuffer(768){} ThermalDataRenderer() : renderBuffer(768){}
Q_INVOKABLE QColor getDataForIndex(const int& index){ Q_INVOKABLE QColor getDataForIndex(const int& index){

@ -62,3 +62,6 @@ HEADERS += \
src/i2cdriversingleton.h \ src/i2cdriversingleton.h \
src/i2cif.h \ src/i2cif.h \
thermaldatarenderer.h thermaldatarenderer.h
RESOURCES += \
ressources.qrc

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.15.2, 2023-06-16T17:37:41. --> <!-- Written by QtCreator 4.15.2, 2023-06-21T11:48:49. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>

Loading…
Cancel
Save