runtime/Modbus_config.py
changeset 2665 978cf239c689
parent 2661 9d08e3bba629
child 2666 5f48d5e60a81
equal deleted inserted replaced
2664:a26a8e182190 2665:978cf239c689
   381     for par_name, x1, x2, x3 in WebParamList:
   381     for par_name, x1, x2, x3 in WebParamList:
   382         value = kwargs.get(par_name, None)
   382         value = kwargs.get(par_name, None)
   383         if value is not None:
   383         if value is not None:
   384             newConfig[par_name] = value
   384             newConfig[par_name] = value
   385 
   385 
   386     _WebNodeList[WebNode_id]["WebviewConfiguration"] = newConfig
       
   387     
       
   388     # First check if configuration is OK.
   386     # First check if configuration is OK.
   389     # Note that this is not currently required, as we use drop down choice menus
   387     # Note that this is not currently required, as we use drop down choice menus
   390     # for baud, parity and sop bits, so the values should always be correct!
   388     # for baud, parity and sop bits, so the values should always be correct!
   391     #if not _CheckWebConfiguration(newConfig):
   389     #if not _CheckWebConfiguration(newConfig):
   392     #    return
   390     #    return
   396     # has a cold start (i.e. when Beremiz_service.py is retarted)
   394     # has a cold start (i.e. when Beremiz_service.py is retarted)
   397     _SetSavedConfiguration(WebNode_id, newConfig)
   395     _SetSavedConfiguration(WebNode_id, newConfig)
   398 
   396 
   399     # Configure PLC with the current Modbus parameters
   397     # Configure PLC with the current Modbus parameters
   400     _SetPLCConfiguration(WebNode_id, newConfig)
   398     _SetPLCConfiguration(WebNode_id, newConfig)
       
   399 
       
   400     # Update the viewable configuration
       
   401     # The PLC may have coerced the values on calling _SetPLCConfiguration()
       
   402     # so we do not set it directly to newConfig
       
   403     _WebNodeList[WebNode_id]["WebviewConfiguration"] = _GetPLCConfiguration(WebNode_id)
   401 
   404 
   402     # File has just been created => Delete button must be shown on web interface!
   405     # File has just been created => Delete button must be shown on web interface!
   403     _updateWebInterface(WebNode_id)
   406     _updateWebInterface(WebNode_id)
   404 
   407 
   405 
   408