Skip to content
Snippets Groups Projects
Commit 050dd360 authored by Sara Savanovic Djordjevic's avatar Sara Savanovic Djordjevic
Browse files

update: remove test data

parent 300d19ae
No related branches found
No related tags found
1 merge request!12Clhp map
......@@ -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;
......
No preview for this file type
......@@ -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/"
No preview for this file type
No preview for this file type
......@@ -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:
......
......@@ -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'])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment