36 lines
708 B
C++
36 lines
708 B
C++
#include "base_form.h"
|
|
#include "lua_bind.h"
|
|
#include <iostream>
|
|
#include "global.h"
|
|
|
|
// 在qml界面中显示lua层处理过的数据
|
|
int LuaShowData(lua_State* vm)
|
|
{
|
|
// 获取函数参数:从栈底取一个参数
|
|
const char* k = lua_tostring(vm, 1);
|
|
if (nullptr != k) {
|
|
//todo qml显示添加
|
|
}
|
|
std::cout << "LuaShowData" << k << std::endl;
|
|
auto current = gMainWindow->FindCurrentFormByLuaPointer(vm);
|
|
if (nullptr == current) {
|
|
return -1;
|
|
}
|
|
current->ShowDataInEdit(k);
|
|
return 0;
|
|
}
|
|
|
|
//
|
|
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;
|
|
}
|
|
|