修正平尾拟合系数,V尾拟合系数

This commit is contained in:
hm
2022-12-06 18:27:39 +08:00
parent f7539c4d31
commit 846978ffd2
5 changed files with 50 additions and 38 deletions
+20 -11
View File
@@ -52,6 +52,9 @@ MavLinkNode::MavLinkNode(QObject *parent) : ThreadTemplet(parent)
startuptime = current;
mavlogFileName = QString("./log/Tlog/GCS%1.tlog").arg(current.toString("yyyyMMddHHmmss"));
plogFileName = QString("./log/Tlog/GCS%1.plog").arg(current.toString("yyyyMMddHHmmss"));
mavLogFile = new QFile(mavlogFileName);
mavLogFile->open(QIODevice::WriteOnly);
@@ -564,28 +567,31 @@ void MavLinkNode::LogTimerOut(void)
*/
}
bool MavLinkNode::setLogData(mavlink_message_t msg)
bool MavLinkNode::setLogData(QString name,uint8_t type,mavlink_message_t msg)
{
uint8_t buff[MAVLINK_MAX_PACKET_LEN+sizeof(quint64)];
quint64 currentTimestamp = ((quint64)QDateTime::currentMSecsSinceEpoch()) * 1000;
qToBigEndian(currentTimestamp, buff);
uint16_t len = mavlink_msg_to_send_buffer(buff+sizeof(quint64), &msg);
if (mavLogFile)
QFile file(name);
if(file.open(QIODevice::Append))
{
auto size = Packer2_pack(&packer,1,buff,len+sizeof(quint64));
uint8_t buff[MAVLINK_MAX_PACKET_LEN+sizeof(quint64)];
qToLittleEndian(type, buff);
quint64 currentTimestamp = (quint64)QDateTime::currentMSecsSinceEpoch();
qToLittleEndian(currentTimestamp, buff+1);
uint16_t len = mavlink_msg_to_send_buffer(buff+1+sizeof(quint64), &msg);
auto size = Packer2_pack(&packer,1,buff,len+1+sizeof(quint64));
QByteArray data;
data.clear();
data.append((const char *)packer.buff,size);
QDataStream stream(mavLogFile);
QDataStream stream(&file);
stream << data;
return mavLogFile->flush();
file.flush();
file.close();
}
return false;
}
@@ -664,6 +670,9 @@ void MavLinkNode::Mavlinkparse(quint32 src,QByteArray datagram)
}
setLogData(plogFileName,0,msg);
count++;
if(msg.sysid < 250) //过滤地面站发过来的数据
{
+3 -1
View File
@@ -273,7 +273,7 @@ private slots:
void timer_1s_Out(void);
bool setLogData(mavlink_message_t msg);
bool setLogData(QString name, uint8_t type, mavlink_message_t msg);
//解析
void Mavlinkparse(quint32 src,QByteArray datagram);
@@ -320,6 +320,8 @@ protected:
QString mavlogFileName;
QFile *mavLogFile = NULL;
QString plogFileName;
QTimer *logTimer = nullptr;
Parser2_t parser;