添加了一个qml窗口,这个窗口无法和当前界面兼容导致界面使用的其他小部件布局无法和以前一样,map无法全部铺满
This commit is contained in:
@@ -78,7 +78,6 @@ void commandprocess::process()//线程函数
|
||||
thread = nullptr;
|
||||
}
|
||||
|
||||
|
||||
void commandprocess::SendMessage(mavlink_message_t msg)
|
||||
{
|
||||
uint8_t buff[256+20];
|
||||
@@ -89,13 +88,25 @@ void commandprocess::SendMessage(mavlink_message_t msg)
|
||||
//这个函数类似中断,专门处理接收到的状态
|
||||
void commandprocess::Parse(mavlink_message_t msg)
|
||||
{
|
||||
mavlink_command_int_t command_int;
|
||||
mavlink_command_long_t command_long;
|
||||
mavlink_command_ack_t command_ack;
|
||||
|
||||
switch (msg.msgid) {
|
||||
case MAVLINK_MSG_ID_COMMAND_INT:
|
||||
case MAVLINK_MSG_ID_COMMAND_INT://几乎不可能收到
|
||||
mavlink_msg_command_int_decode(&msg,&command_int);
|
||||
case MAVLINK_MSG_ID_COMMAND_LONG:
|
||||
break;
|
||||
case MAVLINK_MSG_ID_COMMAND_LONG://几乎不可能收到
|
||||
mavlink_msg_command_long_decode(&msg,&command_long);
|
||||
break;
|
||||
case MAVLINK_MSG_ID_COMMAND_ACK:
|
||||
mavlink_msg_command_ack_decode(&msg,&command_ack);
|
||||
|
||||
if(command_ack.result == MAV_RESULT_ACCEPTED)
|
||||
{
|
||||
status.transmit.isWaitingforACK = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,8 +114,8 @@ void commandprocess::Parse(mavlink_message_t msg)
|
||||
void commandprocess::ReadStateMachine(void)//没有读指令这个说法
|
||||
{
|
||||
static uint8_t step = 0;
|
||||
static uint8_t timeout_count = 0;
|
||||
static uint32_t time = 0;
|
||||
//static uint8_t timeout_count = 0;
|
||||
static int time = 0;
|
||||
|
||||
|
||||
if(step == 0)
|
||||
@@ -125,11 +136,10 @@ void commandprocess::WriteStateMachine(void)
|
||||
{
|
||||
static uint8_t step = 0;
|
||||
static uint8_t timeout_count = 0;
|
||||
static uint32_t time = 0;
|
||||
static int time = 0;
|
||||
|
||||
if(step == 0)
|
||||
{
|
||||
|
||||
status.transmit.isWaitingforACK = true;
|
||||
|
||||
//set("id",0,1);//发送一个指令
|
||||
@@ -168,7 +178,6 @@ void commandprocess::WriteStateMachine(void)
|
||||
|
||||
|
||||
/*all msg
|
||||
|
||||
MAVLINK_MSG_ID_COMMAND_INT
|
||||
MAVLINK_MSG_ID_COMMAND_LONG
|
||||
MAVLINK_MSG_ID_COMMAND_ACK
|
||||
@@ -251,9 +260,21 @@ void commandprocess::_long(float param1,
|
||||
**/
|
||||
|
||||
|
||||
void commandprocess::ack()//地面站几乎不可能放这个函数
|
||||
void commandprocess::ack(uint16_t command,uint8_t result,uint8_t progress,int32_t result_param2)//地面站几乎不可能放这个函数
|
||||
{
|
||||
static mavlink_message_t msg;
|
||||
static mavlink_command_ack_t command_ack;
|
||||
|
||||
command_ack.target_system = sysid;
|
||||
command_ack.target_component = compid;
|
||||
|
||||
command_ack.command = command;
|
||||
command_ack.result = result;
|
||||
command_ack.progress = progress;
|
||||
command_ack.result_param2 = result_param2;
|
||||
|
||||
mavlink_msg_command_ack_encode(2,MAV_COMP_ID_MISSIONPLANNER, &msg,&command_ack);
|
||||
SendMessage(msg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user