b
This commit is contained in:
+1
-1
@@ -13,7 +13,7 @@ Vehicle::~Vehicle()
|
||||
|
||||
void Vehicle::setType(int t)
|
||||
{
|
||||
type = t;
|
||||
//type = t;
|
||||
}
|
||||
|
||||
void Vehicle::setMsg(int idx,int m)
|
||||
|
||||
@@ -9,6 +9,16 @@
|
||||
#include "QMap"
|
||||
#include "VehicleType.h"
|
||||
|
||||
|
||||
/*
|
||||
|
||||
航线 航迹 图片 颜色
|
||||
|
||||
参数 状态 指令
|
||||
|
||||
*/
|
||||
|
||||
|
||||
class VEHICLEMANAGE_EXPORT Vehicle : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -22,12 +32,25 @@ signals:
|
||||
|
||||
public slots:
|
||||
|
||||
void setSysID(int id)
|
||||
{
|
||||
sysid = id;
|
||||
}
|
||||
|
||||
int SysID(void)
|
||||
{
|
||||
return sysid;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void setType(int t);
|
||||
|
||||
void setMsg(int idx, int m);
|
||||
void setParam(int idx,param *p);
|
||||
void setMission(int idx, item_int *i);
|
||||
|
||||
|
||||
private slots:
|
||||
|
||||
|
||||
@@ -37,7 +60,6 @@ private:
|
||||
|
||||
int sysid;
|
||||
|
||||
int type;
|
||||
|
||||
|
||||
state m_state;
|
||||
|
||||
+3
-1
@@ -14,7 +14,9 @@ void VehicleManage::addVehicle(int sysid)
|
||||
{
|
||||
Vehicle *v = new Vehicle();
|
||||
|
||||
Vehicles.insert(sysid,v);
|
||||
v->setSysID(sysid);
|
||||
|
||||
Vehicles.insert(v->SysID(),v);
|
||||
}
|
||||
|
||||
void VehicleManage::setMsg(int sysid,int s)
|
||||
|
||||
+5
-1
@@ -14,6 +14,10 @@ public:
|
||||
explicit VehicleManage();
|
||||
~VehicleManage();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
signals:
|
||||
|
||||
void PluginLoading(bool flag);
|
||||
@@ -23,7 +27,7 @@ public slots:
|
||||
void addVehicle(int sysid);
|
||||
|
||||
private slots:
|
||||
|
||||
void setMsg(int sysid,int s);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
+12
-3
@@ -23,10 +23,19 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||
|
||||
DESTDIR = $$PWD/bin
|
||||
MOC_DIR = $$PWD/build
|
||||
OBJECTS_DIR = $$PWD/build
|
||||
|
||||
DESTDIR = $$PWD/../bin
|
||||
MOC_DIR = $$PWD/../build
|
||||
OBJECTS_DIR = $$PWD/../build
|
||||
|
||||
#添加mavlink目录
|
||||
INCLUDEPATH += $$PWD/../mavlink \
|
||||
$$PWD/../mavlink/ardupilotmega \
|
||||
$$PWD/../mavlink/common \
|
||||
$$PWD/../mavlink/icarous \
|
||||
$$PWD/../mavlink/uAvionix \
|
||||
$$PWD/../mavlink/XYK \
|
||||
$$PWD/../mavlink/message_definitions
|
||||
|
||||
SOURCES += \
|
||||
Vehicle.cpp \
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="VehicleManage_zh_CN"></TS>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="VehicleManage_zh_CN">
|
||||
</TS>
|
||||
|
||||
+48
-5
@@ -4,6 +4,9 @@
|
||||
#include "QDebug"
|
||||
#include "QObject"
|
||||
|
||||
|
||||
#include "mavlink.h"
|
||||
|
||||
typedef struct __state
|
||||
{
|
||||
bool isSeleted = false;
|
||||
@@ -83,13 +86,53 @@ typedef struct __item_int {
|
||||
} item_int;
|
||||
|
||||
|
||||
typedef struct {
|
||||
int sysid; /* ID of message sender system/aircraft */
|
||||
int compid; /* ID of the message sender component */
|
||||
|
||||
mavlink_autopilot_version_t autopilot_version;
|
||||
mavlink_sys_status_t sys_status;
|
||||
mavlink_heartbeat_t heartbeat;
|
||||
mavlink_ping_t ping;
|
||||
mavlink_attitude_t attitude;
|
||||
mavlink_ins1_t ins1;
|
||||
mavlink_ins2_t ins2;
|
||||
mavlink_gps_raw_int_t gps_raw_int;
|
||||
mavlink_global_position_int_t global_position_int;
|
||||
mavlink_servo_output_raw_t servo_output_raw;
|
||||
mavlink_rc_channels_raw_t rc_channels_raw;
|
||||
mavlink_nav_controller_output_t nav_controller_output;
|
||||
mavlink_airspeed_autocal_t airspeed_autocal;
|
||||
mavlink_rpm_t rpm;
|
||||
mavlink_scaled_pressure_t scaled_pressure;
|
||||
mavlink_extended_sys_state_t extended_sys_state;
|
||||
mavlink_battery_status_t battery_status;
|
||||
mavlink_vibration_t vibration;
|
||||
mavlink_enginestate_t enginestate;
|
||||
mavlink_vfr_hud_t vfr_hud;
|
||||
mavlink_aoa_ssa_t aoa_ssa;
|
||||
mavlink_emb_atmo_com_t emb_atom_com;
|
||||
mavlink_turbinestate_t turbinstate;
|
||||
mavlink_bmustate_t bmustate;
|
||||
mavlink_ccmstate_t ccmstate;
|
||||
mavlink_serial_control_t serial_control;
|
||||
|
||||
}_vehicle;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* 历史 -1指令
|
||||
* -2参数
|
||||
* -3消息
|
||||
* -4状态
|
||||
* 当前 -状态
|
||||
* -参数
|
||||
* -指令
|
||||
* -消息
|
||||
* -航线
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user