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 {
id: fpsPicker
width: parent.width - Theme.horizontalPageMargin * 2
placeholderText: "Enter FPS limit(1-60)"
validator: IntValidator { bottom: 1; top: 60 }
placeholderText: "Enter FPS limit(1-25)"
validator: IntValidator { bottom: 1; top: 25 }
onTextChanged: {
if (fpsPicker.acceptableInput) {
polling_timer.timeout = (1000/parseInt(text, 10))
@ -42,7 +42,8 @@ Page {
SectionHeader { text: "Display" }
Label {
text: "Min-Max Value"
id: lbl
text: "Smoothing factor: 0%"
anchors.left: parent.left
anchors.leftMargin: Theme.horizontalPageMargin
}
@ -50,11 +51,12 @@ Page {
id: rangeSlider
width: parent.width - Theme.horizontalPageMargin * 2
stepSize: 1
value: 50
minimumValue: 0
maximumValue: 100
value: 98
minimumValue: 50
maximumValue: 99
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;
std::sort(sortedData.begin(), sortedData.end());
const float lowerPercentile = 0.2f;
const float upperPercentile = 0.98f;
const float lowerPercentile = lp/100.0f;
const float upperPercentile = hp/100.0f;
int lowerIndex = static_cast<int>(lowerPercentile * sortedData.size());
int upperIndex = static_cast<int>(upperPercentile * sortedData.size());

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

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

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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>
<data>
<variable>EnvironmentId</variable>

Loading…
Cancel
Save