Greetings,
I’m sure the problem is with my driver but can anyone reassure me that tox uses an offset of 600 kHz?
In one tox test for my driver, duplex is changed from ‘+’ to ‘split’. The test also points out that we should ignore the offset. That may be a problem for the IC-F520.
The IC-F520 stores the receive and transmit frequencies in each memory without the offset. Rather than write the driver with duplex of only ‘’ and ‘split’, I do a little math to support ‘+’ and ‘-‘ splits when the difference between receive and transmit is 600 kHz (this is a VHF radio).
Thanks! tox test below.
_______________________________________________________________________________________________________ TestCaseBruteForce_Icom_IC-F520.test_duplex ________________________________________________________________________________________________________
[gw7] linux -- Python 3.12.3 /home/joseph/Devl/chirp/.tox/driver/bin/python
self = <tests.TestCaseBruteForce_Icom_IC-F520 testMethod=test_duplex>
@base.requires_feature('valid_duplexes')
def test_duplex(self):
m = self.get_mem()
if 'duplex' in m.immutable:
self.skipTest('Test memory has immutable duplex')
for duplex in self.rf.valid_duplexes:
assert duplex in ["", "-", "+", "split", "off"]
if duplex == 'split':
self.assertTrue(self.rf.can_odd_split,
'Radio supports split but does not set '
'can_odd_split=True in features')
m.offset = self.rf.valid_bands[0][1] - 100000
else:
m.offset = chirp_common.to_kHz(int(m.tuning_step) * 2)
m.duplex = duplex
# Ignore the offset because we do some fudging on this and we
# don't necessarily know the best step to use. What we care about
# is duplex here.
> self.set_and_compare(m, ignore=['offset'])
tests/test_brute_force.py:106:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_brute_force.py:28: in set_and_compare
self.assertEqualMem(m, ret_m, **kwargs)
tests/base.py:203: in assertEqualMem
self.assertEqual(a_vals, b_vals,
E AssertionError: {'fre[117 chars]'duplex': '+', 'mode': 'FM', 'comment': '', 'empty': False} != {'fre[117 chars]'duplex': 'split', 'mode': 'FM', 'comment': '', 'empty': False}
E {'comment': '',
E 'dtcs_polarity': 'NN',
E - 'duplex': '+',
E ? ^
E
E + 'duplex': 'split',
E ? ^^^^^
E
E 'empty': False,
E 'extd_number': '',
E 'freq': 136005000,
E 'mode': 'FM',
E 'name': '',
E 'number': 1,
E 'skip': '',
E 'tmode': '',
E 'vfo': 0} : Memories have unexpected differences
-------------------------------------------------------------------------------------------------------------------- Captured log call ---------------------------------------------------------------------------------------------------------------------
DEBUG chirp.chirp_common:chirp_common.py:1553 Loaded metadata: {'mem_extra': {}, 'rclass': 'DynamicRadioAlias', 'vendor': 'Icom', 'model': 'IC-F520', 'variant': '', 'chirp_version': 'next-20241206'}
DEBUG chirp.chirp_common:chirp_common.py:2037 Parsed version 'next-20241206' to (0,)
DEBUG chirp.chirp_common:chirp_common.py:2037 Parsed version 'py3dev' to (0,)