Skip to content

Commit 7f5a3a5

Browse files
committed
Set LocationInfo properly for GADRAS 19.5.x.
1 parent c2756bf commit 7f5a3a5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

riid/gadras/api.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
with open(GADRAS_API_SCHEMA_PATH, "r") as fin:
4343
GADRAS_API_SCHEMA = json.load(fin)
4444

45-
GADRAS_API_SEEMINGLY_AVAILABLE = os.path.exists(GADRAS_API_CONFIG_FILE_PATH)
45+
GADRAS_API_SEEMINGLY_AVAILABLE = os.path.exists(GADRAS_ASSEMBLY_PATH)
4646
IS_GADRAS19 = False
4747

4848
if sys.platform == "win32" and GADRAS_API_SEEMINGLY_AVAILABLE:
@@ -293,11 +293,11 @@ def get_gadras_api(instance_num=1, initialize_transport=True):
293293
GADRAS_API_CONFIG_FILE_PATH,
294294
GADRAS_INSTALL_PATH
295295
)
296-
api_Settings_loaded = Configs.loadApiSettings(
296+
api_settings_loaded = Configs.loadApiSettings(
297297
GADRAS_API_CONFIG_FILE_PATH,
298298
createNonExistantDirectories=True
299299
)
300-
if not api_Settings_loaded:
300+
if not api_settings_loaded:
301301
raise RuntimeError("Failed to load API settings.")
302302

303303
return GadrasAPIWrapper(
@@ -340,7 +340,8 @@ def get_inject_setup(gadras_api, output_path, title, record_num, source,
340340
loc_info.Longitude = detector_longitude_deg
341341
loc_info.Overburden = detector_overburden
342342

343-
if IS_GADRAS19:
343+
update_background_location_op = getattr(setup, "UpdateBackgroundLocation", None)
344+
if callable(update_background_location_op):
344345
setup.UpdateBackgroundLocation(loc_info)
345346
else:
346347
setup.LocationInfo = loc_info

0 commit comments

Comments
 (0)