Beremiz_service.py
changeset 2654 7575050a80c5
parent 2649 db68cb0e6bdc
child 2659 09bac1f52b1e
equal deleted inserted replaced
2649:db68cb0e6bdc 2654:7575050a80c5
   474 
   474 
   475 
   475 
   476 installThreadExcepthook()
   476 installThreadExcepthook()
   477 havewamp = False
   477 havewamp = False
   478 haveBNconf = False
   478 haveBNconf = False
       
   479 haveMBconf = False
   479 
   480 
   480 
   481 
   481 if havetwisted:
   482 if havetwisted:
   482     if webport is not None:
   483     if webport is not None:
   483         try:
   484         try:
   493         try:
   494         try:
   494             import runtime.BACnet_config as BNconf
   495             import runtime.BACnet_config as BNconf
   495             haveBNconf = True
   496             haveBNconf = True
   496         except Exception:
   497         except Exception:
   497             LogMessageAndException(_("BACnet configuration web interface - import failed :"))
   498             LogMessageAndException(_("BACnet configuration web interface - import failed :"))
   498         
   499 
       
   500     # Try to add support for Modbus configuration via web server interface
       
   501     # NOTE:Modbus web config only makes sense if web server is available
       
   502     if webport is not None:
       
   503         try:
       
   504             import runtime.Modbus_config as MBconf
       
   505             haveMBconf = True
       
   506         except Exception:
       
   507             LogMessageAndException(_("Modbus configuration web interface - import failed :"))
       
   508                 
   499     try:
   509     try:
   500         import runtime.WampClient as WC  # pylint: disable=ungrouped-imports
   510         import runtime.WampClient as WC  # pylint: disable=ungrouped-imports
   501         WC.WorkingDir = WorkingDir
   511         WC.WorkingDir = WorkingDir
   502         havewamp = True
   512         havewamp = True
   503     except Exception:
   513     except Exception:
   537     if haveBNconf:
   547     if haveBNconf:
   538         try:
   548         try:
   539             BNconf.init(plcobj, NS, WorkingDir)
   549             BNconf.init(plcobj, NS, WorkingDir)
   540         except Exception:
   550         except Exception:
   541             LogMessageAndException(_("BACnet web configuration failed startup. "))
   551             LogMessageAndException(_("BACnet web configuration failed startup. "))
       
   552 
       
   553     if haveMBconf:
       
   554         try:
       
   555             MBconf.init(plcobj, NS, WorkingDir)
       
   556         except Exception:
       
   557             LogMessageAndException(_("Modbus web configuration failed startup. "))
   542 
   558 
   543     if havewamp:
   559     if havewamp:
   544         try:
   560         try:
   545             WC.SetServer(pyroserver)
   561             WC.SetServer(pyroserver)
   546             WC.RegisterWampClient(wampconf, PSKpath)
   562             WC.RegisterWampClient(wampconf, PSKpath)