# HG changeset patch # User Ray Cielencki rayslinky@gmail.com # Date 1520793253 14400 # Sun Mar 11 14:34:13 2018 -0400 # Node ID c5ab89c9767712207d53a6ecfa69249a9d1bb175 # Parent bc008caf047165682aff19fc420a05b264ad1e5c #5635: FT2D variant, fix opening message, extend smart beaconing limit
diff -r bc008caf0471 -r c5ab89c97677 chirp/drivers/ft1d.py --- a/chirp/drivers/ft1d.py Thu Mar 08 20:23:39 2018 +0000 +++ b/chirp/drivers/ft1d.py Sun Mar 11 14:34:13 2018 -0400 @@ -624,6 +624,7 @@ _BACKTRACK_STATUS = ("Valid", "Invalid") _NS_HEMI = ("N", "S") _WE_HEMI = ("W", "E") + _APRS_HIGH_SPEED_MAX = 70
@classmethod def get_prompts(cls): @@ -1350,7 +1351,8 @@ prof = aprs.smartbeaconing_profile[profile]
low_val = RadioSettingValueInteger(2, 30, prof.low_speed_mph) - high_val = RadioSettingValueInteger(3, 70, prof.high_speed_mph) + high_val = RadioSettingValueInteger(3, self._APRS_HIGH_SPEED_MAX, \ + prof.high_speed_mph) low_val.get_max = lambda: min(30, int(high_val.get_value()) - 1)
rs = RadioSetting("%s.low_speed_mph" % path, @@ -1470,6 +1472,12 @@ val) menu.append(rs)
+ rs = self._decode_opening_message(opening_message) + menu.append(rs) + + return menu + + def _decode_opening_message(self, opening_message): msg = "" for i in opening_message.message.padded_yaesu: if i == 0xFF: @@ -1480,9 +1488,7 @@ "Opening Message", val) rs.set_apply_callback(self.apply_ff_padded_yaesu, opening_message.message) - menu.append(rs) - - return menu + return rs
def backtrack_ll_validate(self, number, min, max): if str(number).lstrip('0').strip().isdigit() and \ diff -r bc008caf0471 -r c5ab89c97677 chirp/drivers/ft2d.py --- a/chirp/drivers/ft2d.py Thu Mar 08 20:23:39 2018 +0000 +++ b/chirp/drivers/ft2d.py Sun Mar 11 14:34:13 2018 -0400 @@ -20,7 +20,8 @@
from chirp.drivers import yaesu_clone, ft1d from chirp import chirp_common, directory, bitwise -from chirp.settings import RadioSettings +from chirp.settings import RadioSetting, RadioSettings +from chirp.settings import RadioSettingValueString
# Differences from Yaesu FT1D # 999 memories, but 901-999 are only for skipping VFO frequencies @@ -75,6 +76,7 @@ 0x1064A, # APRS beacon content address. 134, # Length of beacon data stored. 60) # Number of beacons stored. + _APRS_HIGH_SPEED_MAX = 90
@classmethod def get_prompts(cls): @@ -125,4 +127,31 @@ if mem.number >= 901 and mem.number <= 999: # for FT2D; enforces skip flag.skip = True mem.skip = "S" - super(FT2D, self).set_memory(mem) \ No newline at end of file + super(FT2D, self).set_memory(mem) + + def _decode_opening_message(self, opening_message): + msg = "" + for i in opening_message.message.padded_yaesu: + if i == 0xFF: + break + msg += chr(int(i)) + val = RadioSettingValueString(0, 16, msg) + rs = RadioSetting("opening_message.message.padded_yaesu", + "Opening Message", val) + rs.set_apply_callback(self._apply_opening_message, + opening_message.message.padded_yaesu) + return rs + + def _apply_opening_message(self, setting, obj): + data = self._add_ff_pad(setting.value.get_value().rstrip(), 16) + val = [] + for i in data: + val.append(ord(i)) + self._memobj.opening_message.message.padded_yaesu = val + +@directory.register +class FT2Dv2(FT2D): + """Yaesu FT-2D v2 firwmare""" + VARIANT = "Rv2" + + _model = "AH60G"