From a90cebe3d9c1db4bb5578ddbe8668cc9358cf786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20=C3=87olako=C4=9Flu?= Date: Thu, 2 May 2019 11:22:10 +0300 Subject: [PATCH] asdasd asdasdasd --- .../gq/yigit/mycity/DenunciationFragment.java | 20 +- bus_stop/qr_reader/main.py | 57 + .../interface/UserData/denunciation_map.html | 5 + .../interface/UserData/denunciation_view.html | 50 + client_side/interface/UserData/ratings.html | 33 +- .../interface/UserData/voting_results.html | 10 +- server_side/api/app.py | 3 +- server_side/api/modules/data.json | 208390 --------------- .../api/modules/databases/denunciations.json | 52 + server_side/api/modules/denunciation.py | 89 +- server_side/api/modules/timely.json | 62568 ----- server_side/api/modules/user_info.py | 23 +- traffic_analyzer/3bug90h684ie.jpg | Bin 0 -> 47297 bytes traffic_analyzer/5y0qqefgf8pm.jpg | Bin 0 -> 56532 bytes traffic_analyzer/6xj0sv03e1rp.jpg | Bin 0 -> 49938 bytes traffic_analyzer/7u38saf39803.jpg | Bin 0 -> 49605 bytes traffic_analyzer/8giefz6t7blg.jpg | Bin 0 -> 57404 bytes traffic_analyzer/9hbgjp8pr9ml.jpg | Bin 0 -> 54685 bytes traffic_analyzer/bhcabz3ylbps.jpg | Bin 0 -> 53056 bytes traffic_analyzer/bka4e0uyj819.jpg | Bin 0 -> 54883 bytes traffic_analyzer/f6tjfpenclkn.jpg | Bin 0 -> 53963 bytes traffic_analyzer/f8tjw066xd8k.jpg | Bin 0 -> 57123 bytes traffic_analyzer/hcw6jsi4snvy.jpg | Bin 0 -> 54819 bytes traffic_analyzer/iyh7h75p89qb.jpg | Bin 0 -> 58022 bytes traffic_analyzer/jmv0qy8gh2hu.jpg | Bin 0 -> 54884 bytes traffic_analyzer/lynlxwlxzovj.jpg | Bin 0 -> 56652 bytes traffic_analyzer/q7xf4ijepqh0.jpg | Bin 0 -> 56641 bytes traffic_analyzer/snpw5fj1pm5y.jpg | Bin 0 -> 57207 bytes traffic_analyzer/traffic.py | 38 + traffic_analyzer/tsrrxuybcpd8.jpg | Bin 0 -> 54892 bytes traffic_analyzer/wau45wn0y7vr.jpg | Bin 0 -> 57216 bytes 31 files changed, 310 insertions(+), 271028 deletions(-) create mode 100644 bus_stop/qr_reader/main.py create mode 100644 client_side/interface/UserData/denunciation_view.html delete mode 100644 server_side/api/modules/data.json delete mode 100644 server_side/api/modules/timely.json create mode 100644 traffic_analyzer/3bug90h684ie.jpg create mode 100644 traffic_analyzer/5y0qqefgf8pm.jpg create mode 100644 traffic_analyzer/6xj0sv03e1rp.jpg create mode 100644 traffic_analyzer/7u38saf39803.jpg create mode 100644 traffic_analyzer/8giefz6t7blg.jpg create mode 100644 traffic_analyzer/9hbgjp8pr9ml.jpg create mode 100644 traffic_analyzer/bhcabz3ylbps.jpg create mode 100644 traffic_analyzer/bka4e0uyj819.jpg create mode 100644 traffic_analyzer/f6tjfpenclkn.jpg create mode 100644 traffic_analyzer/f8tjw066xd8k.jpg create mode 100644 traffic_analyzer/hcw6jsi4snvy.jpg create mode 100644 traffic_analyzer/iyh7h75p89qb.jpg create mode 100644 traffic_analyzer/jmv0qy8gh2hu.jpg create mode 100644 traffic_analyzer/lynlxwlxzovj.jpg create mode 100644 traffic_analyzer/q7xf4ijepqh0.jpg create mode 100644 traffic_analyzer/snpw5fj1pm5y.jpg create mode 100644 traffic_analyzer/traffic.py create mode 100644 traffic_analyzer/tsrrxuybcpd8.jpg create mode 100644 traffic_analyzer/wau45wn0y7vr.jpg diff --git a/MyCity/app/src/main/java/gq/yigit/mycity/DenunciationFragment.java b/MyCity/app/src/main/java/gq/yigit/mycity/DenunciationFragment.java index 1830869..1947d8c 100644 --- a/MyCity/app/src/main/java/gq/yigit/mycity/DenunciationFragment.java +++ b/MyCity/app/src/main/java/gq/yigit/mycity/DenunciationFragment.java @@ -101,11 +101,16 @@ public class DenunciationFragment extends Fragment implements WebRequest.respons HashMap args = new HashMap<>(); try { args.put("id", MainActivity.userData.getString("id")); - }catch (JSONException e){} - args.put("emergency",emergency); + }catch (JSONException e) {} + String latitude = "39.9127897"; + String longitude = "32.8073577"; + args.put("latitude", latitude); + args.put("longitude", longitude); - args.put("note",note.getText().toString()); - args.put("accepted","false"); + args.put("emergency", emergency); + + args.put("note", note.getText().toString()); + args.put("accepted", "false"); if(img != null) { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); @@ -228,7 +233,12 @@ public class DenunciationFragment extends Fragment implements WebRequest.respons try { args.put("id", MainActivity.userData.getString("id")); }catch (JSONException e){} - args.put("emergency",emergency); + + String latitude = "39.9127897"; + String longitude = "32.8073577"; + args.put("latitude", latitude); + args.put("longitude", longitude); + args.put("emergency", emergency); args.put("note",note.getText().toString()); if(img != null) { diff --git a/bus_stop/qr_reader/main.py b/bus_stop/qr_reader/main.py new file mode 100644 index 0000000..335c8d7 --- /dev/null +++ b/bus_stop/qr_reader/main.py @@ -0,0 +1,57 @@ +from imutils.video import VideoStream +from pyzbar import pyzbar +import requests +import imutils +import cv2 + +vs = VideoStream().start() +dates = [] +reps = 0 +barcodes = None +prevcode = None + + +def main(host): + global vs + global dates + global reps + global barcodes + global prevcode + while True: + try: + while (barcodes == None or barcodes == []): + frame = vs.read() + frame = imutils.resize(frame, width=400) + barcodes = pyzbar.decode(frame) + cv2.imshow("Image", frame) + if cv2.waitKey(1) & 0xFF == ord('q'): + break + barcodes = pyzbar.decode(frame) + # loop over the detected barcodes + for barcode in barcodes: + (x, y, w, h) = barcode.rect + cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 0, 255), 2) + + barcodeData = barcode.data.decode("utf-8") + barcodeType = barcode.type + + if (barcodeData != prevcode): + text = "{} ({})".format(barcodeData, barcodeType) + cv2.putText(frame, text, (x, y - 10), cv2.FONT_HERSHEY_SIMPLEX, + 0.5, (0, 0, 255), 2) + + print("[INFO] Found {} barcode: {}".format(barcodeType, barcodeData)) + requests.post('https://' + host + '/reduce', data={'id': barcodeData, 'reduce': 2.5}) + reps += 1 + + prevcode = barcodeData + barcodes = None + cv2.imshow("Image", frame) + if cv2.waitKey(1) & 0xFF == ord('q'): + break + except KeyboardInterrupt: + break +main(input('Host << ')) +print("[INFO] cleaning up...") +cv2.destroyAllWindows() +vs.stop() \ No newline at end of file diff --git a/client_side/interface/UserData/denunciation_map.html b/client_side/interface/UserData/denunciation_map.html index 237504c..b00b7d1 100644 --- a/client_side/interface/UserData/denunciation_map.html +++ b/client_side/interface/UserData/denunciation_map.html @@ -48,6 +48,11 @@ label: element["priority"].toString(), title: element["info"] }); + + marker.addListener('click', function() { + window.open(window.location.href.replace("denunciation_map", "denunciation_view") + "&id=" + element["id"]); + + }); markers.push(marker); }); } diff --git a/client_side/interface/UserData/denunciation_view.html b/client_side/interface/UserData/denunciation_view.html new file mode 100644 index 0000000..e512386 --- /dev/null +++ b/client_side/interface/UserData/denunciation_view.html @@ -0,0 +1,50 @@ + + + + + Denunction Info + + + + +Denunciated by

+Information:
+

+Emergency Type:

+Priority:
+ + + + + diff --git a/client_side/interface/UserData/ratings.html b/client_side/interface/UserData/ratings.html index 3f200c7..e7e8412 100644 --- a/client_side/interface/UserData/ratings.html +++ b/client_side/interface/UserData/ratings.html @@ -4,8 +4,16 @@ Ratings + + +
+

Ratings


+
+
+
+
-
\ No newline at end of file diff --git a/client_side/interface/UserData/voting_results.html b/client_side/interface/UserData/voting_results.html index c0b6b1f..4c5fffd 100644 --- a/client_side/interface/UserData/voting_results.html +++ b/client_side/interface/UserData/voting_results.html @@ -5,11 +5,15 @@ Voting Results + -
+
+
+
+