From 5b734f314c2481789a146581455ec5969956d233 Mon Sep 17 00:00:00 2001 From: April Date: Fri, 21 Oct 2022 22:01:49 -0700 Subject: [PATCH] Function to return tide stations in the MPC --- Util/MachineProductCfg.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Util/MachineProductCfg.py b/Util/MachineProductCfg.py index d3547ea..83e2dc8 100644 --- a/Util/MachineProductCfg.py +++ b/Util/MachineProductCfg.py @@ -29,6 +29,12 @@ def getPrimaryLocations(): return locationIds +def getTideStations(): + """ Returns all of the tide stations present in the MachineProductCfg """ + stations = [] + for i in data['Config']['ConfigDef']['ConfigItems']['ConfigItem']: + if "TideStation" in i['@key'] and i['@value'] != "": + stations.append(i['@value'].split("_")[2]) def getAirportCodes(): """ Returns all of the airport identifiers present in the MachineProductCfg """