缓存可能有点问题

This commit is contained in:
hm
2020-08-06 21:58:42 +08:00
parent 6db2b44969
commit 73b0085517
6 changed files with 60 additions and 45 deletions
+11 -9
View File
@@ -6,7 +6,7 @@
commandprocess::commandprocess(QObject *parent) : QObject(parent)
{
setRunFrq(100);
setRunFrq(10);
}
@@ -117,10 +117,10 @@ void commandprocess::WriteCmd_int(uint8_t m_sysid, uint8_t m_compid ,
cmd_int.autocontinue = autocontinue;
//开启线程开始传输
status.m_Mode = TransmitMode;//发送模式
status.transmit.type = 0;
start();//开启线程
status.m_Mode = TransmitMode;//发送模式
//start();//开启线程
}
@@ -143,7 +143,7 @@ void commandprocess::WriteCmd_long(float param1, float param2, float param3, fl
//开启线程开始传输
status.m_Mode = TransmitMode;//发送模式
status.transmit.type = 1;
start();//开启线程
//start();//开启线程
}
@@ -173,13 +173,15 @@ void commandprocess::Parse(mavlink_message_t msg)
break;//如果目标系统不是自己,那么就抛弃该指令
}
qDebug() << "command_ack.result" << command_ack.result;
if(command_ack.result == MAV_RESULT_ACCEPTED)
{
status.transmit.isWaitingforACK = false;
emit commandAccepted(true,command_ack.command,command_ack.result);//广播指令反馈
qDebug() << "command_ack.result" << command_ack.result;
}
else
{
@@ -238,7 +240,7 @@ void commandprocess::WriteStateMachine(void)
}
else if(step == 1)//等待返回
{
if((QTime::currentTime().msecsSinceStartOfDay() - time) > 1000)
if((QTime::currentTime().msecsSinceStartOfDay() - time) > 5000)
{
timeout_count ++;
step = 0;//返回上一个步骤
@@ -367,7 +369,7 @@ void commandprocess::_int(float param1,
command_int.current = current;
command_int.autocontinue = autocontinue;
mavlink_msg_command_int_encode(Current_sysID,MAV_COMP_ID_MISSIONPLANNER, &msg,&command_int);
mavlink_msg_command_int_encode(Current_sysID,Current_CompID, &msg,&command_int);
SendMessage(msg);
}
@@ -397,7 +399,7 @@ void commandprocess::_long(float param1,
command_long.command = command;
command_long.confirmation = confirmation;
mavlink_msg_command_long_encode(Current_sysID,MAV_COMP_ID_MISSIONPLANNER, &msg,&command_long);
mavlink_msg_command_long_encode(Current_sysID,Current_CompID, &msg,&command_long);
SendMessage(msg);
}