🐨 Removes unused components
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { Card, CardHeader } from "../components/index";
|
||||
import { socket, isConnected } from "$lib/socket";
|
||||
import { throttler } from "$lib/throttle";
|
||||
|
||||
let throttle = new throttler();
|
||||
let throttle_timing = 25;
|
||||
let pwm = 300
|
||||
let servo = 0
|
||||
|
||||
let min = 0;
|
||||
let halfWay = 0;
|
||||
let max = 0;
|
||||
let overallRange = 0;
|
||||
|
||||
$: buffer = (overallRange - 180) / 2
|
||||
$: conversionRate = (max - min) / overallRange;
|
||||
$: zeroMark = (conversionRate * buffer) + min;
|
||||
$: oneEightyMark = (conversionRate * buffer) + halfWay;
|
||||
|
||||
$: pwm, throttle.throttle(() => $isConnected ? $socket.send(JSON.stringify({servo, pwm, action:0})) : console.log("Is not connected yet"), throttle_timing);
|
||||
|
||||
</script>
|
||||
|
||||
<div class="w-full h-full absolute top-0 p-4 flex justify-center items-center">
|
||||
<Card class="w-full h-1/2">
|
||||
<CardHeader>Servo calibration</CardHeader>
|
||||
<div>Servo</div>
|
||||
<input type="number" class="bg-background" bind:value={servo}>
|
||||
<div class="flex w-full">
|
||||
<label for="pwm">Pwm ({pwm})</label>
|
||||
<div class="flex w-full">
|
||||
<button class="p-2" on:click={() => pwm--}>-</button>
|
||||
<input class="flex-1" bind:value={pwm} type="range" id="pwm" min={0} max={700}>
|
||||
<button class="p-2" on:click={() => pwm++}>+</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 w-1/2">
|
||||
<div>Min pwm</div>
|
||||
<input type="number" class="bg-background" bind:value={min}>
|
||||
<div>Pwm at Halfway from min</div> <input type="number" class="bg-background" bind:value={halfWay}>
|
||||
<div>Max pwm</div> <input type="number" class="bg-background" bind:value={max}>
|
||||
<div>Overall angle</div> <input type="number" class="bg-background" bind:value={overallRange}>
|
||||
<div>Buffer</div><div>{buffer}</div>
|
||||
<div>Conversion rate</div><div>{conversionRate}</div>
|
||||
<div>pwm for 0° mark</div><div>{zeroMark}</div>
|
||||
<div>pwm for 180° Mark</div><div>{oneEightyMark}</div>
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
@@ -1,34 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { onDestroy, onMount } from 'svelte';
|
||||
import { dataBuffer, socket } from '../lib/socket';
|
||||
import { humanFileSize } from '../lib/utils';
|
||||
|
||||
let buf = new Uint8Array(2);
|
||||
buf[0] = 1;
|
||||
|
||||
onMount(() => {
|
||||
buf[1] = 1;
|
||||
$socket.send(buf);
|
||||
});
|
||||
|
||||
onDestroy(() => {
|
||||
buf[1] = 0;
|
||||
$socket.send(buf);
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="p-10 flex gap-4">
|
||||
<div class="bg-slate-600 rounded-md p-2 drop-shadow-lg">
|
||||
<b>Heap allocation:</b>
|
||||
<div class="flex gap-2"><span>Total free:</span>{humanFileSize($dataBuffer[8])}</div>
|
||||
<div class="flex gap-2"><span>Max free block:</span>{humanFileSize($dataBuffer[12])}</div>
|
||||
<div class="flex gap-2"><span>Min:</span>{humanFileSize($dataBuffer[10])}</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-slate-600 rounded-md p-2 drop-shadow-lg">
|
||||
<b>PSRam allocation:</b>
|
||||
<div class="flex gap-2"><span>Free</span>{humanFileSize($dataBuffer[9])}</div>
|
||||
<div class="flex gap-2"><span>Min:</span>{humanFileSize($dataBuffer[11])}</div>
|
||||
<div class="flex gap-2"><span>Max block:</span>{humanFileSize($dataBuffer[13])}</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user