# HG changeset patch # User Edouard Tisserant # Date 1592295385 -7200 # Node ID b276d05bdb097e0a03cd6f36c807ed75a7c647d4 # Parent 3ca5611d63080852814dc7c2ef8a66f682aec6ff Modbus/BACnet : add some comments so that we don't forget some pending optimization. diff -r 3ca5611d6308 -r b276d05bdb09 bacnet/web_settings.py --- a/bacnet/web_settings.py Tue Jun 16 10:12:21 2020 +0200 +++ b/bacnet/web_settings.py Tue Jun 16 10:16:25 2020 +0200 @@ -315,6 +315,8 @@ GetParamFuncName = "__bacnet_%(location_str)s_get_ConfigParam_" + name SetParamFuncName = "__bacnet_%(location_str)s_set_ConfigParam_" + name + # XXX TODO : stop reading from PLC .so file. This code is template code + # that can use modbus extension build data GetParamFuncs[name] = getattr(PLCObject.PLClibraryHandle, GetParamFuncName) GetParamFuncs[name].restype = c_dtype GetParamFuncs[name].argtypes = None diff -r 3ca5611d6308 -r b276d05bdb09 modbus/web_settings.py --- a/modbus/web_settings.py Tue Jun 16 10:12:21 2020 +0200 +++ b/modbus/web_settings.py Tue Jun 16 10:16:25 2020 +0200 @@ -547,6 +547,8 @@ # are not present in the .so file we conclude that the currently loaded # PLC does not have the Modbus plugin included (situation (2b) described above init()) try: + # XXX TODO : stop reading from PLC .so file. This code is template code + # that can use modbus extension build data, such as client node count. client_count = ctypes.c_int.in_dll(PLCObject.PLClibraryHandle, "__modbus_plugin_client_node_count").value server_count = ctypes.c_int.in_dll(PLCObject.PLClibraryHandle, "__modbus_plugin_server_node_count").value except Exception: @@ -569,6 +571,8 @@ GetServerParamFuncs = {} SetServerParamFuncs = {} + # XXX TODO : stop reading from PLC .so file. This code is template code + # that can use modbus extension build data for name, web_label, c_dtype, web_dtype in TCPclient_parameters + RTUclient_parameters + General_parameters: ParamFuncName = "__modbus_get_ClientNode_" + name GetClientParamFuncs[name] = getattr(PLCObject.PLClibraryHandle, ParamFuncName) @@ -581,6 +585,8 @@ SetClientParamFuncs[name].restype = None SetClientParamFuncs[name].argtypes = [ctypes.c_int, c_dtype] + # XXX TODO : stop reading from PLC .so file. This code is template code + # that can use modbus extension build data for name, web_label, c_dtype, web_dtype in TCPserver_parameters + RTUslave_parameters + General_parameters: ParamFuncName = "__modbus_get_ServerNode_" + name GetServerParamFuncs[name] = getattr(PLCObject.PLClibraryHandle, ParamFuncName)