# HG changeset patch # User Jim Unroe # Date 1359300502 18000 # Node ID ea6376baf70993d29056ee17ba438ed070c1640a # Parent 5f4fff6266ab03ebd6720f093541c190a0fee1b8 [uv5r] add vfo frequency presets to work mode tab removed 'options =' band list and created BAND_LIST list removed duplicate 'RadioSettingValueList' from 'chirp.settings import' #467 diff -r 5f4fff6266ab -r ea6376baf709 chirp/uv5r.py --- a/chirp/uv5r.py Mon Jan 21 14:59:40 2013 -0800 +++ b/chirp/uv5r.py Sun Jan 27 10:28:22 2013 -0500 @@ -20,8 +20,7 @@ from chirp import bitwise from chirp.settings import RadioSetting, RadioSettingGroup, \ RadioSettingValueInteger, RadioSettingValueList, \ - RadioSettingValueList, RadioSettingValueBoolean, \ - RadioSettingValueString + RadioSettingValueBoolean, RadioSettingValueString MEM_FORMAT = """ #seekto 0x0008; @@ -207,6 +206,8 @@ STEDELAY_LIST = ["%s ms" % x for x in range(100, 1100, 100)] STEDELAY_LIST.insert(0, "OFF") SCODE_LIST = ["%s" % x for x in range(1, 16)] +BAND_LIST = ["VHF (136-174 MHz)", "UHF (400-520 MHz)"] + SETTING_LISTS = { "step" : STEP_LIST, @@ -226,6 +227,7 @@ "rpste" : RPSTE_LIST, "stedelay" : STEDELAY_LIST, "scode" : SCODE_LIST, + "band" : BAND_LIST, } def _do_status(radio, block): @@ -880,15 +882,38 @@ RadioSettingValueInteger(0, 127, _mrcnb)) workmode.append(rs) - options = ["VHF", "UHF"] rs = RadioSetting("vfoa.band", "VFO A Band", - RadioSettingValueList(options, - options[self._memobj.vfoa.band])) + RadioSettingValueList(BAND_LIST, + BAND_LIST[self._memobj.vfoa.band])) + workmode.append(rs) + + _vfoa = self._memobj.vfoa.freq + rs = RadioSetting("vfoa.freq", "VFO A Frequency", + RadioSettingValueInteger(1, 5, _vfoa[0]), + RadioSettingValueInteger(0, 9, _vfoa[1]), + RadioSettingValueInteger(0, 9, _vfoa[2]), + RadioSettingValueInteger(0, 9, _vfoa[3]), + RadioSettingValueInteger(0, 9, _vfoa[4]), + RadioSettingValueInteger(0, 9, _vfoa[5]), + RadioSettingValueInteger(0, 7, _vfoa[6]), + RadioSettingValueInteger(0, 5, _vfoa[7], 5)) workmode.append(rs) rs = RadioSetting("vfob.band", "VFO B Band", - RadioSettingValueList(options, - options[self._memobj.vfob.band])) + RadioSettingValueList(BAND_LIST, + BAND_LIST[self._memobj.vfob.band])) + workmode.append(rs) + + _vfob = self._memobj.vfob.freq + rs = RadioSetting("vfob.freq", "VFO B Frequency", + RadioSettingValueInteger(1, 5, _vfob[0]), + RadioSettingValueInteger(0, 9, _vfob[1]), + RadioSettingValueInteger(0, 9, _vfob[2]), + RadioSettingValueInteger(0, 9, _vfob[3]), + RadioSettingValueInteger(0, 9, _vfob[4]), + RadioSettingValueInteger(0, 9, _vfob[5]), + RadioSettingValueInteger(0, 7, _vfob[6]), + RadioSettingValueInteger(0, 5, _vfob[7], 5)) workmode.append(rs) options = ["High", "Low"]