diff --git a/NERODevelopment/CMakeLists.txt b/NERODevelopment/CMakeLists.txt index f8581ac..6fe9b99 100644 --- a/NERODevelopment/CMakeLists.txt +++ b/NERODevelopment/CMakeLists.txt @@ -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 diff --git a/NERODevelopment/content/Thermometer.qml b/NERODevelopment/content/Thermometer.qml index 07af6ec..2522578 100644 --- a/NERODevelopment/content/Thermometer.qml +++ b/NERODevelopment/content/Thermometer.qml @@ -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")