no message
parent
62c9df87c8
commit
8e0176a5c0
|
@ -5,6 +5,7 @@ import QtQuick.Controls.Material 2.12
|
|||
|
||||
|
||||
Item {
|
||||
id: debug_form
|
||||
objectName: "ProtoDebug"
|
||||
width: 800
|
||||
height: 600
|
||||
|
@ -52,7 +53,7 @@ Item {
|
|||
font.pixelSize: 30
|
||||
font.bold: true
|
||||
}
|
||||
Flickable {
|
||||
ScrollView {
|
||||
id: flick
|
||||
Layout.preferredHeight: parent.height - 100
|
||||
Layout.preferredWidth: parent.width/2 - 20
|
||||
|
@ -60,7 +61,6 @@ Item {
|
|||
|
||||
contentWidth: lua_script.paintedWidth
|
||||
contentHeight: lua_script.paintedHeight
|
||||
clip: true
|
||||
Layout.leftMargin: 10
|
||||
|
||||
ColorAnimation {
|
||||
|
@ -91,20 +91,29 @@ Item {
|
|||
onCursorRectangleChanged: flick.ensureVisible(cursorRectangle)
|
||||
}
|
||||
}
|
||||
ScrollView{
|
||||
Layout.columnSpan: 1
|
||||
Layout.preferredWidth: parent.width/2 - 35
|
||||
Layout.preferredHeight: parent.height - 200
|
||||
Layout.leftMargin: 10
|
||||
height: parent.height
|
||||
|
||||
TextArea {
|
||||
id: text_output
|
||||
Layout.preferredHeight: parent.height - 100
|
||||
height: parent.height
|
||||
text: qsTr("")
|
||||
font.pixelSize: 20
|
||||
Layout.columnSpan: 1
|
||||
Layout.preferredWidth: parent.width/2 - 20
|
||||
cursorVisible: true;
|
||||
focus: true;
|
||||
readOnly: true
|
||||
selectByMouse:true;
|
||||
selectByKeyboard: true
|
||||
background: Rectangle {
|
||||
border.color: text_output.enabled ? "#21be2b" : "transparent"
|
||||
}
|
||||
Layout.leftMargin: 10
|
||||
|
||||
}
|
||||
}
|
||||
RowLayout{
|
||||
visible: true
|
||||
Layout.columnSpan: 2
|
||||
|
@ -168,10 +177,17 @@ Item {
|
|||
text: qsTr("执行命令")
|
||||
Layout.bottomMargin: 10
|
||||
onClicked: {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
id: button3
|
||||
text: qsTr("清空缓冲区")
|
||||
Layout.bottomMargin: 10
|
||||
onClicked: {
|
||||
console.log("dfsd")
|
||||
debug_form.clearbuff()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -195,6 +211,10 @@ Item {
|
|||
showbuf += str;
|
||||
text_output.text = showbuf;
|
||||
}
|
||||
function clearbuff(){
|
||||
showbuf = "";
|
||||
text_output.text = showbuf;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -95,6 +95,7 @@ void LuaDelegate::OnClientLeave(QString ip, uint32_t port, uint32_t sockptr)
|
|||
lua_call(mVM,3,0);
|
||||
}
|
||||
|
||||
|
||||
void LuaDelegate::DumpStack()
|
||||
{
|
||||
static int count = 0;
|
||||
|
|
|
@ -50,6 +50,7 @@ public:
|
|||
void OnNetworkData(char*,char*,uint32_t port);
|
||||
void OnNewTcpClient(QString ip,uint32_t port,uint32_t sockptr);
|
||||
void OnClientLeave(QString ip,uint32_t port,uint32_t sockptr);
|
||||
void ClearShowBuffer();
|
||||
|
||||
void DumpStack();
|
||||
|
||||
|
|
|
@ -32,16 +32,13 @@ public:
|
|||
int OnDataRecv(QByteArray);
|
||||
int ShowDataInQML(QString x);
|
||||
int SendUartData(const char *);
|
||||
|
||||
Q_INVOKABLE void getValFromQml(int v) {
|
||||
emit valueFromCpp(456);
|
||||
}
|
||||
|
||||
Q_INVOKABLE int openUart(QString port,QString baudRate,QString dataBits,QString stopBits,
|
||||
QString flow);
|
||||
Q_INVOKABLE int openNetwork(QString ip,unsigned int port,bool is_ws,int type);
|
||||
Q_INVOKABLE int closeNetwork(QString);
|
||||
|
||||
Q_INVOKABLE int closeSerial();
|
||||
Q_INVOKABLE int TestLua();
|
||||
Q_INVOKABLE int TestShowData();
|
||||
|
@ -49,14 +46,13 @@ public:
|
|||
Q_INVOKABLE int saveLuaScript(QString);
|
||||
Q_INVOKABLE bool luaStatus();
|
||||
Q_INVOKABLE bool DoLuaCmd(QString);
|
||||
|
||||
QString _txt = "hello world\r\n";
|
||||
|
||||
signals:
|
||||
void txtchanged();
|
||||
void valueFromCpp(int val);
|
||||
void sendToQml(int count);
|
||||
void disConnected();
|
||||
void clearBuffer();
|
||||
|
||||
public slots:
|
||||
void on_network_data_recv();
|
||||
|
|
Loading…
Reference in New Issue