Browse Source

Auto stash before merge of "efe" and "origin/yigit"

yigit
Yiğit Çolakoğlu 6 years ago
parent
commit
e877fe73d2
46 changed files with 128 additions and 29 deletions
  1. BIN
      server_side/api/modules/__pycache__/navigation.cpython-37.pyc
  2. BIN
      server_side/api/modules/__pycache__/smart_park.cpython-37.pyc
  3. +0
    -0
      server_side/apia/__init__.py
  4. +12
    -11
      server_side/apia/app.py
  5. +0
    -0
      server_side/apia/encryption/mycity-decrypted.key
  6. +0
    -0
      server_side/apia/encryption/mycity.crt
  7. +0
    -0
      server_side/apia/encryption/mycity.csr
  8. +0
    -0
      server_side/apia/encryption/mycity.key
  9. +0
    -0
      server_side/apia/encryption/mycity.pem
  10. +0
    -0
      server_side/apia/images/9vard12ty0ad2yvwp3q53rsf3h43r2vq.png
  11. +0
    -0
      server_side/apia/images/9vard12ty0ad2yvwp3q53rsf3h43r2vq_qr.png
  12. +0
    -0
      server_side/apia/images/muhtarlik.jpg
  13. +0
    -0
      server_side/apia/images/park.jpg
  14. +0
    -0
      server_side/apia/images/voting.jpg
  15. +0
    -0
      server_side/apia/modules/SpotSelector.py
  16. +0
    -0
      server_side/apia/modules/__init__.py
  17. +0
    -0
      server_side/apia/modules/announcements.py
  18. +0
    -0
      server_side/apia/modules/bus_stops.py
  19. +0
    -0
      server_side/apia/modules/databases/announcements.json
  20. +0
    -0
      server_side/apia/modules/databases/bus.json
  21. +0
    -0
      server_side/apia/modules/databases/bus_locations.json
  22. +12
    -0
      server_side/apia/modules/databases/denunciations.json
  23. +0
    -0
      server_side/apia/modules/databases/locations.json
  24. +0
    -0
      server_side/apia/modules/databases/park_data.json
  25. +2
    -2
      server_side/apia/modules/databases/ratings.json
  26. +0
    -0
      server_side/apia/modules/databases/users.json
  27. +0
    -0
      server_side/apia/modules/databases/votings.json
  28. +2
    -2
      server_side/apia/modules/denunciation.py
  29. +0
    -0
      server_side/apia/modules/image5.jpg
  30. +0
    -0
      server_side/apia/modules/lot.jpg
  31. +0
    -0
      server_side/apia/modules/navigation.py
  32. +2
    -3
      server_side/apia/modules/rating_system.py
  33. +0
    -0
      server_side/apia/modules/smart_park.py
  34. +4
    -5
      server_side/apia/modules/user_info.py
  35. +2
    -3
      server_side/apia/modules/utility.py
  36. +0
    -0
      server_side/apia/modules/utils.py
  37. +2
    -2
      server_side/apia/modules/voting_system.py
  38. +0
    -0
      server_side/apia/requirements.txt
  39. BIN
      traffic_analyzer/CPUThermometerLib.dll
  40. BIN
      traffic_analyzer/OpenHardwareMonitorLib.dll
  41. BIN
      traffic_analyzer/amb_1.mp4
  42. BIN
      traffic_analyzer/amb_2.mp4
  43. BIN
      traffic_analyzer/frame_data.pkl
  44. +11
    -0
      traffic_analyzer/saver.py
  45. +6
    -1
      traffic_analyzer/sender.py
  46. +73
    -0
      traffic_analyzer/windowsTemp.py

BIN
server_side/api/modules/__pycache__/navigation.cpython-37.pyc View File


BIN
server_side/api/modules/__pycache__/smart_park.cpython-37.pyc View File


server_side/api/modules/__init__.py → server_side/apia/__init__.py View File


server_side/api/app.py → server_side/apia/app.py View File


server_side/api/encryption/mycity-decrypted.key → server_side/apia/encryption/mycity-decrypted.key View File


server_side/api/encryption/mycity.crt → server_side/apia/encryption/mycity.crt View File


server_side/api/encryption/mycity.csr → server_side/apia/encryption/mycity.csr View File


server_side/api/encryption/mycity.key → server_side/apia/encryption/mycity.key View File


server_side/api/encryption/mycity.pem → server_side/apia/encryption/mycity.pem View File


server_side/api/images/9vard12ty0ad2yvwp3q53rsf3h43r2vq.png → server_side/apia/images/9vard12ty0ad2yvwp3q53rsf3h43r2vq.png View File


server_side/api/images/9vard12ty0ad2yvwp3q53rsf3h43r2vq_qr.png → server_side/apia/images/9vard12ty0ad2yvwp3q53rsf3h43r2vq_qr.png View File


server_side/api/images/muhtarlik.jpg → server_side/apia/images/muhtarlik.jpg View File


server_side/api/images/park.jpg → server_side/apia/images/park.jpg View File


server_side/api/images/voting.jpg → server_side/apia/images/voting.jpg View File


server_side/api/modules/SpotSelector.py → server_side/apia/modules/SpotSelector.py View File


+ 0
- 0
server_side/apia/modules/__init__.py View File


server_side/api/modules/announcements.py → server_side/apia/modules/announcements.py View File


server_side/api/modules/bus_stops.py → server_side/apia/modules/bus_stops.py View File


server_side/api/modules/databases/announcements.json → server_side/apia/modules/databases/announcements.json View File


server_side/api/modules/databases/bus.json → server_side/apia/modules/databases/bus.json View File


server_side/api/modules/databases/bus_locations.json → server_side/apia/modules/databases/bus_locations.json View File


server_side/apia/modules/databases/denunciations.json
File diff suppressed because it is too large
View File


server_side/api/modules/databases/locations.json → server_side/apia/modules/databases/locations.json View File


server_side/api/modules/databases/park_data.json → server_side/apia/modules/databases/park_data.json View File


server_side/api/modules/databases/ratings.json → server_side/apia/modules/databases/ratings.json View File


server_side/api/modules/databases/users.json → server_side/apia/modules/databases/users.json View File


server_side/api/modules/databases/votings.json → server_side/apia/modules/databases/votings.json View File


server_side/api/modules/denunciation.py → server_side/apia/modules/denunciation.py View File


server_side/api/modules/image5.jpg → server_side/apia/modules/image5.jpg View File


server_side/api/modules/lot.jpg → server_side/apia/modules/lot.jpg View File


server_side/api/modules/navigation.py → server_side/apia/modules/navigation.py View File


server_side/api/modules/rating_system.py → server_side/apia/modules/rating_system.py View File


server_side/api/modules/smart_park.py → server_side/apia/modules/smart_park.py View File


server_side/api/modules/user_info.py → server_side/apia/modules/user_info.py View File


server_side/api/modules/utility.py → server_side/apia/modules/utility.py View File


server_side/api/modules/utils.py → server_side/apia/modules/utils.py View File


server_side/api/modules/voting_system.py → server_side/apia/modules/voting_system.py View File


server_side/api/requirements.txt → server_side/apia/requirements.txt View File


BIN
traffic_analyzer/CPUThermometerLib.dll View File


BIN
traffic_analyzer/OpenHardwareMonitorLib.dll View File


BIN
traffic_analyzer/amb_1.mp4 View File


BIN
traffic_analyzer/amb_2.mp4 View File


BIN
traffic_analyzer/frame_data.pkl View File


+ 11
- 0
traffic_analyzer/saver.py View File

@ -0,0 +1,11 @@
import os
import cv2
cap = cv2.VideoCapture(0)
frame_width = int(cap.get(3))
frame_height = int(cap.get(4))
while True:
ret, image = cap.read()

+ 6
- 1
traffic_analyzer/sender.py View File

@ -5,8 +5,13 @@ import base64
from PIL import Image
from io import BytesIO
import psutil
<<<<<<< Updated upstream
import multiprocessing
cam = cv2.VideoCapture(0)
=======
cam = cv2.VideoCapture(1)
>>>>>>> Stashed changes
def open_switch():
@ -72,7 +77,7 @@ while True:
if socket_switch:
try:
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect(('127.0.0.1', 8485))
client_socket.connect(('10.10.26.163', 8485))
connection = client_socket.makefile('wb')
socket_switch = False
except:


+ 73
- 0
traffic_analyzer/windowsTemp.py View File

@ -0,0 +1,73 @@
import clr #package pythonnet, not clr
import wmi
import time
openhardwaremonitor_hwtypes = ['Mainboard','SuperIO','CPU','RAM','GpuNvidia','GpuAti','TBalancer','Heatmaster','HDD']
cputhermometer_hwtypes = ['Mainboard','SuperIO','CPU','GpuNvidia','GpuAti','TBalancer','Heatmaster','HDD']
openhardwaremonitor_sensortypes = ['Voltage','Clock','Temperature','Load','Fan','Flow','Control','Level','Factor','Power','Data','SmallData']
cputhermometer_sensortypes = ['Voltage','Clock','Temperature','Load','Fan','Flow','Control','Level']
def initialize_openhardwaremonitor():
file = 'OpenHardwareMonitorLib'
clr.AddReference(file)
from OpenHardwareMonitor import Hardware
handle = Hardware.Computer()
handle.MainboardEnabled = True
handle.CPUEnabled = True
handle.RAMEnabled = True
handle.GPUEnabled = True
handle.HDDEnabled = True
handle.Open()
return handle
def initialize_cputhermometer():
file = r'C:\Users\Tednokent01\Downloads\MyCity\traffic_analyzer\CPUThermometerLib'
clr.FindAssembly(file)
clr.AddReference(file)
from CPUThermometer import Hardware
handle = Hardware.Computer()
handle.CPUEnabled = True
handle.Open()
return handle
def fetch_stats(handle):
for i in handle.Hardware:
i.Update()
for sensor in i.Sensors:
parse_sensor(sensor)
for j in i.SubHardware:
j.Update()
for subsensor in j.Sensors:
parse_sensor(subsensor)
def parse_sensor(sensor):
if sensor.Value is not None:
if type(sensor).__module__ == 'CPUThermometer.Hardware':
sensortypes = cputhermometer_sensortypes
hardwaretypes = cputhermometer_hwtypes
elif type(sensor).__module__ == 'OpenHardwareMonitor.Hardware':
sensortypes = openhardwaremonitor_sensortypes
hardwaretypes = openhardwaremonitor_hwtypes
else:
return
if sensor.SensorType == sensortypes.index('Temperature'):
print(u"%s %s Temperature Sensor #%i %s - %s\u00B0C" % (hardwaretypes[sensor.Hardware.HardwareType], sensor.Hardware.Name, sensor.Index, sensor.Name, sensor.Value))
if __name__ == "__main__":
print("OpenHardwareMonitor:")
start = time.time()
#HardwareHandle = initialize_openhardwaremonitor()
#print(time.time() - start)
#start = time.time()
#fetch_stats(HardwareHandle)
print(time.time() - start)
print("\nCPUMonitor:")
CPUHandle = initialize_cputhermometer()
fetch_stats(CPUHandle)

Loading…
Cancel
Save