From 6aa8afd70131f5a85843122ee23ce72a992e2f08 Mon Sep 17 00:00:00 2001
From: 00asdf
Date: Tue, 22 Apr 2025 19:00:26 +0200
Subject: [PATCH] pid value interface on web page
---
.idea/libraries/json.xml | 10 +++
VFHeatControl.iml | 1 +
.../asdf00/visionfive/hc/GlobalDataStore.kt | 5 ++
.../dev/asdf00/visionfive/hc/server/Main.kt | 70 ++++++++++++++++++-
4 files changed, 83 insertions(+), 3 deletions(-)
create mode 100644 .idea/libraries/json.xml
diff --git a/.idea/libraries/json.xml b/.idea/libraries/json.xml
new file mode 100644
index 0000000..0ae7dc6
--- /dev/null
+++ b/.idea/libraries/json.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/VFHeatControl.iml b/VFHeatControl.iml
index 4eba30b..a38f787 100644
--- a/VFHeatControl.iml
+++ b/VFHeatControl.iml
@@ -11,5 +11,6 @@
+
\ No newline at end of file
diff --git a/src/main/kotlin/dev/asdf00/visionfive/hc/GlobalDataStore.kt b/src/main/kotlin/dev/asdf00/visionfive/hc/GlobalDataStore.kt
index 3eed029..72cbb6b 100644
--- a/src/main/kotlin/dev/asdf00/visionfive/hc/GlobalDataStore.kt
+++ b/src/main/kotlin/dev/asdf00/visionfive/hc/GlobalDataStore.kt
@@ -6,5 +6,10 @@ import java.util.concurrent.CopyOnWriteArraySet
object GlobalDataStore {
@Volatile var temperature = 0.0
@Volatile var tempUpdated = Date()
+ @Volatile var isSunny = true
val allowedTempUpdates = CopyOnWriteArraySet()
+
+ @Volatile var pval = 0.0
+ @Volatile var ival = 1.0
+ @Volatile var dval = 2.0
}
\ No newline at end of file
diff --git a/src/main/kotlin/dev/asdf00/visionfive/hc/server/Main.kt b/src/main/kotlin/dev/asdf00/visionfive/hc/server/Main.kt
index 42e916d..f545a33 100644
--- a/src/main/kotlin/dev/asdf00/visionfive/hc/server/Main.kt
+++ b/src/main/kotlin/dev/asdf00/visionfive/hc/server/Main.kt
@@ -5,6 +5,8 @@ import dev.asdf00.visionfive.hc.GlobalDataStore
import java.nio.charset.StandardCharsets
import java.util.*
+import org.json.JSONObject
+
fun main() {
val server = buildWebServer(8030) {
// data collection
@@ -43,10 +45,39 @@ fun main() {
Welcome to HeatControl
You are logged in as ${uname}. To log out, click here.
-
- The current recorded temperature is currently ${String.format("%.1f",GlobalDataStore.temperature)} C
+ The current recorded temperature is currently ${String.format("%.1f", GlobalDataStore.temperature)} C
+ Last updated ${GlobalDataStore.tempUpdated}
+ Current forecast for today: ${if (GlobalDataStore.isSunny) "sunny" else "cloudy"}
+