NEW: release DJI Payload-SDK version 3.12.0
This commit is contained in:
@ -33,6 +33,7 @@
|
||||
#include "dji_gimbal.h"
|
||||
#include "dji_xport.h"
|
||||
#include "gimbal_emu/test_payload_gimbal_emu.h"
|
||||
#include <widget_interaction_test/test_widget_interaction.h>
|
||||
|
||||
/* Private constants ---------------------------------------------------------*/
|
||||
#define PAYLOAD_CAMERA_EMU_TASK_FREQ (100)
|
||||
@ -118,6 +119,7 @@ static T_TestCameraGimbalRotationArgument s_tapZoomNewestGimbalRotationArgument
|
||||
static uint32_t s_tapZoomNewestTargetHybridFocalLength = 0; // unit: 0.1mm
|
||||
static T_DjiMutexHandle s_tapZoomMutex = NULL;
|
||||
static E_DjiCameraVideoStreamType s_cameraVideoStreamType;
|
||||
static uint32_t s_currentVideoRecordTimeInSeconds = 0;
|
||||
|
||||
/* Private functions declaration ---------------------------------------------*/
|
||||
static T_DjiReturnCode GetSystemState(T_DjiCameraSystemState *systemState);
|
||||
@ -205,6 +207,7 @@ static T_DjiReturnCode SetMode(E_DjiCameraMode mode)
|
||||
|
||||
s_cameraState.cameraMode = mode;
|
||||
USER_LOG_INFO("set camera mode:%d", mode);
|
||||
DjiTest_WidgetLogAppend("set cam mode %d", mode);
|
||||
|
||||
returnCode = osalHandler->MutexUnlock(s_commonMutex);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
@ -235,6 +238,7 @@ static T_DjiReturnCode StartRecordVideo(void)
|
||||
|
||||
s_cameraState.isRecording = true;
|
||||
USER_LOG_INFO("start record video");
|
||||
DjiTest_WidgetLogAppend("start record video");
|
||||
|
||||
out:
|
||||
djiStat = osalHandler->MutexUnlock(s_commonMutex);
|
||||
@ -267,6 +271,7 @@ static T_DjiReturnCode StopRecordVideo(void)
|
||||
s_cameraState.isRecording = false;
|
||||
s_cameraState.currentVideoRecordingTimeInSeconds = 0;
|
||||
USER_LOG_INFO("stop record video");
|
||||
DjiTest_WidgetLogAppend("stop record video");
|
||||
|
||||
out:
|
||||
djiStat = osalHandler->MutexUnlock(s_commonMutex);
|
||||
@ -290,6 +295,7 @@ static T_DjiReturnCode StartShootPhoto(void)
|
||||
}
|
||||
|
||||
USER_LOG_INFO("start shoot photo");
|
||||
DjiTest_WidgetLogAppend("start shoot photo");
|
||||
s_cameraState.isStoring = true;
|
||||
|
||||
if (s_cameraShootPhotoMode == DJI_CAMERA_SHOOT_PHOTO_MODE_SINGLE) {
|
||||
@ -300,6 +306,7 @@ static T_DjiReturnCode StartShootPhoto(void)
|
||||
s_cameraState.shootingState = DJI_CAMERA_SHOOTING_INTERVAL_PHOTO;
|
||||
s_cameraState.isShootingIntervalStart = true;
|
||||
s_cameraState.currentPhotoShootingIntervalTimeInSeconds = s_cameraPhotoTimeIntervalSettings.timeIntervalSeconds;
|
||||
s_cameraState.currentPhotoShootingIntervalTimeInMs = s_cameraPhotoTimeIntervalSettings.timeIntervalMilliseconds;
|
||||
}
|
||||
|
||||
returnCode = osalHandler->MutexUnlock(s_commonMutex);
|
||||
@ -323,6 +330,7 @@ static T_DjiReturnCode StopShootPhoto(void)
|
||||
}
|
||||
|
||||
USER_LOG_INFO("stop shoot photo");
|
||||
DjiTest_WidgetLogAppend("stop shoot photo");
|
||||
s_cameraState.shootingState = DJI_CAMERA_SHOOTING_PHOTO_IDLE;
|
||||
s_cameraState.isStoring = false;
|
||||
s_cameraState.isShootingIntervalStart = false;
|
||||
@ -439,8 +447,9 @@ static T_DjiReturnCode SetPhotoTimeIntervalSettings(T_DjiCameraPhotoTimeInterval
|
||||
|
||||
s_cameraPhotoTimeIntervalSettings.captureCount = settings.captureCount;
|
||||
s_cameraPhotoTimeIntervalSettings.timeIntervalSeconds = settings.timeIntervalSeconds;
|
||||
USER_LOG_INFO("set photo interval settings count:%d seconds:%d", settings.captureCount,
|
||||
settings.timeIntervalSeconds);
|
||||
s_cameraPhotoTimeIntervalSettings.timeIntervalMilliseconds = settings.timeIntervalMilliseconds;
|
||||
USER_LOG_INFO("set photo interval settings count:%d seconds:%d.%d", settings.captureCount,
|
||||
settings.timeIntervalSeconds, settings.timeIntervalMilliseconds / 100);
|
||||
s_cameraState.currentPhotoShootingIntervalCount = settings.captureCount;
|
||||
|
||||
returnCode = osalHandler->MutexUnlock(s_commonMutex);
|
||||
@ -907,7 +916,17 @@ static T_DjiReturnCode DjiTest_CameraRotationGimbal(T_TestCameraGimbalRotationAr
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
if (aircraftBaseInfo.djiAdapterType == DJI_SDK_ADAPTER_TYPE_XPORT) {
|
||||
if (aircraftBaseInfo.djiAdapterType == DJI_SDK_ADAPTER_TYPE_SKYPORT_V2 ||
|
||||
aircraftBaseInfo.djiAdapterType == DJI_SDK_ADAPTER_TYPE_SKYPORT_V3 ||
|
||||
aircraftBaseInfo.djiAdapterType == DJI_SDK_ADAPTER_TYPE_EPORT_V2_RIBBON_CABLE ||
|
||||
aircraftBaseInfo.djiAdapterType == DJI_SDK_ADAPTER_TYPE_NONE) {
|
||||
returnCode = DjiTest_GimbalRotate(gimbalRotationArgument.rotationMode, gimbalRotationArgument.rotationProperty,
|
||||
gimbalRotationArgument.rotationValue);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("rotate gimbal error: 0x%08llX.", returnCode);
|
||||
return returnCode;
|
||||
}
|
||||
} else if (aircraftBaseInfo.djiAdapterType == DJI_SDK_ADAPTER_TYPE_XPORT) {
|
||||
returnCode = DjiXPort_RotateSync(gimbalRotationArgument.rotationMode, gimbalRotationArgument.rotationProperty,
|
||||
gimbalRotationArgument.rotationValue);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
@ -938,6 +957,7 @@ static void *UserCamera_Task(void *arg)
|
||||
uint32_t currentTime = 0;
|
||||
bool isStartIntervalPhotoAction = false;
|
||||
T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler();
|
||||
uint32_t intervalFreq = 10;
|
||||
|
||||
USER_UTIL_UNUSED(arg);
|
||||
|
||||
@ -1130,8 +1150,7 @@ out:
|
||||
}
|
||||
}
|
||||
|
||||
// 1Hz
|
||||
if (USER_UTIL_IS_WORK_TURN(step, 1, PAYLOAD_CAMERA_EMU_TASK_FREQ)) {
|
||||
if (USER_UTIL_IS_WORK_TURN(step, intervalFreq, PAYLOAD_CAMERA_EMU_TASK_FREQ)) {
|
||||
returnCode = osalHandler->MutexLock(s_commonMutex);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("lock mutex error: 0x%08llX.", returnCode);
|
||||
@ -1139,13 +1158,21 @@ out:
|
||||
}
|
||||
|
||||
if (s_cameraState.isRecording) {
|
||||
s_cameraState.currentVideoRecordingTimeInSeconds++;
|
||||
s_cameraSDCardState.remainSpaceInMB =
|
||||
s_cameraSDCardState.remainSpaceInMB - SDCARD_PER_SECONDS_RECORD_SPACE_IN_MB;
|
||||
if (s_cameraSDCardState.remainSpaceInMB > SDCARD_TOTAL_SPACE_IN_MB) {
|
||||
s_cameraSDCardState.remainSpaceInMB = 0;
|
||||
s_cameraSDCardState.isFull = true;
|
||||
uint16_t preTimeInSeconds = s_cameraState.currentVideoRecordingTimeInSeconds;
|
||||
|
||||
s_currentVideoRecordTimeInSeconds++;
|
||||
|
||||
s_cameraState.currentVideoRecordingTimeInSeconds = s_currentVideoRecordTimeInSeconds / intervalFreq;
|
||||
if (s_cameraState.currentVideoRecordingTimeInSeconds > preTimeInSeconds) {
|
||||
s_cameraSDCardState.remainSpaceInMB =
|
||||
s_cameraSDCardState.remainSpaceInMB - SDCARD_PER_SECONDS_RECORD_SPACE_IN_MB;
|
||||
if (s_cameraSDCardState.remainSpaceInMB > SDCARD_TOTAL_SPACE_IN_MB) {
|
||||
s_cameraSDCardState.remainSpaceInMB = 0;
|
||||
s_cameraSDCardState.isFull = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
s_currentVideoRecordTimeInSeconds = 0;
|
||||
}
|
||||
|
||||
if (s_cameraState.isShootingIntervalStart == false) {
|
||||
@ -1154,10 +1181,16 @@ out:
|
||||
|
||||
if (s_cameraShootPhotoMode == DJI_CAMERA_SHOOT_PHOTO_MODE_INTERVAL
|
||||
&& s_cameraState.isShootingIntervalStart == true && s_cameraPhotoTimeIntervalSettings.captureCount > 0
|
||||
&& s_cameraPhotoTimeIntervalSettings.timeIntervalSeconds > 0) {
|
||||
s_cameraState.currentPhotoShootingIntervalTimeInSeconds--;
|
||||
&& (s_cameraPhotoTimeIntervalSettings.timeIntervalSeconds > 0 || s_cameraPhotoTimeIntervalSettings.timeIntervalMilliseconds > 0)) {
|
||||
uint16_t currentPhotoShootingIntervalTimeInMs = s_cameraState.currentPhotoShootingIntervalTimeInSeconds * 1000 +
|
||||
s_cameraState.currentPhotoShootingIntervalTimeInMs;
|
||||
|
||||
if ((s_cameraState.currentPhotoShootingIntervalTimeInSeconds == 0 &&
|
||||
currentPhotoShootingIntervalTimeInMs -= 1000 / intervalFreq;
|
||||
|
||||
s_cameraState.currentPhotoShootingIntervalTimeInSeconds = currentPhotoShootingIntervalTimeInMs / 1000;
|
||||
s_cameraState.currentPhotoShootingIntervalTimeInMs = currentPhotoShootingIntervalTimeInMs % 1000;
|
||||
|
||||
if ((currentPhotoShootingIntervalTimeInMs == 0 &&
|
||||
s_cameraState.currentPhotoShootingIntervalCount > 0) ||
|
||||
(s_cameraState.isShootingIntervalStart == true && isStartIntervalPhotoAction == false)) {
|
||||
|
||||
@ -1165,13 +1198,14 @@ out:
|
||||
|
||||
s_cameraState.shootingState = DJI_CAMERA_SHOOTING_INTERVAL_PHOTO;
|
||||
s_cameraState.isStoring = true;
|
||||
s_cameraState.currentPhotoShootingIntervalTimeInSeconds
|
||||
= s_cameraPhotoTimeIntervalSettings.timeIntervalSeconds;
|
||||
s_cameraState.currentPhotoShootingIntervalTimeInSeconds = s_cameraPhotoTimeIntervalSettings.timeIntervalSeconds;
|
||||
s_cameraState.currentPhotoShootingIntervalTimeInMs = s_cameraPhotoTimeIntervalSettings.timeIntervalMilliseconds;
|
||||
if (s_cameraState.currentPhotoShootingIntervalCount < INTERVAL_PHOTOGRAPH_ALWAYS_COUNT) {
|
||||
USER_LOG_INFO("interval taking photograph count:%d interval_time:%ds",
|
||||
USER_LOG_INFO("interval taking photograph count:%d interval_time:%d.%ds",
|
||||
(s_cameraPhotoTimeIntervalSettings.captureCount -
|
||||
s_cameraState.currentPhotoShootingIntervalCount + 1),
|
||||
s_cameraPhotoTimeIntervalSettings.timeIntervalSeconds);
|
||||
s_cameraPhotoTimeIntervalSettings.timeIntervalSeconds,
|
||||
s_cameraPhotoTimeIntervalSettings.timeIntervalMilliseconds / 100);
|
||||
s_cameraState.currentPhotoShootingIntervalCount--;
|
||||
if (s_cameraState.currentPhotoShootingIntervalCount == 0) {
|
||||
s_cameraState.shootingState = DJI_CAMERA_SHOOTING_PHOTO_IDLE;
|
||||
@ -1179,8 +1213,9 @@ out:
|
||||
s_cameraState.isShootingIntervalStart = false;
|
||||
}
|
||||
} else {
|
||||
USER_LOG_INFO("interval taking photograph always, interval_time:%ds",
|
||||
s_cameraPhotoTimeIntervalSettings.timeIntervalSeconds);
|
||||
USER_LOG_INFO("interval taking photograph always, interval_time:%d.%ds",
|
||||
s_cameraPhotoTimeIntervalSettings.timeIntervalSeconds,
|
||||
s_cameraPhotoTimeIntervalSettings.timeIntervalMilliseconds / 100);
|
||||
s_cameraState.currentPhotoShootingIntervalCount--;
|
||||
}
|
||||
}
|
||||
|
||||
@ -194,7 +194,8 @@ T_DjiReturnCode DjiTest_CameraEmuMediaStartService(void)
|
||||
UtilBuffer_Init(&s_mediaPlayCommandBufferHandler, s_mediaPlayCommandBuffer, sizeof(s_mediaPlayCommandBuffer));
|
||||
|
||||
if (aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M300_RTK ||
|
||||
aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M350_RTK) {
|
||||
aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M350_RTK ||
|
||||
aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M400) {
|
||||
returnCode = DjiPayloadCamera_RegMediaDownloadPlaybackHandler(&s_psdkCameraMedia);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("psdk camera media function init error.");
|
||||
|
||||
@ -855,6 +855,8 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition,
|
||||
|| DJI_CAMERA_TYPE_M30 == cameraType || DJI_CAMERA_TYPE_M30T == cameraType
|
||||
|| DJI_CAMERA_TYPE_M3E == cameraType || DJI_CAMERA_TYPE_M3T == cameraType
|
||||
|| DJI_CAMERA_TYPE_M3D == cameraType || DJI_CAMERA_TYPE_M3TD == cameraType
|
||||
|| DJI_CAMERA_TYPE_M4T == cameraType || DJI_CAMERA_TYPE_M4TD == cameraType
|
||||
|| DJI_CAMERA_TYPE_H30 == cameraType || DJI_CAMERA_TYPE_H30T == cameraType
|
||||
|| DJI_CAMERA_TYPE_M4T == cameraType || DJI_CAMERA_TYPE_M4E == cameraType
|
||||
|| DJI_CAMERA_TYPE_H30 == cameraType || DJI_CAMERA_TYPE_H30T == cameraType
|
||||
|| DJI_CAMERA_TYPE_M4TD == cameraType || DJI_CAMERA_TYPE_M4D == cameraType
|
||||
@ -899,9 +901,10 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition,
|
||||
|| DJI_CAMERA_TYPE_M30 == cameraType || DJI_CAMERA_TYPE_M30T == cameraType
|
||||
|| DJI_CAMERA_TYPE_M3E == cameraType || DJI_CAMERA_TYPE_M3T == cameraType
|
||||
|| DJI_CAMERA_TYPE_M3D == cameraType || DJI_CAMERA_TYPE_M3TD == cameraType
|
||||
|| DJI_CAMERA_TYPE_M4T == cameraType || DJI_CAMERA_TYPE_M4E == cameraType
|
||||
|| DJI_CAMERA_TYPE_H30 == cameraType || DJI_CAMERA_TYPE_H30T == cameraType
|
||||
|| DJI_CAMERA_TYPE_M4TD == cameraType || DJI_CAMERA_TYPE_M4D == cameraType
|
||||
|| DJI_CAMERA_TYPE_M4T == cameraType || DJI_CAMERA_TYPE_M4TD == cameraType
|
||||
|| DJI_CAMERA_TYPE_M4E == cameraType || DJI_CAMERA_TYPE_H30 == cameraType
|
||||
|| DJI_CAMERA_TYPE_H30T == cameraType|| DJI_CAMERA_TYPE_M4TD == cameraType
|
||||
|| DJI_CAMERA_TYPE_M4D == cameraType
|
||||
) {
|
||||
USER_LOG_INFO("Set mounted position %d camera's exposure mode to manual mode.",
|
||||
mountPosition);
|
||||
@ -1938,7 +1941,8 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition,
|
||||
cameraType == DJI_CAMERA_TYPE_L1 || cameraType == DJI_CAMERA_TYPE_M30 ||
|
||||
cameraType == DJI_CAMERA_TYPE_M3E || cameraType == DJI_CAMERA_TYPE_M3D ||
|
||||
cameraType == DJI_CAMERA_TYPE_L2 || cameraType == DJI_CAMERA_TYPE_H30 ||
|
||||
cameraType == DJI_CAMERA_TYPE_M4T || cameraType == DJI_CAMERA_TYPE_M4TD) {
|
||||
cameraType == DJI_CAMERA_TYPE_M4TD || cameraType == DJI_CAMERA_TYPE_M4D ||
|
||||
cameraType == DJI_CAMERA_TYPE_M4T) {
|
||||
USER_LOG_WARN("Camera type %s don't support FFC function.",
|
||||
s_cameraTypeStrList[DjiTest_CameraManagerGetCameraTypeIndex(cameraType)].cameraTypeStr);
|
||||
goto exitCameraModule;
|
||||
@ -1985,7 +1989,8 @@ T_DjiReturnCode DjiTest_CameraManagerRunSample(E_DjiMountPosition mountPosition,
|
||||
cameraType == DJI_CAMERA_TYPE_L1 || cameraType == DJI_CAMERA_TYPE_M30 ||
|
||||
cameraType == DJI_CAMERA_TYPE_M3E || cameraType == DJI_CAMERA_TYPE_M3D ||
|
||||
cameraType == DJI_CAMERA_TYPE_L2 || cameraType == DJI_CAMERA_TYPE_H30 ||
|
||||
cameraType == DJI_CAMERA_TYPE_M4T || cameraType == DJI_CAMERA_TYPE_M4TD) {
|
||||
cameraType == DJI_CAMERA_TYPE_M4TD || cameraType == DJI_CAMERA_TYPE_M4D ||
|
||||
cameraType == DJI_CAMERA_TYPE_M4T) {
|
||||
USER_LOG_WARN("Camera type %s don't support infrared function.",
|
||||
s_cameraTypeStrList[DjiTest_CameraManagerGetCameraTypeIndex(cameraType)].cameraTypeStr);
|
||||
goto exitCameraModule;
|
||||
@ -2133,6 +2138,7 @@ static T_DjiReturnCode DjiTest_CameraManagerMediaDownloadAndDeleteMediaFile(E_Dj
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
USER_LOG_INFO("obtain downloader rights of pos %d", position);
|
||||
returnCode = DjiCameraManager_ObtainDownloaderRights(position);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Obtain downloader rights failed, error code: 0x%08X.", returnCode);
|
||||
@ -2215,10 +2221,10 @@ static T_DjiReturnCode DjiTest_CameraManagerMediaDownloadAndDeleteMediaFile(E_Dj
|
||||
}
|
||||
|
||||
if (s_meidaFileList.fileListInfo[0].type == DJI_CAMERA_FILE_TYPE_JPEG) {
|
||||
USER_LOG_INFO("delete camera file of index %d", s_meidaFileList.fileListInfo[0].fileIndex);
|
||||
returnCode = DjiCameraManager_DeleteFileByIndex(position, s_meidaFileList.fileListInfo[0].fileIndex);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Delete media file by index failed, error code: 0x%08X.", returnCode);
|
||||
return returnCode;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2227,6 +2233,7 @@ static T_DjiReturnCode DjiTest_CameraManagerMediaDownloadAndDeleteMediaFile(E_Dj
|
||||
USER_LOG_WARN("Media file is not existed in sdcard.\r\n");
|
||||
}
|
||||
|
||||
ReleaseDownloaderRights:
|
||||
returnCode = DjiCameraManager_ReleaseDownloaderRights(position);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Release downloader rights failed, error code: 0x%08X.", returnCode);
|
||||
@ -2575,6 +2582,7 @@ T_DjiReturnCode DjiTest_CameraManagerSubscribePointCloud(E_DjiMountPosition posi
|
||||
uint32_t colorPointCloudDataByte = 0;
|
||||
uint32_t colorPointsNum = 0;
|
||||
static bool isMopInit = false;
|
||||
E_DjiChannelAddress mopChannelAddress = 0;
|
||||
|
||||
returnCode = DjiCameraManager_StartRecordPointCloud(position);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
@ -2613,7 +2621,10 @@ T_DjiReturnCode DjiTest_CameraManagerSubscribePointCloud(E_DjiMountPosition posi
|
||||
|
||||
RECONNECT:
|
||||
osalHandler->TaskSleepMs(TEST_CAMERA_MOP_CHANNEL_WAIT_TIME_MS);
|
||||
returnCode = DjiMopChannel_Connect(s_mopChannelHandle, DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO1,
|
||||
mopChannelAddress = position - DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1 + DJI_CHANNEL_ADDRESS_PAYLOAD_PORT_NO1;
|
||||
USER_LOG_INFO("connect to mop channel addr %d, channel id %d",
|
||||
mopChannelAddress, TEST_CAMERA_MOP_CHANNEL_SUBSCRIBE_POINT_CLOUD_CHANNEL_ID);
|
||||
returnCode = DjiMopChannel_Connect(s_mopChannelHandle, mopChannelAddress,
|
||||
TEST_CAMERA_MOP_CHANNEL_SUBSCRIBE_POINT_CLOUD_CHANNEL_ID);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Connect point cloud mop channel error, stat:0x%08llX.", returnCode);
|
||||
|
||||
@ -0,0 +1,99 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file test_cloud_api_by_web_socket.c
|
||||
* @brief
|
||||
*
|
||||
* @copyright (c) 2021 DJI. All rights reserved.
|
||||
*
|
||||
* All information contained herein is, and remains, the property of DJI.
|
||||
* The intellectual and technical concepts contained herein are proprietary
|
||||
* to DJI and may be covered by U.S. and foreign patents, patents in process,
|
||||
* and protected by trade secret or copyright law. Dissemination of this
|
||||
* information, including but not limited to data and other proprietary
|
||||
* material(s) incorporated within the information, in any form, is strictly
|
||||
* prohibited without the express written consent of DJI.
|
||||
*
|
||||
* If you receive this source code without DJI’s authorization, you may not
|
||||
* further disseminate the information, and you must immediately remove the
|
||||
* source code and notify DJI of its removal. DJI reserves the right to pursue
|
||||
* legal actions against you for any loss(es) or damage(s) caused by your
|
||||
* failure to do so.
|
||||
*
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
#include <utils/util_misc.h>
|
||||
#include <stdio.h>
|
||||
#include <utils/util_md5.h>
|
||||
#include "dji_cloud_api_by_websockt.h"
|
||||
#include "dji_logger.h"
|
||||
#include "dji_platform.h"
|
||||
#include "test_cloud_api_by_web_socket.h"
|
||||
|
||||
/* Private constants ---------------------------------------------------------*/
|
||||
#define TEST_MOP_CHANNEL_NORMAL_TRANSFOR_SEND_BUFFER (64 * 1024)
|
||||
|
||||
/* Private types -------------------------------------------------------------*/
|
||||
|
||||
/* Private values -------------------------------------------------------------*/
|
||||
|
||||
/* Private functions declaration ---------------------------------------------*/
|
||||
static T_DjiTaskHandle s_testCloudApiByWebSocketSendTask;
|
||||
|
||||
/* Private functions definition-----------------------------------------------*/
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmissing-noreturn"
|
||||
#pragma GCC diagnostic ignored "-Wreturn-type"
|
||||
|
||||
static void *DjiTest_CloudApiByWebSocketSendTask(void *arg)
|
||||
{
|
||||
uint8_t *sendBuf = NULL;
|
||||
uint32_t realLen = 0;
|
||||
T_DjiReturnCode returnCode;
|
||||
uint32_t sendDataCount = 0;
|
||||
T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler();
|
||||
|
||||
USER_UTIL_UNUSED(arg);
|
||||
|
||||
sendBuf = osalHandler->Malloc(TEST_MOP_CHANNEL_NORMAL_TRANSFOR_SEND_BUFFER);
|
||||
if (sendBuf == NULL) {
|
||||
USER_LOG_ERROR("cloud_api over mop malloc send buffer error");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
sendDataCount++;
|
||||
memset(sendBuf, 'A' - 1 + (sendDataCount % 26), TEST_MOP_CHANNEL_NORMAL_TRANSFOR_SEND_BUFFER);
|
||||
returnCode = DjiCloudApi_SendDataByWebSocket(sendBuf, TEST_MOP_CHANNEL_NORMAL_TRANSFOR_SEND_BUFFER, &realLen);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_WARN("cloud_api over mop send data to channel error,stat:0x%08llX", returnCode);
|
||||
} else {
|
||||
USER_LOG_INFO("cloud_api over mop send data to channel length:%d count:%d", realLen, sendDataCount);
|
||||
}
|
||||
|
||||
osalHandler->TaskSleepMs(1000);
|
||||
}
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
/* Exported functions definition ---------------------------------------------*/
|
||||
T_DjiReturnCode DjiTest_CloudApiByWebSocketStartService(void)
|
||||
{
|
||||
T_DjiReturnCode returnCode;
|
||||
T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler();
|
||||
|
||||
USER_LOG_INFO("cloud_api over mop send task create error, stat:0x%08llX.", returnCode);
|
||||
returnCode = osalHandler->TaskCreate("CloudApiByWebSocket", DjiTest_CloudApiByWebSocketSendTask,
|
||||
2048, NULL, &s_testCloudApiByWebSocketSendTask);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("cloud_api over mop send task create error, stat:0x%08llX.", returnCode);
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
|
||||
}
|
||||
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/
|
||||
@ -0,0 +1,49 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file test_mop_channel.h
|
||||
* @brief This is the header file for "test_mop_channel.c", defining the structure and
|
||||
* (exported) function prototypes.
|
||||
*
|
||||
* @copyright (c) 2021 DJI. All rights reserved.
|
||||
*
|
||||
* All information contained herein is, and remains, the property of DJI.
|
||||
* The intellectual and technical concepts contained herein are proprietary
|
||||
* to DJI and may be covered by U.S. and foreign patents, patents in process,
|
||||
* and protected by trade secret or copyright law. Dissemination of this
|
||||
* information, including but not limited to data and other proprietary
|
||||
* material(s) incorporated within the information, in any form, is strictly
|
||||
* prohibited without the express written consent of DJI.
|
||||
*
|
||||
* If you receive this source code without DJI’s authorization, you may not
|
||||
* further disseminate the information, and you must immediately remove the
|
||||
* source code and notify DJI of its removal. DJI reserves the right to pursue
|
||||
* legal actions against you for any loss(es) or damage(s) caused by your
|
||||
* failure to do so.
|
||||
*
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef TEST_CLOUD_API_BY_WEEBSOCKET_H
|
||||
#define TEST_CLOUD_API_BY_WEEBSOCKET_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
T_DjiReturnCode DjiTest_CloudApiByWebSocketStartService(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // TEST_CLOUD_API_BY_WEEBSOCKET_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -87,7 +87,7 @@ T_DjiReturnCode DjiTest_DataTransmissionStartService(void)
|
||||
s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M30T ||
|
||||
s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M3D ||
|
||||
s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M3TD ||
|
||||
s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M4D ||
|
||||
s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M4D ||
|
||||
s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M4TD) {
|
||||
channelAddress = DJI_CHANNEL_ADDRESS_CLOUD_API;
|
||||
djiStat = DjiLowSpeedDataChannel_RegRecvDataCallback(channelAddress, ReceiveDataFromCloud);
|
||||
@ -97,7 +97,10 @@ T_DjiReturnCode DjiTest_DataTransmissionStartService(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (s_aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1 ||
|
||||
if (s_aircraftInfoBaseInfo.aircraftType == DJI_AIRCRAFT_TYPE_M400) {
|
||||
USER_LOG_INFO("M400 is not support to use data transmition between PSDK device.");
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
|
||||
} else if (s_aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO1 ||
|
||||
s_aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO2 ||
|
||||
s_aircraftInfoBaseInfo.mountPosition == DJI_MOUNT_POSITION_PAYLOAD_PORT_NO3) {
|
||||
channelAddress = DJI_CHANNEL_ADDRESS_EXTENSION_PORT;
|
||||
|
||||
@ -99,6 +99,7 @@ static void DjiTest_FlightControlVelocityControlSample(void);
|
||||
static void DjiTest_FlightControlArrestFlyingSample(void);
|
||||
static void DjiTest_FlightControlSetGetParamSample(void);
|
||||
static void DjiTest_FlightControlPassiveTriggerFtsSample(void);
|
||||
static void DjiTest_FlightControlSlowRotateMotorSample(void);
|
||||
static T_DjiReturnCode DjiTest_TriggerFtsEventCallback(void);
|
||||
static void DjiTest_FlightControlSample(E_DjiTestFlightCtrlSampleSelect flightCtrlSampleSelect);
|
||||
|
||||
@ -922,6 +923,63 @@ void DjiTest_FlightControlPassiveTriggerFtsSample(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void DjiTest_FlightControlSlowRotateMotorSample(void)
|
||||
{
|
||||
E_DjiFlightControllerElectronicSpeedControllerStatus escStatus;
|
||||
|
||||
T_DjiReturnCode returnCode = 0;
|
||||
|
||||
USER_LOG_INFO("Start rotating.");
|
||||
returnCode = DjiFlightController_StartSlowRotateMotor();
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Start slow rotate blade failed, error code is 0x%08X", returnCode);
|
||||
return ;
|
||||
}
|
||||
|
||||
returnCode = DjiFlightController_GetElectronicSpeedControllerStatus(&escStatus);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Fail to get ESC status, error code is 0x%08X", returnCode);
|
||||
}
|
||||
|
||||
USER_LOG_INFO("The ESC status is: %s motor(s) in rotate mode",
|
||||
escStatus == DJI_FLIGHT_CONTROLLER_NO_MOTOR_IN_SLOW_ROTATE_MODE ? "no" :
|
||||
escStatus == DJI_FLIGHT_CONTROLLER_SOME_MOTOR_IN_SLOW_ROTATE_MODE ? "some" :
|
||||
escStatus == DJI_FLIGHT_CONTROLLER_ALL_MOTOR_IN_SLOW_ROTATE_MODE ? "all" : "(error)");
|
||||
|
||||
for (int32_t i = 0; i < 8; i++) {
|
||||
s_osalHandler->TaskSleepMs(1000);
|
||||
|
||||
returnCode = DjiFlightController_GetElectronicSpeedControllerStatus(&escStatus);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Fail to get ESC status, error code is 0x%08X", returnCode);
|
||||
}
|
||||
|
||||
USER_LOG_INFO("The ESC status is: %s motor(s) in rotate mode",
|
||||
escStatus == DJI_FLIGHT_CONTROLLER_NO_MOTOR_IN_SLOW_ROTATE_MODE ? "no" :
|
||||
escStatus == DJI_FLIGHT_CONTROLLER_SOME_MOTOR_IN_SLOW_ROTATE_MODE ? "some" :
|
||||
escStatus == DJI_FLIGHT_CONTROLLER_ALL_MOTOR_IN_SLOW_ROTATE_MODE ? "all" : "(error)");
|
||||
}
|
||||
|
||||
USER_LOG_INFO("Stop rotating.");
|
||||
returnCode = DjiFlightController_StopSlowRotateMotor();
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_INFO("Stop slow rotate blade failed, error code is 0x%08X", returnCode);
|
||||
return ;
|
||||
}
|
||||
|
||||
s_osalHandler->TaskSleepMs(1000);
|
||||
|
||||
returnCode = DjiFlightController_GetElectronicSpeedControllerStatus(&escStatus);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Fail to get ESC status, error code is 0x%08X", returnCode);
|
||||
}
|
||||
|
||||
USER_LOG_INFO("The ESC status is: %s motor(s) in rotate mode",
|
||||
escStatus == DJI_FLIGHT_CONTROLLER_NO_MOTOR_IN_SLOW_ROTATE_MODE ? "no" :
|
||||
escStatus == DJI_FLIGHT_CONTROLLER_SOME_MOTOR_IN_SLOW_ROTATE_MODE ? "some" :
|
||||
escStatus == DJI_FLIGHT_CONTROLLER_ALL_MOTOR_IN_SLOW_ROTATE_MODE ? "all" : "(error)");
|
||||
}
|
||||
|
||||
void DjiTest_FlightControlSample(E_DjiTestFlightCtrlSampleSelect flightCtrlSampleSelect)
|
||||
{
|
||||
switch (flightCtrlSampleSelect) {
|
||||
@ -953,6 +1011,10 @@ void DjiTest_FlightControlSample(E_DjiTestFlightCtrlSampleSelect flightCtrlSampl
|
||||
DjiTest_FlightControlPassiveTriggerFtsSample();
|
||||
break;
|
||||
}
|
||||
case E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_SLOW_ROTATE_BLADE: {
|
||||
DjiTest_FlightControlSlowRotateMotorSample();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -1305,6 +1367,8 @@ bool DjiTest_FlightControlGoHomeAndConfirmLanding(void)
|
||||
if (DJI_AIRCRAFT_TYPE_M3E == aircraftInfoBaseInfo.aircraftType || DJI_AIRCRAFT_TYPE_M3T == aircraftInfoBaseInfo.aircraftType
|
||||
|| DJI_AIRCRAFT_TYPE_M3D == aircraftInfoBaseInfo.aircraftType || DJI_AIRCRAFT_TYPE_M3TD == aircraftInfoBaseInfo.aircraftType
|
||||
|| DJI_AIRCRAFT_TYPE_M4T == aircraftInfoBaseInfo.aircraftType
|
||||
|| DJI_AIRCRAFT_TYPE_M4TD == aircraftInfoBaseInfo.aircraftType
|
||||
|| DJI_AIRCRAFT_TYPE_M4D == aircraftInfoBaseInfo.aircraftType
|
||||
|| DJI_AIRCRAFT_TYPE_M4E == aircraftInfoBaseInfo.aircraftType
|
||||
|| DJI_AIRCRAFT_TYPE_M4TD == aircraftInfoBaseInfo.aircraftType
|
||||
|| DJI_AIRCRAFT_TYPE_M4D == aircraftInfoBaseInfo.aircraftType
|
||||
@ -1608,4 +1672,62 @@ DjiTest_FlightControlJoystickCtrlAuthSwitchEventCallback(T_DjiFlightControllerJo
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
static T_DjiReturnCode DjiTest_FlightControlSetFtsTrigger(E_DjiMountPosition position, char* desc)
|
||||
{
|
||||
T_DjiReturnCode djiStat;
|
||||
T_DjiFtsPwmEscTriggerStatus esc_status;
|
||||
|
||||
djiStat = DjiFlightController_SelectFtsPwmTrigger(position);
|
||||
if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("select fts pwm trigger E-PORT error, error code: 0x%08X", djiStat);
|
||||
return djiStat;
|
||||
}
|
||||
|
||||
djiStat = DjiFlightController_GetFtsPwmTriggerStatus(&esc_status);
|
||||
if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("get pwm trigger status error, error code: 0x%08X", djiStat);
|
||||
return djiStat;
|
||||
}
|
||||
|
||||
if (esc_status.ESC[0].fts_select != position || esc_status.ESC[1].fts_select != position)
|
||||
{
|
||||
USER_LOG_ERROR("pwm trigger status incorrect");
|
||||
return djiStat;
|
||||
}
|
||||
|
||||
if (esc_status.ESC[0].fts_status == DJI_FLIGHT_CONTROLLER_FTS_NOT_TRIGGERD && esc_status.ESC[1].fts_status == DJI_FLIGHT_CONTROLLER_FTS_NOT_TRIGGERD)
|
||||
|
||||
USER_LOG_INFO("Set fts trigger position %s success", desc);
|
||||
|
||||
return djiStat;
|
||||
}
|
||||
|
||||
T_DjiReturnCode DjiTest_FlightControlFtsPwmTriggerSample(void)
|
||||
{
|
||||
T_DjiReturnCode returnCode;
|
||||
|
||||
returnCode = DjiTest_FlightControlInit();
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Init flight Control sample failed,error code:0x%08llX", returnCode);
|
||||
return returnCode;
|
||||
}
|
||||
returnCode = DjiTest_FlightControlSetFtsTrigger(DJI_MOUNT_POSITION_EXTENSION_PORT, "DJI_MOUNT_POSITION_EXTENSION_PORT");
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Test select DJI_MOUNT_POSITION_EXTENSION_PORT fts pwm trigger failed");
|
||||
return returnCode;
|
||||
}
|
||||
returnCode = DjiTest_FlightControlSetFtsTrigger(DJI_MOUNT_POSITION_EXTENSION_LITE_PORT, "DJI_MOUNT_POSITION_EXTENSION_LITE_PORT");
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Test select DJI_MOUNT_POSITION_EXTENSION_LITE_PORT fts pwm trigger failed");
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
returnCode = DjiTest_FlightControlDeInit();
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Deinit Flight Control sample failed,error code:0x%08llX", returnCode);
|
||||
return returnCode;
|
||||
}
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/
|
||||
|
||||
@ -43,6 +43,7 @@ typedef enum {
|
||||
E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_ARREST_FLYING,
|
||||
E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_SET_GET_PARAM,
|
||||
E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_FTS_TRIGGER,
|
||||
E_DJI_TEST_FLIGHT_CTRL_SAMPLE_SELECT_SLOW_ROTATE_BLADE,
|
||||
} E_DjiTestFlightCtrlSampleSelect;
|
||||
|
||||
#pragma pack(1)
|
||||
@ -59,6 +60,7 @@ typedef struct {
|
||||
T_DjiReturnCode DjiTest_FlightControlRunSample(E_DjiTestFlightCtrlSampleSelect flightCtrlSampleSelect);
|
||||
void DjiTest_FlightControlVelocityAndYawRateCtrl(const T_DjiTestFlightControlVector3f offsetDesired, float yawRate,
|
||||
uint32_t timeMs);
|
||||
T_DjiReturnCode DjiTest_FlightControlFtsPwmTriggerSample(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
#include "dji_logger.h"
|
||||
#include "dji_platform.h"
|
||||
#include "utils/util_misc.h"
|
||||
#include "widget_interaction_test/test_widget_interaction.h"
|
||||
|
||||
/* Private constants ---------------------------------------------------------*/
|
||||
#define PAYLOAD_GIMBAL_EMU_TASK_STACK_SIZE (2048)
|
||||
@ -277,6 +278,7 @@ T_DjiReturnCode DjiTest_GimbalRotate(E_DjiGimbalRotationMode rotationMode,
|
||||
|
||||
break;
|
||||
case DJI_GIMBAL_ROTATION_MODE_ABSOLUTE_ANGLE:
|
||||
DjiTest_WidgetLogAppend("abs mode (%d %d %d)", rotationValue.pitch, rotationValue.roll, rotationValue.yaw);
|
||||
USER_LOG_INFO("gimbal absolute rotate angle: pitch %d, roll %d, yaw %d.", rotationValue.pitch,
|
||||
rotationValue.roll, rotationValue.yaw);
|
||||
USER_LOG_DEBUG("gimbal absolute rotate action time: %d.",
|
||||
@ -325,6 +327,7 @@ T_DjiReturnCode DjiTest_GimbalRotate(E_DjiGimbalRotationMode rotationMode,
|
||||
|
||||
break;
|
||||
case DJI_GIMBAL_ROTATION_MODE_SPEED:
|
||||
DjiTest_WidgetLogAppend("speed mode (%d %d %d)", rotationValue.pitch, rotationValue.roll, rotationValue.yaw);
|
||||
USER_LOG_INFO("gimbal rotate speed: pitch %d, roll %d, yaw %d.", rotationValue.pitch,
|
||||
rotationValue.roll, rotationValue.yaw);
|
||||
|
||||
|
||||
@ -77,6 +77,7 @@ T_DjiReturnCode DjiTest_GimbalManagerRunSample(E_DjiMountPosition mountPosition,
|
||||
T_DjiGimbalManagerRotation rotation;
|
||||
T_DjiAircraftInfoBaseInfo baseInfo;
|
||||
E_DjiAircraftSeries aircraftSeries;
|
||||
bool gimbalAnglesSubscribedFlag = false;
|
||||
|
||||
returnCode = DjiAircraftInfo_GetBaseInfo(&baseInfo);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
@ -89,10 +90,17 @@ T_DjiReturnCode DjiTest_GimbalManagerRunSample(E_DjiMountPosition mountPosition,
|
||||
USER_LOG_INFO("Gimbal manager sample start");
|
||||
DjiTest_WidgetLogAppend("Gimbal manager sample start");
|
||||
|
||||
returnCode = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES, DJI_DATA_SUBSCRIPTION_TOPIC_50_HZ, NULL);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Failed to subscribe topic %d, 0x%08X", DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES, returnCode);
|
||||
goto out;
|
||||
if (DJI_AIRCRAFT_SERIES_M30 == aircraftSeries ||
|
||||
DJI_AIRCRAFT_SERIES_M3 == aircraftSeries ||
|
||||
DJI_AIRCRAFT_SERIES_M3D == aircraftSeries ||
|
||||
DJI_AIRCRAFT_SERIES_M4 == aircraftSeries ||
|
||||
DJI_AIRCRAFT_SERIES_M4D == aircraftSeries) {
|
||||
returnCode = DjiFcSubscription_SubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES, DJI_DATA_SUBSCRIPTION_TOPIC_50_HZ, NULL);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Failed to subscribe topic %d, 0x%08X", DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES, returnCode);
|
||||
goto out;
|
||||
}
|
||||
gimbalAnglesSubscribedFlag = true;
|
||||
}
|
||||
|
||||
USER_LOG_INFO("--> Step 1: Init gimbal manager module");
|
||||
@ -170,9 +178,12 @@ T_DjiReturnCode DjiTest_GimbalManagerRunSample(E_DjiMountPosition mountPosition,
|
||||
}
|
||||
}
|
||||
|
||||
returnCode = DjiFcSubscription_UnSubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Failed to unsubscribe topic %d, 0x%08X", DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES, returnCode);
|
||||
if (gimbalAnglesSubscribedFlag) {
|
||||
returnCode = DjiFcSubscription_UnSubscribeTopic(DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Failed to unsubscribe topic %d, 0x%08X", DJI_FC_SUBSCRIPTION_TOPIC_GIMBAL_ANGLES, returnCode);
|
||||
}
|
||||
gimbalAnglesSubscribedFlag = false;
|
||||
}
|
||||
|
||||
USER_LOG_INFO("--> Step 5: Deinit gimbal manager module");
|
||||
|
||||
@ -43,7 +43,11 @@
|
||||
#define MAX_HMS_ERROR_LEVEL (6)
|
||||
#define HMS_DIR_PATH_LEN_MAX (256)
|
||||
|
||||
#ifdef SYSTEM_ARCH_LINUX
|
||||
#define DJI_CUSTOM_HMS_CODE_INJECT_ON (0)
|
||||
#else
|
||||
#define DJI_CUSTOM_HMS_CODE_INJECT_ON (1)
|
||||
#endif
|
||||
|
||||
/* Private types -------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
#include "dji_logger.h"
|
||||
#include "dji_flight_controller.h"
|
||||
#include "flight_control/test_flight_control.h"
|
||||
#include "dji_aircraft_info.h"
|
||||
|
||||
/* Private constants ---------------------------------------------------------*/
|
||||
|
||||
@ -45,11 +46,18 @@ T_DjiReturnCode DjiTest_InterestPointRunSample(void)
|
||||
T_DjiInterestPointSettings interestPointSettings = {0};
|
||||
T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler();
|
||||
T_DjiFlightControllerRidInfo ridInfo = {0};
|
||||
T_DjiAircraftInfoBaseInfo aircraftInfoBaseInfo = {0};
|
||||
|
||||
ridInfo.latitude = 22.542812;
|
||||
ridInfo.longitude = 113.958902;
|
||||
ridInfo.altitude = 10;
|
||||
|
||||
returnCode = DjiAircraftInfo_GetBaseInfo(&aircraftInfoBaseInfo);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("get aircraft base info error");
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_SYSTEM_ERROR;
|
||||
}
|
||||
|
||||
returnCode = DjiFlightController_Init(ridInfo);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Flight control init failed, errno=%lld", returnCode);
|
||||
@ -74,8 +82,8 @@ T_DjiReturnCode DjiTest_InterestPointRunSample(void)
|
||||
osalHandler->TaskSleepMs(1000);
|
||||
DjiTest_FlightControlVelocityAndYawRateCtrl((T_DjiTestFlightControlVector3f) {3, 0, 0}, 0, 5000);
|
||||
|
||||
interestPointSettings.latitude = 22.542812;
|
||||
interestPointSettings.longitude = 113.958902;
|
||||
interestPointSettings.latitude = 22.57775;
|
||||
interestPointSettings.longitude = 113.94265;
|
||||
|
||||
returnCode = DjiInterestPoint_RegMissionStateCallback(DjiUser_InterestPointMissionStateCallback);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
@ -83,25 +91,37 @@ T_DjiReturnCode DjiTest_InterestPointRunSample(void)
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
if (aircraftInfoBaseInfo.aircraftSeries == DJI_AIRCRAFT_SERIES_M400) {
|
||||
interestPointSettings.payloadCameraIndex = 1;
|
||||
USER_LOG_INFO("The sample try to use payload camera on position %d for poi, please make sure that DJI camera mounted on this position.",
|
||||
interestPointSettings.payloadCameraIndex);
|
||||
}
|
||||
|
||||
USER_LOG_INFO("Start interest point circle, circumcenter(%f, %f)", interestPointSettings.latitude, interestPointSettings.longitude);
|
||||
returnCode = DjiInterestPoint_Start(interestPointSettings);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Point interest start failed, errno=%lld", returnCode);
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
DjiInterestPoint_SetSpeed(5.0f);
|
||||
osalHandler->TaskSleepMs(1000);
|
||||
|
||||
USER_LOG_INFO("set speed to 15");
|
||||
DjiInterestPoint_SetSpeed(15.0f);
|
||||
|
||||
for (int i = 0; i < 60; ++i) {
|
||||
USER_LOG_INFO("Interest point mission running %d.", i);
|
||||
osalHandler->TaskSleepMs(1000);
|
||||
}
|
||||
|
||||
USER_LOG_INFO("Stop interest point circle");
|
||||
returnCode = DjiInterestPoint_Stop();
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Point interest stop failed, errno=%lld", returnCode);
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
USER_LOG_INFO("Force landing");
|
||||
DjiFlightController_StartForceLanding();
|
||||
|
||||
returnCode = DjiInterestPoint_DeInit();
|
||||
@ -122,7 +142,11 @@ T_DjiReturnCode DjiTest_InterestPointRunSample(void)
|
||||
/* Private functions definition-----------------------------------------------*/
|
||||
static T_DjiReturnCode DjiUser_InterestPointMissionStateCallback(T_DjiInterestPointMissionState missionState)
|
||||
{
|
||||
USER_LOG_INFO("Interest point state: %d, radius: %.2f m, speed: %.2f m/s", missionState.state, missionState.radius,
|
||||
USER_LOG_INFO("Interest point state: %s, radius: %.2f m, speed: %.2f m/s",
|
||||
missionState.state == DJI_INTEREST_POINT_MISSION_ACTION_STATE_NOT_STARTED ? "not started" :
|
||||
missionState.state == DJI_INTEREST_POINT_MISSION_ACTION_STATE_PAUSE ? "pause" :
|
||||
missionState.state == DJI_INTEREST_POINT_MISSION_ACTION_STATE_RUNNING ? "running" : "unknown",
|
||||
missionState.radius,
|
||||
missionState.curSpeed);
|
||||
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
|
||||
|
||||
@ -77,12 +77,13 @@ T_DjiReturnCode DjiTest_LiveviewRunSample(E_DjiMountPosition mountPosition)
|
||||
goto out;
|
||||
}
|
||||
|
||||
USER_LOG_INFO("--> Step 2: Start h264 stream of the fpv and selected payload\r\n");
|
||||
USER_LOG_INFO("--> Step 2: Start h264 stream of the fpv and default of selected payload\r\n");
|
||||
DjiTest_WidgetLogAppend("--> Step 2: Start h264 stream of the fpv and selected payload\r\n");
|
||||
|
||||
if (aircraftInfoBaseInfo.aircraftSeries == DJI_AIRCRAFT_SERIES_M300 ||
|
||||
aircraftInfoBaseInfo.aircraftSeries == DJI_AIRCRAFT_SERIES_M350 ||
|
||||
aircraftInfoBaseInfo.aircraftSeries == DJI_AIRCRAFT_SERIES_M30) {
|
||||
aircraftInfoBaseInfo.aircraftSeries == DJI_AIRCRAFT_SERIES_M30 ||
|
||||
aircraftInfoBaseInfo.aircraftSeries == DJI_AIRCRAFT_SERIES_M400) {
|
||||
|
||||
localTime = localtime(¤tTime);
|
||||
sprintf(s_fpvCameraStreamFilePath, "fpv_stream_%04d%02d%02d_%02d-%02d-%02d.h264",
|
||||
@ -98,7 +99,7 @@ T_DjiReturnCode DjiTest_LiveviewRunSample(E_DjiMountPosition mountPosition)
|
||||
}
|
||||
|
||||
localTime = localtime(¤tTime);
|
||||
sprintf(s_payloadCameraStreamFilePath, "payload%d_vis_stream_%04d%02d%02d_%02d-%02d-%02d.h264",
|
||||
sprintf(s_payloadCameraStreamFilePath, "payload%d_default_stream_%04d%02d%02d_%02d-%02d-%02d.h264",
|
||||
mountPosition, localTime->tm_year + 1900, localTime->tm_mon + 1, localTime->tm_mday,
|
||||
localTime->tm_hour, localTime->tm_min, localTime->tm_sec);
|
||||
|
||||
@ -128,7 +129,8 @@ T_DjiReturnCode DjiTest_LiveviewRunSample(E_DjiMountPosition mountPosition)
|
||||
DjiTest_WidgetLogAppend("--> Step 3: Stop h264 stream of the fpv and selected payload");
|
||||
if (aircraftInfoBaseInfo.aircraftSeries == DJI_AIRCRAFT_SERIES_M300 ||
|
||||
aircraftInfoBaseInfo.aircraftSeries == DJI_AIRCRAFT_SERIES_M350 ||
|
||||
aircraftInfoBaseInfo.aircraftSeries == DJI_AIRCRAFT_SERIES_M30) {
|
||||
aircraftInfoBaseInfo.aircraftSeries == DJI_AIRCRAFT_SERIES_M30 ||
|
||||
aircraftInfoBaseInfo.aircraftSeries == DJI_AIRCRAFT_SERIES_M400) {
|
||||
returnCode = DjiLiveview_StopH264Stream(DJI_LIVEVIEW_CAMERA_POSITION_FPV, DJI_LIVEVIEW_CAMERA_SOURCE_DEFAULT);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Request to stop h264 of fpv failed, error code: 0x%08X", returnCode);
|
||||
@ -143,9 +145,6 @@ T_DjiReturnCode DjiTest_LiveviewRunSample(E_DjiMountPosition mountPosition)
|
||||
goto out;
|
||||
}
|
||||
|
||||
USER_LOG_INFO("Fpv stream is saved to file: %s", s_fpvCameraStreamFilePath);
|
||||
USER_LOG_INFO("Payload%d stream is saved to file: %s\r\n", mountPosition, s_payloadCameraStreamFilePath);
|
||||
|
||||
if (DJI_AIRCRAFT_TYPE_M3T == aircraftInfoBaseInfo.aircraftType
|
||||
|| DJI_AIRCRAFT_TYPE_M3TD == aircraftInfoBaseInfo.aircraftType
|
||||
|| DJI_AIRCRAFT_TYPE_M4T == aircraftInfoBaseInfo.aircraftType
|
||||
|
||||
@ -723,6 +723,8 @@ static void *DjiTest_MopChannelFileServiceRecvTask(void *arg)
|
||||
s_fileServiceContent[clientNum].uploadState = MOP_FILE_SERVICE_UPLOAD_DATA_SENDING;
|
||||
s_fileServiceContent[clientNum].uploadSeqNum = fileTransfor->seqNum;
|
||||
|
||||
USER_LOG_INFO("fileTransfor->seqNum %d", fileTransfor->seqNum);
|
||||
|
||||
uploadWriteLen = fwrite(&recvBuf[UTIL_OFFSETOF(T_DjiMopChannel_FileTransfor, data)], 1,
|
||||
fileTransfor->dataLen, uploadFile);
|
||||
if (uploadWriteLen < 0) {
|
||||
|
||||
@ -39,11 +39,11 @@
|
||||
#endif
|
||||
|
||||
/* Private constants ---------------------------------------------------------*/
|
||||
#define POSITIONING_TASK_FREQ (1)
|
||||
#define POSITIONING_TASK_STACK_SIZE (2048)
|
||||
#define POSITIONING_TASK_FREQ (0.1)
|
||||
#define POSITIONING_TASK_STACK_SIZE (3 * 1024)
|
||||
#define TEST_RTCM_FILE_PATH_STR_MAX_SIZE (64)
|
||||
|
||||
#define DJI_TEST_POSITIONING_EVENT_COUNT (2)
|
||||
#define DJI_TEST_POSITIONING_EVENT_COUNT (1)
|
||||
#define DJI_TEST_TIME_INTERVAL_AMONG_EVENTS_US (200000)
|
||||
|
||||
/* Private types -------------------------------------------------------------*/
|
||||
@ -168,22 +168,22 @@ static void *DjiTest_PositioningTask(void *arg)
|
||||
continue;
|
||||
}
|
||||
|
||||
USER_LOG_DEBUG("request position of target points success.");
|
||||
USER_LOG_DEBUG("detail position information:");
|
||||
USER_LOG_INFO("request position of target points success.");
|
||||
USER_LOG_INFO("detail position information:");
|
||||
for (i = 0; i < DJI_TEST_POSITIONING_EVENT_COUNT; ++i) {
|
||||
USER_LOG_DEBUG("position solution property: %d.", positionInfo[i].positionSolutionProperty);
|
||||
USER_LOG_DEBUG("pitchAttitudeAngle: %d\trollAttitudeAngle: %d\tyawAttitudeAngle: %d",
|
||||
USER_LOG_INFO("position solution property: %d.", positionInfo[i].positionSolutionProperty);
|
||||
USER_LOG_INFO("pitchAttitudeAngle: %d\trollAttitudeAngle: %d\tyawAttitudeAngle: %d",
|
||||
positionInfo[i].uavAttitude.pitch, positionInfo[i].uavAttitude.roll,
|
||||
positionInfo[i].uavAttitude.yaw);
|
||||
USER_LOG_DEBUG("northPositionOffset: %d\tearthPositionOffset: %d\tdownPositionOffset: %d",
|
||||
USER_LOG_INFO("northPositionOffset: %d\tearthPositionOffset: %d\tdownPositionOffset: %d",
|
||||
positionInfo[i].offsetBetweenMainAntennaAndTargetPoint.x,
|
||||
positionInfo[i].offsetBetweenMainAntennaAndTargetPoint.y,
|
||||
positionInfo[i].offsetBetweenMainAntennaAndTargetPoint.z);
|
||||
USER_LOG_DEBUG("longitude: %.8f\tlatitude: %.8f\theight: %.8f",
|
||||
USER_LOG_INFO("longitude: %.8f\tlatitude: %.8f\theight: %.8f",
|
||||
positionInfo[i].targetPointPosition.longitude,
|
||||
positionInfo[i].targetPointPosition.latitude,
|
||||
positionInfo[i].targetPointPosition.height);
|
||||
USER_LOG_DEBUG(
|
||||
USER_LOG_INFO(
|
||||
"longStandardDeviation: %.8f\tlatStandardDeviation: %.8f\thgtStandardDeviation: %.8f",
|
||||
positionInfo[i].targetPointPositionStandardDeviation.longitude,
|
||||
positionInfo[i].targetPointPositionStandardDeviation.latitude,
|
||||
|
||||
@ -89,7 +89,9 @@ T_DjiReturnCode DjiTest_PowerManagementStartService(void)
|
||||
|
||||
if (baseInfo.djiAdapterType == DJI_SDK_ADAPTER_TYPE_SKYPORT_V2 ||
|
||||
baseInfo.djiAdapterType == DJI_SDK_ADAPTER_TYPE_XPORT ||
|
||||
baseInfo.aircraftType == DJI_AIRCRAFT_TYPE_FC30) {
|
||||
baseInfo.djiAdapterType == DJI_SDK_ADAPTER_TYPE_SKYPORT_V3 ||
|
||||
baseInfo.djiAdapterType == DJI_SDK_ADAPTER_TYPE_EPORT_V2_RIBBON_CABLE ||
|
||||
baseInfo.aircraftType == DJI_AIRCRAFT_TYPE_FC30) {
|
||||
// apply high power
|
||||
if (s_applyHighPowerHandler.pinInit == NULL) {
|
||||
USER_LOG_ERROR("apply high power pin init interface is NULL error");
|
||||
@ -113,15 +115,31 @@ T_DjiReturnCode DjiTest_PowerManagementStartService(void)
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
if (baseInfo.djiAdapterType == DJI_SDK_ADAPTER_TYPE_SKYPORT_V3 ||
|
||||
baseInfo.djiAdapterType == DJI_SDK_ADAPTER_TYPE_EPORT_V2_RIBBON_CABLE) {
|
||||
E_DjiHighPowerVoltage voltage = E_DJI_HIGH_POWER_VOLTAGE_17V;
|
||||
|
||||
USER_LOG_INFO("Start to apply high power.");
|
||||
USER_LOG_INFO("Start to apply high power.");
|
||||
|
||||
returnCode = DjiPowerManagement_ApplyHighPowerSync();
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("apply high power error");
|
||||
return returnCode;
|
||||
returnCode = DjiPowerManagement_ApplyHighPowerSyncV2(voltage);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("apply high power error");
|
||||
return returnCode;
|
||||
}
|
||||
USER_LOG_INFO("Success to apply high power %s.",
|
||||
voltage == E_DJI_HIGH_POWER_VOLTAGE_13V6 ? "13V6" :
|
||||
voltage == E_DJI_HIGH_POWER_VOLTAGE_17V ? "17V" :
|
||||
voltage == E_DJI_HIGH_POWER_VOLTAGE_24V ? "24V" : "???");
|
||||
} else {
|
||||
USER_LOG_INFO("Start to apply high power.");
|
||||
|
||||
returnCode = DjiPowerManagement_ApplyHighPowerSync();
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("apply high power error");
|
||||
return returnCode;
|
||||
}
|
||||
USER_LOG_INFO("Success to apply high power.");
|
||||
}
|
||||
USER_LOG_INFO("Success to apply high power.");
|
||||
}
|
||||
|
||||
// register power off notification callback function
|
||||
|
||||
@ -0,0 +1,108 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file test_tethered_battery.c
|
||||
* @brief
|
||||
*
|
||||
* @copyright (c) 2024 DJI. All rights reserved.
|
||||
*
|
||||
* All information contained herein is, and remains, the property of DJI.
|
||||
* The intellectual and technical concepts contained herein are proprietary
|
||||
* to DJI and may be covered by U.S. and foreign patents, patents in process,
|
||||
* and protected by trade secret or copyright law. Dissemination of this
|
||||
* information, including but not limited to data and other proprietary
|
||||
* material(s) incorporated within the information, in any form, is strictly
|
||||
* prohibited without the express written consent of DJI.
|
||||
*
|
||||
* If you receive this source code without DJI’s authorization, you may not
|
||||
* further disseminate the information, and you must immediately remove the
|
||||
* source code and notify DJI of its removal. DJI reserves the right to pursue
|
||||
* legal actions against you for any loss(es) or damage(s) caused by your
|
||||
* failure to do so.
|
||||
*
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "test_tethered_battery.h"
|
||||
#include "dji_logger.h"
|
||||
#include "dji_tethered_battery.h"
|
||||
#include "utils/util_misc.h"
|
||||
|
||||
/* Private constants ---------------------------------------------------------*/
|
||||
#define TETHERED_BATTERY_TASK_STACK_SIZE (2048)
|
||||
#define TETHERED_BATTERY_TETHER_LINE_MAX_LENGTH (150)
|
||||
|
||||
/* Private types -------------------------------------------------------------*/
|
||||
|
||||
/* Private values -------------------------------------------------------------*/
|
||||
static T_DjiTaskHandle s_tetheredBatteryTestThread;
|
||||
static bool s_isTetherRetrieval = false;
|
||||
|
||||
/* Private functions declaration ---------------------------------------------*/
|
||||
static void *DjiTest_TetheredBatteryTask(void *arg);
|
||||
|
||||
/* Exported functions definition ---------------------------------------------*/
|
||||
T_DjiReturnCode DjiTest_TetheredBatteryStartService(void)
|
||||
{
|
||||
T_DjiReturnCode returnCode;
|
||||
T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler();
|
||||
|
||||
returnCode = DjiTetheredBattery_Init();
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Dji test tethered battery init failed, errno = 0x%08llX", returnCode);
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
returnCode = osalHandler->TaskCreate("user_tethered_battery_task", DjiTest_TetheredBatteryTask,
|
||||
TETHERED_BATTERY_TASK_STACK_SIZE, NULL,
|
||||
&s_tetheredBatteryTestThread);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Dji tethered battery test task create failed, errno = 0x%08llX", returnCode);
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
|
||||
}
|
||||
|
||||
/* Private functions definition-----------------------------------------------*/
|
||||
|
||||
static void *DjiTest_TetheredBatteryTask(void *arg)
|
||||
{
|
||||
uint32_t sysTimeMs = 0;
|
||||
T_DjiReturnCode returnCode;
|
||||
T_DjiOsalHandler *osalHandler = DjiPlatform_GetOsalHandler();
|
||||
T_DjiTetherLineStatus tetherLineStatus = {0};
|
||||
|
||||
USER_UTIL_UNUSED(arg);
|
||||
|
||||
tetherLineStatus.usedLength = 0;
|
||||
tetherLineStatus.totalLength = TETHERED_BATTERY_TETHER_LINE_MAX_LENGTH;
|
||||
|
||||
while (1) {
|
||||
if (tetherLineStatus.usedLength >= tetherLineStatus.totalLength) {
|
||||
s_isTetherRetrieval = true;
|
||||
}
|
||||
|
||||
if (tetherLineStatus.usedLength <= 0.01f) {
|
||||
s_isTetherRetrieval = false;
|
||||
}
|
||||
|
||||
if (s_isTetherRetrieval == false) {
|
||||
tetherLineStatus.usedLength += 1.00f;
|
||||
} else {
|
||||
tetherLineStatus.usedLength -= 1.00f;
|
||||
}
|
||||
|
||||
returnCode = DjiTetheredBattery_PushTetherLineStatus(tetherLineStatus);
|
||||
if (returnCode != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Test push tether line status error, stat = 0x%08llX", returnCode);
|
||||
}
|
||||
|
||||
USER_LOG_DEBUG("Push tether line status, total: %.2f, used: %.2f", tetherLineStatus.totalLength,
|
||||
tetherLineStatus.usedLength);
|
||||
|
||||
osalHandler->TaskSleepMs(100);
|
||||
}
|
||||
}
|
||||
|
||||
/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/
|
||||
@ -0,0 +1,49 @@
|
||||
/**
|
||||
********************************************************************
|
||||
* @file test_tethered_battery.h
|
||||
* @brief This is the header file for "test_tethered_battery.c", defining the structure and
|
||||
* (exported) function prototypes.
|
||||
*
|
||||
* @copyright (c) 2024 DJI. All rights reserved.
|
||||
*
|
||||
* All information contained herein is, and remains, the property of DJI.
|
||||
* The intellectual and technical concepts contained herein are proprietary
|
||||
* to DJI and may be covered by U.S. and foreign patents, patents in process,
|
||||
* and protected by trade secret or copyright law. Dissemination of this
|
||||
* information, including but not limited to data and other proprietary
|
||||
* material(s) incorporated within the information, in any form, is strictly
|
||||
* prohibited without the express written consent of DJI.
|
||||
*
|
||||
* If you receive this source code without DJI’s authorization, you may not
|
||||
* further disseminate the information, and you must immediately remove the
|
||||
* source code and notify DJI of its removal. DJI reserves the right to pursue
|
||||
* legal actions against you for any loss(es) or damage(s) caused by your
|
||||
* failure to do so.
|
||||
*
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef TEST_TETHERED_BATTERY_H
|
||||
#define TEST_TETHERED_BATTERY_H
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "dji_typedef.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
T_DjiReturnCode DjiTest_TetheredBatteryStartService(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // TEST_TETHERED_BATTERY_H
|
||||
/************************ (C) COPYRIGHT DJI Innovations *******END OF FILE******/
|
||||
@ -160,9 +160,16 @@ static void *DjiTest_TimeSyncTask(void *arg)
|
||||
continue;
|
||||
}
|
||||
|
||||
USER_LOG_DEBUG("current aircraft time is %04d-%02d-%02d %02d:%02d:%02d %d.",
|
||||
aircraftTime.year, aircraftTime.month, aircraftTime.day,
|
||||
aircraftTime.hour, aircraftTime.minute, aircraftTime.second, aircraftTime.microsecond);
|
||||
if ((aircraftTime.second % 30) == 0) {
|
||||
USER_LOG_INFO("current aircraft time is %04d-%02d-%02d %02d:%02d:%02d %d.",
|
||||
aircraftTime.year, aircraftTime.month, aircraftTime.day,
|
||||
aircraftTime.hour, aircraftTime.minute, aircraftTime.second, aircraftTime.microsecond);
|
||||
} else {
|
||||
USER_LOG_DEBUG("current aircraft time is %04d-%02d-%02d %02d:%02d:%02d %d.",
|
||||
aircraftTime.year, aircraftTime.month, aircraftTime.day,
|
||||
aircraftTime.hour, aircraftTime.minute, aircraftTime.second, aircraftTime.microsecond);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -240,6 +240,10 @@ static T_DjiReturnCode DjiUserConfigManager_GetLinkConfigInner(const char *path,
|
||||
linkConfig->type = DJI_USER_LINK_CONFIG_USE_UART_AND_NETWORK_DEVICE;
|
||||
} else if (strcmp(jsonValue->valuestring, "use_uart_and_usb_bulk_device") == 0) {
|
||||
linkConfig->type = DJI_USER_LINK_CONFIG_USE_UART_AND_USB_BULK_DEVICE;
|
||||
} else if (strcmp(jsonValue->valuestring, "use_only_usb_bulk_device") == 0) {
|
||||
linkConfig->type = DJI_USER_LINK_CONFIG_USE_ONLY_USB_BULK_DEVICE;
|
||||
} else if (strcmp(jsonValue->valuestring, "use_only_network_device") == 0) {
|
||||
linkConfig->type = DJI_USER_LINK_CONFIG_USE_ONLY_NETWORK_DEVICE;
|
||||
}
|
||||
}
|
||||
|
||||
@ -326,6 +330,23 @@ static T_DjiReturnCode DjiUserConfigManager_GetLinkConfigInner(const char *path,
|
||||
jsonConfig = cJSON_GetObjectItem(jsonValue, "usb_bulk2_endpoint_out");
|
||||
printf("Config usb bulk2 endpoint out: %s\r\n", jsonConfig->valuestring);
|
||||
linkConfig->usbBulkConfig.usbBulk2EndpointOut = configValue;
|
||||
|
||||
jsonConfig = cJSON_GetObjectItem(jsonValue, "usb_bulk3_device_name");
|
||||
printf("Config usb bulk2 device name: %s\r\n", jsonConfig->valuestring);
|
||||
strcpy(linkConfig->usbBulkConfig.usbBulk3DeviceName, jsonConfig->valuestring);
|
||||
|
||||
jsonConfig = cJSON_GetObjectItem(jsonValue, "usb_bulk3_interface_num");
|
||||
printf("Config usb bulk2 interface num: %s\r\n", jsonConfig->valuestring);
|
||||
sscanf(jsonConfig->valuestring, "%X", &configValue);
|
||||
linkConfig->usbBulkConfig.usbBulk3InterfaceNum = configValue;
|
||||
|
||||
jsonConfig = cJSON_GetObjectItem(jsonValue, "usb_bulk3_endpoint_in");
|
||||
printf("Config usb bulk2 endpoint in: %s\r\n", jsonConfig->valuestring);
|
||||
linkConfig->usbBulkConfig.usbBulk3EndpointIn = configValue;
|
||||
|
||||
jsonConfig = cJSON_GetObjectItem(jsonValue, "usb_bulk3_endpoint_out");
|
||||
printf("Config usb bulk2 endpoint out: %s\r\n", jsonConfig->valuestring);
|
||||
linkConfig->usbBulkConfig.usbBulk3EndpointOut = configValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -43,6 +43,8 @@ typedef enum {
|
||||
DJI_USER_LINK_CONFIG_USE_ONLY_UART,
|
||||
DJI_USER_LINK_CONFIG_USE_UART_AND_NETWORK_DEVICE,
|
||||
DJI_USER_LINK_CONFIG_USE_UART_AND_USB_BULK_DEVICE,
|
||||
DJI_USER_LINK_CONFIG_USE_ONLY_USB_BULK_DEVICE,
|
||||
DJI_USER_LINK_CONFIG_USE_ONLY_NETWORK_DEVICE,
|
||||
} E_DjiUserLinkConfigType;
|
||||
|
||||
typedef struct {
|
||||
@ -72,6 +74,10 @@ typedef struct {
|
||||
uint8_t usbBulk2EndpointIn;
|
||||
uint8_t usbBulk2EndpointOut;
|
||||
|
||||
char usbBulk3DeviceName[USER_DEVICE_NAME_STR_MAX_SIZE];
|
||||
uint8_t usbBulk3InterfaceNum;
|
||||
uint8_t usbBulk3EndpointIn;
|
||||
uint8_t usbBulk3EndpointOut;
|
||||
} usbBulkConfig;
|
||||
} T_DjiUserLinkConfig;
|
||||
|
||||
|
||||
@ -104,6 +104,7 @@ T_DjiReturnCode DjiTest_WidgetStartService(void)
|
||||
}
|
||||
|
||||
//set default ui config path
|
||||
USER_LOG_INFO("widget file: %s", tempPath);
|
||||
djiStat = DjiWidget_RegDefaultUiConfigByDirPath(tempPath);
|
||||
if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Add default widget ui config error, stat = 0x%08llX", djiStat);
|
||||
|
||||
@ -324,6 +324,8 @@ static T_DjiReturnCode DjiTest_PlayTtsData(void)
|
||||
if (DJI_AIRCRAFT_TYPE_M3E == aircraftInfoBaseInfo.aircraftType || DJI_AIRCRAFT_TYPE_M3T == aircraftInfoBaseInfo.aircraftType
|
||||
|| DJI_AIRCRAFT_TYPE_M3D == aircraftInfoBaseInfo.aircraftType || DJI_AIRCRAFT_TYPE_M3TD == aircraftInfoBaseInfo.aircraftType
|
||||
|| DJI_AIRCRAFT_TYPE_M4T == aircraftInfoBaseInfo.aircraftType
|
||||
|| DJI_AIRCRAFT_TYPE_M4TD == aircraftInfoBaseInfo.aircraftType
|
||||
|| DJI_AIRCRAFT_TYPE_M4D == aircraftInfoBaseInfo.aircraftType
|
||||
|| DJI_AIRCRAFT_TYPE_M4E == aircraftInfoBaseInfo.aircraftType
|
||||
|| DJI_AIRCRAFT_TYPE_M4TD == aircraftInfoBaseInfo.aircraftType
|
||||
|| DJI_AIRCRAFT_TYPE_M4D == aircraftInfoBaseInfo.aircraftType
|
||||
|
||||
@ -1,148 +1,612 @@
|
||||
{
|
||||
"version": {
|
||||
"major": 1,
|
||||
"minor": 0
|
||||
},
|
||||
"main_interface": {
|
||||
"floating_window": {
|
||||
"is_enable": true
|
||||
"version": {
|
||||
"major": 1,
|
||||
"minor": 0
|
||||
},
|
||||
"speaker": {
|
||||
"is_enable_tts": true,
|
||||
"is_enable_voice": true
|
||||
},
|
||||
"widget_list": [
|
||||
{
|
||||
"widget_index": 0,
|
||||
"widget_type": "button",
|
||||
"widget_name": "按钮",
|
||||
"icon_file_set": {
|
||||
"icon_file_name_selected": "icon_button1.png",
|
||||
"icon_file_name_unselected": "icon_button1.png"
|
||||
},
|
||||
"customize_rc_buttons_config": {
|
||||
"is_enable": true,
|
||||
"mapping_config_display_order": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"widget_index": 1,
|
||||
"widget_type": "list",
|
||||
"widget_name": "列表",
|
||||
"list_item": [
|
||||
{
|
||||
"item_name": "选项_1",
|
||||
"icon_file_set": {
|
||||
"icon_file_name_selected": "icon_list_item1.png",
|
||||
"icon_file_name_unselected": "icon_list_item1.png"
|
||||
"ar_config": {
|
||||
"circleStyleList": [
|
||||
{
|
||||
"face": {
|
||||
"bottom": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
},
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.4,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 0,
|
||||
"minDist": 50
|
||||
},
|
||||
"side": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
},
|
||||
"top": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
}
|
||||
},
|
||||
"stroke": {
|
||||
"bottom": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"side": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"top": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"styleId": 10
|
||||
},
|
||||
{
|
||||
"face": {
|
||||
"bottom": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
},
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.4,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 0,
|
||||
"minDist": 50
|
||||
},
|
||||
"side": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
},
|
||||
"top": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
}
|
||||
},
|
||||
"stroke": {
|
||||
"bottom": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"side": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"top": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"styleId": 11
|
||||
}
|
||||
},
|
||||
{
|
||||
"item_name": "选项_2",
|
||||
"icon_file_set": {
|
||||
"icon_file_name_selected": "icon_list_item2.png",
|
||||
"icon_file_name_unselected": "icon_list_item2.png"
|
||||
],
|
||||
"commonPointStyleList": [
|
||||
{
|
||||
"alwaysInEdge": false,
|
||||
"arTextAttribute": {
|
||||
"color": -65536
|
||||
},
|
||||
"isIgnoreBorder": true,
|
||||
"styleId": 10
|
||||
},
|
||||
{
|
||||
"alwaysInEdge": false,
|
||||
"arTextAttribute": {
|
||||
"color": -65536
|
||||
},
|
||||
"isIgnoreBorder": true,
|
||||
"styleId": 11
|
||||
}
|
||||
}
|
||||
],
|
||||
"customize_rc_buttons_config": {
|
||||
"is_enable": true,
|
||||
"mapping_config_display_order": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"widget_index": 2,
|
||||
"widget_type": "switch",
|
||||
"widget_name": "开关",
|
||||
"icon_file_set": {
|
||||
"icon_file_name_selected": "icon_switch_select.png",
|
||||
"icon_file_name_unselected": "icon_switch_unselect.png"
|
||||
},
|
||||
"customize_rc_buttons_config": {
|
||||
"is_enable": true,
|
||||
"mapping_config_display_order": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"widget_index": 3,
|
||||
"widget_type": "scale",
|
||||
"widget_name": "范围条",
|
||||
"icon_file_set": {
|
||||
"icon_file_name_selected": "icon_scale.png",
|
||||
"icon_file_name_unselected": "icon_scale.png"
|
||||
},
|
||||
"customize_rc_buttons_config": {
|
||||
"is_enable": true,
|
||||
"mapping_config_display_order": 3,
|
||||
"button_value_step_length": 5
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"config_interface": {
|
||||
"text_input_box": {
|
||||
"widget_name": "文本输入框",
|
||||
"placeholder_text": "请输入消息",
|
||||
"is_enable": true
|
||||
"lineStyleList": [
|
||||
{
|
||||
"color": -256,
|
||||
"stokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": false,
|
||||
"width": {
|
||||
"maxStrokeWidth": 2,
|
||||
"maxWidthDist": 2,
|
||||
"minStrokeWidth": 2,
|
||||
"minWidthDist": 2
|
||||
}
|
||||
},
|
||||
"styleId": 10,
|
||||
"useDepth": false
|
||||
},
|
||||
{
|
||||
"color": -256,
|
||||
"stokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": false,
|
||||
"width": {
|
||||
"maxStrokeWidth": 2,
|
||||
"maxWidthDist": 2,
|
||||
"minStrokeWidth": 2,
|
||||
"minWidthDist": 2
|
||||
}
|
||||
},
|
||||
"styleId": 11,
|
||||
"useDepth": false
|
||||
}
|
||||
],
|
||||
"pointStyleList": [
|
||||
{
|
||||
"keyName": 0,
|
||||
"pointConfig": {
|
||||
"arrowConfig": {
|
||||
"customIcon": false,
|
||||
"defaultDeg": 0,
|
||||
"img": "",
|
||||
"imgHeight": 0,
|
||||
"imgWidth": 0,
|
||||
"showMode": 0,
|
||||
"translate": 0,
|
||||
"type": 0
|
||||
},
|
||||
"needFont": true,
|
||||
"needOrthographic": true,
|
||||
"needPerspective": false,
|
||||
"oConfig": {
|
||||
"displayHeight": 20.0,
|
||||
"displayWidth": 20.0,
|
||||
"img": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" fill=\"none\"\n version=\"1.1\" width=\"8\" height=\"8\" viewBox=\"0 0 8 8\">\n <g>\n <ellipse id=\"point_normal_bg\"\n cx=\"4\" cy=\"4\" rx=\"2\" ry=\"2\"\n fill=\"#FFFFFF\" fill-opacity=\"1\" />\n </g>\n\n</svg>",
|
||||
"imgHeight": 20.0,
|
||||
"imgWidth": 20.0
|
||||
},
|
||||
"pConfig": {
|
||||
"maxSVG": "",
|
||||
"maxSize": 0,
|
||||
"minSVG": "",
|
||||
"minSize": 0,
|
||||
"realSize": 0,
|
||||
"strokeWidthRadio": 0
|
||||
},
|
||||
"textConfig": {
|
||||
"backgroundColor": 1427379220,
|
||||
"cornerRadius": 5,
|
||||
"paddingB": 5,
|
||||
"paddingL": 10,
|
||||
"paddingR": 10,
|
||||
"paddingT": 5,
|
||||
"shadow": false,
|
||||
"textGravity": 1,
|
||||
"textSize": 20
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"keyName": 1,
|
||||
"pointConfig": {
|
||||
"arrowConfig": {
|
||||
"customIcon": false,
|
||||
"defaultDeg": 0,
|
||||
"img": "",
|
||||
"imgHeight": 0,
|
||||
"imgWidth": 0,
|
||||
"showMode": 0,
|
||||
"translate": 0,
|
||||
"type": 0
|
||||
},
|
||||
"needFont": true,
|
||||
"needOrthographic": true,
|
||||
"needPerspective": false,
|
||||
"oConfig": {
|
||||
"displayHeight": 20.0,
|
||||
"displayWidth": 20.0,
|
||||
"img": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" fill=\"none\"\n version=\"1.1\" width=\"8\" height=\"8\" viewBox=\"0 0 8 8\">\n <g>\n <ellipse id=\"point_normal_bg\"\n cx=\"4\" cy=\"4\" rx=\"2\" ry=\"2\"\n fill=\"#FFFFFF\" fill-opacity=\"1\" />\n </g>\n\n</svg>",
|
||||
"imgHeight": 20.0,
|
||||
"imgWidth": 20.0
|
||||
},
|
||||
"pConfig": {
|
||||
"maxSVG": "",
|
||||
"maxSize": 0,
|
||||
"minSVG": "",
|
||||
"minSize": 0,
|
||||
"realSize": 0,
|
||||
"strokeWidthRadio": 0
|
||||
},
|
||||
"textConfig": {
|
||||
"backgroundColor": 1427379220,
|
||||
"cornerRadius": 5,
|
||||
"paddingB": 5,
|
||||
"paddingL": 10,
|
||||
"paddingR": 10,
|
||||
"paddingT": 5,
|
||||
"shadow": false,
|
||||
"textGravity": 1,
|
||||
"textSize": 20
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"polygonStyleList": [
|
||||
{
|
||||
"face": {
|
||||
"bottom": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
},
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.4,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 0,
|
||||
"minDist": 50
|
||||
},
|
||||
"side": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
},
|
||||
"top": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
}
|
||||
},
|
||||
"is3DMesh": false,
|
||||
"stroke": {
|
||||
"bottom": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"side": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"top": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"styleId": 10
|
||||
},
|
||||
{
|
||||
"face": {
|
||||
"bottom": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
},
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.4,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 0,
|
||||
"minDist": 50
|
||||
},
|
||||
"side": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
},
|
||||
"top": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
}
|
||||
},
|
||||
"is3DMesh": false,
|
||||
"stroke": {
|
||||
"bottom": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"side": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"top": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"styleId": 11
|
||||
}
|
||||
]
|
||||
},
|
||||
"widget_list": [
|
||||
{
|
||||
"widget_index": 4,
|
||||
"widget_type": "button",
|
||||
"widget_name": "按钮 4",
|
||||
"customize_rc_buttons_config": {
|
||||
"is_enable": true,
|
||||
"mapping_config_display_order": 4
|
||||
}
|
||||
},
|
||||
{
|
||||
"widget_index": 5,
|
||||
"widget_type": "scale",
|
||||
"widget_name": "范围条 5",
|
||||
"customize_rc_buttons_config": {
|
||||
"is_enable": true,
|
||||
"mapping_config_display_order": 5,
|
||||
"button_value_step_length": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"widget_index": 6,
|
||||
"widget_type": "int_input_box",
|
||||
"widget_name": "整形值输入框 6",
|
||||
"int_input_box_hint": "unit:s"
|
||||
},
|
||||
{
|
||||
"widget_index": 7,
|
||||
"widget_type": "switch",
|
||||
"widget_name": "开关 7",
|
||||
"customize_rc_buttons_config": {
|
||||
"is_enable": true,
|
||||
"mapping_config_display_order": 7
|
||||
}
|
||||
},
|
||||
{
|
||||
"widget_index": 8,
|
||||
"widget_type": "list",
|
||||
"widget_name": "列表 8",
|
||||
"list_item": [
|
||||
{
|
||||
"item_name": "选项 1"
|
||||
},
|
||||
{
|
||||
"item_name": "选项 2"
|
||||
},
|
||||
{
|
||||
"item_name": "选项 3"
|
||||
},
|
||||
{
|
||||
"item_name": "选项 4"
|
||||
}
|
||||
],
|
||||
"customize_rc_buttons_config": {
|
||||
"is_enable": true,
|
||||
"mapping_config_display_order": 8
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
"main_interface": {
|
||||
"floating_window": {
|
||||
"is_enable": true
|
||||
},
|
||||
"speaker": {
|
||||
"is_enable_tts": true,
|
||||
"is_enable_voice": true
|
||||
},
|
||||
"widget_list": [
|
||||
{
|
||||
"widget_index": 0,
|
||||
"widget_type": "button",
|
||||
"widget_name": "按钮",
|
||||
"icon_file_set": {
|
||||
"icon_file_name_selected": "icon_button1.png",
|
||||
"icon_file_name_unselected": "icon_button1.png"
|
||||
},
|
||||
"customize_rc_buttons_config": {
|
||||
"is_enable": true,
|
||||
"mapping_config_display_order": 0
|
||||
}
|
||||
},
|
||||
{
|
||||
"widget_index": 1,
|
||||
"widget_type": "list",
|
||||
"widget_name": "列表",
|
||||
"list_item": [
|
||||
{
|
||||
"item_name": "选项_1",
|
||||
"icon_file_set": {
|
||||
"icon_file_name_selected": "icon_list_item1.png",
|
||||
"icon_file_name_unselected": "icon_list_item1.png"
|
||||
}
|
||||
},
|
||||
{
|
||||
"item_name": "选项_2",
|
||||
"icon_file_set": {
|
||||
"icon_file_name_selected": "icon_list_item2.png",
|
||||
"icon_file_name_unselected": "icon_list_item2.png"
|
||||
}
|
||||
}
|
||||
],
|
||||
"customize_rc_buttons_config": {
|
||||
"is_enable": true,
|
||||
"mapping_config_display_order": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"widget_index": 2,
|
||||
"widget_type": "switch",
|
||||
"widget_name": "开关",
|
||||
"icon_file_set": {
|
||||
"icon_file_name_selected": "icon_switch_select.png",
|
||||
"icon_file_name_unselected": "icon_switch_unselect.png"
|
||||
},
|
||||
"customize_rc_buttons_config": {
|
||||
"is_enable": true,
|
||||
"mapping_config_display_order": 2
|
||||
}
|
||||
},
|
||||
{
|
||||
"widget_index": 3,
|
||||
"widget_type": "scale",
|
||||
"widget_name": "范围条",
|
||||
"icon_file_set": {
|
||||
"icon_file_name_selected": "icon_scale.png",
|
||||
"icon_file_name_unselected": "icon_scale.png"
|
||||
},
|
||||
"customize_rc_buttons_config": {
|
||||
"is_enable": true,
|
||||
"mapping_config_display_order": 3,
|
||||
"button_value_step_length": 5
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"config_interface": {
|
||||
"text_input_box": {
|
||||
"widget_name": "文本输入框",
|
||||
"placeholder_text": "请输入消息",
|
||||
"is_enable": true
|
||||
},
|
||||
"widget_list": [
|
||||
{
|
||||
"widget_index": 4,
|
||||
"widget_type": "button",
|
||||
"widget_name": "按钮 4",
|
||||
"customize_rc_buttons_config": {
|
||||
"is_enable": true,
|
||||
"mapping_config_display_order": 4
|
||||
}
|
||||
},
|
||||
{
|
||||
"widget_index": 5,
|
||||
"widget_type": "scale",
|
||||
"widget_name": "范围条 5",
|
||||
"customize_rc_buttons_config": {
|
||||
"is_enable": true,
|
||||
"mapping_config_display_order": 5,
|
||||
"button_value_step_length": 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"widget_index": 6,
|
||||
"widget_type": "int_input_box",
|
||||
"widget_name": "整形值输入框 6",
|
||||
"int_input_box_hint": "unit:s"
|
||||
},
|
||||
{
|
||||
"widget_index": 7,
|
||||
"widget_type": "switch",
|
||||
"widget_name": "开关 7",
|
||||
"customize_rc_buttons_config": {
|
||||
"is_enable": true,
|
||||
"mapping_config_display_order": 7
|
||||
}
|
||||
},
|
||||
{
|
||||
"widget_index": 8,
|
||||
"widget_type": "list",
|
||||
"widget_name": "列表 8",
|
||||
"list_item": [
|
||||
{
|
||||
"item_name": "选项 1"
|
||||
},
|
||||
{
|
||||
"item_name": "选项 2"
|
||||
},
|
||||
{
|
||||
"item_name": "选项 3"
|
||||
},
|
||||
{
|
||||
"item_name": "选项 4"
|
||||
}
|
||||
],
|
||||
"customize_rc_buttons_config": {
|
||||
"is_enable": true,
|
||||
"mapping_config_display_order": 8
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,470 @@
|
||||
"major": 1,
|
||||
"minor": 0
|
||||
},
|
||||
"ar_config": {
|
||||
"circleStyleList": [
|
||||
{
|
||||
"face": {
|
||||
"bottom": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
},
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.4,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 0,
|
||||
"minDist": 50
|
||||
},
|
||||
"side": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
},
|
||||
"top": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
}
|
||||
},
|
||||
"stroke": {
|
||||
"bottom": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"side": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"top": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"styleId": 10
|
||||
},
|
||||
{
|
||||
"face": {
|
||||
"bottom": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
},
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.4,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 0,
|
||||
"minDist": 50
|
||||
},
|
||||
"side": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
},
|
||||
"top": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
}
|
||||
},
|
||||
"stroke": {
|
||||
"bottom": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"side": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"top": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"styleId": 11
|
||||
}
|
||||
],
|
||||
"commonPointStyleList": [
|
||||
{
|
||||
"alwaysInEdge": false,
|
||||
"arTextAttribute": {
|
||||
"color": -65536
|
||||
},
|
||||
"isIgnoreBorder": true,
|
||||
"styleId": 10
|
||||
},
|
||||
{
|
||||
"alwaysInEdge": false,
|
||||
"arTextAttribute": {
|
||||
"color": -65536
|
||||
},
|
||||
"isIgnoreBorder": true,
|
||||
"styleId": 11
|
||||
}
|
||||
],
|
||||
"lineStyleList": [
|
||||
{
|
||||
"color": -256,
|
||||
"stokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": false,
|
||||
"width": {
|
||||
"maxStrokeWidth": 2,
|
||||
"maxWidthDist": 2,
|
||||
"minStrokeWidth": 2,
|
||||
"minWidthDist": 2
|
||||
}
|
||||
},
|
||||
"styleId": 10,
|
||||
"useDepth": false
|
||||
},
|
||||
{
|
||||
"color": -256,
|
||||
"stokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": false,
|
||||
"width": {
|
||||
"maxStrokeWidth": 2,
|
||||
"maxWidthDist": 2,
|
||||
"minStrokeWidth": 2,
|
||||
"minWidthDist": 2
|
||||
}
|
||||
},
|
||||
"styleId": 11,
|
||||
"useDepth": false
|
||||
}
|
||||
],
|
||||
"pointStyleList": [
|
||||
{
|
||||
"keyName": 0,
|
||||
"pointConfig": {
|
||||
"arrowConfig": {
|
||||
"customIcon": false,
|
||||
"defaultDeg": 0,
|
||||
"img": "",
|
||||
"imgHeight": 0,
|
||||
"imgWidth": 0,
|
||||
"showMode": 0,
|
||||
"translate": 0,
|
||||
"type": 0
|
||||
},
|
||||
"needFont": true,
|
||||
"needOrthographic": true,
|
||||
"needPerspective": false,
|
||||
"oConfig": {
|
||||
"displayHeight": 20.0,
|
||||
"displayWidth": 20.0,
|
||||
"img": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" fill=\"none\"\n version=\"1.1\" width=\"8\" height=\"8\" viewBox=\"0 0 8 8\">\n <g>\n <ellipse id=\"point_normal_bg\"\n cx=\"4\" cy=\"4\" rx=\"2\" ry=\"2\"\n fill=\"#FFFFFF\" fill-opacity=\"1\" />\n </g>\n\n</svg>",
|
||||
"imgHeight": 20.0,
|
||||
"imgWidth": 20.0
|
||||
},
|
||||
"pConfig": {
|
||||
"maxSVG": "",
|
||||
"maxSize": 0,
|
||||
"minSVG": "",
|
||||
"minSize": 0,
|
||||
"realSize": 0,
|
||||
"strokeWidthRadio": 0
|
||||
},
|
||||
"textConfig": {
|
||||
"backgroundColor": 1427379220,
|
||||
"cornerRadius": 5,
|
||||
"paddingB": 5,
|
||||
"paddingL": 10,
|
||||
"paddingR": 10,
|
||||
"paddingT": 5,
|
||||
"shadow": false,
|
||||
"textGravity": 1,
|
||||
"textSize": 20
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"keyName": 1,
|
||||
"pointConfig": {
|
||||
"arrowConfig": {
|
||||
"customIcon": false,
|
||||
"defaultDeg": 0,
|
||||
"img": "",
|
||||
"imgHeight": 0,
|
||||
"imgWidth": 0,
|
||||
"showMode": 0,
|
||||
"translate": 0,
|
||||
"type": 0
|
||||
},
|
||||
"needFont": true,
|
||||
"needOrthographic": true,
|
||||
"needPerspective": false,
|
||||
"oConfig": {
|
||||
"displayHeight": 20.0,
|
||||
"displayWidth": 20.0,
|
||||
"img": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" fill=\"none\"\n version=\"1.1\" width=\"8\" height=\"8\" viewBox=\"0 0 8 8\">\n <g>\n <ellipse id=\"point_normal_bg\"\n cx=\"4\" cy=\"4\" rx=\"2\" ry=\"2\"\n fill=\"#FFFFFF\" fill-opacity=\"1\" />\n </g>\n\n</svg>",
|
||||
"imgHeight": 20.0,
|
||||
"imgWidth": 20.0
|
||||
},
|
||||
"pConfig": {
|
||||
"maxSVG": "",
|
||||
"maxSize": 0,
|
||||
"minSVG": "",
|
||||
"minSize": 0,
|
||||
"realSize": 0,
|
||||
"strokeWidthRadio": 0
|
||||
},
|
||||
"textConfig": {
|
||||
"backgroundColor": 1427379220,
|
||||
"cornerRadius": 5,
|
||||
"paddingB": 5,
|
||||
"paddingL": 10,
|
||||
"paddingR": 10,
|
||||
"paddingT": 5,
|
||||
"shadow": false,
|
||||
"textGravity": 1,
|
||||
"textSize": 20
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"polygonStyleList": [
|
||||
{
|
||||
"face": {
|
||||
"bottom": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
},
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.4,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 0,
|
||||
"minDist": 50
|
||||
},
|
||||
"side": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
},
|
||||
"top": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
}
|
||||
},
|
||||
"is3DMesh": false,
|
||||
"stroke": {
|
||||
"bottom": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"side": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"top": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"styleId": 10
|
||||
},
|
||||
{
|
||||
"face": {
|
||||
"bottom": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
},
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.4,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 0,
|
||||
"minDist": 50
|
||||
},
|
||||
"side": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
},
|
||||
"top": {
|
||||
"backColor": -256,
|
||||
"faceColor": -65536
|
||||
}
|
||||
},
|
||||
"is3DMesh": false,
|
||||
"stroke": {
|
||||
"bottom": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"side": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"top": {
|
||||
"distAlpha": {
|
||||
"maxAlpha": 0.6,
|
||||
"maxDist": 100,
|
||||
"minAlpha": 1,
|
||||
"minDist": 50
|
||||
},
|
||||
"strokeInfo": {
|
||||
"color": -65536,
|
||||
"dash": true,
|
||||
"width": {
|
||||
"maxStrokeWidth": 20,
|
||||
"maxWidthDist": 20,
|
||||
"minStrokeWidth": 2.5,
|
||||
"minWidthDist": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"styleId": 11
|
||||
}
|
||||
]
|
||||
},
|
||||
"main_interface": {
|
||||
"floating_window": {
|
||||
"is_enable": true
|
||||
|
||||
@ -228,7 +228,9 @@ T_DjiReturnCode DjiTest_WidgetInteractionStartService(void)
|
||||
snprintf(tempPath, WIDGET_DIR_PATH_LEN_MAX, "%swidget_file/en_big_screen", curFileDirPath);
|
||||
}
|
||||
|
||||
USER_LOG_ERROR("Dji test widget set path");
|
||||
//set default ui config path
|
||||
USER_LOG_INFO("widget file: %s", tempPath);
|
||||
djiStat = DjiWidget_RegDefaultUiConfigByDirPath(tempPath);
|
||||
if (djiStat != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||
USER_LOG_ERROR("Add default widget ui config error, stat = 0x%08llX", djiStat);
|
||||
@ -463,7 +465,9 @@ static void *DjiTest_WidgetInteractionTask(void *arg)
|
||||
DjiTest_WidgetLogAppend("-> Sample Start");
|
||||
|
||||
if (s_aircraftInfoBaseInfo.mountPositionType == DJI_MOUNT_POSITION_TYPE_EXTENSION_PORT ||
|
||||
s_aircraftInfoBaseInfo.mountPositionType == DJI_MOUNT_POSITION_TYPE_EXTENSION_LITE_PORT) {
|
||||
s_aircraftInfoBaseInfo.mountPositionType == DJI_MOUNT_POSITION_TYPE_EXTENSION_LITE_PORT ||
|
||||
s_aircraftInfoBaseInfo.mountPositionType == DJI_MOUNT_POSITION_TYPE_MANIFOLD3_ONBOARD ||
|
||||
s_aircraftInfoBaseInfo.mountPositionType == DJI_MOUNT_POSITION_TYPE_EXTENSION_PORT_V2) {
|
||||
switch (s_extensionPortSampleIndex) {
|
||||
case E_DJI_SAMPLE_INDEX_WAYPOINT_V2:
|
||||
if (s_isallowRunFlightControlSample == true) {
|
||||
|
||||
Reference in New Issue
Block a user