Skip to content

Commit

Permalink
menu
Browse files Browse the repository at this point in the history
  • Loading branch information
patrykorwat committed Dec 22, 2024
1 parent 8d3f1fb commit 1115755
Show file tree
Hide file tree
Showing 9 changed files with 108 additions and 100 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ The application has two features:

Supported devices:
* tinySA Ultra
* RTL-SDR v4

Supported environments:
* Chrome
* Edge
* Opera

See more: [caniuse.com/web-serial](https://caniuse.com/web-serial)
See more: [caniuse.com/web-serial](https://caniuse.com/web-serial), [caniuse.com/webusb](https://caniuse.com/webusb)

## Spectrum analyzer
![spectrum ](spectrum.gif)
Expand All @@ -31,8 +32,8 @@ Data decode sets a trigger and upon detection of a signal, the device captures i
## References

YT videos with explanations and tests:
* [Web (r)evolution in lab electronics? Building a Web Spectrum Analyzer for TinySA Ultra](https://www.youtube.com/watch?v=XeK0TL0F8DI&t=7s&ab_channel=PatrickonEngineering)
* [Signal decoding with TinySA Ultra](https://www.youtube.com/watch?v=bqgmftWSKPc&t=9s&ab_channel=PatrickonEngineering)
* [Web (r)evolution in lab electronics? Building a Web Spectrum Analyzer for TinySA Ultra](https://www.youtube.com/watch?v=XeK0TL0F8DI)
* [Signal decoding with TinySA Ultra](https://www.youtube.com/watch?v=bqgmftWSKPc)

## Development

Expand Down
6 changes: 3 additions & 3 deletions docs/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"files": {
"main.css": "./static/css/main.f2783ece.css",
"main.js": "./static/js/main.1c52cafc.js",
"main.js": "./static/js/main.055c60dc.js",
"static/js/453.3991db68.chunk.js": "./static/js/453.3991db68.chunk.js",
"static/media/roboto-latin-700-normal.woff2": "./static/media/roboto-latin-700-normal.4535474e1cf8598695ad.woff2",
"static/media/roboto-latin-500-normal.woff2": "./static/media/roboto-latin-500-normal.7077203b1982951ecf76.woff2",
Expand Down Expand Up @@ -61,11 +61,11 @@
"static/media/roboto-greek-ext-400-normal.woff": "./static/media/roboto-greek-ext-400-normal.16eb83b4a3b1ea994243.woff",
"index.html": "./index.html",
"main.f2783ece.css.map": "./static/css/main.f2783ece.css.map",
"main.1c52cafc.js.map": "./static/js/main.1c52cafc.js.map",
"main.055c60dc.js.map": "./static/js/main.055c60dc.js.map",
"453.3991db68.chunk.js.map": "./static/js/453.3991db68.chunk.js.map"
},
"entrypoints": [
"static/css/main.f2783ece.css",
"static/js/main.1c52cafc.js"
"static/js/main.055c60dc.js"
]
}
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="./logo192.png"/><link rel="manifest" href="./manifest.json"/><title>Web Spectrum</title><script defer="defer" src="./static/js/main.1c52cafc.js"></script><link href="./static/css/main.f2783ece.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="./favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="./logo192.png"/><link rel="manifest" href="./manifest.json"/><title>Web Spectrum</title><script defer="defer" src="./static/js/main.055c60dc.js"></script><link href="./static/css/main.f2783ece.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
84 changes: 84 additions & 0 deletions docs/static/js/main.055c60dc.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
meshuga/web-spectrum
Copyright (C) 2024 Patryk Orwat
Copyright (C) 2024 Patryk Orwat

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
Expand Down
1 change: 1 addition & 0 deletions docs/static/js/main.055c60dc.js.map

Large diffs are not rendered by default.

84 changes: 0 additions & 84 deletions docs/static/js/main.1c52cafc.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/static/js/main.1c52cafc.js.map

This file was deleted.

21 changes: 14 additions & 7 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import ListItem from '@mui/material/ListItem';
import ListItemButton from '@mui/material/ListItemButton';
import ListItemIcon from '@mui/material/ListItemIcon';
import ListItemText from '@mui/material/ListItemText';
import Divider from '@mui/material/Divider';


import TroubleshootIcon from '@mui/icons-material/Troubleshoot';
import EqualizerIcon from '@mui/icons-material/Equalizer';
Expand Down Expand Up @@ -75,13 +77,15 @@ const StyledBreadcrumbs = styled(Breadcrumbs)(({ theme }) => ({
}));

const mainListItems = [
{ group: 'TinySA Ultra'},
{ text: 'Spectrum', icon: <EqualizerIcon /> },
{ text: 'Decode', icon: <TroubleshootIcon /> },
{ text: 'RTL-SDR Decode', icon: <TroubleshootIcon /> },
{ group: 'RTL-SDR'},
{ text: 'Decode', icon: <TroubleshootIcon /> },
];

function App() {
const [menuSelection, setMenuSelection] = useState(0);
const [menuSelection, setMenuSelection] = useState(1);

return (
<ThemeProvider theme={darkTheme}>
Expand All @@ -100,10 +104,12 @@ return (
<List dense>
{mainListItems.map((item, index) => (
<ListItem key={index} disablePadding sx={{ display: 'block' }}>
<ListItemButton selected={index === menuSelection} onClick={() => setMenuSelection(index)}>
<ListItemIcon>{item.icon}</ListItemIcon>
<ListItemText primary={item.text} />
</ListItemButton>
{item.group === undefined ?
<ListItemButton selected={index === menuSelection} onClick={() => setMenuSelection(index)}>
<ListItemIcon>{item.icon}</ListItemIcon>
<ListItemText primary={item.text} />
</ListItemButton>
: <><b>{item.group}</b><Divider /></>}
</ListItem>
))}
</List>
Expand Down Expand Up @@ -144,12 +150,13 @@ return (
separator={<NavigateNextRoundedIcon fontSize="small" />}
>
<Typography variant="body1">Web Spectrum</Typography>
<Typography variant="body1">{menuSelection < 3 ? 'TinySA Ultra' : 'RTL-SDR'}</Typography>
<Typography variant="body1" sx={{ color: 'text.primary', fontWeight: 600 }}>
{mainListItems[menuSelection].text}
</Typography>
</StyledBreadcrumbs>
</Stack>
{ menuSelection === 0 ? <Spectrum /> : (menuSelection === 1 ? <Decoder /> : <RtlDecoder />) }
{ menuSelection === 1 ? <Spectrum /> : (menuSelection === 2 ? <Decoder /> : <RtlDecoder />) }
</Stack>
</Box>
</Box>
Expand Down

0 comments on commit 1115755

Please sign in to comment.