外出测试

This commit is contained in:
hm
2020-08-04 17:19:40 +08:00
parent c7baf9ad3b
commit 753d2f5f1f
11 changed files with 55 additions and 34 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ QT += quickwidgets
QT += opengl
QT += sql
QT += svg
QT += texttospeech
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
+11
View File
@@ -1,6 +1,8 @@
#include "CommandUI.h"
#include "ui_CommandUI.h"
#include "QtTextToSpeech/QtTextToSpeech"
const char* CommandUI::_versionJsonKey = "version";
const char* CommandUI::_commentJsonKey = "comment";
@@ -276,16 +278,25 @@ void CommandUI::commandAccepted(bool flag,uint16_t command,uint8_t result)
{
if(btn->text() == info.toObject().find(_TextJsonKey).value().toString())
{
QString string;
if(flag)
{
btn->setProperty("state",state::success);
string.append(tr("command %1,%2 success").arg(command).arg(btn->text()));
}
else
{
btn->setProperty("state",state::failure);
string.append(tr("command %1,%2 failure").arg(command).arg(btn->text()));
}
btn->style()->unpolish(btn);
btn->style()->polish(btn);
QTextToSpeech *tts = new QTextToSpeech();
tts->say(string);
}
}
}
+1
View File
@@ -7,6 +7,7 @@ QT += svg
QT += quickwidgets
QT += quick
QT += qml
QT += texttospeech
INCLUDEPATH += $$PWD/../ComponentUI/CharInputter
INCLUDEPATH += $$PWD/../ComponentUI/Inputter
+2 -2
View File
@@ -1,4 +1,4 @@
#include "Scope.h"
#include "Scope.h"
#include "ui_Scope.h"
int Scope::ChannelIndex = 0;
@@ -28,7 +28,7 @@ Scope::Scope(QWidget *parent) :
chartView->setRenderHint(QPainter::Antialiasing);
chartView->chart()->legend()->setAlignment(Qt::AlignRight);
chartView->chart()->legend()->setMarkerShape(QLegend::MarkerShapeCircle);
chartView->chart()->setTheme(QChart::ChartThemeBlueCerulean);
chartView->chart()->setTheme(QChart::ChartThemeLight);
//chartView->setMouseTracking(true);
//chartView->setRubberBand(QChartView::RectangleRubberBand);
BIN
View File
Binary file not shown.
+27 -20
View File
@@ -330,16 +330,26 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="CommandUI/CommandUI.cpp" line="56"/>
<location filename="CommandUI/CommandUI.cpp" line="58"/>
<source>Command Version:</source>
<translation> </translation>
</message>
<message>
<location filename="CommandUI/CommandUI.cpp" line="286"/>
<source>command %1,%2 success</source>
<translation> %1%2 </translation>
</message>
<message>
<location filename="CommandUI/CommandUI.cpp" line="292"/>
<source>command %1,%2 failure</source>
<translation> %1%2 </translation>
</message>
<message>
<source>press will send a command to vehicle</source>
<translation type="vanished"></translation>
</message>
<message>
<location filename="CommandUI/CommandUI.cpp" line="241"/>
<location filename="CommandUI/CommandUI.cpp" line="243"/>
<source>clicked</source>
<translation></translation>
</message>
@@ -534,7 +544,10 @@
<message>
<location filename="Setting/Index0/LinkUI/ConnectDialog/ConnectDialog.cpp" line="108"/>
<location filename="Setting/Index0/LinkUI/ConnectDialog/ConnectDialog.cpp" line="110"/>
<source>192.168.0.1</source>
<location filename="Setting/Index0/LinkUI/ConnectDialog/ConnectDialog.cpp" line="328"/>
<location filename="Setting/Index0/LinkUI/ConnectDialog/ConnectDialog.cpp" line="330"/>
<source>127.0.0.1</source>
<oldsource>192.168.0.1</oldsource>
<translation type="unfinished">192.168.0.1</translation>
</message>
<message>
@@ -600,19 +613,13 @@
<translation type="vanished"></translation>
</message>
<message>
<location filename="Setting/Index0/LinkUI/ConnectDialog/ConnectDialog.cpp" line="328"/>
<location filename="Setting/Index0/LinkUI/ConnectDialog/ConnectDialog.cpp" line="330"/>
<source>127.0.0.1</source>
<translation>127.0.0.1</translation>
</message>
<message>
<location filename="Setting/Index0/LinkUI/ConnectDialog/ConnectDialog.cpp" line="111"/>
<location filename="Setting/Index0/LinkUI/ConnectDialog/ConnectDialog.cpp" line="109"/>
<location filename="Setting/Index0/LinkUI/ConnectDialog/ConnectDialog.cpp" line="329"/>
<source>6061</source>
<translation>6061</translation>
</message>
<message>
<location filename="Setting/Index0/LinkUI/ConnectDialog/ConnectDialog.cpp" line="109"/>
<location filename="Setting/Index0/LinkUI/ConnectDialog/ConnectDialog.cpp" line="111"/>
<location filename="Setting/Index0/LinkUI/ConnectDialog/ConnectDialog.cpp" line="331"/>
<source>6060</source>
<translation>6060</translation>
@@ -849,7 +856,7 @@
<translation></translation>
</message>
<message>
<location filename="ToolsUI/tools_Index0/MAVLinkInspector/MAVLinkInspector.ui" line="38"/>
<location filename="ToolsUI/tools_Index0/MAVLinkInspector/MAVLinkInspector.ui" line="76"/>
<source>Clear</source>
<translation></translation>
</message>
@@ -870,7 +877,7 @@
</message>
<message>
<location filename="ToolsUI/tools_Index0/MAVLinkInspector/MAVLinkInspector.cc" line="68"/>
<location filename="ToolsUI/tools_Index0/MAVLinkInspector/MAVLinkInspector.cc" line="311"/>
<location filename="ToolsUI/tools_Index0/MAVLinkInspector/MAVLinkInspector.cc" line="345"/>
<source>Vehicle %1</source>
<translation> %1</translation>
</message>
@@ -1180,33 +1187,33 @@
<translation></translation>
</message>
<message>
<location filename="ComponentUI/Scope/Scope.ui" line="52"/>
<location filename="ComponentUI/Scope/Scope.cpp" line="387"/>
<location filename="ComponentUI/Scope/Scope.ui" line="90"/>
<location filename="ComponentUI/Scope/Scope.cpp" line="401"/>
<source>Pause</source>
<translation></translation>
</message>
<message>
<location filename="ComponentUI/Scope/Scope.ui" line="71"/>
<location filename="ComponentUI/Scope/Scope.ui" line="128"/>
<source>Clear</source>
<translation></translation>
</message>
<message>
<location filename="ComponentUI/Scope/Scope.ui" line="90"/>
<location filename="ComponentUI/Scope/Scope.ui" line="71"/>
<source>Flag1</source>
<translation>1</translation>
</message>
<message>
<location filename="ComponentUI/Scope/Scope.ui" line="109"/>
<location filename="ComponentUI/Scope/Scope.ui" line="147"/>
<source>Flag2</source>
<translation>2</translation>
</message>
<message>
<location filename="ComponentUI/Scope/Scope.ui" line="128"/>
<location filename="ComponentUI/Scope/Scope.ui" line="109"/>
<source>Close</source>
<translation></translation>
</message>
<message>
<location filename="ComponentUI/Scope/Scope.cpp" line="383"/>
<location filename="ComponentUI/Scope/Scope.cpp" line="397"/>
<source>Scroll</source>
<translation></translation>
</message>
@@ -1,4 +1,4 @@
#include "ConnectDialog.h"
#include "ConnectDialog.h"
#include "ui_ConnectDialog.h"
ConnectDialog::ConnectDialog(QWidget *parent) :
@@ -105,9 +105,9 @@ void ConnectDialog::setInit(QVariant inter, QVariant device)
}
else if(m_Type.toString() == tr("UDP"))
{
m_Param1 = tr("127.0.0.1");
m_Param2 = tr("6061");
m_Param3 = tr("127.0.0.1");
m_Param1 = tr("192.168.1.2");
m_Param2 = tr("6062");
m_Param3 = tr("192.168.1.3");
m_Param4 = tr("6060");
}
}
@@ -325,9 +325,9 @@ void ConnectDialog::setType(QVariant value)
}
else if(m_Type.toString() == tr("UDP"))
{
m_Param1 = tr("127.0.0.1");
m_Param2 = tr("6061");
m_Param3 = tr("127.0.0.1");
m_Param1 = tr("192.168.1.2");
m_Param2 = tr("6062");
m_Param3 = tr("192.168.1.3");
m_Param4 = tr("6060");
m_Param5 = "";
}
+1 -1
View File
@@ -603,7 +603,7 @@ void MainWindow::updateUI()//事件驱动式更新数据
message.append(tr("<h6>数据强度:<font color=red>%1</font>\t").arg(QString::number(100)));
message.append(tr("定位类型:<font color=red>%1</font>\t").arg(gps_str));
message.append(tr("卫星数目:<font color=red>%1</font>颗</h6>").arg(QString::number(dlink->mavlinknode->vehicle.gps_raw_int.satellites_visible)));
message.append(tr("<h6>电池电压:<font color=red>%1</font>V\t").arg(QString::number(dlink->mavlinknode->vehicle.sys_status.voltage_battery)));
message.append(tr("<h6>电池电压:<font color=red>%1</font>V\t").arg(QString::number(dlink->mavlinknode->vehicle.sys_status.voltage_battery * 0.01)));
message.append(tr("剩余时间:<font color=red>%1</font></h6>").arg(QString::number(100)));
showMessage(message);
+3 -1
View File
@@ -23,6 +23,8 @@ DLink::DLink(QObject *parent) : QObject(parent)
this,SIGNAL(showMessage(QString,int)),Qt::DirectConnection);
// mavlinknode->start();
//其他协议节点。。。
}
@@ -214,7 +216,7 @@ bool DLink::setupClient(const QHostAddress &remote_addr, int remote_port, int lo
{
bool isSuccess = false;
Clientsock = new QUdpSocket(this);
if (Clientsock->bind(QHostAddress::Any, local_port))
if (Clientsock->bind(QHostAddress::AnyIPv4, local_port))
{
Clientsock->joinMulticastGroup(remote_addr);//加入组播
+2 -2
View File
@@ -42,7 +42,7 @@ public:
MavLinkNode *mavlinknode = nullptr;
int SendMessageTo(quint8 ch, quint8 *msg, quint16 len);
signals:
void showMessage(const QString &message,int TimeOut = 0);
@@ -67,7 +67,7 @@ public slots:
void readPendingDatagramsClient(void);
int SendMessageTo(quint8 ch, quint8 *msg, quint16 len);
protected:
Binary file not shown.