Skip to content

Commit

Permalink
Temperature threshold updates
Browse files Browse the repository at this point in the history
Sync temperature stuff with the new expected values - the old ones were too damn high. Also adds "°C" to clarify the (estimated) units of measurement.
Since the values are planned to be configurable in a later update and should be pulled from settingsTable when they are, these temperature values are just the current defaults.
  • Loading branch information
SeongGino authored Jun 30, 2024
1 parent 97bc278 commit a6c1a26
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 5 additions & 5 deletions guiwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2060,12 +2060,12 @@ void guiWindow::serialPort_readyRead()
testLabel[button-1]->setText(valuesNameList[button]);
} else if(idleBuffer.contains("Temperature:")) {
uint8_t temp = idleBuffer.trimmed().right(2).toInt();
if(temp > 70) {
testLabel[14]->setText(QString("<font color=#FF0000>Temp: %1</font>").arg(temp));
} else if(temp > 60) {
testLabel[14]->setText(QString("<font color=#EABD2B>Temp: %1</font>").arg(temp));
if(temp > tempShutoff) {
testLabel[14]->setText(QString("<font color=#FF0000>Temp: %1°C</font>").arg(temp));
} else if(temp > tempWarning) {
testLabel[14]->setText(QString("<font color=#EABD2B>Temp: %1°C</font>").arg(temp));
} else {
testLabel[14]->setText(QString("<font color=#11D00A>Temp: %1</font>").arg(temp));
testLabel[14]->setText(QString("<font color=#11D00A>Temp: %1°C</font>").arg(temp));
}
} else if(idleBuffer.contains("Analog:")) {
uint8_t analogDir = idleBuffer.trimmed().right(1).toInt();
Expand Down
4 changes: 4 additions & 0 deletions guiwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ private slots:
// Table of tunables, as loaded from gun firmware
uint32_t settingsTable_orig[settingsTypesCount];

// TODO: add this to settingsTable (5.1?)
uint8_t tempWarning = 35;
uint8_t tempShutoff = 42;

// because pinBoxes' "->currentIndex" gets updated AFTER calling its activation signal,
// we need to save its last index to properly compare and prevent duplicate changes,
// and then update it at the end of the activate signal.
Expand Down

0 comments on commit a6c1a26

Please sign in to comment.