Last update: 12/28/2024
Attached are :
frontend/src/App.svelte
frontend/site_information.json
frontend/src/waterfall.js
frontend/src/audio.js
The mods to App.svelte includes interface mods and functions listed below. I have updated App.svelte to be more svelte-friendly on the Site Information section.
Created and added setBand(band,centerFrequency,newFrequency,newMode,span) - this function is triggered by a on:click from a button and it sets the band, sets the waterfall to center that band, sets the waterfall brightness and contrast and also moves the initial center frequency setting to a random frequency and mode inside that band.
band = the amateur band you wish to tune to.
centerFrequency = the center frequency of the band (needed to set the waterfall properly).
newFrequency = a random frequency in the band, but not center.
newMode = the mode you select.
span = the waterfall span that allows the client to see the entire band they have chosen.
updateBandButton() - Added this function to track frequency and update the appropriate band button.
handleFrequencyChange() - modded this function with a call to updateBandButton().
handlePassbandChange(passband) - modded this function with a call to updateBandButton().
Created and added fineTune() - this function is triggered by a on:click from a button and increments the current frequency up and down the band based on the value set by the button.
The addBookmark() function is modified to store all available settings except bandwidth.
The handleAutoAdjust(value) function is modified to return the waterfall setting back to its original setting in case Auto Adjust does not produce a liked setting.
Created and added the function handleWaterfallChange() for 'toggling' the waterfall on/off. With this change, I also added code to update the Waterfall and Spectrum buttons when they are on and off.
Created and added handleAudioBufferDelayMove(newAudioBufferDelay) - this function along with changes to the function audio.playAudio(pcmArray) allows the user to adjust the limits set in the dynamic audio buffer in audio.js - all code is commented. This helps clients with low data rates to not have so many drops.
Added button ID's and descriptions in the tutorial section to cover all added buttons / toggle switches.
frontend/site_information.json - this file contains the information displayed at the head of the page. You just need to edit it to your site information.
frontend/src/audio.js includes a change to the FM case : settings inside the updateFilters() function to improve the FM audio when using the PhantomSDR+ software on VHF.
frontend/src/waterfall.js includes changes in the this.bands[] array to adjust the green & purple sections on the waterfall that represent the particular band - this file is modified to adjust those settings to the USA FCC band plan. Added a MW section based on the USA AM BCB band plan.
You can see the site in action by going to http://websdr.lumpkinschools.com/
App.svelte - updated 12/28/2024
site_information.json
waterfall.js - updated 12/25/2024
audio.js - updated 12/28/2024
Happy New Year dear Phil!
Excellent new options, I have included all of them, and they are working just perfect. Only site.information is not used, because I didn't find a way to include links. But it is a very clever idea!
Some minor changes to your code, maybe you'll find them useful:
- Instead of:
function updateBandButton() {
if (frequency >= 135.7 && frequency <= 137.8) { currentBand = 2200; }
.........
else if (frequency >= 5330 && frequency <= 5407) { currentBand = 60; }
else if (frequency >= 7000 && frequency <= 7300) { currentBand = 40; }
else if (frequency >= 10100 && frequency <= 10150) { currentBand = 30; }
else if (frequency >= 14000 && frequency <= 14350) { currentBand = 20; }
..........
else { currentBand = 0; }
I've used:
function updateBandButton() {
if (frequency >= 0.0 && frequency <= 150) { currentBand = 2200; setStep(1000)}
.........
else if (frequency >= 3500 && frequency <= 3800) { currentBand = 80; setStep(1000)}
else if (frequency >= 5380031 && frequency <= 4000) { currentBand = 75; setStep(5000)}
else if (frequency >= 5330 && frequency <= 5407) { currentBand = 60; setStep(1000)}
else if (frequency >= 5900 && frequency <= 6200) { currentBand = 49; setStep(5000)}
else if (frequency >= 7000 && frequency <= 7200) { currentBand = 40; setStep(1000)}
else if (frequency >= 7200 && frequency <= 7450) { currentBand = 41; setStep(5000)}
else if (frequency >= 9400 && frequency <= 9900) { currentBand = 31; setStep(5000)}
else if (frequency >= 10100 && frequency <= 10150) { currentBand = 30; setStep(100)}
.......
else { currentBand = 0; setStep(1000)}
As you can easily understand, I've added step for every bandButton, so if you click on a band, the step will be included by our default one for every band.
- Time function code (line 1399), does not work. You can delete it and use if you like this code:
// Getting The Current Date & Time And Setting It
let currentDateTime = new Date();
onMount(() => {
const interval = setInterval(() => {
currentDateTime = new Date();
}, 1000);
return () => {
clearInterval(interval);
};
});
const formatter = new Intl.DateTimeFormat('default', {
weekday: 'short',
month: 'short',
day: 'numeric',
hour: 'numeric',
minute: '2-digit',
second: '2-digit',
hour12: false
});
$: date = formatter.format(currentDateTime);
- Very good idea with the Buffer. I've included the function, it seems all ok and working, but in your site it is more obvious that working. Don't know why so...
My newer adapted website is here: SV1BTL WebSDR (http://sv1btlham.no-ip.org:8900/)
and my App.svelte as an attachment.
Keep on your excellent work. Your help is precious.
Updated App.svelte (App (SV1BTL) 2nd of January 2025 with all modifications of NY4Q. Some of them are not activated but written in the file, and there are few minor modofications to his original file, to fix my needs.
Very good Emmanuel. I have made changes since the last post. I am placing comments in the App.svelte to show the breaks in the different sections and I have rewritten the Fine Tuning Selection and Band Selection areas to eliminate the redundant <button> code in the App.svelte. I will do the same with all the other <button> sections that need to be cleaned up.
It will be a few days before I can clean all that up and comment the code.
Quote from: Phil - NY4Q on Jan 01, 2025, 11:04 AMIt will be a few days before I can clean all that up and comment the code.
I have used the attachment with the date 12/28/2024. I don't know if it is the last one.
I have also added a player (audiomotion.js) to play recorded files. If you find it interesting, maybe worths to make it play real time and not only records (?!?!)
Quote from: Emmanuel SV1BTL on Jan 01, 2025, 11:48 AMI have used the attachment with the date 12/28/2024. I don't know if it is the last one.
I have also added a player (audiomotion.js) to play recorded files. If you find it interesting, maybe worths to make it play real time and not only records (?!?!)
No additions since then. I am just cleaning up older code with newer code. Slowly learning. I will post the changes when I finish for you to look over.