From b20e0e3a9053c395eaeeb2dc003ec544f4858ea4 Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 28 May 2024 16:47:17 +0800 Subject: [PATCH] [Controller] update layout&add more freqs --- Controller/src/qml/main.qml | 11 +++++++---- Controller/src/serialobject.cpp | 14 ++++---------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/Controller/src/qml/main.qml b/Controller/src/qml/main.qml index 6c17f953..3411dc85 100644 --- a/Controller/src/qml/main.qml +++ b/Controller/src/qml/main.qml @@ -31,7 +31,7 @@ ApplicationWindow{ Rectangle{ id : radio; width:parent.width; - height:380; + height:420; color:"transparent"; Rectangle{ width:parent.width; @@ -45,7 +45,7 @@ ApplicationWindow{ width: parent.width - 15; anchors.horizontalCenter: parent.horizontalCenter; anchors.top: parent.top; - anchors.margins: 10; + anchors.margins: 20; title :qsTr("Sender Setting") + translator.emptyString; Grid{ height:parent.height; @@ -107,7 +107,8 @@ ApplicationWindow{ anchors.top: crazyListRectangle.bottom; anchors.right: parent.right; anchors.rightMargin: 20; - anchors.topMargin: 10; + anchors.topMargin: 15; + anchors.bottomMargin: 15; onClicked: clickEvent(); function clickEvent(){ if(ifConnected){ @@ -127,6 +128,7 @@ ApplicationWindow{ width:parent.width - 15; anchors.top:crazyConnect.bottom; anchors.horizontalCenter: parent.horizontalCenter; + anchors.topMargin: 15; id : groupBox2; Grid{ id : crazyShow; @@ -433,7 +435,8 @@ ApplicationWindow{ anchors.right:parent.right; anchors.rightMargin: 20; anchors.top:groupBox2.bottom; - anchors.topMargin: 10; + anchors.topMargin: 15; + anchors.bottomMargin: 15; enabled : crazyConnect.ifConnected;//如果连接成功按钮才有效 onClicked:{ handleClickEvent(); diff --git a/Controller/src/serialobject.cpp b/Controller/src/serialobject.cpp index 3c6fde27..d5522e63 100644 --- a/Controller/src/serialobject.cpp +++ b/Controller/src/serialobject.cpp @@ -22,16 +22,10 @@ SerialObject::SerialObject(QObject *parent):QObject(parent),radioPacket(&serial) dataBits.append(QSerialPort::Data8); stringDataBits.append("7"); parity.append(QSerialPort::NoParity); stringParity.append("OddParity"); stopBits.append(QSerialPort::TwoStop); stringStopBits.append("Two"); - frequency.append(0); stringFrequency.append("0"); - frequency.append(1); stringFrequency.append("1"); - frequency.append(2); stringFrequency.append("2"); - frequency.append(3); stringFrequency.append("3"); - frequency.append(4); stringFrequency.append("4"); - frequency.append(5); stringFrequency.append("5"); - frequency.append(6); stringFrequency.append("6"); - frequency.append(7); stringFrequency.append("7"); - frequency.append(8); stringFrequency.append("8"); - frequency.append(9); stringFrequency.append("9"); + for (int i = 0; i < 16; i++){ + frequency.append(i); + stringFrequency.append(QString::number(i)); + } connect(&serial, &QSerialPort::readyRead, this, &SerialObject::readData); } QString SerialObject::getName(int itemIndex) const{