遥控器界面
This commit is contained in:
@ -32,6 +32,10 @@
|
|||||||
#include "dji_sdk_config.h"
|
#include "dji_sdk_config.h"
|
||||||
#include "file_binary_array_list_en.h"
|
#include "file_binary_array_list_en.h"
|
||||||
|
|
||||||
|
//sbg
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
/* Private constants ---------------------------------------------------------*/
|
/* Private constants ---------------------------------------------------------*/
|
||||||
#define WIDGET_DIR_PATH_LEN_MAX (256)
|
#define WIDGET_DIR_PATH_LEN_MAX (256)
|
||||||
#define WIDGET_TASK_STACK_SIZE (2048)
|
#define WIDGET_TASK_STACK_SIZE (2048)
|
||||||
@ -45,21 +49,65 @@ static T_DjiReturnCode DjiTestWidget_SetWidgetValue(E_DjiWidgetType widgetType,
|
|||||||
static T_DjiReturnCode DjiTestWidget_GetWidgetValue(E_DjiWidgetType widgetType, uint32_t index, int32_t *value,
|
static T_DjiReturnCode DjiTestWidget_GetWidgetValue(E_DjiWidgetType widgetType, uint32_t index, int32_t *value,
|
||||||
void *userData);
|
void *userData);
|
||||||
|
|
||||||
|
static T_DjiReturnCode PsdkTestWidget_SetWidgetValue_StartRecord(E_DjiWidgetType widgetType, uint32_t index, int32_t value,
|
||||||
|
void *userData);
|
||||||
|
|
||||||
|
static void *PsdkTest_IrisRecordSystemChanged(void *arg);
|
||||||
|
|
||||||
/* Private values ------------------------------------------------------------*/
|
/* Private values ------------------------------------------------------------*/
|
||||||
static T_DjiTaskHandle s_widgetTestThread;
|
static T_DjiTaskHandle s_widgetTestThread;
|
||||||
static bool s_isWidgetFileDirPathConfigured = false;
|
static bool s_isWidgetFileDirPathConfigured = false;
|
||||||
static char s_widgetFileDirPath[DJI_FILE_PATH_SIZE_MAX] = {0};
|
static char s_widgetFileDirPath[DJI_FILE_PATH_SIZE_MAX] = {0};
|
||||||
|
|
||||||
|
|
||||||
|
static T_DjiTaskHandle s_widgetSbgThread;
|
||||||
|
static T_DjiTaskHandle s_widgetXimeaThread;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int SbgRecordCondition=0;
|
||||||
|
|
||||||
|
static int s_sbgMagState=0;
|
||||||
|
static int s_stateOfXimea=100;
|
||||||
|
static int s_stateOfSbg=0;
|
||||||
|
static int s_stateOfFile=0;
|
||||||
|
|
||||||
|
//0:ximeaAirborneSystem系统未就绪,不可启动;1:ximeaAirborneSystem系统就绪,可以启动;
|
||||||
|
//2:ximeaAirborneSystem系统正在启动;3:ximeaAirborneSystem系统启动成功;4:系统已经关闭,并且不能再次启动;
|
||||||
|
int systemON_Control = 0;
|
||||||
|
|
||||||
|
char s_strUIMessage[100]=" ";
|
||||||
|
static char * s_strStateOfSbg="None";
|
||||||
|
static char * s_strSbgSatelliteCounter="None";
|
||||||
|
static char * s_strSbgAccuracy="None";
|
||||||
|
char XimeaFramerate[100]=" ";
|
||||||
|
char XimeaExposeTime[100]=" ";
|
||||||
|
char XimeaExposeMaxValue[100]=" ";
|
||||||
|
char spectralBin[100]="None";
|
||||||
|
static char * s_strSbgSolutionMode="None";
|
||||||
|
static char * s_strStateOfXimea="None";
|
||||||
|
|
||||||
|
char * s_strPitch="None";
|
||||||
|
char * s_strRoll="None";
|
||||||
|
char * s_strYaw="None";
|
||||||
|
|
||||||
|
static int s_sockfd;
|
||||||
|
static struct sockaddr_in s_server;
|
||||||
|
|
||||||
|
|
||||||
static const T_DjiWidgetHandlerListItem s_widgetHandlerList[] = {
|
static const T_DjiWidgetHandlerListItem s_widgetHandlerList[] = {
|
||||||
{0, DJI_WIDGET_TYPE_BUTTON, DjiTestWidget_SetWidgetValue, DjiTestWidget_GetWidgetValue, NULL},
|
{0, DJI_WIDGET_TYPE_BUTTON, DjiTestWidget_SetWidgetValue, DjiTestWidget_GetWidgetValue, NULL},
|
||||||
{1, DJI_WIDGET_TYPE_LIST, DjiTestWidget_SetWidgetValue, DjiTestWidget_GetWidgetValue, NULL},
|
{1, DJI_WIDGET_TYPE_LIST, DjiTestWidget_SetWidgetValue, DjiTestWidget_GetWidgetValue, NULL},
|
||||||
{2, DJI_WIDGET_TYPE_SWITCH, DjiTestWidget_SetWidgetValue, DjiTestWidget_GetWidgetValue, NULL},
|
{2, DJI_WIDGET_TYPE_SWITCH, DjiTestWidget_SetWidgetValue, DjiTestWidget_GetWidgetValue, NULL},
|
||||||
{3, DJI_WIDGET_TYPE_SCALE, DjiTestWidget_SetWidgetValue, DjiTestWidget_GetWidgetValue, NULL},
|
{3, DJI_WIDGET_TYPE_SCALE, DjiTestWidget_SetWidgetValue, DjiTestWidget_GetWidgetValue, NULL},
|
||||||
{4, DJI_WIDGET_TYPE_BUTTON, DjiTestWidget_SetWidgetValue, DjiTestWidget_GetWidgetValue, NULL},
|
{4, DJI_WIDGET_TYPE_BUTTON, DjiTestWidget_SetWidgetValue, DjiTestWidget_GetWidgetValue, NULL},
|
||||||
{5, DJI_WIDGET_TYPE_SCALE, DjiTestWidget_SetWidgetValue, DjiTestWidget_GetWidgetValue, NULL},
|
{5, DJI_WIDGET_TYPE_SWITCH, PsdkTestWidget_SetWidgetValue_StartRecord, DjiTestWidget_GetWidgetValue, NULL},
|
||||||
{6, DJI_WIDGET_TYPE_INT_INPUT_BOX, DjiTestWidget_SetWidgetValue, DjiTestWidget_GetWidgetValue, NULL},
|
{6, DJI_WIDGET_TYPE_INT_INPUT_BOX, PsdkTestWidget_SetWidgetValue_StartRecord, DjiTestWidget_GetWidgetValue, NULL},
|
||||||
{7, DJI_WIDGET_TYPE_SWITCH, DjiTestWidget_SetWidgetValue, DjiTestWidget_GetWidgetValue, NULL},
|
{7, DJI_WIDGET_TYPE_BUTTON, PsdkTestWidget_SetWidgetValue_StartRecord, DjiTestWidget_GetWidgetValue, NULL},
|
||||||
{8, DJI_WIDGET_TYPE_LIST, DjiTestWidget_SetWidgetValue, DjiTestWidget_GetWidgetValue, NULL},
|
{8, DJI_WIDGET_TYPE_INT_INPUT_BOX, PsdkTestWidget_SetWidgetValue_StartRecord, DjiTestWidget_GetWidgetValue, NULL},
|
||||||
|
{9, DJI_WIDGET_TYPE_SWITCH, PsdkTestWidget_SetWidgetValue_StartRecord, DjiTestWidget_GetWidgetValue, NULL},
|
||||||
|
{10, DJI_WIDGET_TYPE_LIST, PsdkTestWidget_SetWidgetValue_StartRecord, DjiTestWidget_GetWidgetValue, NULL},//PsdkTestWidget_SetWidgetValue
|
||||||
|
{11, DJI_WIDGET_TYPE_LIST, PsdkTestWidget_SetWidgetValue_StartRecord, DjiTestWidget_GetWidgetValue, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *s_widgetTypeNameArray[] = {
|
static const char *s_widgetTypeNameArray[] = {
|
||||||
@ -89,6 +137,9 @@ T_DjiReturnCode DjiTest_WidgetStartService(void)
|
|||||||
|
|
||||||
#ifdef SYSTEM_ARCH_LINUX
|
#ifdef SYSTEM_ARCH_LINUX
|
||||||
//Step 2 : Set UI Config (Linux environment)
|
//Step 2 : Set UI Config (Linux environment)
|
||||||
|
//获取控件图像和UI配置文件所在文件夹
|
||||||
|
USER_LOG_INFO("验证是否定义了宏PSDK_ARCH_SYS_LINUX:是!--------------------------------------------------------------------------------------------------------------------------");
|
||||||
|
|
||||||
char curFileDirPath[WIDGET_DIR_PATH_LEN_MAX];
|
char curFileDirPath[WIDGET_DIR_PATH_LEN_MAX];
|
||||||
char tempPath[WIDGET_DIR_PATH_LEN_MAX];
|
char tempPath[WIDGET_DIR_PATH_LEN_MAX];
|
||||||
djiStat = DjiUserUtil_GetCurrentFileDirPath(__FILE__, WIDGET_DIR_PATH_LEN_MAX, curFileDirPath);
|
djiStat = DjiUserUtil_GetCurrentFileDirPath(__FILE__, WIDGET_DIR_PATH_LEN_MAX, curFileDirPath);
|
||||||
@ -111,6 +162,7 @@ T_DjiReturnCode DjiTest_WidgetStartService(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//set ui config for English language
|
//set ui config for English language
|
||||||
|
//设置系统语言为英文时控件配置文件的路径
|
||||||
djiStat = DjiWidget_RegUiConfigByDirPath(DJI_MOBILE_APP_LANGUAGE_ENGLISH,
|
djiStat = DjiWidget_RegUiConfigByDirPath(DJI_MOBILE_APP_LANGUAGE_ENGLISH,
|
||||||
DJI_MOBILE_APP_SCREEN_TYPE_BIG_SCREEN,
|
DJI_MOBILE_APP_SCREEN_TYPE_BIG_SCREEN,
|
||||||
tempPath);
|
tempPath);
|
||||||
@ -161,6 +213,27 @@ T_DjiReturnCode DjiTest_WidgetStartService(void)
|
|||||||
return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
|
return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Step 5 : Run ximea task
|
||||||
|
if (osalHandler->TaskCreate("ximea", PsdkTest_IrisRecordSystemChanged, WIDGET_TASK_STACK_SIZE, NULL,
|
||||||
|
&s_widgetXimeaThread) != DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||||
|
USER_LOG_ERROR("Psdk widget test task(ximea) create error.");
|
||||||
|
return DJI_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* tc-----------------------------------------------*/
|
||||||
|
struct hostent *he;
|
||||||
|
he=gethostbyname("127.0.0.1");
|
||||||
|
|
||||||
|
s_sockfd=socket(AF_INET, SOCK_DGRAM,0);
|
||||||
|
|
||||||
|
|
||||||
|
bzero(&s_server,sizeof(s_server));
|
||||||
|
s_server.sin_family = AF_INET;
|
||||||
|
s_server.sin_port = htons(PORT);
|
||||||
|
s_server.sin_addr= *((struct in_addr *)he->h_addr);
|
||||||
|
/* tc-----------------------------------------------*/
|
||||||
|
|
||||||
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
|
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -186,6 +259,13 @@ __attribute__((weak)) void DjiTest_WidgetLogAppend(const char *fmt, ...)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Private functions definition-----------------------------------------------*/
|
/* Private functions definition-----------------------------------------------*/
|
||||||
|
//在DJI pilot的浮窗上显示系统时间
|
||||||
|
int messageTimeCounter = 0;
|
||||||
|
int messageTimespan = 10;
|
||||||
|
|
||||||
|
int XimeaAirborneSystemSurvival_Counter = 1;
|
||||||
|
int ximeaAirborneSystemSurvivalTime = 0;
|
||||||
|
int ximeaAirborneSystemSurvivalTime_Temp = 0;
|
||||||
static void *DjiTest_WidgetTask(void *arg)
|
static void *DjiTest_WidgetTask(void *arg)
|
||||||
{
|
{
|
||||||
char message[DJI_WIDGET_FLOATING_WINDOW_MSG_MAX_LEN];
|
char message[DJI_WIDGET_FLOATING_WINDOW_MSG_MAX_LEN];
|
||||||
@ -202,7 +282,8 @@ static void *DjiTest_WidgetTask(void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef USER_FIRMWARE_MAJOR_VERSION
|
#ifndef USER_FIRMWARE_MAJOR_VERSION
|
||||||
snprintf(message, DJI_WIDGET_FLOATING_WINDOW_MSG_MAX_LEN, "System time : %u ms", sysTimeMs);
|
snprintf(message, DJI_WIDGET_FLOATING_WINDOW_MSG_MAX_LEN, "%s\n相机: %s; 惯导: %s;\n卫星: %s; 精度: %s;\n帧率: %s;曝光: %s;max: %s;\nP: %s; R: %s; Y: %s;\n光谱bin: %s;\n",
|
||||||
|
s_strUIMessage, s_strStateOfXimea, s_strStateOfSbg, s_strSbgSatelliteCounter, s_strSbgAccuracy, XimeaFramerate, XimeaExposeTime, XimeaExposeMaxValue, s_strPitch, s_strRoll, s_strYaw, spectralBin);
|
||||||
#else
|
#else
|
||||||
snprintf(message, DJI_WIDGET_FLOATING_WINDOW_MSG_MAX_LEN,
|
snprintf(message, DJI_WIDGET_FLOATING_WINDOW_MSG_MAX_LEN,
|
||||||
"System time : %u ms\r\nVersion: v%02d.%02d.%02d.%02d\r\nBuild time: %s %s", sysTimeMs,
|
"System time : %u ms\r\nVersion: v%02d.%02d.%02d.%02d\r\nBuild time: %s %s", sysTimeMs,
|
||||||
@ -217,10 +298,279 @@ static void *DjiTest_WidgetTask(void *arg)
|
|||||||
USER_LOG_ERROR("Floating window show message error, stat = 0x%08llX", djiStat);
|
USER_LOG_ERROR("Floating window show message error, stat = 0x%08llX", djiStat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
messageTimeCounter++;
|
||||||
|
|
||||||
|
if (messageTimeCounter % messageTimespan == 0)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage," ");
|
||||||
|
}
|
||||||
|
|
||||||
|
//判断ximeaAirborneSystem系统是否存活
|
||||||
|
// if(ximeaAirborneSystemSurvivalTime > 10)
|
||||||
|
// {
|
||||||
|
// if (XimeaAirborneSystemSurvival_Counter % 10 ==0)
|
||||||
|
// {
|
||||||
|
// if (ximeaAirborneSystemSurvivalTime - ximeaAirborneSystemSurvivalTime_Temp == 0)
|
||||||
|
// {
|
||||||
|
// strcpy(s_strUIMessage,"采集系统无响应,请重启!");
|
||||||
|
// messageTimeCounter = 0;
|
||||||
|
// messageTimespan = 10;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// XimeaAirborneSystemSurvival_Counter = 1;
|
||||||
|
// ximeaAirborneSystemSurvivalTime_Temp = ximeaAirborneSystemSurvivalTime;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// XimeaAirborneSystemSurvival_Counter++;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
osalHandler->TaskSleepMs(1000);
|
osalHandler->TaskSleepMs(1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void *PsdkTest_IrisRecordSystemChanged(void *arg)//
|
||||||
|
{
|
||||||
|
// FILE * fp;
|
||||||
|
// char buffer[80];
|
||||||
|
// fp = popen("/home/iris-xport/cpp_qtcreator/ximeaImageRecorder-Release/ximeaImageRecorder", "r");ss
|
||||||
|
// fgets(buffer, sizeof(buffer), fp);
|
||||||
|
// printf("%s", buffer);
|
||||||
|
// pclose(fp);
|
||||||
|
|
||||||
|
|
||||||
|
int sockfd;
|
||||||
|
struct sockaddr_in server;
|
||||||
|
struct sockaddr_in client;
|
||||||
|
socklen_t addrlen;
|
||||||
|
int num;
|
||||||
|
char buf[MAXDATASIZE];
|
||||||
|
|
||||||
|
if((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1)
|
||||||
|
{
|
||||||
|
perror("Creatingsocket failed.");
|
||||||
|
}
|
||||||
|
|
||||||
|
bzero(&server,sizeof(server));
|
||||||
|
server.sin_family=AF_INET;
|
||||||
|
server.sin_port=htons(PORT+1);
|
||||||
|
server.sin_addr.s_addr= htonl(INADDR_ANY);
|
||||||
|
if(bind(sockfd, (struct sockaddr *)&server, sizeof(server)) == -1)
|
||||||
|
{
|
||||||
|
perror("Bind()error.");
|
||||||
|
}
|
||||||
|
|
||||||
|
addrlen=sizeof(client);
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
//printf("PsdkTest_IrisRecordSystemChanged: record system status change! 8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888\n");
|
||||||
|
|
||||||
|
num =recvfrom(sockfd,buf,MAXDATASIZE,0,(struct sockaddr*)&client,&addrlen);
|
||||||
|
|
||||||
|
if (num < 0)
|
||||||
|
{
|
||||||
|
perror("recvfrom() error\n");
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
buf[num] = '\0';
|
||||||
|
|
||||||
|
printf("You got a message (%s) from client.\n",buf);
|
||||||
|
//printf("You got a message (%s%) from client.\nIt's ip is%s, port is %d.\n",buf,inet_ntoa(client.sin_addr),htons(client.sin_port));
|
||||||
|
|
||||||
|
|
||||||
|
char * result[3];
|
||||||
|
result[0] = strtok( buf, "," );
|
||||||
|
result[1] = strtok( NULL, "," );
|
||||||
|
result[2] = strtok( NULL, "," );
|
||||||
|
|
||||||
|
// printf("result[0]: %s\n", result[0]);
|
||||||
|
// printf("result[1]: %s\n\n", result[1]);
|
||||||
|
// printf("result[2]: %s\n\n", result[2]);
|
||||||
|
|
||||||
|
|
||||||
|
if (strcmp(result[0],"sbg") == 0)
|
||||||
|
{
|
||||||
|
s_stateOfSbg = atoi(result[1]);
|
||||||
|
printf("sbg的状态为: %d\n\n", atoi(result[1]));
|
||||||
|
|
||||||
|
switch (s_stateOfSbg)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
s_strStateOfSbg="未打开";
|
||||||
|
|
||||||
|
if (systemON_Control == 0)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"系统已就绪!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 1000;
|
||||||
|
|
||||||
|
systemON_Control = 1;//ximeaAirborneSystem系统一启动就会发送此信息 → 代表采集系统就绪;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (systemON_Control == 3)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"数据量过大,采集系统已经停止,请重新上电!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
s_strStateOfSbg="波特率设置失败";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
s_strStateOfSbg="打开成功";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
s_strStateOfSbg="采集中";
|
||||||
|
systemON_Control = 3;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (strcmp(result[0],"Accuracy") == 0)
|
||||||
|
{
|
||||||
|
// printf("惯导定位精度为: %s\n\n", result[1]);
|
||||||
|
|
||||||
|
s_strSbgAccuracy=result[1];
|
||||||
|
s_strSbgSatelliteCounter=result[2];
|
||||||
|
|
||||||
|
ximeaAirborneSystemSurvivalTime++;
|
||||||
|
|
||||||
|
|
||||||
|
// s_sbgMagState = atoi(result[1]);
|
||||||
|
|
||||||
|
// switch (s_sbgMagState)
|
||||||
|
// {
|
||||||
|
// case 0:
|
||||||
|
// s_strSbgAccuracy="false";
|
||||||
|
// break;
|
||||||
|
// case 1:
|
||||||
|
// s_strSbgAccuracy="true";
|
||||||
|
// break;
|
||||||
|
|
||||||
|
// default:
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
else if (strcmp(result[0],"SolutionMode") == 0)
|
||||||
|
{
|
||||||
|
// s_sbgMagState = atoi(result[1]);
|
||||||
|
//
|
||||||
|
// switch (s_sbgMagState)
|
||||||
|
// {
|
||||||
|
// case 0:
|
||||||
|
// s_strSbgSolutionMode="UNINITIALIZED";
|
||||||
|
// break;
|
||||||
|
// case 1:
|
||||||
|
// s_strSbgSolutionMode="VERTICAL_GYRO";
|
||||||
|
// break;
|
||||||
|
// case 2:
|
||||||
|
// s_strSbgSolutionMode="AHRS";
|
||||||
|
// break;
|
||||||
|
// case 3:
|
||||||
|
// s_strSbgSolutionMode="NAV_VELOCITY";
|
||||||
|
// break;
|
||||||
|
// case 4:
|
||||||
|
// s_strSbgSolutionMode="NAV_POSITION";
|
||||||
|
// break;
|
||||||
|
//
|
||||||
|
// default:
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
else if (strcmp(result[0],"ximea") == 0)
|
||||||
|
{
|
||||||
|
s_stateOfXimea = atoi(result[1]);
|
||||||
|
printf("ximea的状态为: %d\n\n", atoi(result[1]));
|
||||||
|
|
||||||
|
switch (s_stateOfXimea)//0-61:ximea官方错误代码;99:发生的ximea官方错误代码,没有处理;100:未打开;101:打开;102:设置帧率;103:自动曝光;104:正在采集;
|
||||||
|
{
|
||||||
|
case 10:
|
||||||
|
s_strStateOfXimea="10";
|
||||||
|
|
||||||
|
strcpy(s_strUIMessage,"相机timeout,请重启!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 200;
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
s_strStateOfXimea="11";
|
||||||
|
|
||||||
|
strcpy(s_strUIMessage,"相机:Invalid arguments supplied!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 200;
|
||||||
|
break;
|
||||||
|
case 57:
|
||||||
|
s_strStateOfXimea="57";
|
||||||
|
|
||||||
|
strcpy(s_strUIMessage,"相机被占用!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 200;
|
||||||
|
break;
|
||||||
|
case 99:
|
||||||
|
s_strStateOfXimea="99";
|
||||||
|
|
||||||
|
strcpy(s_strUIMessage,"相机异常,错误码见日志!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 200;
|
||||||
|
break;
|
||||||
|
case 100:
|
||||||
|
s_strStateOfXimea="未打开";
|
||||||
|
break;
|
||||||
|
case 101:
|
||||||
|
s_strStateOfXimea="打开成功";
|
||||||
|
|
||||||
|
strcpy(s_strUIMessage,"系统启动成功!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 20;
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 102:
|
||||||
|
s_strStateOfXimea="帧率已设置";
|
||||||
|
break;
|
||||||
|
case 103:
|
||||||
|
s_strStateOfXimea="曝光完成";
|
||||||
|
break;
|
||||||
|
case 104:
|
||||||
|
s_strStateOfXimea="正在采集";
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (strcmp(result[0],"XimeaAutoExpose") == 0)
|
||||||
|
{
|
||||||
|
strcpy(XimeaExposeMaxValue, result[1]);
|
||||||
|
strcpy(XimeaExposeTime, result[2]);
|
||||||
|
|
||||||
|
strcpy(s_strUIMessage,"曝光时间设置成功!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10;
|
||||||
|
}
|
||||||
|
else if (strcmp(result[0],"XimeaFrameRate") == 0)
|
||||||
|
{
|
||||||
|
int tmp = atoi(result[1]);
|
||||||
|
sprintf(XimeaFramerate,"%d",tmp);
|
||||||
|
// strcpy(XimeaFramerate,result[1]);
|
||||||
|
|
||||||
|
strcpy(s_strUIMessage,"帧率设置成功!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10;
|
||||||
|
}
|
||||||
|
else if (strcmp(result[0],"bin") == 0)
|
||||||
|
{
|
||||||
|
int spectralBin_tm = atoi(result[2]);
|
||||||
|
sprintf(spectralBin,"%d",spectralBin_tm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef __CC_ARM
|
#ifndef __CC_ARM
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
#endif
|
#endif
|
||||||
@ -248,4 +598,298 @@ static T_DjiReturnCode DjiTestWidget_GetWidgetValue(E_DjiWidgetType widgetType,
|
|||||||
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
|
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int frameRateGlobel = 0;
|
||||||
|
static T_DjiReturnCode PsdkTestWidget_SetWidgetValue_StartRecord(E_DjiWidgetType widgetType, uint32_t index, int32_t value,
|
||||||
|
void *userData)
|
||||||
|
{
|
||||||
|
USER_UTIL_UNUSED(userData);
|
||||||
|
|
||||||
|
USER_LOG_INFO("Set widget value, widgetType = %s, widgetIndex = %d ,widgetValue = %d",
|
||||||
|
s_widgetTypeNameArray[widgetType], index, value);
|
||||||
|
s_widgetValueList[index] = value;
|
||||||
|
|
||||||
|
switch (index)
|
||||||
|
{
|
||||||
|
case 5://系统启动关闭
|
||||||
|
if (value==0)//系统关闭
|
||||||
|
{
|
||||||
|
if (systemON_Control == 3)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"系统已经关闭!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 1000;
|
||||||
|
|
||||||
|
char* command = "2";
|
||||||
|
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
||||||
|
|
||||||
|
systemON_Control = 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (value==1)//系统启动
|
||||||
|
{
|
||||||
|
if (systemON_Control == 0)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"请等待系统初始化!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 1000;
|
||||||
|
}
|
||||||
|
else if (systemON_Control == 1)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"系统启动中,请等待!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 1000;
|
||||||
|
|
||||||
|
char* command = "1";
|
||||||
|
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
||||||
|
|
||||||
|
systemON_Control = 2;
|
||||||
|
}
|
||||||
|
else if (systemON_Control == 2)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"系统启动中,请等待!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 1000;
|
||||||
|
}
|
||||||
|
else if (systemON_Control == 3)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"系统已经启动!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 1000;
|
||||||
|
}
|
||||||
|
else if (systemON_Control == 4)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"相机占用,请重新上电!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 1000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 6://设置帧率
|
||||||
|
{
|
||||||
|
if (s_stateOfXimea < 101)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"请先启动系统!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (s_stateOfXimea > 103)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"相机采集中,此操作无效!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 控制帧率范围
|
||||||
|
if(value > 150)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"帧率不可超过150!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if(value == 0)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"帧率无效!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
frameRateGlobel = value;
|
||||||
|
|
||||||
|
char command[50] = "5,";
|
||||||
|
char framerate[20];
|
||||||
|
sprintf(framerate,"%d",value);
|
||||||
|
strcat(command,framerate);
|
||||||
|
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 7://自动曝光
|
||||||
|
if (value==0)
|
||||||
|
{
|
||||||
|
;
|
||||||
|
}
|
||||||
|
else if (value==1)
|
||||||
|
{
|
||||||
|
if (s_stateOfXimea < 101)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"请先启动系统!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (s_stateOfXimea > 103)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"相机采集中,此操作无效!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
strcpy(s_strUIMessage,"正在自动曝光,请稍等!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 1000;
|
||||||
|
|
||||||
|
char* command = "6";
|
||||||
|
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 8://手动设置曝光时间
|
||||||
|
{
|
||||||
|
if (s_stateOfXimea < 101)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"请先启动系统!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (s_stateOfXimea > 103)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"相机采集中,此操作无效!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//曝光时间有效性判断
|
||||||
|
if(frameRateGlobel == 0)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"请先设置帧率!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
float maxExposureTime = 1 / (float)frameRateGlobel * 1000;//单位是ms
|
||||||
|
|
||||||
|
if(value > maxExposureTime)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"曝光时间超过上限,无效!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if(value == 0)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"曝光时间无效!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
char command[50] = "7,";
|
||||||
|
char exposureTime[20];
|
||||||
|
sprintf(exposureTime,"%d",(value));
|
||||||
|
strcat(command,exposureTime);
|
||||||
|
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 9:
|
||||||
|
if (value==0)//停止采集
|
||||||
|
{
|
||||||
|
char* command = "4";
|
||||||
|
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
||||||
|
}
|
||||||
|
else if (value==1)//开始采集
|
||||||
|
{
|
||||||
|
if (s_stateOfXimea < 101)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"请先启动系统!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (s_stateOfXimea == 101)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"请先设置帧率!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if (s_stateOfXimea == 102)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"请先设置曝光时间!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
char* command = "3";
|
||||||
|
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
if (value==0)//等待指令
|
||||||
|
{
|
||||||
|
}
|
||||||
|
if (value==1)
|
||||||
|
{
|
||||||
|
system("reboot");
|
||||||
|
}
|
||||||
|
else if (value==2)
|
||||||
|
{
|
||||||
|
system("shutdown now");
|
||||||
|
}
|
||||||
|
else if (value==3)
|
||||||
|
{
|
||||||
|
system("/home/300tc/projects/udpClient/udpClient 127.0.0.1 9,1");
|
||||||
|
}
|
||||||
|
else if (value==4)
|
||||||
|
{
|
||||||
|
system("/home/300tc/projects/udpClient/udpClient 127.0.0.1 9,0");
|
||||||
|
}
|
||||||
|
else if (value==5)
|
||||||
|
{
|
||||||
|
strcpy(s_strUIMessage,"系统正在更新,稍后会自动重启!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10000;
|
||||||
|
|
||||||
|
system("/home/pi/tc_ShellScripts/update0.sh &> /media/nvme/300TC/update/log");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 11:
|
||||||
|
if (value==0)//等待指令
|
||||||
|
{
|
||||||
|
}
|
||||||
|
if (value==1)
|
||||||
|
{
|
||||||
|
system("sudo sed -i 's/spectralBin =.*/spectralBin = 1;/g' /media/nvme/300TC/config/ximea.cfg");
|
||||||
|
}
|
||||||
|
else if (value==2)
|
||||||
|
{
|
||||||
|
system("sudo sed -i 's/spectralBin =.*/spectralBin = 2;/g' /media/nvme/300TC/config/ximea.cfg");
|
||||||
|
}
|
||||||
|
|
||||||
|
strcpy(s_strUIMessage,"请重新上电!");
|
||||||
|
messageTimeCounter = 0;
|
||||||
|
messageTimespan = 10000;
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return DJI_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/
|
/****************** (C) COPYRIGHT DJI Innovations *****END OF FILE****/
|
||||||
|
@ -34,6 +34,21 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
|
||||||
|
|
||||||
|
#define PORT 45454
|
||||||
|
#define MAXDATASIZE 100
|
||||||
|
|
||||||
|
|
||||||
/* Exported constants --------------------------------------------------------*/
|
/* Exported constants --------------------------------------------------------*/
|
||||||
|
|
||||||
/* Exported types ------------------------------------------------------------*/
|
/* Exported types ------------------------------------------------------------*/
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
},
|
},
|
||||||
"speaker": {
|
"speaker": {
|
||||||
"is_enable_tts": true,
|
"is_enable_tts": true,
|
||||||
"is_enable_voice": true
|
"is_enable_voice": false
|
||||||
},
|
},
|
||||||
"widget_list": [
|
"widget_list": [
|
||||||
{
|
{
|
||||||
@ -76,6 +76,19 @@
|
|||||||
"mapping_config_display_order": 3,
|
"mapping_config_display_order": 3,
|
||||||
"button_value_step_length": 5
|
"button_value_step_length": 5
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widget_index": 4,
|
||||||
|
"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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -86,62 +99,73 @@
|
|||||||
"is_enable": true
|
"is_enable": true
|
||||||
},
|
},
|
||||||
"widget_list": [
|
"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_index": 5,
|
||||||
"widget_type": "scale",
|
"widget_type": "switch",
|
||||||
"widget_name": "范围条 5",
|
"widget_name": "系统启动"
|
||||||
"customize_rc_buttons_config": {
|
|
||||||
"is_enable": true,
|
|
||||||
"mapping_config_display_order": 5,
|
|
||||||
"button_value_step_length": 5
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widget_index": 6,
|
"widget_index": 6,
|
||||||
"widget_type": "int_input_box",
|
"widget_type": "int_input_box",
|
||||||
"widget_name": "整形值输入框 6",
|
"widget_name": "帧率",
|
||||||
"int_input_box_hint": "unit:s"
|
"int_input_box_hint": "unit:hz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widget_index": 7,
|
"widget_index": 7,
|
||||||
"widget_type": "switch",
|
"widget_type": "button",
|
||||||
"widget_name": "开关 7",
|
"widget_name": "自动曝光"
|
||||||
"customize_rc_buttons_config": {
|
|
||||||
"is_enable": true,
|
|
||||||
"mapping_config_display_order": 7
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widget_index": 8,
|
"widget_index": 8,
|
||||||
|
"widget_type": "int_input_box",
|
||||||
|
"widget_name": "曝光时间",
|
||||||
|
"int_input_box_hint": "unit:ms"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widget_index": 9,
|
||||||
|
"widget_type": "switch",
|
||||||
|
"widget_name": "开始采集"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widget_index": 10,
|
||||||
"widget_type": "list",
|
"widget_type": "list",
|
||||||
"widget_name": "列表 8",
|
"widget_name": "系统指令",
|
||||||
"list_item": [
|
"list_item": [
|
||||||
{
|
{
|
||||||
"item_name": "选项 1"
|
"item_name": "等待指令"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item_name": "选项 2"
|
"item_name": "重启电脑"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item_name": "选项 3"
|
"item_name": "关机"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item_name": "选项 4"
|
"item_name": "测试采集"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"item_name": "停止采集"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"item_name": "更新"
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"customize_rc_buttons_config": {
|
},
|
||||||
"is_enable": true,
|
{
|
||||||
"mapping_config_display_order": 8
|
"widget_index": 11,
|
||||||
|
"widget_type": "list",
|
||||||
|
"widget_name": "bin",
|
||||||
|
"list_item": [
|
||||||
|
{
|
||||||
|
"item_name": "等待指令"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"item_name": "光谱1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"item_name": "光谱2"
|
||||||
}
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
},
|
},
|
||||||
"speaker": {
|
"speaker": {
|
||||||
"is_enable_tts": true,
|
"is_enable_tts": true,
|
||||||
"is_enable_voice": true
|
"is_enable_voice": false
|
||||||
},
|
},
|
||||||
"widget_list": [
|
"widget_list": [
|
||||||
{
|
{
|
||||||
@ -76,6 +76,19 @@
|
|||||||
"mapping_config_display_order": 3,
|
"mapping_config_display_order": 3,
|
||||||
"button_value_step_length": 5
|
"button_value_step_length": 5
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widget_index": 4,
|
||||||
|
"widget_type": "button",
|
||||||
|
"widget_name": "Button",
|
||||||
|
"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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -86,62 +99,73 @@
|
|||||||
"is_enable": true
|
"is_enable": true
|
||||||
},
|
},
|
||||||
"widget_list": [
|
"widget_list": [
|
||||||
{
|
|
||||||
"widget_index": 4,
|
|
||||||
"widget_type": "button",
|
|
||||||
"widget_name": "Button 4",
|
|
||||||
"customize_rc_buttons_config": {
|
|
||||||
"is_enable": true,
|
|
||||||
"mapping_config_display_order": 4
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"widget_index": 5,
|
"widget_index": 5,
|
||||||
"widget_type": "scale",
|
"widget_type": "switch",
|
||||||
"widget_name": "Scale 5",
|
"widget_name": "系统启动"
|
||||||
"customize_rc_buttons_config": {
|
|
||||||
"is_enable": true,
|
|
||||||
"mapping_config_display_order": 5,
|
|
||||||
"button_value_step_length": 5
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widget_index": 6,
|
"widget_index": 6,
|
||||||
"widget_type": "int_input_box",
|
"widget_type": "int_input_box",
|
||||||
"widget_name": "Integer Input Box 6",
|
"widget_name": "帧率",
|
||||||
"int_input_box_hint": "unit:s"
|
"int_input_box_hint": "unit:hz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widget_index": 7,
|
"widget_index": 7,
|
||||||
"widget_type": "switch",
|
"widget_type": "button",
|
||||||
"widget_name": "Switch 7",
|
"widget_name": "自动曝光"
|
||||||
"customize_rc_buttons_config": {
|
|
||||||
"is_enable": true,
|
|
||||||
"mapping_config_display_order": 7
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widget_index": 8,
|
"widget_index": 8,
|
||||||
|
"widget_type": "int_input_box",
|
||||||
|
"widget_name": "曝光时间",
|
||||||
|
"int_input_box_hint": "unit:ms"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widget_index": 9,
|
||||||
|
"widget_type": "switch",
|
||||||
|
"widget_name": "开始采集"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widget_index": 10,
|
||||||
"widget_type": "list",
|
"widget_type": "list",
|
||||||
"widget_name": "List 8",
|
"widget_name": "系统指令",
|
||||||
"list_item": [
|
"list_item": [
|
||||||
{
|
{
|
||||||
"item_name": "Item 1"
|
"item_name": "等待指令"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item_name": "Item 2"
|
"item_name": "重启电脑"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item_name": "Item 3"
|
"item_name": "关机"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item_name": "Item 4"
|
"item_name": "测试采集"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"item_name": "停止采集"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"item_name": "更新"
|
||||||
}
|
}
|
||||||
],
|
]
|
||||||
"customize_rc_buttons_config": {
|
},
|
||||||
"is_enable": true,
|
{
|
||||||
"mapping_config_display_order": 8
|
"widget_index": 11,
|
||||||
|
"widget_type": "list",
|
||||||
|
"widget_name": "bin",
|
||||||
|
"list_item": [
|
||||||
|
{
|
||||||
|
"item_name": "等待指令"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"item_name": "光谱1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"item_name": "光谱2"
|
||||||
}
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user