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