Don't apply this ! It can break support to other radios supported by this lib!

Hi Tom,

I think you don't read the full driver, at the end there is a section with the specific limits for each radio the lib supports and all of it's known (to me and by the software)

So changing the limit in the main class code is discouraged (low and high variables are updated by the specific radio model/type class instantiation at the bottom of the file), the right place to do that is in the specific class instance for the radio type, please see the bottom of the lib, for the TK-360:

================================

@directory.register
class TK360_Radio(Kenwood_P60_Radio):
    """Kenwood TK-360 Radios"""
    MODEL = "TK-360"
    TYPE = "P0360"
    VARIANTS = {
        "P0360\x24\x00\x00": (4, 450, 470, "F1"),
        "P0360\x25\x00\x00": (4, 470, 490, "F2"),
        "P0360\x26\x00\x00": (4, 490, 512, "F3"),
        "P0360\x23\x00\x00": (4, 406, 430, "F4"),
        }

===============================

As you can see there are 4 variants of this radio and some has very different band segments, I know that almost all kenwood radios can work outside the dealer limits, but how far away is the question.

I follow a policy of just modify the ones that I can confirm by my/others test, in your image I sport that you has a F1 version (see attached image, 450 to 470MHz as dealer states) and you have confirmed that it works down to 440, which is great.

So the right change must be this (and not in the Kenwood_P60_Radio class):

================================

@directory.register
class TK360_Radio(Kenwood_P60_Radio):
    """Kenwood TK-360 Radios"""
    MODEL = "TK-360"
    TYPE = "P0360"
    VARIANTS = {
        "P0360\x24\x00\x00": (4, 440, 470, "F1"),   # original 450-470
        "P0360\x25\x00\x00": (4, 470, 490, "F2"),
        "P0360\x26\x00\x00": (4, 490, 512, "F3"),
        "P0360\x23\x00\x00": (4, 406, 430, "F4"),
        }

===============================

Now I missed to comment the structure of the data in the file, and that must confuse you, here it's:

Radio internal ID: (ch_count, lower_edge, upper_edge, dealer_variant_code) 

So for the radio you have it's:

Radio internal ID: "P0360\x24\x00\x00"

Ch count: 4

Lower band edge: 440 (was 450)

Upper band edge: 470

Dealer Variant Code: "F1"


Should I patch it with the proper changes or you can fix it?


73 de Pavel CO7WT


El 07/04/17 a las 23:07, Tom Hayward via chirp_devel escribió:
# HG changeset patch
# User Tom Hayward <tom@tomh.us>
# Date 1491620809 25200
#      Fri Apr 07 20:06:49 2017 -0700
# Node ID 87617be5ce849914797040874cb95922c64a712a
# Parent  aa35de3cc43ead9e35ecd637525cb4a5dfa9faad
[TK-270] Allow programming Kenwood commercial UHF radios in the 70cm band. #4709

diff -r aa35de3cc43e -r 87617be5ce84 chirp/drivers/tk270.py
--- a/chirp/drivers/tk270.py	Thu Mar 30 15:43:25 2017 -0700
+++ b/chirp/drivers/tk270.py	Fri Apr 07 20:06:49 2017 -0700
@@ -413,14 +413,12 @@
         # indentify the radio variant and set the enviroment to it's values
         try:
             self._upper, low, high, self._kind = self.VARIANTS[rid]
-            self._range = [low * 1000000, high * 1000000]
+            self._range = [min(440, low) * 1000000, high * 1000000]
 
             # put the VARIANT in the class, clean the model / CHs / Type
             # in the same layout as the KPG program
             self._VARIANT = self.MODEL + " [" + str(self._upper) + "CH]: "
-            self._VARIANT += self._kind + ", "
-            self._VARIANT += str(self._range[0]/1000000) + "-"
-            self._VARIANT += str(self._range[1]/1000000) + " Mhz"
+            self._VARIANT += "%s, %d-%d Mhz" % (self._kind, low, high)
 
             # DEBUG
             #print self._VARIANT
_______________________________________________
chirp_devel mailing list
chirp_devel@intrepid.danplanet.com
http://intrepid.danplanet.com/mailman/listinfo/chirp_devel
Developer docs: http://chirp.danplanet.com/projects/chirp/wiki/Developers