-
Notifications
You must be signed in to change notification settings - Fork 0
/
control_center.py
executable file
·40 lines (35 loc) · 1.51 KB
/
control_center.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python
#Manages Sensor Inputs
#Author: Kevin Murphy
#Date : 18 - Oct - 14
#Import infrastructure modules
from sensor_factory import SensorFactory
from sensor_manager import SensorManager
from database_manager import DatabaseManager
from api_manager import APIManager
from configuration_manager import ConfigurationManager
from alert_manager import AlertManager
from system_details_manager import SystemDetailsManager
from wifi_direct_manager import WifiDirectManager
##---TODO
#March
#Constants
DEBUG = True
def main():
databaseManager = DatabaseManager()
alertManager = AlertManager()
sensorFactory = SensorFactory(alertManager=alertManager)
sensorManager = SensorManager(sensorFactory.getSensors(), databaseManager)
apiManager = APIManager(sensorManager=sensorManager)
systemDetailsManager = SystemDetailsManager(databaseManager=databaseManager)
wifiDirectManager = WifiDirectManager(sensorManager=sensorManager, databaseManager=databaseManager)
configurationManager = ConfigurationManager({apiManager, databaseManager, sensorManager,
alertManager, systemDetailsManager, wifiDirectManager})
#configurationManager.writeoutConfiguration()
#Api and WifiDirectManager both need to update configuration
apiManager.setConfigManager(configurationManager)
wifiDirectManager.setConfigManager(configurationManager)
try:
main()
except KeyboardInterrupt, SystemExit:
print "KeyboardInterrupted..."