hub.py 1.4 KB

1234567891011121314151617181920212223242526272829
  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. emqx = importlib.import_module(f"xclient.xmqtt").Client(host='127.0.0.1', port=41883)
  8. aps = importlib.import_module(f"xpip.xapscheduler").APS(db_type='mongo',
  9. db_host='127.0.0.1',
  10. db_port=47017,
  11. username='admin', password='admin',
  12. database='bg', collection='LoopTask')
  13. # --- 业务数据数据库 ---
  14. mdb = importlib.import_module(f"xclient.xmongo").Client(host='127.0.0.1', port=47017, database='bg',
  15. username='admin', password='admin')
  16. # emqx = importlib.import_module(f"xclient.xmqtt").Client(host='10.10.10.73', port=41883)
  17. # aps = importlib.import_module(f"xpip.xapscheduler").APS(db_type='mongo',
  18. # db_host='10.10.10.73',
  19. # db_port=47017,
  20. # username='admin', password='admin',
  21. # database='bg', collection='LoopTask')