Skip to content

Commit

Permalink
[Controller] update layout&add more freqs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-tz committed May 28, 2024
1 parent 178f020 commit b20e0e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
11 changes: 7 additions & 4 deletions Controller/src/qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ApplicationWindow{
Rectangle{
id : radio;
width:parent.width;
height:380;
height:420;
color:"transparent";
Rectangle{
width:parent.width;
Expand All @@ -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;
Expand Down Expand Up @@ -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){
Expand All @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
14 changes: 4 additions & 10 deletions Controller/src/serialobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit b20e0e3

Please sign in to comment.