Blame view

simulators/plc/run_meteo.py 425 Bytes
8a42ace9   Patrick Maeght   meteo_20180917.log
1
2


d18e437e   Patrick Maeght   New json in
3
import json, os
8a42ace9   Patrick Maeght   meteo_20180917.log
4
5
from simulators.plc.meteo_worker import WorkerState, WorkerThread

d18e437e   Patrick Maeght   New json in
6
7
8
9
10
print(os.path.abspath("."))
# Load PLC status in colibri-new-fixed-2.json
colibri_json = open("colibri-new-fixed-2.json")
colibri_struct = json.load(colibri_json)
plc_status = colibri_struct["statuses"][1]["entities"][0]
8a42ace9   Patrick Maeght   meteo_20180917.log
11
12
13


my_state = WorkerState()
d18e437e   Patrick Maeght   New json in
14
my_worker = WorkerThread(my_state, plc_status)
8a42ace9   Patrick Maeght   meteo_20180917.log
15
16
17

my_worker.start()
my_state.status = 'init'