Skip to content

Commit

Permalink
Improving UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanmahe committed Oct 7, 2024
1 parent 31817c1 commit edc1d17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/components/Canvas.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ const createCanvases = () => {
const newWglPlots: WebglPlot[] = [];
const newLines: WebglLine[] = [];



for (let i = 0; i < numChannels; i++) {
const canvas = document.createElement("canvas");

Expand Down Expand Up @@ -253,8 +255,8 @@ const createCanvases = () => {

return (
<div
style={{ marginBottom: `${marginBottom}px` }} // Apply the dynamic margin-bottom here
className="flex justify-center items-center h-[80vh] mb-5 mt-3">
// style={{ marginBottom: `${marginBottom}px` }} // Apply the dynamic margin-bottom here
className="flex justify-center items-center min-h-[calc(100vh-8rem)] mb-5 mt-3">
{/* Canvas container taking 70% of the screen height */}
<div className="flex flex-col justify-center items-start w-full px-3">
<div className="grid w-full h-full relative">
Expand Down
3 changes: 1 addition & 2 deletions src/components/Connection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ const Connection: React.FC<ConnectionProps> = ({
const writerRef = useRef<WritableStreamDefaultWriter<Uint8Array> | null>(
null
);
const buffer: number[] = []; // Buffer to store incoming data
const bufferdRef =useRef<number[][][]>([[], []]); // Two buffers: [0] and [1]

const togglePause = () => {
Expand Down Expand Up @@ -308,7 +307,7 @@ const Connection: React.FC<ConnectionProps> = ({

// Function to read data from a connected device and process it
const readData = async (): Promise<void> => {

const buffer: number[] = []; // Buffer to store incoming data
const HEADER_LENGTH = 3; // Length of the packet header
const NUM_CHANNELS = 6; // Number of channels in the data packet
const PACKET_LENGTH = 16; // Total length of each packet
Expand Down

0 comments on commit edc1d17

Please sign in to comment.