Browse code

all memory

gandolf authored on 02/01/2020 05:02:27
Showing 1 changed files
... ...
@@ -55,6 +55,9 @@ ptrDevice = None
55 55
 # CTCSS tone, and DCS code are translated to the repective FT991 parameter
56 56
 # value.
57 57
 
58
+# Binary On / Off state
59
+bState = { 'OFF':'0', 'ON':'1' }
60
+
58 61
 # Modulation modes
59 62
 dMode = { 'LSB':'1', 'USB':'2', 'CW':'3', 'FM':'4', 'AM':'5',
60 63
           'RTTY-LSB':'6', 'CW-R':'7', 'DATA-LSB':'8', 'RTTY-USB':'9',
... ...
@@ -113,9 +116,12 @@ dDcs = { '23':'000', '25':'001', '26':'002', '31':'003', '32':'004',
113 116
          '664':'095', '703':'096', '712':'097', '723':'098', '731':'099',
114 117
          '732':'100', '734':'101', '743':'102', '754':'103' }
115 118
 
116
-# Clarifier state
117
-dRxClar = { 'OFF':'0', 'ON':'1' }
118
-dTxClar = { 'OFF':'0', 'ON':'1' }
119
+# Preamplifier State
120
+dPreamp = { 'IPO':'0', 'AMP 1':'1', 'AMP 2':'2' }
121
+
122
+# Narror band filter state
123
+dNAR = { 'WIDE':'0', 'NARROW':'1' }
124
+
119 125
 
120 126
 #############################################################################
121 127
 # Define 'get' methods to encapsulate FT991 commands returning status info. #
... ...
@@ -135,24 +141,24 @@ def getMemory(memloc):
135 141
 
136 142
     # Parse memory settings string returned by the FT991
137 143
     memloc = sResult[2:5]
138
-    rxfreq = sResult[5:14]
144
+    vfoa = sResult[5:14]
139 145
     clarfreq = sResult[14:19]
140 146
     rxclar = sResult[19]
141 147
     txclar = sResult[20]
142 148
     mode = sResult[21]
143 149
     encode = sResult[23]
144
-    shift = sResult[26]
150
+    rpoffset = sResult[26]
145 151
     tag = sResult[28:40]
146 152
 
147 153
     # Store the memory settings in a dictionary object.
148 154
     dMem['memloc'] = str(int(memloc))
149
-    dMem['rxfreq'] = str(float(rxfreq) / 10**6)
155
+    dMem['vfoa'] = str(float(vfoa) / 10**6)
150 156
     dMem['clarfreq'] = str(int(clarfreq))
151
-    dMem['rxclar'] = dRxClar.keys()[dRxClar.values().index(rxclar)]
152
-    dMem['txclar'] = dTxClar.keys()[dTxClar.values().index(txclar)]
157
+    dMem['rxclar'] = bState.keys()[bState.values().index(rxclar)]
158
+    dMem['txclar'] = bState.keys()[bState.values().index(txclar)]
153 159
     dMem['mode'] = dMode.keys()[dMode.values().index(mode)]
154 160
     dMem['encode'] = dEncode.keys()[dEncode.values().index(encode)]
155
-    dMem['shift'] = dShift.keys()[dShift.values().index(shift)]
161
+    dMem['rpoffset'] = dShift.keys()[dShift.values().index(rpoffset)]
156 162
     dMem['tag'] = tag.strip()
157 163
 
158 164
     return dMem
... ...
@@ -190,10 +196,9 @@ def getRxClarifier():
190 196
     """
191 197
     # An exception will automatically be raised if incorrect data is
192 198
     # supplied - most likely a "key not found" error.
193
-    sCmd = 'RT;'
194
-    sResult = sendCommand(sCmd)
199
+    sResult = sendCommand('RT;')
195 200
     state = sResult[2]
196
-    return dRxClar.keys()[dRxClar.values().index(state)]
201
+    return bState.keys()[bState.values().index(state)]
197 202
 ## end def
198 203
 
199 204
 def getTxClarifier():
... ...
@@ -204,14 +209,182 @@ def getTxClarifier():
204 209
     """
205 210
     # An exception will automatically be raised if incorrect data is
206 211
     # supplied - most likely a "key not found" error.
207
-    sCmd = 'XT;'
208
-    sResult = sendCommand(sCmd)
212
+    sResult = sendCommand('XT;')
209 213
     state = sResult[2]
210
-    return dTxClar.keys()[dTxClar.values().index(state)]
214
+    return bState.keys()[bState.values().index(state)]
215
+## end def
216
+
217
+def getPower():
218
+    """
219
+    Description:  Gets the transmit power level.
220
+    Parameters: none
221
+    Returns: string containing the power in Watts
222
+    """
223
+    sResult = sendCommand('PC;')
224
+    return sResult[2:5]
225
+##end def
226
+
<