Browse code

all memory

gandolf authored on 02/01/2020 05:02:27
Showing 1 changed files
... ...
@@ -42,6 +42,7 @@ _DEFAULT_MENU_SETTINGS_FILE = 'ft991menu.cfg'
42 42
 _DEFAULT_MEMORY_SETTINGS_FILE = 'ft991mem.csv'
43 43
 _MAX_NUMBER_OF_MENU_ITEMS = 154
44 44
 _MAX_NUMBER_OF_MEMORY_ITEMS = 118
45
+_DEBUG = False
45 46
 
46 47
 # Global definitions
47 48
 
... ...
@@ -262,9 +263,12 @@ def readMemorySettings():
262 263
              contained in the list.
263 264
     """
264 265
     # Define the column headers as the first item in the list.
265
-    lSettings = [ 'Memory Ch,Rx Frequency,Tx Frequency,Offset,' \
266
-                        'Repeater Shift,Mode,Tag,Encoding,Tone,DCS,' \
267
-                        'Clarifier,RxClar,TxClar' ]
266
+    lSettings = [ 'Memory Ch,VFO_A,VFO_B,' \
267
+                  'RepeaterShift,Mode,Tag,Encoding,Tone,DCS,' \
268
+                  'Clarifier,RxClar,TxClar,PreAmp,RfAttn,NB,IFshift,' \
269
+                  'IFwidthIndex,ContourState,ContourFreq,' \
270
+                  'APFstate,APFfreq,DNRstate,DNRalgorithm,DNFstate,' \
271
+                  'NBFstate,NotchState,NotchFreq' ]
268 272
 
269 273
     for iLocation in range(1, _MAX_NUMBER_OF_MEMORY_ITEMS):
270 274
 
... ...
@@ -280,14 +284,31 @@ def readMemorySettings():
280 284
         dMem = ft991.getMemory(iLocation)
281 285
         tone = ft991.getCTCSS()
282 286
         dcs = ft991.getDCS()
287
+        preamp = ft991.getPreamp()
288
+        rfattn = ft991.getRfAttn()
289
+        nblkr = ft991.getNoiseBlanker()
290
+        shift = ft991.getIFshift()
291
+        width = ft991.getIFwidth()
292
+        lContour = ft991.getContour()
293
+        dnrstate = ft991.getDNRstate()
294
+        dnralgorithm = ft991.getDNRalgorithm()
295
+        dnfstate = ft991.getDNFstate()
296
+        narstate = ft991.getNARstate()
297
+        notch = ft991.getNotchState()
283 298
         # getMemory, above, stores data in a dictionary object.  Format
284 299
         # the data in this object, as well as, the DCS code and CTCSS
285 300
         # tone into a comma-delimited string.
286
-        sCsvFormat = '%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s' % \
287
-               ( dMem['memloc'], dMem['rxfreq'], '', '', \
288
-                 dMem['shift'], dMem['mode'], dMem['tag'], dMem['encode'], \
301
+        sCsvFormat = '%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,' \
302
+                     '%s,%s,%s,%s,%s,%s,%s,%s,%s,%s' % \
303
+               (
304
+                 dMem['memloc'], dMem['vfoa'], '', \
305
+                 dMem['rpoffset'], dMem['mode'], dMem['tag'], dMem['encode'], \
289 306
                  tone, dcs, dMem['clarfreq'], dMem['rxclar'], \
290
-                 dMem['txclar'] )
307
+                 dMem['txclar'], preamp, rfattn, nblkr, shift, width, \
308
+                 lContour[0], lContour[1], lContour[2], lContour[3], \
309
+                 dnrstate, dnralgorithm, dnfstate, narstate, notch[0],
310
+                 notch[1]
311
+               )
291 312
         # Add the comma-delimited string to the list object.
292 313
         lSettings.append(sCsvFormat)
293 314
     return lSettings
... ...
@@ -301,13 +322,14 @@ def writeMemorySettings(lSettings):
301 322
     Returns: nothing
302 323
     """
303 324
     for item in lSettings:
304
-        # Parse the comma-delimited line and store in a dictionary object.
305
-        dItem = ft991.parseCsvData(item)
306
-        # The first item in the memory settings list are the column headers;
307
-        # so ignore this item.  (parseData returns None for this item.)
308
-        if dItem == None:
309
-            continue
310 325
         try:
326
+            # Parse the comma-delimited line and store in a dictionary object.
327
+            dItem = ft991.parseCsvData(item)
328
+            # The first item in the memory settings list are the
329
+            # column headers, so ignore this item.  (parseData returns
330
+            # None for this item.)
331
+            if dItem == None:
332
+                continue
311 333
             # Set the parameters for the memory location.
312 334
             ft991.setMemory(dItem)
313 335
             # Set current channel to memory location being set.
... ...
@@ -322,13 +344,36 @@ def writeMemorySettings(lSettings):
322 344
             # off by sending the 'RT0' and 'XT0' commands.  This situation
323 345
             # is probably due to a bug in the CAT interface.
324 346
             ft991.setRxClarifier(dItem['rxclar'])
325
-            ft991.setTxClarifier(dItem['txclar'])            
347
+            ft991.setTxClarifier(dItem['txclar'])
348
+            # Set Rx preamplifier state
349
+            ft991.setPreamp(dItem['preamp'])
350
+            # Set RF attenuator state
351
+            ft991.setRfAttn(dItem['rfattn'])
35