mirror of
https://gitlab1.ptb.de/waltem01/Matrix
synced 2024-11-12 16:03:50 +00:00
implement matrix instance for clock
This commit is contained in:
parent
be55d35f67
commit
205d96f399
@ -1,5 +1,12 @@
|
||||
<script lang="ts">
|
||||
import {
|
||||
PUBLIC_LED_CHAIN,
|
||||
PUBLIC_LED_HEIGHT,
|
||||
PUBLIC_LED_PARALLEL,
|
||||
PUBLIC_LED_WIDTH
|
||||
} from '$env/static/public';
|
||||
import { redirectAPI } from '$lib/client/httpRequests';
|
||||
import type { Matrix } from '$lib/client/matrix';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
// Data structure to keep track of clock
|
||||
@ -39,6 +46,7 @@
|
||||
|
||||
//.System variables
|
||||
let clockEnabled: boolean = false;
|
||||
let matrix: Matrix;
|
||||
const clock: Clock = {
|
||||
body: 48,
|
||||
hands: {
|
||||
@ -101,6 +109,10 @@
|
||||
|
||||
onMount(() => {
|
||||
setInterval(update, clock.speed * 1000);
|
||||
matrix = {
|
||||
width: +PUBLIC_LED_WIDTH * +PUBLIC_LED_CHAIN,
|
||||
height: +PUBLIC_LED_HEIGHT * +PUBLIC_LED_PARALLEL
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user