# HG changeset patch
# User Philip J Freeman <phil@k6fsm.net>
# Date 1558043458 25200
#      Thu May 16 14:50:58 2019 -0700
# Branch k6fsm
# Node ID c85508f6c23cd3c5636cd0ffd31b1a6ca5fbcef5
# Parent  7f46b0213c16e4082984a8ccecf1af4bd17624c7
Extend alinco driver to support DJ-G7T

diff -r 7f46b0213c16 -r c85508f6c23c chirp/drivers/alinco.py
--- a/chirp/drivers/alinco.py	Sun May 12 00:35:53 2019 -0400
+++ b/chirp/drivers/alinco.py	Thu May 16 14:50:58 2019 -0700
@@ -572,7 +572,7 @@
         return data
 
 
-DJG7EG_MEM_FORMAT = """
+DJG7_MEM_FORMAT = """
 #seekto 0x200;
 ul16 bank[50];
 ul16 special_bank[7];
@@ -598,11 +598,9 @@
 """
 
 
-@directory.register
-class AlincoDJG7EG(AlincoStyleRadio):
+class AlincoDJG7(AlincoStyleRadio):
     """Alinco DJ-G7EG"""
     VENDOR = "Alinco"
-    MODEL = "DJ-G7EG"
     BAUD_RATE = 57600
 
     # Those are different from the other Alinco radios.
@@ -613,7 +611,6 @@
     TMODES = ["", "??1", "Tone", "TSQL", "TSQL-R", "DTCS"]
 
     # This is a bit of a hack to avoid overwriting _identify()
-    _model = "AL~DJ-G7EG"
     _memsize = 0x1a7c0
     _range = [(500000, 1300000000)]
 
@@ -777,7 +774,7 @@
                             "frequency. Touch channel to fix." % number)
 
     def process_mmap(self):
-        self._memobj = bitwise.parse(DJG7EG_MEM_FORMAT, self._mmap)
+        self._memobj = bitwise.parse(DJG7_MEM_FORMAT, self._mmap)
         # We check all channels for corruption (see bug #5275) but we don't fix
         # it automatically because it would be unpolite to modify something on
         # a read operation. A log message is emitted though for the user to
@@ -866,3 +863,20 @@
             _mem.unknown2 = 0x0000000a
             _mem.unknown3 = 0x00000000
             _mem.unknown4 = 0x00000000
+
+@directory.register
+class AlincoDJG7EG(AlincoDJG7):
+    """Alinco DJ-G7EG"""
+    MODEL = "DJ-G7EG"
+
+    # This is a bit of a hack to avoid overwriting _identify()
+    _model = "AL~DJ-G7EG"
+
+@directory.register
+class AlincoDJG7T(AlincoDJG7):
+    """Alinco DJ-G7T"""
+    MODEL = "DJ-G7T"
+
+    # This is a bit of a hack to avoid overwriting _identify()
+    _model = "AL~DJ-G7T"
+
