Skip to content

Commit

Permalink
Fix wonky scrolling in CENTER mode with RIT enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyc committed Nov 18, 2023
1 parent 7c4e70e commit 79d7996
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/js/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ let Hooks = {
})

this.handleEvent("freq_delta", (event) => {
//console.log("freq_delta", event)
// console.log("freq_delta", event)
// interpolate delta event.bs.low ... event.bs.high to the scope size
this.draw = false

Expand Down
15 changes: 14 additions & 1 deletion lib/open890/radio_state.ex
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,16 @@ defmodule Open890.RadioState do
state = %{state | vfo_a_frequency: frequency}

previous_active_frequency = effective_active_frequency(state) || 0

# TC - possibly need to subtract the RIT offset if enabled?
delta = frequency - previous_active_frequency

delta = if state.rit_enabled do
delta + state.rit_xit_offset
else
delta
end

state =
if state.active_receiver == :a do
%{state | active_frequency: frequency, active_frequency_delta: delta}
Expand Down Expand Up @@ -458,7 +466,12 @@ defmodule Open890.RadioState do

previous_active_frequency = effective_active_frequency(state) || 0
delta = frequency - previous_active_frequency
# delta = (frequency + delta?) - previous_active_frequency

delta = if state.rit_enabled do
delta + state.rit_xit_offset
else
delta
end

state =
if state.active_receiver == :b do
Expand Down

0 comments on commit 79d7996

Please sign in to comment.