Skip to content

Commit 7015d8d

Browse files
committed
Fix #6: Allow Duplex=off as a way to disable TX
1 parent ceb028d commit 7015d8d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

uvk5_egzumer.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ def get_features(self):
702702
rf.valid_name_length = 10
703703
rf.valid_power_levels = UVK5_POWER_LEVELS
704704
rf.valid_special_chans = self.Get_VFO_CHANNEL_NAMES()
705+
rf.valid_duplexes = ["", "-", "+", "off"]
705706

706707
steps = STEPS.copy()
707708
steps.sort()
@@ -752,6 +753,9 @@ def get_raw_memory(self, number):
752753
def validate_memory(self, mem):
753754
msgs = super().validate_memory(mem)
754755

756+
if mem.duplex == 'off':
757+
return msgs
758+
755759
# find tx frequency
756760
if mem.duplex == '-':
757761
txfreq = mem.freq - mem.offset
@@ -939,7 +943,12 @@ def get_memory(self, number2):
939943
mem.duplex = ''
940944
else:
941945
if _mem.offsetDir == FLAGS1_OFFSET_MINUS:
942-
mem.duplex = '-'
946+
if _mem.freq == _mem.offset:
947+
# fake tx disable by setting tx to 0 MHz
948+
mem.duplex = 'off'
949+
mem.offset = 0
950+
else:
951+
mem.duplex = '-'
943952
elif _mem.offsetDir == FLAGS1_OFFSET_PLUS:
944953
mem.duplex = '+'
945954
else:
@@ -2127,7 +2136,10 @@ def set_memory(self, mem):
21272136
_mem.offsetDir = FLAGS1_OFFSET_MINUS
21282137
elif mem.duplex == '+':
21292138
_mem.offsetDir = FLAGS1_OFFSET_PLUS
2130-
2139+
elif mem.duplex == 'off':
2140+
# we fake tx disable by setting the tx freq to 0 MHz
2141+
_mem.offsetDir = FLAGS1_OFFSET_MINUS
2142+
_mem.offset = _mem.freq
21312143
# set band
21322144
if number < 200:
21332145
_mem4.channel_attributes[number].is_free = 0

0 commit comments

Comments
 (0)