Skip to content

Commit

Permalink
uv17pro: Fix exposing static banks on some models
Browse files Browse the repository at this point in the history
Previously in commit:5d295a8b we added a static bank model to show
the static mappings between memories and "banks" in these radios.
However, only some of the more advanced models have this functionality,
not all the radios that inherit from UV17Pro. This fixes that to only
apply this model to the UV17ProGPS and BF-F8HP-PRO models.

Further, in commit:d1f8504e we fixed the bug where the UV17 models
inherited this behavior to disable it for them. Those overrides are
no longer necessary, so this removes them.

Related to #11642
  • Loading branch information
kk7ds committed Jan 13, 2025
1 parent dc48c8a commit fc94f14
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
8 changes: 0 additions & 8 deletions chirp/drivers/baofeng_uv17.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,14 +492,6 @@ def set_memory(self, mem):

self.set_memory_common(mem, _mem)

def get_features(self):
rf = super().get_features()
rf.has_bank = False
return rf

def get_mapping_models(self):
return []


@directory.register
class UV13Pro(UV17):
Expand Down
21 changes: 17 additions & 4 deletions chirp/drivers/baofeng_uv17Pro.py
Original file line number Diff line number Diff line change
Expand Up @@ -1139,15 +1139,12 @@ def sync_out(self):
raise errors.RadioError('Unexpected error communicating '
'with the radio')

def get_bank_model(self):
return chirp_common.StaticBankModel(self, banks=10)

def get_features(self):
"""Get the radio's features"""

rf = chirp_common.RadioFeatures()
rf.has_settings = True
rf.has_bank = True
rf.has_bank = False
rf.has_tuning_step = False
rf.can_odd_split = True
rf.has_name = True
Expand Down Expand Up @@ -1415,6 +1412,14 @@ class UV17ProGPS(UV17Pro):
UV17Pro._uhf_range, UV17Pro._uhf2_range]
MODES = UV17Pro.MODES + ['AM']

def get_bank_model(self):
return chirp_common.StaticBankModel(self, banks=10)

def get_features(self):
rf = super().get_features()
rf.has_bank = True
return rf


@directory.register
class BF5RM(UV17Pro):
Expand Down Expand Up @@ -1611,6 +1616,14 @@ def apply_stationid(setting, obj):
rs.set_apply_callback(apply_stationid, _nameobj)
basic.append(rs)

def get_bank_model(self):
return chirp_common.StaticBankModel(self, banks=10)

def get_features(self):
rf = super().get_features()
rf.has_bank = True
return rf


@directory.register
class UV5RH(UV17Pro):
Expand Down

0 comments on commit fc94f14

Please sign in to comment.