Skip to content

Commit a5ac45d

Browse files
committed
FFT UI updated
1 parent 0db482f commit a5ac45d

File tree

3 files changed

+7
-69
lines changed

3 files changed

+7
-69
lines changed

src/components/BandPowerGraph.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ const Graph
217217
}, [animateGraph]);
218218

219219
return (
220-
<div ref={containerRef} className="w-full h-full max-w-[500px] min-h-0 min-w-0">
220+
<div ref={containerRef} className="w-full h-full max-w-[700px] min-h-0 min-w-0">
221221
<canvas ref={canvasRef} className="w-full h-full" />
222222
</div>
223223
);

src/components/Connection.tsx

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ const Connection: React.FC<ConnectionProps> = ({
763763
);
764764
}) || null;
765765
}
766-
766+
handleFrequencySelectionEXG(0, 3);
767767
let baudRate;
768768
let serialTimeout;
769769

@@ -1744,68 +1744,6 @@ const Connection: React.FC<ConnectionProps> = ({
17441744
<div className="flex items-center">
17451745
<div className="text-sm font-semibold w-12">{channelNames[0]}</div>
17461746
<div className="flex space-x-2">
1747-
<div className="flex border border-input rounded-xl items-center mx-0 px-0">
1748-
<Button
1749-
variant="outline"
1750-
size="sm"
1751-
onClick={() => removeEXGFilter(0)}
1752-
className={`rounded-xl rounded-r-none border-l-none border-0
1753-
${appliedEXGFiltersRef.current[0] === undefined
1754-
? "bg-red-700 hover:bg-white-500 hover:text-white text-white" // Disabled background
1755-
: "bg-white-500" // Active background
1756-
}`}
1757-
>
1758-
<CircleOff size={17} />
1759-
</Button>
1760-
<Button
1761-
variant="outline"
1762-
size="sm"
1763-
onClick={() => handleFrequencySelectionEXG(0, 4)}
1764-
className={`flex items-center justify-center px-3 py-2 rounded-none select-none border-0
1765-
${appliedEXGFiltersRef.current[0] === 4
1766-
? "bg-green-700 hover:bg-white-500 text-white hover:text-white" // Disabled background
1767-
: "bg-white-500" // Active background
1768-
}`}
1769-
>
1770-
<BicepsFlexed size={17} />
1771-
</Button>
1772-
<Button
1773-
variant="outline"
1774-
size="sm"
1775-
onClick={() => handleFrequencySelectionEXG(0, 3)}
1776-
className={`flex items-center justify-center px-3 py-2 rounded-none select-none border-0
1777-
${appliedEXGFiltersRef.current[0] === 3
1778-
? "bg-green-700 hover:bg-white-500 text-white hover:text-white" // Disabled background
1779-
: "bg-white-500" // Active background
1780-
}`}
1781-
>
1782-
<Brain size={17} />
1783-
</Button>
1784-
<Button
1785-
variant="outline"
1786-
size="sm"
1787-
onClick={() => handleFrequencySelectionEXG(0, 1)}
1788-
className={`flex items-center justify-center px-3 py-2 rounded-none select-none border-0
1789-
${appliedEXGFiltersRef.current[0] === 1
1790-
? "bg-green-700 hover:bg-white-500 text-white hover:text-white" // Disabled background
1791-
: "bg-white-500" // Active background
1792-
}`}
1793-
>
1794-
<Heart size={17} />
1795-
</Button>
1796-
<Button
1797-
variant="outline"
1798-
size="sm"
1799-
onClick={() => handleFrequencySelectionEXG(0, 2)}
1800-
className={`rounded-xl rounded-l-none border-0
1801-
${appliedEXGFiltersRef.current[0] === 2
1802-
? "bg-green-700 hover:bg-white-500 text-white hover:text-white" // Disabled background
1803-
: "bg-white-500" // Active background
1804-
}`}
1805-
>
1806-
<Eye size={17} />
1807-
</Button>
1808-
</div>
18091747
<div className="flex border border-input rounded-xl items-center mx-0 px-0">
18101748
<Button
18111749
variant="outline"

src/components/FFT.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,14 +335,14 @@ const FFT = forwardRef(
335335
</main>
336336

337337
{/* Responsive container for FFT (canvas) and BandPowerGraph */}
338-
<div className="flex-1 m-2 flex flex-col md:flex-row overflow-hidden min-h-0 gap-2">
339-
{/* FFT Canvas container */}
340-
<div ref={containerRef} className="flex-1 overflow-hidden min-h-0 min-w-0">
338+
<div className="flex-1 m-2 flex flex-col md:flex-row justify-center overflow-hidden min-h-0 gap-12">
339+
340+
{/* FFT Canvas container */}
341+
<div ref={containerRef} className="flex-1 overflow-hidden min-h-0 min-w-0 ml-12 ">
341342
<canvas ref={canvasRef} className="w-full h-full" />
342343
</div>
343-
344344
{/* BandPowerGraph container */}
345-
<div className="flex-1 overflow-hidden min-h-0 min-w-0">
345+
<div className="flex-1 overflow-hidden min-h-0 min-w-0 ml-4">
346346
<BandPowerGraph fftData={fftData} samplingRate={currentSamplingRate} />
347347
</div>
348348
</div>

0 commit comments

Comments
 (0)