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
25 changes: 24 additions & 1 deletion RocketControlUnitGUI/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { writable } from 'svelte/store';
import type { Writable } from 'svelte/store';
import PocketBase from 'pocketbase';
import BackgroundDark from './background-dark.svelte';
import BackgroundDark from './Background-Dark1.svelte';
import BackgroundLight from './background-light.svelte';
import { auth } from '../store';

Expand Down Expand Up @@ -176,6 +176,7 @@
});

const ac1_open = writable(undefined);
const ac2_open = writable(undefined);

const pbv1_open = writable(undefined);
const pbv2_open = writable(undefined);
Expand Down Expand Up @@ -230,6 +231,7 @@
const timer_remaining: Writable<number | undefined> = writable(undefined);

$: ac1_display = $ac1_open === undefined ? 'N/A' : $ac1_open ? 'ON' : 'OFF';
$: ac2_display = $ac2_open === undefined ? 'N/A' : $ac2_open ? 'ON' : 'OFF';

$: pbv1_display = $pbv1_open === undefined ? 'N/A' : $pbv1_open ? 'OPEN' : 'CLOSE';
$: pbv2_display = $pbv2_open === undefined ? 'N/A' : $pbv2_open ? 'OPEN' : 'CLOSE';
Expand Down Expand Up @@ -308,6 +310,7 @@
// Subscribe to changes in the 'RelayStatus' collection
PB.collection('RelayStatus').subscribe('*', function (e) {
ac1_open.set(e.record.ac1_open);
ac2_open.set(e.record.ac2_open)

pbv1_open.set(e.record.pbv1_open);
pbv2_open.set(e.record.pbv2_open);
Expand Down Expand Up @@ -649,6 +652,18 @@
>
</div>

<div class="ac2_slider relay_status {relayStatusOutdated ? 'outdated' : ''}">
<SlideToggle
name="ac2_slider"
active="bg-primary-500 dark:bg-primary-500"
size="sm"
bind:checked={$ac2_open}
on:click={(e) => handleSliderChange(e, 'NODE_RCU', 'RCU_OPEN_AC2', 'RCU_CLOSE_AC2')}
>
{ac2_display}</SlideToggle
>
</div>

<div class="pbv1_slider relay_status {relayStatusOutdated ? 'outdated' : ''}">
<SlideToggle
name="pbv1_slider"
Expand Down Expand Up @@ -1118,6 +1133,14 @@
transform: translate(-50%, -50%) scale(calc(var(--container-width-unitless) / 1900));
font-size: 16px;
}

.ac2_slider {
position: absolute;
top: calc(var(--container-width) * 0.43);
left: 27.2%;
transform: translate(-50%, -50%) scale(calc(var(--container-width-unitless) / 1900));
font-size: 16px;
}
.pbv1_slider {
position: absolute;
top: calc(var(--container-width) * 0.118);
Expand Down
Loading