This commit is contained in:
hm
2020-12-07 16:29:08 +08:00
parent d9ecddfd10
commit f0793bde7b
18 changed files with 1538 additions and 1134 deletions
+37 -39
View File
@@ -3,6 +3,9 @@
ParameterProcess::ParameterProcess(QObject *parent) : QObject(parent)
{
setRunFrq(20);
status.m_Mode = Nop_Mode;
}
void ParameterProcess::setRunFrq(uint32_t frq)
@@ -90,54 +93,49 @@ void ParameterProcess::SendMessage(mavlink_message_t msg)
void ParameterProcess::ReadCmd(uint8_t m_sysid, uint8_t m_compid,uint8_t type)
{
sysid = m_sysid;
compid = m_compid;
status.m_Mode = RecieveMode;//接收模式
status.recieve.type = (type)?(_readtype::One):(_readtype::All);
if(status.m_Mode == Nop_Mode)
{
sysid = m_sysid;
compid = m_compid;
status.m_Mode = RecieveMode;//接收模式
status.recieve.type = (type)?(_readtype::One):(_readtype::All);
qDebug() << "sysid" << sysid << endl
<< "compid" << compid << endl
<< "Mode" << status.m_Mode << endl
<< "type" << status.recieve.type << endl
<< "start...";
qDebug() << "sysid" << sysid << endl
<< "compid" << compid << endl
<< "Mode" << status.m_Mode << endl
<< "type" << status.recieve.type << endl
<< "start...";
start();//开启线程
start();//开启线程
}
}
void ParameterProcess::WriteCmd(uint8_t m_sysid, uint8_t m_compid ,const char *id,uint8_t type,float value)
{
//Q_UNUSED(count);
sysid = m_sysid;
compid = m_compid;
status.m_Mode = TransmitMode;//发送模式
/*
if(sizeof(id) < 16)
{
memcpy(param_set.param_id,id,sizeof(id));
}
else
if(status.m_Mode == Nop_Mode)
{
sysid = m_sysid;
compid = m_compid;
status.m_Mode = TransmitMode;//发送模式
memcpy(param_set.param_id,id,16);
param_set.param_type = type;
param_set.param_value = value;
qDebug() << "sysid" << sysid << endl
<< "compid" << compid << endl
<< "param_id" << param_set.param_id << endl
<< "param_type" << param_set.param_type << endl
<< "param_value" << param_set.param_value << endl
<< "Mode" << status.m_Mode << endl
<< "type" << status.recieve.type << endl
<< "start...";
start();//开启线程
}
*/
memcpy(param_set.param_id,id,16);
param_set.param_type = type;
param_set.param_value = value;
qDebug() << "sysid" << sysid << endl
<< "compid" << compid << endl
<< "param_id" << param_set.param_id << endl
<< "param_type" << param_set.param_type << endl
<< "param_value" << param_set.param_value << endl
<< "Mode" << status.m_Mode << endl
<< "type" << status.recieve.type << endl
<< "start...";
start();//开启线程
}