From 050dd3608ce44144ace4910349648736e7870924 Mon Sep 17 00:00:00 2001 From: Sara <sarasdj@stud.ntnu.no> Date: Thu, 11 Apr 2024 12:13:24 +0200 Subject: [PATCH] update: remove test data --- app/lib/consts.dart | 2 +- server/__pycache__/consts.cpython-311.pyc | Bin 445 -> 498 bytes server/consts.py | 1 + .../get_lake_relation.cpython-311.pyc | Bin 1759 -> 1759 bytes .../get_measurements.cpython-311.pyc | Bin 5053 -> 4144 bytes server/map_handler/get_lake_relation.py | 1 - server/map_handler/get_measurements.py | 45 +----------------- 7 files changed, 3 insertions(+), 46 deletions(-) diff --git a/app/lib/consts.dart b/app/lib/consts.dart index 6ec58394..2ace10d1 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 GIT binary patch delta 121 zcmdnX{E3-&IWI340}ve8DxOw3kynz@Vxqb!M-+PsM=*mX=fs3mwJOEp)S|M~B7NWd zl++xzqWoOHFjxKj(vpJG68(al{E}jQKTVE_C!*MHaR&JKhfJ1b^x)zJ8p#O6#h#P% S8J+oV@aQ*if?yFhP!IrHCn1pl delta 72 zcmeywyqB4GIWI340}y;*7fth+$ScWcGEv=>C73~zV`54wv!5pW#P?B?Ll~X8cz}u+ Vfw<Uh@<K*u?h6dUKvV?M3jk~?5FP*k diff --git a/server/consts.py b/server/consts.py index eaa96384..da41c583 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 GIT binary patch delta 58 vcmcc5d!LtgIWI340}zC46HoKs$eY8$$h5hN#gj=!m{Ixz113=<1yl?Go3IRr delta 58 vcmcc5d!LtgIWI340}v!E6i*A>$eY8$$g;VL#gj=!gi-nf113=<1yl?Gn<5N{ 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 GIT binary patch delta 725 zcmdn1zCnR+IWI340}xEyE}kYYG?A~0X#vZ|E(0ck5?+un1k|uDV4u8^Rd{kV8~@~K zOnmjVJSBoKNd|@*o@I;-46A_{0#cZ>nLw-}u@YgZ5Rl3O+XLdKh@~^4>Zs+-!=bi@ zCq-b5_%fh*tHEZ1^w&D`=4B}}l!$>i5TL?P6kE$z0(Sz?5{VkV*$i`;P%UC)NRh1N ztzlTe1M-h3Ly8o-d=10o1Qs!g6zLQhR9hJtfZF(=!5}CX$&kWO%U8#j#{r?s8Os?e zm?Ig=8IeqvCC_vbZhn}@76^cBWM!z~T_6ZzF*BsdO<uvK%qYM44BG<c$*Z~Y8HFZG zb6ZZX=FVc|pZtuwMT#XQu_W;pcWz=)c4|>Pn8TP_3^H=^51ve6PauN>h>Q0CL$rb6 z15*;?<`Uj)Myan#3<4q-L{zSeXkQZ1z9^!5MMU=^zupyoz0HCG=8WR5rmhwYM=iMA z<(ZE$ISRW=F&~#=b(fzUFZfT&3uGWD_!WvgfMk&tj3}F2E;P&50LZ<?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Cyw~BUEhP7 z57SNlOp8BLr(Xy>qMQ7ib=n*PsaNzQuM0W+WX5!1T<0@KwfMw?*=BsI6`#`iv>Egy z113OF_nJ|_CJq_lfDsy3n@q07<o21I&J1tAyXC99>uw~O&K&WXFW=gI=kAr=D^31X zi$A5uQ+k~Ll~3vENj;G^o%T_rh`|F=Su^Av^_c*{=G*27pcAJLDdB*^J5ae6mD{(T zKYf7V_Br8@n>gSmn%rcIn{4{CEq``Dcd6;WwD&1>mWW)oUv`4WPR~r1e9T@9&YU2h zoN&x!wO{CeMy}#k<1d&O=MakcTesk@_Pg(ksn@WZ!+`IPh!4kbEZ(RV<TjJS(RmCw j`!Cn)<tkjgQJfa@+E4zo!4GT%I+{Kd?V5`b>^S3Jnx0+t diff --git a/server/map_handler/get_lake_relation.py b/server/map_handler/get_lake_relation.py index d24d32c8..c6fb2f7f 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 21c5505a..bef629b7 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']) -- GitLab