def casted(cls, radio_channel, style):
        switch = {
            radio_types.DEFAULT:
            RadioChannelDefault(radio_channel.cols,
                                radio_channel.digital_contacts,
                                radio_channel.dmr_ids),
            radio_types.CHIRP:
            RadioChannelChirp(radio_channel.cols,
                              radio_channel.digital_contacts,
                              radio_channel.dmr_ids),
            radio_types.FTM400_RT:
            RadioChannelFtm400(radio_channel.cols,
                               radio_channel.digital_contacts,
                               radio_channel.dmr_ids),
            radio_types.D878:
            RadioChannelD878(radio_channel.cols,
                             radio_channel.digital_contacts,
                             radio_channel.dmr_ids),
            radio_types.CS800:
            RadioChannelCS800(radio_channel.cols,
                              radio_channel.digital_contacts,
                              radio_channel.dmr_ids),
            radio_types.D710:
            RadioChannelD710(radio_channel.cols,
                             radio_channel.digital_contacts,
                             radio_channel.dmr_ids),
            radio_types.GPX:
            RadioChannelGpx(radio_channel.cols, radio_channel.digital_contacts,
                            radio_channel.dmr_ids),
        }

        return switch[style]
Пример #2
0
 def test_uhf_simplex(self):
     self.cols['name'] = 'National 70cm'
     self.cols['medium_name'] = 'Natl 70c'
     self.cols['short_name'] = 'NATL 70'
     self.cols['rx_freq'] = '446.0'
     channel = RadioChannelD710(self.cols, None, None)
     result = channel.output(2)
     self.assertEqual(
         '0001,00446.000000,025.00,00.000000,Off,88.5,88.5,023, ,Off,Off,FM,446.000000,025.00,NATL 70C',
         result)
Пример #3
0
 def test_simplex(self):
     self.cols['name'] = 'National 2m'
     self.cols['medium_name'] = 'Natl 2m'
     self.cols['short_name'] = 'NATL 2M'
     self.cols['rx_freq'] = '146.52'
     channel = RadioChannelD710(self.cols, None, None)
     result = channel.output(1)
     self.assertEqual(
         '0000,00146.520000,005.00,00.000000,Off,88.5,88.5,023, ,Off,Off,FM,146.520000,005.00,NATL 2M',
         result)
Пример #4
0
 def test_vhf_repeater(self):
     self.cols['name'] = 'Some Repeater'
     self.cols['medium_name'] = 'Some Rpt'
     self.cols['short_name'] = 'SOMERPT'
     self.cols['rx_freq'] = '145.310'
     self.cols['tx_offset'] = '-0.6'
     self.cols['tx_ctcss'] = '100.0'
     result = RadioChannelD710(self.cols, None, None).output(3)
     self.assertEqual(
         '0002,00145.310000,005.00,00.600000,T,100.0,88.5,023,-,Off,Off,FM,145.310000,005.00,SOME RPT',
         result)
Пример #5
0
 def test_dcs_repeater(self):
     self.cols['name'] = 'Dcs Repeater'
     self.cols['medium_name'] = 'Dcs Rpt'
     self.cols['short_name'] = 'DCS RPT'
     self.cols['rx_freq'] = '447.075'
     self.cols['rx_dcs'] = '165'
     self.cols['tx_offset'] = '-5'
     self.cols['tx_dcs'] = '165'
     result = RadioChannelD710(self.cols, None, None).output(6)
     self.assertEqual(
         '0005,00447.075000,025.00,05.000000,DCS,88.5,88.5,165,-,Off,Off,FM,447.075000,025.00,DCS RPT',
         result)
Пример #6
0
    def test_positive_offset(self):
        self.cols['name'] = 'Some Repeater'
        self.cols['medium_name'] = 'Some Rpt'
        self.cols['short_name'] = 'SOMERPT'
        self.cols['rx_freq'] = '442.125'
        self.cols['rx_ctcss'] = '127.3'
        self.cols['tx_offset'] = '5.0'
        self.cols['tx_ctcss'] = '100.0'
        result = RadioChannelD710(self.cols, None, None).output(4)

        self.assertEqual(
            '0003,00442.125000,025.00,05.000000,CT,100.0,127.3,023,+,Off,Off,FM,442.125000,025.00,SOME RPT',
            result)
Пример #7
0
 def setUp(self):
     self.radio_channel = RadioChannelD710.create_empty()
     self.cols = dict()
     self.cols['name'] = ''
     self.cols['medium_name'] = ''
     self.cols['short_name'] = ''
     self.cols['zone_id'] = ''
     self.cols['rx_freq'] = ''
     self.cols['rx_ctcss'] = ''
     self.cols['rx_dcs'] = ''
     self.cols['rx_dcs_invert'] = ''
     self.cols['tx_power'] = ''
     self.cols['tx_offset'] = ''
     self.cols['tx_ctcss'] = ''
     self.cols['tx_dcs'] = ''
     self.cols['tx_dcs_invert'] = ''
     self.cols['digital_timeslot'] = ''
     self.cols['digital_color'] = ''
     self.cols['digital_contact_id'] = ''
     self.cols['latitude'] = ''
     self.cols['longitude'] = ''