From 333939df875d16be671d8378f846d7ff3666b336 Mon Sep 17 00:00:00 2001 From: Karlsson Winkels Date: Tue, 23 Jul 2024 21:40:46 +0200 Subject: [PATCH] colors for temps and voltages --- src/lib/defs.ts | 2 +- src/routes/+page.svelte | 1 - src/routes/master-status-display.svelte | 41 ++++++++------ src/routes/slave-status-display.svelte | 71 ++++++++++++++++--------- 4 files changed, 72 insertions(+), 43 deletions(-) diff --git a/src/lib/defs.ts b/src/lib/defs.ts index 7af89ae..b37cefd 100644 --- a/src/lib/defs.ts +++ b/src/lib/defs.ts @@ -1,2 +1,2 @@ export const N_CELLS_PER_SLAVE = 15; -export const N_TEMP_SENSORS_PER_SLAVE = 44; \ No newline at end of file +export const N_TEMP_SENSORS_PER_SLAVE = 44; diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 9a07502..1488739 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -47,7 +47,6 @@ }); -

FaSTTUBe Charger

diff --git a/src/routes/master-status-display.svelte b/src/routes/master-status-display.svelte index 95c0fd8..09fbdf1 100644 --- a/src/routes/master-status-display.svelte +++ b/src/routes/master-status-display.svelte @@ -5,25 +5,34 @@
-{#if status} -

Master Status

-
-
State:
-
{status.state}
-
SDC Closed:
-
{status.sdcClosed}
-
SoC:
-
{status.soc}
-
Min. cell voltage:
-
{Math.round(status.minCellVolt*100)/100}
-
Max. cell temperature:
-
{Math.round(status.maxCellTemp*100)/100}
-
-{/if} + {#if status} +

Master Status

+
+
State: {status.state}
+
SDC Closed: {status.sdcClosed}
+
SoC: {status.soc}
+
Min. cell voltage: {Math.round(status.minCellVolt * 100) / 100}
+
Max. cell temperature: {Math.round(status.maxCellTemp * 100) / 100}
+
+ {/if}
diff --git a/src/routes/slave-status-display.svelte b/src/routes/slave-status-display.svelte index 44ef0c3..918d637 100644 --- a/src/routes/slave-status-display.svelte +++ b/src/routes/slave-status-display.svelte @@ -1,42 +1,40 @@ -
-

Slave #{id}

- -
-
Error
-
{status.error}
-
Min. cell voltage
-
{Math.round(status.minCellVolt*100)/100}
-
Max. cell voltage
-
{Math.round(status.maxCellVolt*100)/100}
-
Max. temperature
-
{Math.round(status.maxTemp*100)/100}
- - -
- +
+

Slave #{id}

+ +
+
Error:
{status.error}
+
Min. cell voltage:
{Math.round(status.minCellVolt*100)/100}V
+
Max. cell voltage:
{Math.round(status.maxCellVolt*100)/100}V
+
Max. temperature:
{Math.round(status.maxTemp*100)/100}°
+ + +
+ {#if logData} -
+
{#each logData.voltages as volt, i} {#if i < 15} -
V_{i}
-
{Math.round(volt*100)/100}
+
+
V{i}:
{Math.round(volt*100)/100}V
+
{/if} {/each} {#each logData.temperatures as temp, i} - {#if i > 33 && i < 43} -
T_{i}
-
{temp}
+ {#if i > 33 && i < 44} +
+
T{i}:
{temp}°
+
{/if} {/each}
@@ -48,5 +46,28 @@ display: flex; flex-direction: column; width: 12vw; + padding: 2px; + margin: 2px; + border: 2px solid black; + font-size: 14px; + margin-top: 10px; + background-color: hsl(0, 60%, --lightness); + } + + .log-entry { + display: grid; + grid-template-columns: 5fr 3fr; + margin: 2px; + padding: 2px; + background-color: hsl(var(--hue), 80%, 80%); + } + + .log-collumn { + display: flex; + flex-direction: column; + } + + h2 { + text-align: center; } \ No newline at end of file