diff --git a/product/src/tools/calc_lua_api/CCalcLua.cpp b/product/src/tools/calc_lua_api/CCalcLua.cpp index 6c7e67d1..7c1e4c2f 100644 --- a/product/src/tools/calc_lua_api/CCalcLua.cpp +++ b/product/src/tools/calc_lua_api/CCalcLua.cpp @@ -24,22 +24,9 @@ bool CCalcLua::initialize() m_error = "错误:初始化lua环境失败!"; return false; } - luabridge::getGlobalNamespace(lua_state) - .beginNamespace ("kbd") - .addFunction ("getDataByIndex",&CCalcLua::getDataByIndex) - .endNamespace (); - luabridge::getGlobalNamespace(lua_state) - .beginNamespace ("kbd") - .addFunction ("getInParamNum",&CCalcLua::getInParamNum) - .endNamespace (); - luabridge::getGlobalNamespace(lua_state) - .beginNamespace ("kbd") - .addFunction ("getBitAnd",&CCalcLua::getBitAnd) - .endNamespace (); - luabridge::getGlobalNamespace(lua_state) - .beginNamespace ("kbd") - .addFunction ("getBitOr",&CCalcLua::getBitOr) - .endNamespace (); + + registFunctionToLua(); + return true; } @@ -217,3 +204,22 @@ bool CCalcLua::release() } return true; } + +void CCalcLua::registFunctionToLua() +{ + luabridge::getGlobalNamespace(lua_state) + .beginNamespace ("kbd") + .addFunction ("getDataByIndex",&CCalcLua::getDataByIndex) + .addFunction ("getInParamNum",&CCalcLua::getInParamNum) + .addFunction ("getBitAnd",&CCalcLua::getBitAnd) + .addFunction ("getBitOr",&CCalcLua::getBitOr) + .endNamespace (); + + luabridge::getGlobalNamespace(lua_state) + .beginNamespace ("iot") + .addFunction ("getDataByIndex",&CCalcLua::getDataByIndex) + .addFunction ("getInParamNum",&CCalcLua::getInParamNum) + .addFunction ("getBitAnd",&CCalcLua::getBitAnd) + .addFunction ("getBitOr",&CCalcLua::getBitOr) + .endNamespace (); +} diff --git a/product/src/tools/calc_lua_api/CCommonConfigParse.cpp b/product/src/tools/calc_lua_api/CCommonConfigParse.cpp index 894d9d56..371da09a 100644 --- a/product/src/tools/calc_lua_api/CCommonConfigParse.cpp +++ b/product/src/tools/calc_lua_api/CCommonConfigParse.cpp @@ -1,6 +1,18 @@  #include "CCommonConfigParse.h" + +//< 屏蔽xml_parser编译告警 +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-copy" +#endif + #include "boost/property_tree/xml_parser.hpp" + +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + #include "boost/typeof/typeof.hpp" #include "boost/filesystem.hpp" #include "Common.h"