hub.py 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import sys
  2. import importlib
  3. sys.path.append('../sri-pysdk')
  4. methods = importlib.import_module(f"xlib")
  5. class Global(object):
  6. # todo 需要实现实例化emqx
  7. # --- 中间件服务器 --- for test
  8. emqx_MessageListenerC001 = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
  9. emqx_MessageListenerV001 = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
  10. # --- 中间件服务器 --- for 湛江项目现场
  11. emqx_Veh0533 = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
  12. emqx_Veh0534 = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
  13. emqx_Veh0535 = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
  14. emqx_Veh0537 = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
  15. emqx_Veh0538 = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
  16. aps = importlib.import_module(f"xpip.xapscheduler").APS(db_type='mongo',
  17. db_host='127.0.0.1',
  18. db_port=47017,
  19. username='admin', password='admin',
  20. database='bg', collection='LoopTask')
  21. # --- 业务数据数据库 ---
  22. mdb = importlib.import_module(f"xclient.xmongo").Client(host='127.0.0.1', port=47017, database='bg',
  23. username='admin', password='admin')
  24. # emqx = importlib.import_module(f"xclient.xmqtt").Client(host='10.10.10.73', port=41883)
  25. # aps = importlib.import_module(f"xpip.xapscheduler").APS(db_type='mongo',
  26. # db_host='10.10.10.73',
  27. # db_port=47017,
  28. # username='admin', password='admin',
  29. # database='bg', collection='LoopTask')