fix cmd
This commit is contained in:
+9
-5
@@ -41,16 +41,16 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
checkUI = new CheckUI(this);
|
||||
checkUI->hide();
|
||||
|
||||
|
||||
|
||||
//---
|
||||
inspectui = new InspectUI(this);
|
||||
inspectui->hide();
|
||||
|
||||
|
||||
//信息
|
||||
toolsui = new ToolsUI(this);
|
||||
toolsui->hide();
|
||||
|
||||
|
||||
//指令
|
||||
commandUI = new CommandUI(this);
|
||||
|
||||
|
||||
dlink = new DLink();
|
||||
@@ -106,6 +106,10 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
map,SLOT(setMapTypes(QVariant)));
|
||||
|
||||
|
||||
//command ----- dlink
|
||||
connect(commandUI,SIGNAL(cmd_long(float,float,float,float,float,float,float)),
|
||||
dlink->mavlinknode->Commander,SLOT(WriteCmd_long(float,float,float,float,float,float,float)));
|
||||
|
||||
//setting ----- dlink
|
||||
|
||||
setting->index1->setInstallWidget(dlink->mavlinknode->Parameter->paramInspect);
|
||||
@@ -184,7 +188,7 @@ MainWindow::MainWindow(QWidget *parent)
|
||||
|
||||
|
||||
|
||||
commandUI = new CommandUI(this);
|
||||
|
||||
|
||||
|
||||
//刷新ui,以保证界面不卡
|
||||
|
||||
@@ -122,7 +122,18 @@ void commandprocess::WriteCmd(uint8_t m_sysid, uint8_t m_compid ,
|
||||
|
||||
|
||||
|
||||
|
||||
void commandprocess::WriteCmd_long(float param1, float param2, float param3, float param4, float param5, float param6, float param7)
|
||||
{
|
||||
WriteCmd(0,0,
|
||||
param1,
|
||||
param2,
|
||||
param3,
|
||||
param4,
|
||||
param5,
|
||||
param6,
|
||||
param7,
|
||||
0,0,0,0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -148,6 +159,8 @@ void commandprocess::Parse(mavlink_message_t msg)
|
||||
if(command_ack.result == MAV_RESULT_ACCEPTED)
|
||||
{
|
||||
status.transmit.isWaitingforACK = false;
|
||||
|
||||
emit commandAccepted(command_ack.command);//广播指令已经接受的反馈
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -56,6 +56,9 @@ public:
|
||||
|
||||
|
||||
public slots:
|
||||
|
||||
void WriteCmd_long(float param1, float param2, float param3, float param4, float param5, float param6, float param7);
|
||||
|
||||
//读取和写入指令
|
||||
//void ReadCmd(uint8_t m_sysid, uint8_t m_compid, uint8_t type);
|
||||
void WriteCmd(uint8_t m_sysid, uint8_t m_compid ,
|
||||
@@ -114,6 +117,9 @@ signals:
|
||||
void SendMessageTo(quint8 ch, quint8 *data,quint16 len);
|
||||
|
||||
|
||||
|
||||
void commandAccepted(uint16_t);
|
||||
|
||||
private:
|
||||
bool running_flag = false;
|
||||
quint32 running_frq = 200;//200Hz
|
||||
|
||||
Reference in New Issue
Block a user