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 + -
+
+
+
+