From 04f97f0bad4b6026b62e5cd6ff8dbae51c326943 Mon Sep 17 00:00:00 2001
From: Sara Djordjevic <sarasdj@stud.ntnu.no>
Date: Mon, 5 Feb 2024 13:56:14 +0100
Subject: [PATCH] add: structs.py

---
 .gitignore                             |  3 ++-
 .idea/libraries/Dart_Packages.xml      | 12 ++----------
 app/lib/main.dart                      |  2 +-
 server/sturcts.py                      | 25 +++++++++++++++++++++++++
 server/{private.key => test_data.json} |  0
 5 files changed, 30 insertions(+), 12 deletions(-)
 create mode 100644 server/sturcts.py
 rename server/{private.key => test_data.json} (100%)

diff --git a/.gitignore b/.gitignore
index 95089281..0678d750 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
-# Auto-generated VScode
+# Auto-generated by VScode
 ./vs
 
+# Auto-generated by Android Studio
 ./idea
\ No newline at end of file
diff --git a/.idea/libraries/Dart_Packages.xml b/.idea/libraries/Dart_Packages.xml
index b55c7cc2..3c2e5fe0 100644
--- a/.idea/libraries/Dart_Packages.xml
+++ b/.idea/libraries/Dart_Packages.xml
@@ -37,13 +37,6 @@
             </list>
           </value>
         </entry>
-        <entry key="cupertino_icons">
-          <value>
-            <list>
-              <option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/cupertino_icons-1.0.6/lib" />
-            </list>
-          </value>
-        </entry>
         <entry key="fake_async">
           <value>
             <list>
@@ -75,7 +68,7 @@
         <entry key="http">
           <value>
             <list>
-              <option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/http-1.2.0/lib" />
+              <option value="$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/http-0.13.6/lib" />
             </list>
           </value>
         </entry>
@@ -199,10 +192,9 @@
       <root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/characters-1.3.0/lib" />
       <root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/clock-1.1.1/lib" />
       <root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/collection-1.18.0/lib" />
-      <root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/cupertino_icons-1.0.6/lib" />
       <root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/fake_async-1.3.1/lib" />
       <root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/flutter_lints-2.0.3/lib" />
-      <root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/http-1.2.0/lib" />
+      <root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/http-0.13.6/lib" />
       <root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/http_parser-4.0.2/lib" />
       <root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/lints-2.1.1/lib" />
       <root url="file://$USER_HOME$/AppData/Local/Pub/Cache/hosted/pub.dev/matcher-0.12.16/lib" />
diff --git a/app/lib/main.dart b/app/lib/main.dart
index 4c06d23c..74415606 100644
--- a/app/lib/main.dart
+++ b/app/lib/main.dart
@@ -44,7 +44,7 @@ class DefaultPage extends StatelessWidget {
                 
                 print('Response from server: ${response.body}');
               },
-              child: const Text('Connected to server'),
+              child: const Text('Some text'),
             ),
           ],
         ),
diff --git a/server/sturcts.py b/server/sturcts.py
new file mode 100644
index 00000000..1bc01706
--- /dev/null
+++ b/server/sturcts.py
@@ -0,0 +1,25 @@
+# Geo data relating to a single measurement point using dictionary
+point_template = {
+    "longitude": 0.0,
+    "latitude": 0.0,
+    "precipitation": None,  
+    "thickness": 0.0,
+    "max_weight": 0.0,
+    "safety_level": 3.0,
+    "accuracy": 9
+}
+
+# Geo data relating to a single measurement point using class
+class DataPoint:
+    def __init__(self, longitude, latitude, precipitation, thickness, max_weight, safety_level, accuracy):
+        self.longitude = longitude
+        self.latitude = latitude
+        self.precipitation = precipitation
+        self.thickness = thickness
+        self.max_weight = max_weight
+        self.safety_level = safety_level
+        self.accuracy = accuracy
+
+# Test instance
+test_instance = DataPoint(longitude=1.5, latitude=2.5, precipitation=10.0, thickness = 10.0, safety_level= 5, max_weight= 80)
+
diff --git a/server/private.key b/server/test_data.json
similarity index 100%
rename from server/private.key
rename to server/test_data.json
-- 
GitLab