proto-debuger/protoDebuger/lua_bind.cpp

29 lines
616 B
C++
Raw Permalink Normal View History

2021-04-15 17:13:04 +00:00
#include "lua_bind.h"
2021-04-17 17:57:39 +00:00
#include "sharedata.h"
2021-04-15 17:13:04 +00:00
2021-04-18 15:16:03 +00:00
// 在qml界面中显示lua层处理过的数据
2021-04-15 17:13:04 +00:00
int LuaShowData(lua_State *vm)
{
// 获取函数参数:从栈底取一个参数
const char *k = lua_tostring(vm, 1);
if (nullptr != k){
//todo qml显示添加
}
2021-04-17 17:57:39 +00:00
gGlobal.ShowDataInQML(QString(k));
2021-04-15 17:13:04 +00:00
return 0;
}
2021-04-17 17:57:39 +00:00
2021-04-18 15:16:03 +00:00
//
int LuaWriteUart(lua_State *vm)
{
// 获取函数参数:从栈底取一个参数
const char *k = lua_tostring(vm, 1);
if (nullptr != k){
//todo qml显示添加
}
gGlobal.SendUartData(k);
qDebug()<<"send data "<< QString(k);
return 0;
}