Commit 32d5d60ee71b95b4465fabb1440ba225ff04d94b

Authored by Etienne Pallier
1 parent 873ac998
Exists in dev

bugfix monitoring => now seems ok

simulators/telescope/telescopeSimulator.py 100644 → 100755
  1 +#!/usr/bin/env python3
  2 +
1 3 import os
2 4 import sys
3 5 import time
... ...
src/core/pyros_django/devices/Device.py
... ... @@ -21,7 +21,7 @@ class DeviceController():
21 21 logger = L.setupLogger("DeviceLogger", "Devices")
22 22 name = ""
23 23 #config_file = "../config/socket_config.ini"
24   - config_file = "config/socket_config.ini"
  24 + config_file = "../../../../config/socket_config.ini"
25 25 config = None
26 26 connected = False
27 27 sock = None
... ...
src/core/pyros_django/monitoring/TelescopeMonitoring.py
... ... @@ -7,8 +7,8 @@ import os
7 7 import sys
8 8  
9 9 '''
10   - THIS IS A PROTOTYPE ! Its does not use the RemoteControlClass which convert the command to specific grammar,
11   - it need to be implemented
  10 + THIS IS A PROTOTYPE ! It does not use the RemoteControlClass which convert the command to specific grammar,
  11 + it needs to be implemented
12 12  
13 13  
14 14 Agent which turn in an infinite loop and watch the database looking for requests to execute, it will be also used for
... ...
src/core/pyros_django/monitoring/plc_checker.py
... ... @@ -54,7 +54,8 @@ class PlcChecker(object):
54 54 _struct["origin"] = self.origin
55 55 _struct["sensors"] = self.sensors_table
56 56 _struct["selected_sensors"] = self.sensors_weather
57   - _file = open("./src/monitoring/plc_config.json" , 'w')
  57 + #_file = open("./src/monitoring/plc_config.json" , 'w')
  58 + _file = open("./plc_config.json" , 'w')
58 59 _file.write(json.dumps(_struct))
59 60 _file.close()
60 61 logger.info("Saved : plc_config.json")
... ...
src/core/pyros_django/monitoring/start_agent_telescope_monitoring.py 100644 → 100755
... ... @@ -5,11 +5,16 @@ import sys
5 5  
6 6 # DJANGO setup
7 7 #sys.path.append('/PROJECTS/GFT/SOFT/PYROS_SOFT/PYROS201802')
  8 +# In order to find all pyros django modules (dashboard, ...) :
8 9 sys.path.append('..')
  10 +#sys.path.append("../..")
  11 +#sys.path.append("../../..")
  12 +# In order to find the src/ folder :
  13 +sys.path.append("../../../..")
9 14 # Go into src/
10   -os.chdir('..')
  15 +#os.chdir('../')
11 16 #print("Current directory : " + str(os.getcwd()))
12   -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "src.pyros.settings")
  17 +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "src.core.pyros_django.pyros.settings")
13 18 #os.environ['SECRET_KEY'] = 'abc'
14 19 #os.environ['ENVIRONMENT'] = 'production'
15 20 import django
... ...
src/core/pyros_django/pyros/settings.py
... ... @@ -162,6 +162,16 @@ if MYSQL:
162 162 'NAME': 'pyros',
163 163 'USER': 'pyros',
164 164 'PASSWORD': 'DjangoPyros',
  165 + '''
  166 + (See https://docs.djangoproject.com/fr/2.1/topics/testing/overview/#the-test-database)
  167 + Optional, but this allows to remember the default django test database name
  168 + (and even to rename it if needed).
  169 + For this DB, you need to do this in mysql :
  170 + GRANT ALL PRIVILEGES ON test_pyros.* TO 'pyros_user'@'localhost';
  171 + '''
  172 + 'TEST': {
  173 + 'NAME': 'test_pyros',
  174 + },
165 175 }
166 176 }
167 177  
... ...