--- a/Beremiz_service.py Sun Jun 07 23:47:32 2020 +0100
+++ b/Beremiz_service.py Fri Jun 12 10:30:23 2020 +0200
@@ -492,37 +492,16 @@
installThreadExcepthook()
havewamp = False
-haveBNconf = False
-haveMBconf = False
-
if havetwisted:
if webport is not None:
try:
import runtime.NevowServer as NS # pylint: disable=ungrouped-imports
+ NS.WorkingDir = WorkingDir
except Exception:
LogMessageAndException(_("Nevow/Athena import failed :"))
webport = None
- NS.WorkingDir = WorkingDir # bug? what happens if import fails?
-
- # Try to add support for BACnet configuration via web server interface
- # NOTE:BACnet web config only makes sense if web server is available
- if webport is not None:
- try:
- import runtime.BACnet_config as BNconf
- haveBNconf = True
- except Exception:
- LogMessageAndException(_("BACnet configuration web interface - import failed :"))
-
- # Try to add support for Modbus configuration via web server interface
- # NOTE:Modbus web config only makes sense if web server is available
- if webport is not None:
- try:
- import runtime.Modbus_config as MBconf
- haveMBconf = True
- except Exception:
- LogMessageAndException(_("Modbus configuration web interface - import failed :"))
-
+
try:
import runtime.WampClient as WC # pylint: disable=ungrouped-imports
WC.WorkingDir = WorkingDir
@@ -544,8 +523,6 @@
runtime.CreatePLCObjectSingleton(
WorkingDir, argv, statuschange, evaluator, pyruntimevars)
-plcobj = runtime.GetPLCObjectSingleton()
-
pyroserver = PyroServer(servicename, interface, port)
if havewx:
@@ -561,18 +538,6 @@
except Exception:
LogMessageAndException(_("Nevow Web service failed. "))
- if haveBNconf:
- try:
- BNconf.init(plcobj, NS, WorkingDir)
- except Exception:
- LogMessageAndException(_("BACnet web configuration failed startup. "))
-
- if haveMBconf:
- try:
- MBconf.init(plcobj, NS, WorkingDir)
- except Exception:
- LogMessageAndException(_("Modbus web configuration failed startup. "))
-
if havewamp:
try:
WC.SetServer(pyroserver)
@@ -636,6 +601,7 @@
pyroserver.Quit()
pyro_thread.join()
+plcobj = runtime.GetPLCObjectSingleton()
plcobj.StopPLC()
plcobj.UnLoadPLC()