diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index 2583d4b..91a23cf 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -28,16 +28,7 @@
timeChunkSize: number;
freqSampleRate: number;
freqChunkSize: number;
- }[] = [
- {
- timeSampleRate: 1000,
- timeChunkSize: 512,
- freqSampleRate: 1000,
- freqChunkSize: 512
- }
- // Add more objects as needed for multiple SensorGroup components
- // ...
- ];
+ }[] = [];
// Callback function used to connect to the websocket, retrieve data
// and update the time domain plot
@@ -56,16 +47,6 @@
let parsedData = null;
let datasets = [];
- // sensorGroup = [
- // ...sensorGroup,
- // {
- // timeSampleRate: 1000,
- // timeChunkSize: 512,
- // freqSampleRate: 1000,
- // freqChunkSize: 512
- // }
- // ];
-
// console.log(sensorGroup);
TimeWebSocket.addEventListener('message', async (event) => {
@@ -89,6 +70,19 @@
};
datasets.push(dataset);
}
+
+ console.log(parsedData['TimeChunk']['SourceIndentifier']);
+
+ sensorGroup = [
+ ...sensorGroup,
+ {
+ timeSampleRate: JSON.parse(event.data)['TimeChunk']['SampleRate'],
+ timeChunkSize: JSON.parse(event.data)['TimeChunk']['ChunkSize'],
+ sourceIdentifier: JSON.parse(event.data)['TimeChunk']['SourceIndentifier'],
+ freqSampleRate: 1000,
+ freqChunkSize: 512
+ }
+ ];
}
// const newData = JSON.parse(event.data)['TimeChunk']['Channels'];
// const numChannels = JSON.parse(event.data)['TimeChunk']['NumChannels'];