diff --git a/app/lib/consts.dart b/app/lib/consts.dart index 6ec583942c44e8a7a5138e8adeea09cda111c529..2ace10d1c41ba9e557550050bb7b2a7f540c2cfe 100644 --- a/app/lib/consts.dart +++ b/app/lib/consts.dart @@ -15,7 +15,7 @@ Uint8List selectedRelation = Uint8List(0); List<Measurement> selectedMarkerList = []; Measurement? selectedSubDiv; -LatLng mapCenter = LatLng(60.8000, 10.8471); +LatLng mapCenter = LatLng(60.8000, 10.8471); // NB may not be necessary DateTime ?lastUpdate; // Last time data was fetched from server List<String> lakeSearchOptions = []; bool internetConnection = true; diff --git a/server/__pycache__/consts.cpython-311.pyc b/server/__pycache__/consts.cpython-311.pyc index 64000a10b34e12ebb363886ebb405b756392406e..b77dc6c449ceb6b64e450ba47e925ab1b9b5a034 100644 Binary files a/server/__pycache__/consts.cpython-311.pyc and b/server/__pycache__/consts.cpython-311.pyc differ diff --git a/server/consts.py b/server/consts.py index eaa9638437bb88e4ab29d89ec609d63625e7697d..da41c583663051f30bcd6929ba92f389dd06084a 100644 --- a/server/consts.py +++ b/server/consts.py @@ -12,4 +12,5 @@ SSL_CERT_PATH = CERT_DIR + "testCert.crt" # File paths MAP_HANDLER_PATH = "server/map_handler/" LAKE_RELATIONS_PATH = MAP_HANDLER_PATH + "lake_relations/" +PLOT_PATH = "server/ModelFromNVE/output/plots/" diff --git a/server/map_handler/__pycache__/get_lake_relation.cpython-311.pyc b/server/map_handler/__pycache__/get_lake_relation.cpython-311.pyc index ef3d31476ac6b46bf3c3895ef031e3a381892b01..0246bf6ee4345972419667b0c7b475106842d065 100644 Binary files a/server/map_handler/__pycache__/get_lake_relation.cpython-311.pyc and b/server/map_handler/__pycache__/get_lake_relation.cpython-311.pyc differ diff --git a/server/map_handler/__pycache__/get_measurements.cpython-311.pyc b/server/map_handler/__pycache__/get_measurements.cpython-311.pyc index 7f315cbbb8a3ca4a4bcab0fec5b8380e792ff170..314075cb96602386e95eef9e467a519de7802523 100644 Binary files a/server/map_handler/__pycache__/get_measurements.cpython-311.pyc and b/server/map_handler/__pycache__/get_measurements.cpython-311.pyc differ diff --git a/server/map_handler/get_lake_relation.py b/server/map_handler/get_lake_relation.py index d24d32c86ef4849975dd61f277fdbac9d421cfc7..c6fb2f7f69cbf0f3c9d9e290e27c21ad1c666dd0 100644 --- a/server/map_handler/get_lake_relation.py +++ b/server/map_handler/get_lake_relation.py @@ -3,7 +3,6 @@ from server.consts import LAKE_RELATIONS_PATH # Writes contents of a lake json file to the response def get_divided_map(self, file_name): - try: # Extract contents from JSON file with open(LAKE_RELATIONS_PATH + file_name + "_div.json", "r") as file: diff --git a/server/map_handler/get_measurements.py b/server/map_handler/get_measurements.py index 21c5505a01b672f432b7fbc074454c5da9a20a32..bef629b738d93b1a7f3f6dbaa4281e6e860f62ce 100644 --- a/server/map_handler/get_measurements.py +++ b/server/map_handler/get_measurements.py @@ -85,54 +85,11 @@ def get_measurements(self, cursor, lake_name): 'Subdivisions': [sub_division], # Array of sub_division objects } - ########################### TEST DATA ########################################### - # Temporary test data - test_measurements = [] - subdiv_id = 17 - - for i in range(3, 10): - sub_divisions = [] - - for j in range(0, 30): - min_thickness = random.uniform(0, 10) - avg_thickness = random.uniform(0, 15) + min_thickness - - subdivision = { - 'SubdivID': subdiv_id, - 'GroupID': 1, - 'MinThickness': min_thickness, - 'AvgThickness': avg_thickness, - 'CenLatitude': 7.0, - 'CenLongitude': 8.0, - 'Accuracy': 1.0, - 'Color': calculateColor(avg_thickness), - 'IceStats': () - } - - sub_divisions.append(subdivision) - subdiv_id += 1 - - measurement = { - 'MeasurementID': i, - 'TimeMeasured': str(datetime.now()), - 'CenterLat': 10.0, - 'CenterLon': 8.0, - 'Sensor': { - 'SensorID': 1, - 'SensorType': "test data", - 'Active': True - }, - 'Subdivisions': sub_divisions - } - - test_measurements.append(measurement) - ########################### TEST DATA ########################################### - # NB remember to clos file after implementation # f.close() # Convert dictionary values to list of measurements - data = list(measurement_data.values()) + test_measurements + data = list(measurement_data.values()) if len(data) == 0: marker_data = json.dumps(['no measurements'])