M350b版本

This commit is contained in:
xin
2025-12-24 09:09:03 +08:00
parent 22906dd9fa
commit 72b1b29c10
21 changed files with 999 additions and 203 deletions

View File

@ -14,8 +14,9 @@
#include "hal_network.h"
#include "time.h"
#include "ZZ_Types_M300.h"
//#include "ZZ_Types_M300.h"
using namespace ZZ_DATA_DEF::DJI;
#define ZZ_UNUSED(x) ((x) = (x))
#define ZZ_MIN(a, b) (((a) < (b)) ? (a) : (b))
#define ZZ_MAX(a, b) (((a) > (b)) ? (a) : (b))
@ -49,27 +50,27 @@ T_DjiReturnCode VehicleController::DjiTest_FcSubscriptionReceiveFlightStatusCall
T_DjiReturnCode VehicleController::DjiTest_FcSubscriptionReceiveHeightCallback(const uint8_t* data, uint16_t dataSize, const T_DjiDataTimestamp* timestamp)
{
float fHeight = *((T_DjiFcSubscriptionAltitudeFused*)data);
//qDebug() <<"[Fused Height]:"<< fHeight;
// float fHeight = *((T_DjiFcSubscriptionAltitudeFused*)data);
// //qDebug() <<"[Fused Height]:"<< fHeight;
///Pump need to be added
if (m_siFlagIsPumpWorking==0&& fHeight > 10)
{
//system("sudo gpio mode 7 out");
m_siFlagIsPumpWorking = 1;
system("sudo gpio write 7 1");
qDebug() << "[Fused Height]:" << fHeight;
}
if (m_siFlagIsPumpWorking == 1 && fHeight < 10)
{
//system("sudo gpio mode 7 out");
m_siFlagIsPumpWorking = 0;
system("sudo gpio write 7 0");
qDebug() << "[Fused Height]:" << fHeight;
}
//T_DjiOsalHandler* osalHandler = DjiPlatform_GetOsalHandler();
//osalHandler->TaskSleepMs(2000);
// ///Pump need to be added
// if (m_siFlagIsPumpWorking==0&& fHeight > 10)
//{
// //system("sudo gpio mode 7 out");
// m_siFlagIsPumpWorking = 1;
// system("sudo gpio write 7 1");
// qDebug() << "[Fused Height]:" << fHeight;
// }
// if (m_siFlagIsPumpWorking == 1 && fHeight < 10)
// {
// //system("sudo gpio mode 7 out");
// m_siFlagIsPumpWorking = 0;
// system("sudo gpio write 7 0");
// qDebug() << "[Fused Height]:" << fHeight;
// }
//
// //T_DjiOsalHandler* osalHandler = DjiPlatform_GetOsalHandler();
// //osalHandler->TaskSleepMs(2000);
return 0;
}
@ -82,37 +83,41 @@ T_DjiReturnCode VehicleController::ZZ_DjiWaypointV2EventCallback(T_DjiWaypointV2
}
if (eventData.event == 0x10)
{
if (eventData.data.waypointIndex==0 && m_siFlagIsStartCaptureSignalEmitted==0)
{
if (m_scCaptureMode==0)
{
m_siFlagIsStartCaptureSignalEmitted++;
spCaller->emit Signal_StartCapture();
}
// emit Signal_StartCapture();
}
// if (eventData.data.waypointIndex==0 && m_siFlagIsStartCaptureSignalEmitted==0)
// {
// if (m_scCaptureMode==0)
// {
// m_siFlagIsStartCaptureSignalEmitted++;
//spCaller->emit Signal_StartCapture();
// }
// // emit Signal_StartCapture();
//
// }
}
if (eventData.event == 0x11)
{
qDebug() << "eventData.event" << m_siFlagIsStartCaptureSignalEmitted;
if (m_siFlagIsStartCaptureSignalEmitted > 0)
/*if (m_siFlagIsStartCaptureSignalEmitted > 0)
{
m_siFlagIsStartCaptureSignalEmitted = 0;
spCaller->emit Signal_StopCapture();
}
}*/
}
return 0;
}
int VehicleController::Initialize()
{
//m_clsWidget.GetSettings(m_struUIConfig);
m_clsConfigParser.GetParams(m_struAppRegInfo, m_struHardwareInfo, m_struSensorPort);
//m_clsConfigParser.UpdateUIConfig(m_struUIConfig);
return 0;
}
int VehicleController::SetupEnvironment_M300RTK()
int VehicleController::SetupEnvironment()
{
using namespace ZZ::Device::DJI::M300RTK;
// using namespace ZZ::Device::DJI::M300RTK;
spCaller = this;
@ -121,7 +126,7 @@ int VehicleController::SetupEnvironment_M300RTK()
//clsConfigParser.GetParams(m_struAppRegInfo, m_struHardwareInfo, m_struUIConfig);
//
//for use
m_clsConfigParser.GetParams(m_struAppRegInfo, m_struHardwareInfo, m_struUIConfig);
//m_clsConfigParser.GetParams(m_struAppRegInfo, m_struHardwareInfo, m_struUIConfig);
@ -212,8 +217,18 @@ int VehicleController::SetupEnvironment_M300RTK()
qDebug() << "VehicleController: Func DjiPlatform_RegHalUartHandler. Register hal uart handler error";
throw std::runtime_error("Register hal uart handler error.");
}
if (m_struHardwareInfo.enumHCM == HardwareConnectionMode::UartAndNetwork)
//
// if (/*m_struHardwareInfo.enumHCM == HardwareConnectionMode::UartAndUSBBulk*/1)
// {
// returnCode = DjiPlatform_RegHalUsbBulkHandler(&usbBulkHandler);
// if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
// {
// qDebug() << "VehicleController: Func DjiPlatform_RegHalUsbBulkHandler. Register hal usb bulk handler error";
// throw std::runtime_error("Register hal usb bulk handler error.");
// }
// }
if (/*m_struHardwareInfo.enumHCM == HardwareConnectionMode::UartAndNetwork*/ 1)
{
returnCode = DjiPlatform_RegHalNetworkHandler(&networkHandler);
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
@ -222,29 +237,29 @@ int VehicleController::SetupEnvironment_M300RTK()
throw std::runtime_error("Register hal network handler error");
}
}
else if (m_struHardwareInfo.enumHCM == HardwareConnectionMode::UartAndUSBBulk)
{
returnCode = DjiPlatform_RegHalUsbBulkHandler(&usbBulkHandler);
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
{
qDebug() << "VehicleController: Func DjiPlatform_RegHalUsbBulkHandler. Register hal usb bulk handler error";
throw std::runtime_error("Register hal usb bulk handler error.");
}
}
else if (m_struHardwareInfo.enumHCM == HardwareConnectionMode::UartOnly)
{
returnCode = DjiPlatform_RegSocketHandler(&socketHandler);
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
{
qDebug() << "VehicleController: Func DjiPlatform_RegSocketHandler. Register osal socket handler error";
throw std::runtime_error("register osal socket handler error");
}
}
else
{
qDebug() << "VehicleController: Func DjiPlatform_RegSocketHandler. Register osal socket handler error";
throw std::runtime_error("hardware connection configuration error");
}
//else if (m_struHardwareInfo.enumHCM == HardwareConnectionMode::UartAndUSBBulk)
//{
// returnCode = DjiPlatform_RegHalUsbBulkHandler(&usbBulkHandler);
// if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
// {
// qDebug() << "VehicleController: Func DjiPlatform_RegHalUsbBulkHandler. Register hal usb bulk handler error";
// throw std::runtime_error("Register hal usb bulk handler error.");
// }
// }
//else if (m_struHardwareInfo.enumHCM == HardwareConnectionMode::UartOnly)
//{
// returnCode = DjiPlatform_RegSocketHandler(&socketHandler);
// if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
// {
// qDebug() << "VehicleController: Func DjiPlatform_RegSocketHandler. Register osal socket handler error";
// throw std::runtime_error("register osal socket handler error");
// }
//}
//else
//{
// qDebug() << "VehicleController: Func DjiPlatform_RegSocketHandler. Register osal socket handler error";
// throw std::runtime_error("hardware connection configuration error");
//}
returnCode = DjiPlatform_RegFileSystemHandler(&fileSystemHandler);
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
@ -264,8 +279,9 @@ int VehicleController::SetupEnvironment_M300RTK()
return 0;
}
int VehicleController::StartupPSDK_M300RTK()
int VehicleController::StartupPSDK_M350RTK()
{
T_DjiUserInfo userInfo;
T_DjiReturnCode returnCode;
T_DjiAircraftInfoBaseInfo aircraftInfoBaseInfo;
@ -308,27 +324,27 @@ int VehicleController::StartupPSDK_M300RTK()
throw std::runtime_error("Start sdk application error.");
}
//osalHandler->TaskSleepMs(5000);
SetupWidget();//<2F>ɼ<EFBFBD><C9BC>߼<EFBFBD><DFBC>л<EFBFBD>
//osalHandler->TaskSleepMs(5000);
SetupMessagePipe();//widget<65><74>vehicle
SetupWaypointStatusCallback();
InitSystemParams();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><E4A3AC><EFBFBD><EFBFBD>ϵͳʱ<CDB3>䣬Ȼ<E4A3AC><C8BB>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD>Ϊ<EFBFBD>޷<EFBFBD>ͬʱ<CDAC><CAB1><EFBFBD><EFBFBD>5<EFBFBD><35><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
SetupSubscriptions();//ʵ<><CAB5><EFBFBD><EFBFBD>Ҫ<EFBFBD>Ķ<EFBFBD><C4B6>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD>̫<EFBFBD><CCAB><EFBFBD><EFBFBD>
osalHandler->TaskSleepMs(5000);
SetupWidget();
osalHandler->TaskSleepMs(5000);
SetupMessagePipe();
//SetupWaypointStatusCallback();
//InitSystemParams();
SetupSubscriptions();
qDebug()<<"M300RTK PSDK Channel Started.";
qDebug()<<"M350RTK PSDK Channel Started.";
return 0;
}
int VehicleController::UpdateUIConfig()
{
m_clsWidget.GetSettings(m_struUIConfig);
m_clsConfigParser.UpdateUIConfig(m_struUIConfig);
//m_clsWidget.GetSettings(m_struUIConfig);
//m_clsConfigParser.UpdateUIConfig(m_struUIConfig);
return 0;
}
int VehicleController::GetOneDataFrame(M300RTKDataFrame& M300RTKDataFrame)
int VehicleController::GetOneDataFrame(M350RTKDataFrame& M350RTKDataFrame)
{
T_DjiReturnCode tDjiReturnCode;
T_DjiFcSubscriptionVelocity tDjiVelocity = { 0 };
@ -372,29 +388,29 @@ int VehicleController::GetOneDataFrame(M300RTKDataFrame& M300RTKDataFrame)
//return 4;
}
M300RTKDataFrame.stVelocity.x = tDjiVelocity.data.x;
M300RTKDataFrame.stVelocity.y = tDjiVelocity.data.y;
M300RTKDataFrame.stVelocity.z = tDjiVelocity.data.z;
M350RTKDataFrame.stVelocity.x = tDjiVelocity.data.x;
M350RTKDataFrame.stVelocity.y = tDjiVelocity.data.y;
M350RTKDataFrame.stVelocity.z = tDjiVelocity.data.z;
M300RTKDataFrame.stQuaternion.w_q0 = tDjiQuaternion.q0;
M300RTKDataFrame.stQuaternion.x_q1 = tDjiQuaternion.q1;
M300RTKDataFrame.stQuaternion.y_q2 = tDjiQuaternion.q2;
M300RTKDataFrame.stQuaternion.z_q3 = tDjiQuaternion.q3;
M350RTKDataFrame.stQuaternion.w_q0 = tDjiQuaternion.q0;
M350RTKDataFrame.stQuaternion.x_q1 = tDjiQuaternion.q1;
M350RTKDataFrame.stQuaternion.y_q2 = tDjiQuaternion.q2;
M350RTKDataFrame.stQuaternion.z_q3 = tDjiQuaternion.q3;
M300RTKDataFrame.stGPSPosition.x = tDjiGpsPosition.x;
M300RTKDataFrame.stGPSPosition.y = tDjiGpsPosition.y;
M300RTKDataFrame.stGPSPosition.z = tDjiGpsPosition.z;
M350RTKDataFrame.stGPSPosition.x = tDjiGpsPosition.x;
M350RTKDataFrame.stGPSPosition.y = tDjiGpsPosition.y;
M350RTKDataFrame.stGPSPosition.z = tDjiGpsPosition.z;
M300RTKDataFrame.fAltitudeFused = tDjiAltFused;
M350RTKDataFrame.fAltitudeFused = tDjiAltFused;
//////////////////////////////////////////////////////////////////////////Calc Euler From Quaternion 20230428
M300RTKDataFrame.stEulerAngle.pitch = (dji_f64_t)asinf(-2 * tDjiQuaternion.q1 * tDjiQuaternion.q3 + 2 * tDjiQuaternion.q0 * tDjiQuaternion.q2) * 57.3;
M350RTKDataFrame.stEulerAngle.pitch = (dji_f64_t)asinf(-2 * tDjiQuaternion.q1 * tDjiQuaternion.q3 + 2 * tDjiQuaternion.q0 * tDjiQuaternion.q2) * 57.3;
M300RTKDataFrame.stEulerAngle.roll = (dji_f64_t)atan2f(2 * tDjiQuaternion.q2 * tDjiQuaternion.q3 + 2 * tDjiQuaternion.q0 * tDjiQuaternion.q1,
M350RTKDataFrame.stEulerAngle.roll = (dji_f64_t)atan2f(2 * tDjiQuaternion.q2 * tDjiQuaternion.q3 + 2 * tDjiQuaternion.q0 * tDjiQuaternion.q1,
-2 * tDjiQuaternion.q1 * tDjiQuaternion.q1 - 2 * tDjiQuaternion.q2 * tDjiQuaternion.q2 + 1) * 57.3;
M300RTKDataFrame.stEulerAngle.yaw = (dji_f64_t)atan2f(2 * tDjiQuaternion.q1 * tDjiQuaternion.q2 + 2 * tDjiQuaternion.q0 * tDjiQuaternion.q3,
M350RTKDataFrame.stEulerAngle.yaw = (dji_f64_t)atan2f(2 * tDjiQuaternion.q1 * tDjiQuaternion.q2 + 2 * tDjiQuaternion.q0 * tDjiQuaternion.q3,
-2 * tDjiQuaternion.q2 * tDjiQuaternion.q2 - 2 * tDjiQuaternion.q3 * tDjiQuaternion.q3 + 1) * 57.3;
//////////////////////////////////////////////////////////////////////////
@ -410,24 +426,24 @@ int VehicleController::SetupSubscriptions()
{
T_DjiReturnCode tDjiReturnCode;
// tDjiReturnCode = DjiFcSubscription_Init();
// if (tDjiReturnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
// {
// qDebug() << "init data subscription module error.";
// return 0;
// }
// else
// {
// qDebug() << "init data subscription module finished.";
// }
tDjiReturnCode = DjiFcSubscription_Init();
if (tDjiReturnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
{
qDebug() << "init data subscription module error.";
return 0;
}
else
{
qDebug() << "init data subscription module finished.";
}
tDjiReturnCode = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_HEIGHT_FUSION, DJI_DATA_SUBSCRIPTION_TOPIC_1_HZ, DjiTest_FcSubscriptionReceiveHeightCallback);
if (tDjiReturnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
{
// tDjiReturnCode = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_HEIGHT_FUSION, DJI_DATA_SUBSCRIPTION_TOPIC_1_HZ, DjiTest_FcSubscriptionReceiveHeightCallback);
//if (tDjiReturnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
//{
qDebug() << "Subscribe topic DJI_FC_SUBSCRIPTION_TOPIC_HEIGHT_FUSION error.";
return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
// qDebug() << "Subscribe topic DJI_FC_SUBSCRIPTION_TOPIC_HEIGHT_FUSION error.";
// return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
//}
tDjiReturnCode = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_VELOCITY, DJI_DATA_SUBSCRIPTION_TOPIC_5_HZ, NULL);
if (tDjiReturnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS)
@ -492,7 +508,7 @@ int VehicleController::SetupWaypointStatusCallback()
int VehicleController::LoadUserAppInfo(T_DjiUserInfo* struDjiUserInfo)
{
using namespace ZZ::Device::DJI::M300RTK;
//using namespace ZZ::Device::DJI::M300RTK;
memset(struDjiUserInfo->appName, 0, sizeof(struDjiUserInfo->appName));
memset(struDjiUserInfo->appId, 0, sizeof(struDjiUserInfo->appId));
@ -501,22 +517,38 @@ int VehicleController::LoadUserAppInfo(T_DjiUserInfo* struDjiUserInfo)
memset(struDjiUserInfo->developerAccount, 0, sizeof(struDjiUserInfo->developerAccount));
memset(struDjiUserInfo->baudRate, 0, sizeof(struDjiUserInfo->baudRate));
if (m_struAppRegInfo.qstrUserAppName.length() >= sizeof(struDjiUserInfo->appName) ||
m_struAppRegInfo.qstrUserAppID.length() > sizeof(struDjiUserInfo->appId) ||
m_struAppRegInfo.qstrUserAppKey.length() > sizeof(struDjiUserInfo->appKey) ||
m_struAppRegInfo.qstrUserAppLic.length() > sizeof(struDjiUserInfo->appLicense) ||
m_struAppRegInfo.qstrUserAppAcc.length() >= sizeof(struDjiUserInfo->developerAccount) ||
m_struHardwareInfo.qstrBaudRate.length() > sizeof(struDjiUserInfo->baudRate))
{
qDebug()<<"VehicleController:LoadUserAppInfo.Length of user information string is beyond limit,Please check";
return DJI_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER;
}
//struDjiUserInfo->appName = "Project_Fiora";
//struDjiUserInfo->appId = "151266";
//struDjiUserInfo->appKey = "d8bc685458ca5dca9280abcdc992d93";
//struDjiUserInfo->appLicense = "lXcHSZDwjws7SQnm3TjUINbKIyCC7438vJqiRBBhGe/ckOg3WmhhbYJC5aS/uKSRRMnB2UrqmiE6z+Ta+fBbUOmQUObSQJFrn/VHAsgGKR9nOMdrRNDDSwBbfLcheDIbJwjVmBAgk8RPcTZPH3WNtCohlRcpxuLIrG7oUWaawbLDwwwJ11hx5RqKKHn31I/CXTrbYQbJOm2Da32l/U7/BPF22eBUIJKts7aNfBBbFESNJI3p/xosmxfALkuXYKXMGBiIHk9bu+u0dT53Ddhz++tHh/oFyNQuyhCH4EtecvZu0PR3aMsmxyXbvXhAIocB5+AKZN+kykxhF8ToQS61bQ==";
//struDjiUserInfo->developerAccount = "1033584732@qq.com";
//struDjiUserInfo->baudRate = "460800";
//strncpy(struDjiUserInfo->appName, "Project_Fiora", sizeof(struDjiUserInfo->appName));
//strncpy(struDjiUserInfo->appId, "151266", sizeof(struDjiUserInfo->appId));
//strncpy(struDjiUserInfo->appKey, "d8bc685458ca5dca9280abcdc992d93", sizeof(struDjiUserInfo->appKey));
//strncpy(struDjiUserInfo->appLicense, "lXcHSZDwjws7SQnm3TjUINbKIyCC7438vJqiRBBhGe/ckOg3WmhhbYJC5aS/uKSRRMnB2UrqmiE6z+Ta+fBbUOmQUObSQJFrn/VHAsgGKR9nOMdrRNDDSwBbfLcheDIbJwjVmBAgk8RPcTZPH3WNtCohlRcpxuLIrG7oUWaawbLDwwwJ11hx5RqKKHn31I/CXTrbYQbJOm2Da32l/U7/BPF22eBUIJKts7aNfBBbFESNJI3p/xosmxfALkuXYKXMGBiIHk9bu+u0dT53Ddhz++tHh/oFyNQuyhCH4EtecvZu0PR3aMsmxyXbvXhAIocB5+AKZN+kykxhF8ToQS61bQ==", sizeof(struDjiUserInfo->appLicense));
//strncpy(struDjiUserInfo->developerAccount, "1033584732@qq.com", sizeof(struDjiUserInfo->developerAccount));
//strncpy(struDjiUserInfo->baudRate, "921600", sizeof(struDjiUserInfo->baudRate));
//if (m_struAppRegInfo.qstrUserAppName.length() >= sizeof(struDjiUserInfo->appName) ||
// m_struAppRegInfo.qstrUserAppID.length() > sizeof(struDjiUserInfo->appId) ||
// m_struAppRegInfo.qstrUserAppKey.length() > sizeof(struDjiUserInfo->appKey) ||
// m_struAppRegInfo.qstrUserAppLic.length() > sizeof(struDjiUserInfo->appLicense) ||
// m_struAppRegInfo.qstrUserAppAcc.length() >= sizeof(struDjiUserInfo->developerAccount) ||
// m_struHardwareInfo.qstrBaudRate.length() > sizeof(struDjiUserInfo->baudRate))
// {
// qDebug()<<"VehicleController:LoadUserAppInfo.Length of user information string is beyond limit,Please check";
// return DJI_ERROR_SYSTEM_MODULE_CODE_INVALID_PARAMETER;
//}
strncpy(struDjiUserInfo->appName, m_struAppRegInfo.qstrUserAppName.toLatin1().data(), m_struAppRegInfo.qstrUserAppName.length());
memcpy(struDjiUserInfo->appId, m_struAppRegInfo.qstrUserAppID.toLatin1().data(), ZZ_MIN(sizeof(struDjiUserInfo->appId), m_struAppRegInfo.qstrUserAppID.length()));
memcpy(struDjiUserInfo->appKey, m_struAppRegInfo.qstrUserAppKey.toLatin1().data(), ZZ_MIN(sizeof(struDjiUserInfo->appKey), m_struAppRegInfo.qstrUserAppKey.length()));
memcpy(struDjiUserInfo->appLicense, m_struAppRegInfo.qstrUserAppLic.toLatin1().data(),
ZZ_MIN(sizeof(struDjiUserInfo->appLicense), m_struAppRegInfo.qstrUserAppLic.length()));
memcpy(struDjiUserInfo->appLicense, m_struAppRegInfo.qstrUserAppLic.toLatin1().data(),ZZ_MIN(sizeof(struDjiUserInfo->appLicense), m_struAppRegInfo.qstrUserAppLic.length()));
memcpy(struDjiUserInfo->baudRate, m_struHardwareInfo.qstrBaudRate.toLatin1().data(), ZZ_MIN(sizeof(struDjiUserInfo->baudRate), m_struHardwareInfo.qstrBaudRate.length()));
strncpy(struDjiUserInfo->developerAccount, m_struAppRegInfo.qstrUserAppAcc.toLatin1().data(), sizeof(struDjiUserInfo->developerAccount) - 1);
@ -532,22 +564,22 @@ T_DjiReturnCode VehicleController::DjiUser_PrintMessage(const uint8_t* data, uin
int VehicleController::SetupMessagePipe()
{
connect(&m_clsWidget, &ZZ_Widget_M300RTK::Signal_UpdateCaptureMode, this, &VehicleController::Slot_OnChangeCaptureMode);
// connect(&m_clsWidget, &ZZ_Widget_M300RTK::Signal_UpdateCaptureMode, this, &VehicleController::Slot_OnChangeCaptureMode);
connect(&m_clsWidget, &ZZ_Widget_M300RTK::Signal_StartCapture, this, &VehicleController::Signal_StartCapture);
connect(&m_clsWidget, &ZZ_Widget_M300RTK::Signal_StopCapture, this, &VehicleController::Signal_StopCapture);
connect(&m_clsWidget, &ZZ_Widget_M300RTK::Signal_StopCapture, this, &VehicleController::Signal_StopCapture);
connect(this, &VehicleController::Signal_UpdateVehicleMessage, &m_clsWidget, &ZZ_Widget_M300RTK::Slot_UpdatePSDKFloatMessage);
/// for test
#ifdef ZZ_FLAG_TEST
connect(this, &VehicleController::Signal_StartCapture, this, &VehicleController::Slot_TestStartCapture);
connect(this, &VehicleController::Signal_StopCapture, this, &VehicleController::Slot_TestStopCapture);
#endif
// /// for test
//#ifdef ZZ_FLAG_TEST
// connect(this, &VehicleController::Signal_StartCapture, this, &VehicleController::Slot_TestStartCapture);
// connect(this, &VehicleController::Signal_StopCapture, this, &VehicleController::Slot_TestStopCapture);
//#endif
return 0;
}
int VehicleController::SetupWidget()
{
m_clsWidget.SetUIFilePath("/home/DJI/Widget",100);
m_clsWidget.SetSettings(m_struUIConfig);
m_clsWidget.SetUIFilePath(const_cast<char*>("/home/DJI/Widget"),100);
// m_clsWidget.SetSettings(m_struUIConfig);
m_clsWidget.PreparteEnvironment();
return 0;