Exemplo n.º 1
0
    def validate_memory(self, mem):
        msgs = baofeng_common.BaofengCommonHT.validate_memory(self, mem)

        if mem.freq != int(MURS_FREQS[mem.number - 1] * 1000000):
            msgs.append(
                chirp_common.ValidationError(
                    'Memory location cannot change frequency'))

        if mem.mode == "FM" and (mem.number - 1) not in FM_MODE:
            msgs.append(
                chirp_common.ValidationError(
                    'Memory location only supports NFM'))

        return msgs
Exemplo n.º 2
0
    def validate_memory(self, mem):
        msgs = chirp_common.CloneModeRadio.validate_memory(self, mem)

        if (mem.duplex == "split" and abs(mem.freq - mem.offset) > 69995000) \
                or (mem.duplex in ["+", "-"] and mem.offset > 69995000) :
            msgs.append(chirp_common.ValidationError("Max split is 69.995MHz"))
        return msgs
Exemplo n.º 3
0
    def validate_memory(self, mem):
        msgs = yaesu_clone.YaesuCloneModeRadio.validate_memory(self, mem)

        lo, hi = self.VALID_BANDS[2]    # this is fm broadcasting
        if mem.freq >= lo and mem.freq <= hi:
            if mem.mode != "FM":
                msgs.append(chirp_common.ValidationError(
                        "Only FM is supported in this band"))
        # TODO check that step is valid in current mode
        return msgs
Exemplo n.º 4
0
    def validate_memory(self, mem):
        msgs = yaesu_clone.YaesuCloneModeRadio.validate_memory(self, mem)

        if _is220(mem.freq):
            if str(mem.power) not in [str(l) for l in POWER_LEVELS_220]:
                msgs.append(chirp_common.ValidationError(
                        "Power level %s not supported on 220MHz band" %
                            mem.power))

        return msgs
Exemplo n.º 5
0
    def validate_memory(self, mem):
        # Run the normal validation
        msgs = chirp_common.RadioFeatures.validate_memory(self, mem)

        # Run my validation
        if mem.number <= 6 and mem.mode != "NFM":
            msgs.append(
                chirp_common.ValidationError(
                    'Only NFM is supported on this channel'))

        return msgs
Exemplo n.º 6
0
    def validate_memory(self, mem):
        msgs = baofeng_common.BaofengCommonHT.validate_memory(self, mem)

        _mem = self._memobj.memory[mem.number]
        _msg_freq = 'Memory location cannot change frequency'
        _msg_nfm = 'Memory location only supports NFM'
        _msg_txp = 'Memory location only supports Low'

        # Original GMRS-V1 models
        if str(self._memobj.firmware_msg.line1) in self._is_orig:
            # range of memories with values permanently set by FCC rules
            if mem.number <= 22:
                if mem.freq != int(GMRS_FREQS_ORIG[mem.number] * 1000000):
                    # warn user can't change frequency
                    msgs.append(chirp_common.ValidationError(_msg_freq))

                if mem.number <= 6:
                    if mem.mode == "FM":
                        # warn user can't change mode
                        msgs.append(chirp_common.ValidationError(_msg_nfm))

        # GMRS-V1 models supporting 2017 GMRS rules
        else:
            # range of memories with values permanently set by FCC rules
            if mem.number >= 1 and mem.number <= 30:
                if mem.freq != int(GMRS_FREQS_2017[mem.number - 1] * 1000000):
                    # warn user can't change frequency
                    msgs.append(chirp_common.ValidationError(_msg_freq))

                if mem.number >= 8 and mem.number <= 14:
                    if mem.mode == "FM":
                        # warn user can't change mode
                        msgs.append(chirp_common.ValidationError(_msg_nfm))

                    if str(mem.power) == "High":
                        # warn user can't change power level
                        msgs.append(chirp_common.ValidationError(_msg_txp))

        return msgs
Exemplo n.º 7
0
    def validate_memory(self, mem):
        msgs = ""
        msgs = chirp_common.CloneModeRadio.validate_memory(self, mem)

        _msg_freq = 'Memory location cannot change frequency'
        _msg_simplex = 'Memory location only supports Duplex:(None)'
        _msg_duplex = 'Memory location only supports Duplex: +'
        _msg_offset = 'Memory location only supports Offset: 5.000000'
        _msg_nfm = 'Memory location only supports Mode: NFM'
        _msg_txp = 'Memory location only supports Power: Low'

        # GMRS models
        if self._gmrs:
            # range of memories with values set by FCC rules
            if mem.freq != int(GMRS_FREQS[mem.number - 1] * 1000000):
                # warn user can't change frequency
                msgs.append(chirp_common.ValidationError(_msg_freq))

            # channels 1 - 22 are simplex only
            if mem.number <= 22:
                if str(mem.duplex) != "":
                    # warn user can't change duplex
                    msgs.append(chirp_common.ValidationError(_msg_simplex))

            # channels 23 - 30 are +5 MHz duplex only
            if mem.number >= 23:
                if str(mem.duplex) != "+":
                    # warn user can't change duplex
                    msgs.append(chirp_common.ValidationError(_msg_duplex))

                if str(mem.offset) != "5000000":
                    # warn user can't change offset
                    msgs.append(chirp_common.ValidationError(_msg_offset))

            # channels 8 - 14 are low power NFM only
            if mem.number >= 8 and mem.number <= 14:
                if mem.mode != "NFM":
                    # warn user can't change mode
                    msgs.append(chirp_common.ValidationError(_msg_nfm))

                if mem.power != "Low":
                    # warn user can't change power
                    msgs.append(chirp_common.ValidationError(_msg_txp))

        return msgs
Exemplo n.º 8
0
 def validate_memory(self, mem):
     if mem.freq < 30000000 and mem.mode != 'AM':
         return [
             chirp_common.ValidationError('Only AM is allowed below 30MHz')
         ]
     return icf.IcomCloneModeRadio.validate_memory(self, mem)
Exemplo n.º 9
0
 def test_import_mem_with_errors(self):
     self.assertRaises(import_logic.DestNotCompatible,
                       self.test_import_mem,
                       [chirp_common.ValidationError('Test')])