wouxun_menu_lock.patch

Dan Smith, 05/25/2012 07:12 pm

Download (1.8 kB)

b/chirp/wouxun.py Fri May 25 19:12:12 2012 -0700
17 17
import time
18 18
import os
19 19
from chirp import util, chirp_common, bitwise, memmap, errors, directory
20
from chirp.settings import RadioSetting, RadioSettingGroup, RadioSettingValueBoolean
20 21

  
21 22
if os.getenv("CHIRP_DEBUG"):
22 23
    DEBUG = True
......
41 42
  u8 unknown[2];
42 43
} memory[128];
43 44

  
45
#seekto 0x0E5C;
46
u8 unknown_flag1:7,
47
   menu_available:1;
48

  
44 49
#seekto 0x1008;
45 50
struct {
46 51
  u8 unknown[8];
......
198 203
        rf.has_cross = True
199 204
        rf.has_tuning_step = False
200 205
        rf.has_bank = False
206
        rf.has_settings = True
201 207
        rf.memory_bounds = (1, 128)
202 208
        rf.can_odd_split = True
203 209
        return rf
204 210

  
211
    def get_settings(self):
212
        group = RadioSettingGroup("top", "All Settings")
213

  
214
        rs = RadioSetting("menu_available", "Menu Available",
215
                          RadioSettingValueBoolean(self._memobj.menu_available))
216
        group.append(rs)
217

  
218
        return group
219

  
220
    def set_settings(self, settings):
221
        for element in settings:
222
            if not isinstance(element, RadioSetting):
223
                self.set_settings(element)
224
                continue
225
            try:
226
                setattr(self._memobj, element.get_name(), element.value)
227
            except Exception, e:
228
                print element.get_name()
229
                raise
230

  
231

  
232

  
205 233
    def get_raw_memory(self, number):
206 234
        return repr(self._memobj.memory[number - 1])
207 235