PhantomSDR Support Forum

General Category => General Discussion => Topic started by: Phil - NY4Q on Dec 04, 2024, 06:32 PM

Title: Step Tuning Buttons
Post by: Phil - NY4Q on Dec 04, 2024, 06:32 PM
Button Example

<button class="retro-button text-white font-bold h-10 text-base rounded-md flex items-center justify-center border border-gray-600 shadow-inner transition-all duration-200 ease-in-out bg-gray-700 hover:bg-gray-600" on:click={() => fineTune(10000)} title="+10 kHz">+10 kHz</button>

Fine Tune Function

// Fine Tuning Section

 let fineTuneAmount = 0;
 function fineTune(fineTuneAmount) {
  if(fineTuneAmount == 0) { frequency = Math.round(frequency)}
  frequencyInputComponent.setFrequency((frequency * 1e3)+ fineTuneAmount);
  handleFrequencyChange({ detail: ((frequency * 1e3) + fineTuneAmount) });
}
Title: Re: Step Tuning Buttons
Post by: Emmanuel SV1BTL on Dec 04, 2024, 09:56 PM
It is working and it is very useful when working with mobile phone.
Thank you once more!


// Fine Tuning Section

let fineTuneAmount = 0;
function fineTune(fineTuneAmount) {
  if(fineTuneAmount == 0) { frequency = Math.round(frequency)}
  frequencyInputComponent.setFrequency((frequency * 1e3)+ fineTuneAmount);
  handleFrequencyChange({ detail: ((frequency * 1e3) + fineTuneAmount) });
}

...............

<!--Tuning Buttons-->
<div class="grid grid-cols-2 sm:grid-cols-6 gap-2">
<button class="retro-button text-white font-bold h-8 text-base rounded-md flex items-center justify-center border border-gray-600 shadow-inner transition-all duration-200 ease-in-out bg-gray-700 hover:bg-gray-600" on:click={() => fineTune(-5000)} title="-5 KHz"> -5 KHz </button>
                   
<button class="retro-button text-white font-bold h-8 text-base rounded-md flex items-center justify-center border border-gray-600 shadow-inner transition-all duration-200 ease-in-out bg-gray-700 hover:bg-gray-600" on:click={() => fineTune(-1000)} title="-1 kHz"> -1 KHz </button>
                     
<button class="retro-button text-white font-bold h-8 text-base rounded-md flex items-center justify-center border border-gray-600 shadow-inner transition-all duration-200 ease-in-out bg-gray-700 hover:bg-gray-600" on:click={() => fineTune(-10)} title="-10 Hz"> -10 Hz </button>

<button class="retro-button text-white font-bold h-8 text-base rounded-md flex items-center justify-center border border-gray-600 shadow-inner transition-all duration-200 ease-in-out bg-gray-700 hover:bg-gray-600" on:click={() => fineTune(0)} title="center"> .00 Hz </button>
                                       
<button class="retro-button text-white font-bold h-8 text-base rounded-md flex items-center justify-center border border-gray-600 shadow-inner transition-all duration-200 ease-in-out bg-gray-700 hover:bg-gray-600" on:click={() => fineTune(10)} title="+10 Hz"> +10 Hz </button>

<button class="retro-button text-white font-bold h-8 text-base rounded-md flex items-center justify-center border border-gray-600 shadow-inner transition-all duration-200 ease-in-out bg-gray-700 hover:bg-gray-600" on:click={() => fineTune(1000)} title="+1 kHz"> +1 KHz </button>
                     
<button class="retro-button text-white font-bold h-8 text-base rounded-md flex items-center justify-center border border-gray-600 shadow-inner transition-all duration-200 ease-in-out bg-gray-700 hover:bg-gray-600" on:click={() => fineTune(5000)} title="+5 kHz"> +5 KHz </button>
</div>
Title: Re: Step Tuning Buttons
Post by: hb3xdc on Dec 07, 2024, 12:17 AM
Thank you very much Phil, now implemented the buttons also on mine
Title: Re: Step Tuning Buttons
Post by: hb3xdc on Dec 07, 2024, 01:24 PM
Does anyone of you guys have an idea how we could make the Tuning Steps also take affect for scrolling in the frequency part of the waterfall?
Did not figured out, how this one is working
Title: Re: Step Tuning Buttons
Post by: Phil - NY4Q on Dec 07, 2024, 08:28 PM
Quote from: hb3xdc on Dec 07, 2024, 01:24 PMDoes anyone of you guys have an idea how we could make the Tuning Steps also take affect for scrolling in the frequency part of the waterfall?
Did not figured out, how this one is working

If you notice, the steps are not linear for each event when the mouse is in that area. Also, based on the Mode, the steps are different.

In my region of the US there is an old saying : "Is the juice worth the squeeze?" ha
Title: Re: Step Tuning Buttons
Post by: ke6upi on Jan 02, 2025, 04:57 PM
Hello,

New guy here. What file do you need to add Phil's code to?

Thanks, David
KE6UPI
Title: Re: Step Tuning Buttons
Post by: Bas ON5HB on Jan 02, 2025, 05:01 PM
You missed this.....just started today.

The entire stuff...

https://github.com/ny4qphil

See readme of the frontend directory....it will explain how to compile it, after you altered all the stuff to your likings.
Title: Re: Step Tuning Buttons
Post by: ke6upi on Jan 03, 2025, 06:20 PM
Thanks Bas,

I need some copy and paste. When I ran npm run build. I got an error. I also did an update with Phils lastest github.

root@websdr0:/opt/ny4q/PhantomSDR-Plus/frontend/src# npm run build

> my-svelte-app@0.0.0 build
> vite build

file:///opt/ny4q/PhantomSDR-Plus/frontend/node_modules/vite/bin/vite.js:7
    await import('source-map-support').then((r) => r.default.install())
    ^^^^^

SyntaxError: Unexpected reserved word
    at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
    at async link (internal/modules/esm/module_job.js:42:21)
Title: Re: Step Tuning Buttons
Post by: Bas ON5HB on Jan 03, 2025, 06:31 PM
Have fun:

https://linuxize.com/post/how-to-install-node-js-on-ubuntu-20-04/#installing-nodejs-and-npm-using-nvm
After you installed npm properly it should compile just fine.

I updated the readme on the github, so everybody sees how it's done.