3 Commits

Author SHA1 Message Date
zxs b98f3ff8e5 修改部分文件编码格式 2026-06-15 08:18:27 +08:00
zxs 43533cf493 修复通知栏乱码,强制u8显示 2026-06-11 10:19:39 +08:00
zxs 445c8e1bac 修改转发协议 2026-06-11 09:57:51 +08:00
20 changed files with 116 additions and 85 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
#include "CommandUI.h"
#include "CommandUI.h"
#include "ui_CommandUI.h"
#include "QtTextToSpeech/QtTextToSpeech"
+1 -1
View File
@@ -1,4 +1,4 @@
#include "Payload.h"
#include "Payload.h"
#include "ui_Payload.h"
Payload::Payload(QWidget *parent) :
+1 -1
View File
@@ -1,4 +1,4 @@
#ifndef PAYLOAD_H
#ifndef PAYLOAD_H
#define PAYLOAD_H
#include <QWidget>
+1 -1
View File
@@ -1,4 +1,4 @@
#include "flare_device.h"
#include "flare_device.h"
#include <QtGlobal>
#include <QDebug>
#include <QBitArray>
+1 -1
View File
@@ -1,4 +1,4 @@
#ifndef FLARE_DEVICE_H
#ifndef FLARE_DEVICE_H
#define FLARE_DEVICE_H
#include <QObject>
+1 -1
View File
@@ -1,4 +1,4 @@
#ifndef PAYLOAD_PROTOCOL_H
#define PAYLOAD_PROTOCOL_H
@@ -1,4 +1,4 @@
#include "radar_warning_device.h"
#include "radar_warning_device.h"
#include <QtGlobal>
#include <QDebug>
#include <QMetaType>
@@ -1,4 +1,4 @@
#ifndef RADAR_WARNING_DEVICE_H
#ifndef RADAR_WARNING_DEVICE_H
#define RADAR_WARNING_DEVICE_H
#include <QObject>
@@ -1,4 +1,4 @@
#include "uv_warning_device.h"
#include "uv_warning_device.h"
#include <QtGlobal>
#include <QDebug>
#include <QMetaType>
+1 -1
View File
@@ -1,4 +1,4 @@
#ifndef UV_WARNING_DEVICE_H
#ifndef UV_WARNING_DEVICE_H
#define UV_WARNING_DEVICE_H
#include <QObject>
+1 -1
View File
@@ -1,4 +1,4 @@
#include "MyButton.h"
#include "MyButton.h"
#include <QMouseEvent>
MyButton::MyButton(QWidget *parent)
+1 -1
View File
@@ -1,4 +1,4 @@
#ifndef MYBUTTON_H
#ifndef MYBUTTON_H
#define MYBUTTON_H
#include <QPushButton>
+1
View File
@@ -82,5 +82,6 @@ unix {
TRANSLATIONS += COCKPIT_zh_CN.ts
QMAKE_CXXFLAGS += /utf-8
+2
View File
@@ -9,3 +9,5 @@ SUBDIRS += MavLinkNode
SUBDIRS += dlink
SUBDIRS += App
SUBDIRS += VehicleManage
QMAKE_CXXFLAGS += /utf-8
+1
View File
@@ -133,6 +133,7 @@ unix {
}
TRANSLATIONS += MAVLINKNODE_zh_CN.ts
QMAKE_CXXFLAGS += /utf-8
+63 -56
View File
@@ -1,4 +1,4 @@
#include "mavlinknode.h"
#include "mavlinknode.h"
#include "QElapsedTimer"
#include <cmath>
/*
@@ -97,6 +97,7 @@ double calculateTotalVelocity(double northVelocity, double eastVelocity, double
return totalVelocity;
}
float to360deg(float raw)
{
float angle = 0;
@@ -1526,23 +1527,20 @@ void MavLinkNode::StatusParse(mavlink_message_t msg)
info.flag = ManufacturerID;
info.time = (int32_t)(sec+min*60+hour*3600)*1000;
info.num = 1;
info.id = infoExportID;//1
info.Flag = ManufacturerID;
info.GpsTime = (int32_t)(sec+min*60+hour*3600)*1000;
info.Src = infoExportID;//1
//info.time = (int32_t)vehicle.ins1.time;//(second+min*60+hour*3600)*1000
info.t = 0;
info.pe = (int32_t)(calcEast(refPoint.lat,refPoint.lon, refPoint.hight, vehicle.ins1.lat, vehicle.ins1.lon, vehicle.ins1.alt)* 8);
info.pu = (int32_t)(calcUp(refPoint.lat,refPoint.lon, refPoint.hight, vehicle.ins1.lat, vehicle.ins1.lon, vehicle.ins1.alt) * 8);
info.ps = (int32_t)( (-calcNorth(refPoint.lat,refPoint.lon, refPoint.hight, vehicle.ins1.lat, vehicle.ins1.lon, vehicle.ins1.alt) ) * 8);
info.ve = (int32_t)(vehicle.ins1.v_east * 1024);
info.vu = (int32_t)(vehicle.ins1.v_up * 1024);
info.vs = (int32_t)(-vehicle.ins1.v_north * 1024);
info.vt = (int32_t)(calculateTotalVelocity(vehicle.ins1.v_north, vehicle.ins1.v_east, vehicle.ins1.v_up) * 1024);
info.rcs = 0;
info.reserve = 0;
info.Lan = (int32_t)(vehicle.ins1.lon * 10000000);
info.Lat = (int32_t)(vehicle.ins1.lat * 10000000);
info.Alt = (int32_t)(vehicle.ins1.alt * 100);
info.VE = (int32_t)(vehicle.ins1.v_east * 100);
info.VN - (int32_t)(vehicle.ins1.v_north * 100);
info.VU = (int32_t)(vehicle.ins1.v_up * 100);
info.V = (int32_t)(calculateTotalVelocity(vehicle.ins1.v_east, vehicle.ins1.v_north,vehicle.ins1.v_up) * 100);
info.K = (int32_t)(vehicle.ins1.yaw * 100);
info.Reserve1 = 0;
info.Reserve2 = 0;
//qDebug() << "infoExportID" << infoExportID;
}
@@ -1651,22 +1649,20 @@ void MavLinkNode::StatusParse(mavlink_message_t msg)
// vehicle.ins2.v_up * vehicle.ins2.v_up) * 100;//*100
// info.course = to360deg(vehicle.ins2.yaw * 57.3) * 100;//*100
info.flag = ManufacturerID;
info.time = (int32_t)(sec+min*60+hour*3600)*1000;
info.num = 1;
info.id = infoExportID;//1
info.Flag = ManufacturerID;
info.GpsTime = (int32_t)(sec+min*60+hour*3600)*1000;
info.Src = infoExportID;//1
//info.time = (int32_t)vehicle.ins1.time;//(second+min*60+hour*3600)*1000
info.t = 0;
info.pe = (int32_t)(calcEast(refPoint.lat,refPoint.lon, refPoint.hight, vehicle.ins1.lat, vehicle.ins1.lon, vehicle.ins1.alt)* 8);
info.pu = (int32_t)(calcUp(refPoint.lat,refPoint.lon, refPoint.hight, vehicle.ins1.lat, vehicle.ins1.lon, vehicle.ins1.alt) * 8);
info.ps = (int32_t)( (-calcNorth(refPoint.lat,refPoint.lon, refPoint.hight, vehicle.ins1.lat, vehicle.ins1.lon, vehicle.ins1.alt) ) * 8);
info.ve = (int32_t)(vehicle.ins2.v_east * 1024);
info.vu = (int32_t)(vehicle.ins2.v_up * 1024);
info.vs = (int32_t)(-vehicle.ins2.v_north * 1024);
info.vt = (int32_t)(calculateTotalVelocity(vehicle.ins2.v_north, vehicle.ins2.v_east, vehicle.ins2.v_up) * 1024);
info.rcs = 0;
info.reserve = 0;
info.Lan = (int32_t)(vehicle.ins2.lon * 10000000);
info.Lat = (int32_t)(vehicle.ins2.lat * 10000000);
info.Alt = (int32_t)(vehicle.ins2.alt * 100);
info.VE = (int32_t)(vehicle.ins2.v_east * 100);
info.VN - (int32_t)(vehicle.ins2.v_north * 100);
info.VU = (int32_t)(vehicle.ins2.v_up * 100);
info.V = (int32_t)(calculateTotalVelocity(vehicle.ins2.v_east, vehicle.ins2.v_north,vehicle.ins2.v_up) * 100);
info.K = (int32_t)(vehicle.ins2.yaw * 100);
info.Reserve1 = 0;
info.Reserve2 = 0;
//qDebug() << "infoExportID" << infoExportID;
}
@@ -2237,7 +2233,7 @@ void MavLinkNode::CheckVehicle(int sysid,int compid)
vehicleList.insert(sysid,v);
emit showMessage(tr("出现新的设备,识别号为 %1").arg(v.sysid));
emit showMessage(tr(u8"出现新的设备,识别号为 %1").arg(v.sysid));
emit addVehicles(sysid,compid);
}
}
@@ -2499,77 +2495,88 @@ void MavLinkNode::infoExport(_showinfo info)
// buff[dataCount++] = src.B[3];
#endif
src.D[0] = info.flag;
// 1. Flag (short -> 2字节)
src.D[0] = info.Flag;
buff[dataCount++] = src.B[0];
buff[dataCount++] = src.B[1];
src.H = info.time;
// 2. Src (short -> 2字节)
src.D[0] = info.Src;
buff[dataCount++] = src.B[0];
buff[dataCount++] = src.B[1];
// 3. GpsTime (int32_t -> 4字节)
src.H = info.GpsTime;
buff[dataCount++] = src.B[0];
buff[dataCount++] = src.B[1];
buff[dataCount++] = src.B[2];
buff[dataCount++] = src.B[3];
src.D[0] = info.num;
buff[dataCount++] = src.B[0];
buff[dataCount++] = src.B[1];
src.D[0] = info.id;
buff[dataCount++] = src.B[0];
buff[dataCount++] = src.B[1];
src.D[0] = info.t;
buff[dataCount++] = src.B[0];
buff[dataCount++] = src.B[1];
src.H = info.pe;
// 4. Lan (int32_t -> 4字节)
src.H = info.Lan;
buff[dataCount++] = src.B[0];
buff[dataCount++] = src.B[1];
buff[dataCount++] = src.B[2];
buff[dataCount++] = src.B[3];
src.H = info.pu;
// 5. Lat (int32_t -> 4字节)
src.H = info.Lat;
buff[dataCount++] = src.B[0];
buff[dataCount++] = src.B[1];
buff[dataCount++] = src.B[2];
buff[dataCount++] = src.B[3];
src.H = info.ps;
// 6. Alt (int32_t -> 4字节)
src.H = info.Alt;
buff[dataCount++] = src.B[0];
buff[dataCount++] = src.B[1];
buff[dataCount++] = src.B[2];
buff[dataCount++] = src.B[3];
src.H = info.ve;
// 7. VE (int32_t -> 4字节)
src.H = info.VE;
buff[dataCount++] = src.B[0];
buff[dataCount++] = src.B[1];
buff[dataCount++] = src.B[2];
buff[dataCount++] = src.B[3];
src.H = info.vu;
// 8. VN (int32_t -> 4字节)
src.H = info.VN;
buff[dataCount++] = src.B[0];
buff[dataCount++] = src.B[1];
buff[dataCount++] = src.B[2];
buff[dataCount++] = src.B[3];
src.H = info.vs;
// 9. VU (int32_t -> 4字节)
src.H = info.VU;
buff[dataCount++] = src.B[0];
buff[dataCount++] = src.B[1];
buff[dataCount++] = src.B[2];
buff[dataCount++] = src.B[3];
src.H = info.vt;
// 10. V (int32_t -> 4字节)
src.H = info.V;
buff[dataCount++] = src.B[0];
buff[dataCount++] = src.B[1];
buff[dataCount++] = src.B[2];
buff[dataCount++] = src.B[3];
src.H = info.rcs;
// 11. K (int32_t -> 4字节)
src.H = info.K;
buff[dataCount++] = src.B[0];
buff[dataCount++] = src.B[1];
buff[dataCount++] = src.B[2];
buff[dataCount++] = src.B[3];
src.H = info.reserve;
// 12. Reserve1 (int32_t -> 4字节)
src.H = info.Reserve1;
buff[dataCount++] = src.B[0];
buff[dataCount++] = src.B[1];
buff[dataCount++] = src.B[2];
buff[dataCount++] = src.B[3];
// 13. Reserve2 (int32_t -> 4字节)
src.H = info.Reserve2;
buff[dataCount++] = src.B[0];
buff[dataCount++] = src.B[1];
buff[dataCount++] = src.B[2];
+34 -16
View File
@@ -1,4 +1,4 @@
#ifndef MAVLINKNODE_H
#ifndef MAVLINKNODE_H
#define MAVLINKNODE_H
#include <QObject>
@@ -92,23 +92,41 @@ public:
}_vehicle;
// typedef struct
// {
// int16_t flag;// 标识
// int32_t time;//(second+min*60+hour*3600)*1000
// int16_t num; //飞机数量,默认值为1
// int16_t id;//飞机编号,默认值为1
// int16_t t; //
// int32_t pe; //相对参考点的东向位置,实际值*8,单位为米
// int32_t pu; //相对参考点的天向位置,实际值*8,单位为米
// int32_t ps; //相对参考点的南向位置,实际值*8,单位为米
// int32_t ve; //相对参考点的东向速度,实际值*1024,单位为米/秒
// int32_t vu; //相对参考点的天向速度,实际值*1024,单位为米/秒
// int32_t vs; //相对参考点的南向速度,实际值*1024,单位为米/秒
// int32_t vt; //相对参考点的合速度,实际值*1024,单位为米/秒
// int32_t rcs; //飞机RCS值,默认值为0
// int32_t reserve; //预留位,默认值为0
// }_showinfo;//192.168.5.72:10049
typedef struct
{
int16_t flag;// 标识
int32_t time;//(second+min*60+hour*3600)*1000
int16_t num; //飞机数量,默认值为1
int16_t id;//飞机编号,默认值为1
int16_t t; //
int32_t pe; //相对参考点的东向位置,实际值*8,单位为米
int32_t pu; //相对参考点的天向位置,实际值*8,单位为米
int32_t ps; //相对参考点的南向位置,实际值*8,单位为米
int32_t ve; //相对参考点的东向速度,实际值*1024,单位为米/秒
int32_t vu; //相对参考点的天向速度,实际值*1024,单位为米/秒
int32_t vs; //相对参考点的南向速度,实际值*1024,单位为米/秒
int32_t vt; //相对参考点的合速度,实际值*1024,单位为米/秒
int32_t rcs; //飞机RCS值,默认值为0
int32_t reserve; //预留位,默认值为0
}_showinfo;//192.168.5.72:10049
int16_t Flag; // 0x23f3 标识(每个厂家不一样)
int16_t Src; // 飞机编号
int32_t GpsTime; // (Second + Minute * 60 + Hour * 3600) * 1000 + msec
int32_t Lan; // 经度 * 10000000 度
int32_t Lat; // 纬度 * 10000000 度
int32_t Alt; // 高度 * 100 m
int32_t VE; // 东向速度 * 100 m/s
int32_t VN; // 北向速度 * 100 m/s
int32_t VU; // 天向速度 * 100 m/s
int32_t V; // 东北天合速度 * 100 m/s
int32_t K; // 航向 * 100 度
int32_t Reserve1; // 保留字节
int32_t Reserve2; // 保留字节
}_showinfo;
typedef struct
{
+1 -1
View File
@@ -77,4 +77,4 @@ unix {
system(cp $$src_dir $$dst_dir -arf )
}
QMAKE_CXXFLAGS += /utf-8
+1
View File
@@ -105,6 +105,7 @@ unix {
}
TRANSLATIONS += DLINK_zh_CN.ts
QMAKE_CXXFLAGS += /utf-8
+1
View File
@@ -11,3 +11,4 @@ SUBDIRS += mapwidget
TRANSLATIONS += MAP_zh_CN.ts
QMAKE_CXXFLAGS += /utf-8