[chirp_devel] [Yaesu FT-4, FT-65, FT-25] After CSV import, channels are always low power
Bernhard Hailer
Sat Jan 25 19:31:20 PST 2020
# HG changeset patch
# Parent a23356ce262d9e262866f5be6b7513b11bc973e3
[Yaesu FT-4, FT-65, FT-25] After CSV import, channels are always low power
When a CSV file was imported, then all imported channels were programmed
with Low power. This has been fixed, it's now defaulting to High power.
73
Bernhard AE6YN
Fixes: #7603
diff --git a/chirp/drivers/ft4.py b/chirp/drivers/ft4.py
--- a/chirp/drivers/ft4.py
+++ b/chirp/drivers/ft4.py
@@ -479,9 +479,10 @@
BASETYPE_FT4 = ["FT-4XR", "FT-4XE"]
BASETYPE_FT65 = ["FT-65R", "FT-25R"]
-POWER_LEVELS = [chirp_common.PowerLevel("Low", watts=0.5),
- chirp_common.PowerLevel("Mid", watts=2.5),
- chirp_common.PowerLevel("High", watts=5.0)]
+POWER_LEVELS = [
+ chirp_common.PowerLevel("High", watts=5.0), # high must be first (0)
+ chirp_common.PowerLevel("Mid", watts=2.5),
+ chirp_common.PowerLevel("Low", watts=0.5)]
# these steps encode to 0-9 on all radios, but encoding #2 is disallowed
# on the US versions (FT-4XR)
@@ -1076,7 +1077,7 @@
mem.freq = 0
mem.offset = 0
mem.duplex = "off"
- mem.power = POWER_LEVELS[2] # "High"
+ mem.power = POWER_LEVELS[0] # "High"
mem.mode = "FM"
mem.tuning_step = 0
else:
@@ -1092,7 +1093,7 @@
else:
mem.duplex = DUPLEX[_mem.duplex]
self.decode_sql(mem, _mem)
- mem.power = POWER_LEVELS[mem.tx_pwr]
+ mem.power = POWER_LEVELS[2 - _mem.tx_pwr]
mem.mode = ["FM", "NFM"][_mem.tx_width]
mem.tuning_step = STEP_CODE[_mem.step]
return mem
@@ -1125,7 +1126,9 @@
_mem.freq = txfreq
self.encode_sql(mem, _mem)
if mem.power:
- _mem.tx_pwr = POWER_LEVELS.index(mem.power)
+ _mem.tx_pwr = 2 - POWER_LEVELS.index(mem.power)
+ else:
+ _mem.tx_pwr = 0 # set to "High" if CHIRP canonical value
is None
_mem.tx_width = mem.mode == "NFM"
_mem.step = STEP_CODE.index(mem.tuning_step)
More information about the chirp_devel
mailing list