hub.py 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import sys
  2. import importlib
  3. sys.path.append('../sri-pysdk')
  4. methods = importlib.import_module(f"xlib")
  5. class Global(object):
  6. """
  7. """
  8. save_dir = r'C:\logs' # sri内网测试环境
  9. # save_dir = r'E:\logs' # 湛江现场环境(容量为512G)
  10. # --- 中间件服务器 --- for test
  11. emqx_MessageListenerC001 = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
  12. emqx_MessageListenerV001 = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
  13. # --- 中间件服务器 --- for 湛江项目现场 todo 需要实现实例化emqx | 只能是哪里用到哪里实例化
  14. emqx_Veh0533 = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
  15. emqx_Veh0534 = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
  16. emqx_Veh0535 = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
  17. emqx_Veh0537 = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
  18. emqx_Veh0538 = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
  19. aps = importlib.import_module(f"xpip.xapscheduler").APS(db_type='mongo',
  20. db_host='127.0.0.1',
  21. db_port=47017,
  22. username='admin', password='admin',
  23. database='bg', collection='LoopTask')
  24. # --- 业务数据数据库 ---
  25. mdb = importlib.import_module(f"xclient.xmongo").Client(host='127.0.0.1', port=47017, database='bg',
  26. username='admin', password='admin')
  27. # emqx = importlib.import_module(f"xclient.xmqtt").Client(host='10.10.10.73', port=41883)
  28. # aps = importlib.import_module(f"xpip.xapscheduler").APS(db_type='mongo',
  29. # db_host='10.10.10.73',
  30. # db_port=47017,
  31. # username='admin', password='admin',
  32. # database='bg', collection='LoopTask')