Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions NERODevelopment/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,7 @@ set(PROJECT_SOURCES
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON)
# Create executable with all sources consolidated
qt_add_executable(NEROApp ${PROJECT_SOURCES}



)
qt_add_executable(NEROApp ${PROJECT_SOURCES})

# Add protobuf
qt_add_protobuf(NEROApp
Expand Down
17 changes: 15 additions & 2 deletions NERODevelopment/content/Thermometer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,21 @@ Rectangle {
property int value: 0
property int maxValue: 65
property int minValue: -15
property string fillColor: regen ? Theme.getColor("redThermoStatus") : value > maxValue - ((Math.abs(maxValue) + Math.abs(
minValue)) / 5) ? Theme.getColor("redThermoStatus") : value > maxValue - (((Math.abs(maxValue) + Math.abs(minValue)) / 5) * 2) ? Theme.getColor("orangeThermoStatus") : value > maxValue - (((Math.abs(maxValue) + Math.abs(minValue)) / 5) * 3) ? Theme.getColor("yellowThermoStatus") : value > maxValue - (((Math.abs(maxValue) + Math.abs(minValue)) / 5) * 4) ? Theme.getColor("blueThermoStatus") : Theme.getColor("purpleThermoStatus")

property real percentage: (value - minValue) / (maxValue - minValue) //Converting value to percentage range between minval -> maxval

property color fillColor: regen ? Qt.hsla(0, 1, 0.5, 1) :
Qt.hsla(
percentage > 0.875 ? 0.0 : //Red
percentage > 0.75 ? 0.08 + (0.0 - 0.08) * ((percentage - 0.75) / 0.125) : //Orange -> Red
percentage > 0.5 ? 0.16 + (0.08 - 0.16) * ((percentage - 0.5) / 0.25) : // Yellow -> Orange
percentage > 0.375 ? 0.33 + (0.16 - 0.33) * ((percentage - 0.375) / 0.125) : //Green -> Yellow
percentage > 0.25 ? 0.55 + (0.33 - 0.55) * ((percentage - 0.25) / 0.125) : //Cyan -> Green
percentage > 0.125 ? 0.67 + (0.55 - 0.67) * ((percentage - 0.125) / 0.125) : //Blue -> Cyan
0.83 + (0.67 - 0.83) * (percentage / 0.125), //Purple -> Blue
1, 0.5, 1 //Saturation, lightness, alpha
)

height: 500
width: height / 2.233
color: Theme.getColor("transparent")
Expand Down