changes working so far
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from MeterPublish import MeterPublish
|
||||
from RelaisSubscribe import RelaisSubscribe
|
||||
from FromDevices import FromDevices
|
||||
from ToDevices import ToDevices
|
||||
from ModbusBase import ModbusHandler
|
||||
from loguru import logger
|
||||
from config import Config
|
||||
@@ -22,17 +22,17 @@ def exceptHook(args):
|
||||
|
||||
logger.info("pv controller starting")
|
||||
|
||||
config = Config()
|
||||
config = Config.load_from_file()
|
||||
|
||||
modbusHandler = ModbusHandler(config)
|
||||
|
||||
relaisSubscribeThread = RelaisSubscribe(config, modbusHandler)
|
||||
relaisSubscribeThread.start()
|
||||
logger.info("relaisSubscribe started")
|
||||
# toDevicesThread = ToDevices(config, modbusHandler)
|
||||
# toDevicesThread.start()
|
||||
# logger.info("toDevices started")
|
||||
|
||||
meterPublishThread = MeterPublish(config, modbusHandler)
|
||||
meterPublishThread.start()
|
||||
logger.info("meterPublishThread started")
|
||||
fromDevicesThread = FromDevices(config, modbusHandler)
|
||||
fromDevicesThread.start()
|
||||
logger.info("fromDevices started")
|
||||
|
||||
threading.excepthook = exceptHook
|
||||
logger.info("Threading excepthook set")
|
||||
@@ -43,13 +43,12 @@ logger.info("pv controller is running")
|
||||
deathBell.wait()
|
||||
logger.error("pv controller is dying")
|
||||
|
||||
relaisSubscribeThread.stop()
|
||||
meterPublishThread.stop()
|
||||
# toDevicesThread.stop()
|
||||
fromDevicesThread.stop()
|
||||
|
||||
relaisSubscribeThread.join()
|
||||
logger.error("relaisSubscribe joined")
|
||||
|
||||
meterPublishThread.join()
|
||||
logger.error("meterPublishThread joined")
|
||||
# toDevicesThread.join()
|
||||
# logger.error("toDevices joined")
|
||||
fromDevicesThread.join()
|
||||
logger.error("fromDevices joined")
|
||||
|
||||
logger.error("pv controller is terminated")
|
||||
|
||||
Reference in New Issue
Block a user