Browse code

rev_20190802

Gandolf authored on 08/02/2019 19:39:44
Showing 1 changed files
... ...
@@ -36,8 +36,6 @@
36 36
 #   * v23 released 16 Nov 2018 by J L Owrey: improved fault handling
37 37
 #         and data conversion
38 38
 
39
-_MIRROR_SERVER = False
40
-
41 39
 import os
42 40
 import urllib2
43 41
 import sys
... ...
@@ -53,9 +51,6 @@ _USER = os.environ['USER']
53 51
 
54 52
 # ip address of radiation monitoring device
55 53
 _DEFAULT_RADIATION_MONITOR_URL = "{your radiation monitor url}"
56
-# url if this is a mirror server
57
-_PRIMARY_SERVER_URL = "{your primary server url}" \
58
-                      "/radmon/dynamic/radmonInputData.dat"
59 54
 
60 55
     ### FILE AND FOLDER LOCATIONS ###
61 56
 
... ...
@@ -174,14 +169,12 @@ def getRadiationData():
174 169
     """
175 170
     global remoteDeviceReset
176 171
 
177
-    if _MIRROR_SERVER:
178
-        sUrl = _PRIMARY_SERVER_URL
172
+    sUrl = radiationMonitorUrl
173
+
174
+    if remoteDeviceReset:
175
+        sUrl += "/reset" # reboot the radiation monitor
179 176
     else:
180
-        sUrl = radiationMonitorUrl
181
-        if remoteDeviceReset:
182
-            sUrl += "/reset" # reboot the radiation monitor
183
-        else:
184
-            sUrl += "/rdata" # request data from the monitor
177
+        sUrl += "/rdata" # request data from the monitor
185 178
 
186 179
     try:
187 180
         conn = urllib2.urlopen(sUrl, timeout=_HTTP_REQUEST_TIMEOUT)
... ...
@@ -285,6 +278,9 @@ def writeOutputDataFile(dData):
285 278
         sData += '\"%s\":\"%s\",' % (key, dData[key])
286 279
     sData = sData[:-1] + '}]\n'
287 280
 
281
+    if verboseDebug:
282
+        print sData
283
+
288 284
     # Write the string to the output data file for use by html documents.
289 285
     try:
290 286
         fc = open(_OUTPUT_DATA_FILE, "w")