# HG changeset patch # User Jim Unroe rock.unroe@gmail.com # Date 1385500703 18000 # Node ID fac62ed0236be2ae124c5a5a05e8370ff46c119c # Parent 68dcf5898ba38f087d9a543256ef71828c24f650 [UV-3R] Add Band Limit Settings expose band limit fields in memmap expand band ranges to 136-235 MHz and 400-529 MHz add band limit settings to Basic Settings tab related to #1267
diff -r 68dcf5898ba3 -r fac62ed0236b chirp/baofeng_uv3r.py --- a/chirp/baofeng_uv3r.py Tue Nov 26 16:00:58 2013 -0500 +++ b/chirp/baofeng_uv3r.py Tue Nov 26 16:18:23 2013 -0500 @@ -93,6 +93,14 @@ lbcd tx_freq[4]; } tx_memory[99];
+#seekto 0x0780; +struct { + lbcd lower_vhf[2]; + lbcd upper_vhf[2]; + lbcd lower_uhf[2]; + lbcd upper_uhf[2]; +} limits; + #seekto 0x07C2; struct { u8 squelch; @@ -169,7 +177,7 @@ rf.valid_tmodes = ["", "Tone", "TSQL", "DTCS", "Cross"] rf.valid_modes = ["FM", "NFM"] rf.valid_power_levels = UV3R_POWER_LEVELS - rf.valid_bands = [(136000000, 174000000), (400000000, 470000000)] + rf.valid_bands = [(136000000, 235000000), (400000000, 529000000)] rf.valid_skips = [] rf.valid_duplexes = ["", "-", "+", "split"] rf.valid_cross_modes = ["Tone->Tone", "Tone->DTCS", "DTCS->Tone", @@ -388,6 +396,42 @@ CH_FLAG_LIST[self._memobj.settings.ch_flag])) basic.append(rs)
+ _limit = int(self._memobj.limits.lower_vhf) / 10 + rs = RadioSetting("limits.lower_vhf", "VHF Lower Limit (115-239 MHz)", + RadioSettingValueInteger(115, 235, _limit)) + def apply_limit(setting, obj): + value = int(setting.value) * 10 + obj.lower_vhf = value + rs.set_apply_callback(apply_limit, self._memobj.limits) + basic.append(rs) + + _limit = int(self._memobj.limits.upper_vhf) / 10 + rs = RadioSetting("limits.upper_vhf", "VHF Upper Limit (115-239 MHz)", + RadioSettingValueInteger(115, 235, _limit)) + def apply_limit(setting, obj): + value = int(setting.value) * 10 + obj.upper_vhf = value + rs.set_apply_callback(apply_limit, self._memobj.limits) + basic.append(rs) + + _limit = int(self._memobj.limits.lower_uhf) / 10 + rs = RadioSetting("limits.lower_uhf", "UHF Lower Limit (200-529 MHz)", + RadioSettingValueInteger(200, 529, _limit)) + def apply_limit(setting, obj): + value = int(setting.value) * 10 + obj.lower_uhf = value + rs.set_apply_callback(apply_limit, self._memobj.limits) + basic.append(rs) + + _limit = int(self._memobj.limits.upper_uhf) / 10 + rs = RadioSetting("limits.upper_uhf", "UHF Upper Limit (200-529 MHz)", + RadioSettingValueInteger(200, 529, _limit)) + def apply_limit(setting, obj): + value = int(setting.value) * 10 + obj.upper_uhf = value + rs.set_apply_callback(apply_limit, self._memobj.limits) + basic.append(rs) + return group
def set_settings(self, settings):