Skip to content

Commit

Permalink
Clarify display inhibit and tx inhibit
Browse files Browse the repository at this point in the history
For the user:
Display inhibit column name changed from "Inhibit" to "Mask",
useful doc string was added, and enable choice changed from "Inhibit"
to "Yes".

For the developer:
Variable "inhibit" changed to "disp_inhibit".  Similar changes to
related variables.

Variable "inhibit_tx" changed to "tx_inhibit" to be consistent with
"disp_inhibit" and "compander_inhibit".

Comment about using 0 MHz as an unused memory changed to reflect these
changes.
  • Loading branch information
N7XSD committed Feb 3, 2025
1 parent 270b3d8 commit 0bf9d74
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions chirp/drivers/icf520.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,9 @@
} dtmf_autodial[10];
struct {
char name[10];
u32 inhibit:1,
u32 disp_inhibit:1,
freq_rx:31;
u32 inhibit_tx:1,
u32 tx_inhibit:1,
freq_tx:31;
u16 rx_tone_off:1,
rx_tone_digital:1,
Expand Down Expand Up @@ -305,11 +305,11 @@

APPEAR_CHOICE = ["Appear", "Inhibit"]
ENABLE_CHOICE = ["Disable", "Enable"]
INH_CHOICE = ["", "Inhibit"]
INVERSE_CHOICE = ["Normal", "Inverse"]
NO_YES_CHOICE = ["No", "Yes"]
ON_CHOICE = ["", "On"] # ["OFF", "ON"]
ON_OFF_CHOICE = ["Off", "On"]
YES_CHOICE = ["", "Yes"]

MODES = ["FM", "NFM"] # Supported emission (or receive) modes

Expand Down Expand Up @@ -739,7 +739,7 @@ def get_memory(self, number):
# Frequency: Low level format is frequency in Hz
memory.freq = int(_mem.freq_rx)

if _mem.inhibit_tx:
if _mem.tx_inhibit:
memory.duplex = "off"
memory.offset = 0
elif int(_mem.freq_rx) == int(_mem.freq_tx):
Expand Down Expand Up @@ -795,13 +795,17 @@ def get_memory(self, number):

memory.extra = RadioSettingGroup('extra', 'Extra')

# Inhibit (Don't display channel on radio)
_inhibit = RadioSetting(
"inhibit", "Inhibit",
# Mask (Don't display) channel on radio.
# This is refered as Inhibit in the CS-F500 software.
_disp_inhibit = RadioSetting(
"disp_inhibit", "Mask",
RadioSettingValueList(
INH_CHOICE, current_index=int(_mem.inhibit)))
_inhibit.set_doc("Inhibit")
memory.extra.append(_inhibit)
YES_CHOICE, current_index=int(_mem.disp_inhibit)))
_disp_inhibit.set_doc(
"Prevent the radio from displaying the channel. This "
"prevents use of the channel but CHIRP will still download "
"the channel information.")
memory.extra.append(_disp_inhibit)

_compander_on = RadioSetting(
"compander_on", "Compander",
Expand Down Expand Up @@ -852,11 +856,12 @@ def get_memory(self, number):
# Any memory with a frequency of 0 MHz is treated as empty.
#
# When CS-F500 inserts a blank memory, it sets Tx and Rx frequency
# to 0 MHz and leaves the inhibit bit unset. When the inhibit
# bit is set, the memory is displayed in CS-F500 with an "i" in
# the inhibit column.
# to 0 MHz and leaves the disp_inhibit bit unset. When the
# disp_inhibit bit is set, the memory is displayed in CS-F500
# with an "i" in the inhibit column.
#
# The radio does not display inhibited memory channels.
# The radio does not display inhibited (masked) memory
# channels.
if memory.freq == 0:
memory.empty = True

Expand All @@ -874,10 +879,10 @@ def set_memory(self, memory):

# Frequency: Low level format is frequency in Hz
_mem.freq_rx = memory.freq
_mem.inhibit_tx = 0
_mem.tx_inhibit = 0
if memory.duplex == "off":
_mem.freq_tx = memory.freq
_mem.inhibit_tx = 1
_mem.tx_inhibit = 1
elif memory.duplex == "split":
_mem.freq_tx = memory.offset
elif memory.duplex == "-":
Expand Down Expand Up @@ -933,7 +938,7 @@ def set_memory(self, memory):
else:
_mem.power_rf = 1

_mem.inhibit = 0
_mem.disp_inhibit = 0
_mem.compander_on = 0
_mem.tot_on = 0
_mem.auto_reset = 0
Expand All @@ -943,7 +948,7 @@ def set_memory(self, memory):
_mem.log_out = 0

if memory.extra:
_mem.inhibit = memory.extra['inhibit'].value
_mem.disp_inhibit = memory.extra['disp_inhibit'].value
_mem.compander_on = memory.extra['compander_on'].value
_mem.tot_on = memory.extra['tot_on'].value
_mem.auto_reset = memory.extra['auto_reset_timer'].value
Expand Down

0 comments on commit 0bf9d74

Please sign in to comment.