1. 优化m300遥控器上的控制界面;
2. psdk使用nanopi自带的网卡eth0; 3. 更改遥控器上的psdk别名:300TC;
This commit is contained in:
@ -93,12 +93,12 @@ static char s_widgetFileDirPath[PSDK_FILE_PATH_SIZE_MAX] = {0};
|
|||||||
static const T_PsdkWidgetHandlerListItem s_widgetHandlerList[] = {
|
static const T_PsdkWidgetHandlerListItem s_widgetHandlerList[] = {
|
||||||
{0, PSDK_WIDGET_TYPE_BUTTON, PsdkTestWidget_SetWidgetValue, PsdkTestWidget_GetWidgetValue, NULL},
|
{0, PSDK_WIDGET_TYPE_BUTTON, PsdkTestWidget_SetWidgetValue, PsdkTestWidget_GetWidgetValue, NULL},
|
||||||
{1, PSDK_WIDGET_TYPE_BUTTON, PsdkTestWidget_SetWidgetValue, PsdkTestWidget_GetWidgetValue, NULL},
|
{1, PSDK_WIDGET_TYPE_BUTTON, PsdkTestWidget_SetWidgetValue, PsdkTestWidget_GetWidgetValue, NULL},
|
||||||
{2, PSDK_WIDGET_TYPE_LIST, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
{2, PSDK_WIDGET_TYPE_LIST, PsdkTestWidget_SetWidgetValue, PsdkTestWidget_GetWidgetValue, NULL},
|
||||||
{3, PSDK_WIDGET_TYPE_SWITCH, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
{3, PSDK_WIDGET_TYPE_SWITCH, PsdkTestWidget_SetWidgetValue, PsdkTestWidget_GetWidgetValue, NULL},
|
||||||
{4, PSDK_WIDGET_TYPE_SCALE, PsdkTestWidget_SetWidgetValue, PsdkTestWidget_GetWidgetValue, NULL},
|
{4, PSDK_WIDGET_TYPE_SCALE, PsdkTestWidget_SetWidgetValue, PsdkTestWidget_GetWidgetValue, NULL},
|
||||||
{5, PSDK_WIDGET_TYPE_BUTTON, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
{5, PSDK_WIDGET_TYPE_SWITCH, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
||||||
{6, PSDK_WIDGET_TYPE_SCALE, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
{6, PSDK_WIDGET_TYPE_INT_INPUT_BOX, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
||||||
{7, PSDK_WIDGET_TYPE_INT_INPUT_BOX, PsdkTestWidget_SetWidgetValue, PsdkTestWidget_GetWidgetValue, NULL},
|
{7, PSDK_WIDGET_TYPE_BUTTON, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
||||||
{8, PSDK_WIDGET_TYPE_SWITCH, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
{8, PSDK_WIDGET_TYPE_SWITCH, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
||||||
{9, PSDK_WIDGET_TYPE_LIST, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},//PsdkTestWidget_SetWidgetValue
|
{9, PSDK_WIDGET_TYPE_LIST, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},//PsdkTestWidget_SetWidgetValue
|
||||||
};
|
};
|
||||||
@ -483,7 +483,7 @@ static T_PsdkReturnCode PsdkTestWidget_SetWidgetValue_StartRecord(E_PsdkWidgetTy
|
|||||||
|
|
||||||
switch (index)
|
switch (index)
|
||||||
{
|
{
|
||||||
case 2:
|
case 5://系统启动关闭
|
||||||
if (value==0)//系统关闭
|
if (value==0)//系统关闭
|
||||||
{
|
{
|
||||||
char* command = "2";
|
char* command = "2";
|
||||||
@ -495,25 +495,6 @@ static T_PsdkReturnCode PsdkTestWidget_SetWidgetValue_StartRecord(E_PsdkWidgetTy
|
|||||||
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
|
||||||
if (value==0)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
else if (value==1)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 5://自动曝光
|
|
||||||
if (value==0)
|
|
||||||
{
|
|
||||||
;
|
|
||||||
}
|
|
||||||
else if (value==1)
|
|
||||||
{
|
|
||||||
char* command = "6";
|
|
||||||
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 6://设置帧率
|
case 6://设置帧率
|
||||||
{
|
{
|
||||||
char command[50] = "5,";
|
char command[50] = "5,";
|
||||||
@ -523,6 +504,17 @@ static T_PsdkReturnCode PsdkTestWidget_SetWidgetValue_StartRecord(E_PsdkWidgetTy
|
|||||||
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 7://自动曝光
|
||||||
|
if (value==0)
|
||||||
|
{
|
||||||
|
;
|
||||||
|
}
|
||||||
|
else if (value==1)
|
||||||
|
{
|
||||||
|
char* command = "6";
|
||||||
|
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (value==0)//停止采集
|
if (value==0)//停止采集
|
||||||
{
|
{
|
||||||
@ -538,7 +530,6 @@ static T_PsdkReturnCode PsdkTestWidget_SetWidgetValue_StartRecord(E_PsdkWidgetTy
|
|||||||
case 9:
|
case 9:
|
||||||
if (value==0)//无操作
|
if (value==0)//无操作
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
if (value==1)
|
if (value==1)
|
||||||
{
|
{
|
||||||
|
@ -32,17 +32,17 @@
|
|||||||
"widget_name": "列表_3",
|
"widget_name": "列表_3",
|
||||||
"list_item": [
|
"list_item": [
|
||||||
{
|
{
|
||||||
"item_name": "系统关闭",
|
"item_name": "选项_1",
|
||||||
"icon_file_set": {
|
"icon_file_set": {
|
||||||
"icon_file_name_selected": "system_OFF.png",
|
"icon_file_name_selected": "icon_list_item1.png",
|
||||||
"icon_file_name_unselected": "system_OFF.png"
|
"icon_file_name_unselected": "icon_list_item1.png"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item_name": "系统启动",
|
"item_name": "选项_2",
|
||||||
"icon_file_set": {
|
"icon_file_set": {
|
||||||
"icon_file_name_selected" : "system_ON.png",
|
"icon_file_name_selected" : "icon_list_item2.png",
|
||||||
"icon_file_name_unselected" : "system_ON.png"
|
"icon_file_name_unselected" : "icon_list_item2.png"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -76,19 +76,19 @@
|
|||||||
"widget_list": [
|
"widget_list": [
|
||||||
{
|
{
|
||||||
"widget_index": 5,
|
"widget_index": 5,
|
||||||
"widget_type": "button",
|
"widget_type": "switch",
|
||||||
"widget_name": "自动曝光"
|
"widget_name": "系统启动"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widget_index": 6,
|
"widget_index": 6,
|
||||||
"widget_type": "scale",
|
"widget_type": "int_input_box",
|
||||||
"widget_name": "帧率"
|
"widget_name": "帧率",
|
||||||
|
"int_input_box_hint": "unit:hz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widget_index": 7,
|
"widget_index": 7,
|
||||||
"widget_type": "int_input_box",
|
"widget_type": "button",
|
||||||
"widget_name": "整形值输入框_8",
|
"widget_name": "自动曝光"
|
||||||
"int_input_box_hint": "unit:s"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widget_index": 8,
|
"widget_index": 8,
|
||||||
@ -98,7 +98,7 @@
|
|||||||
{
|
{
|
||||||
"widget_index": 9,
|
"widget_index": 9,
|
||||||
"widget_type": "list",
|
"widget_type": "list",
|
||||||
"widget_name": "列表_10",
|
"widget_name": "系统指令",
|
||||||
"list_item": [
|
"list_item": [
|
||||||
{
|
{
|
||||||
"item_name": "等待指令"
|
"item_name": "等待指令"
|
||||||
|
@ -76,41 +76,41 @@
|
|||||||
"widget_list": [
|
"widget_list": [
|
||||||
{
|
{
|
||||||
"widget_index": 5,
|
"widget_index": 5,
|
||||||
"widget_type": "button",
|
"widget_type": "switch",
|
||||||
"widget_name": "Button_6"
|
"widget_name": "系统启动"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widget_index": 6,
|
"widget_index": 6,
|
||||||
"widget_type": "scale",
|
"widget_type": "int_input_box",
|
||||||
"widget_name": "Scale_7"
|
"widget_name": "帧率",
|
||||||
|
"int_input_box_hint": "unit:hz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widget_index": 7,
|
"widget_index": 7,
|
||||||
"widget_type": "int_input_box",
|
"widget_type": "button",
|
||||||
"widget_name": "IntegerInputBox_8",
|
"widget_name": "自动曝光"
|
||||||
"int_input_box_hint": "unit:s"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widget_index": 8,
|
"widget_index": 8,
|
||||||
"widget_type": "switch",
|
"widget_type": "switch",
|
||||||
"widget_name": "Switch_9"
|
"widget_name": "开始采集"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widget_index": 9,
|
"widget_index": 9,
|
||||||
"widget_type": "list",
|
"widget_type": "list",
|
||||||
"widget_name": "List_10",
|
"widget_name": "列表_10",
|
||||||
"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": "关机"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -398,7 +398,7 @@ int main(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//设置负载设备的别称
|
//设置负载设备的别称
|
||||||
if (PsdkProductInfo_SetAlias("PSDK_APPALIAS") != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
if (PsdkProductInfo_SetAlias("300TC") != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||||
PsdkLogger_UserLogError("set product alias error.");
|
PsdkLogger_UserLogError("set product alias error.");
|
||||||
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
|
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include "psdk_logger.h"
|
#include "psdk_logger.h"
|
||||||
|
|
||||||
/* Private constants ---------------------------------------------------------*/
|
/* Private constants ---------------------------------------------------------*/
|
||||||
#define LINUX_NETWORK_DEV "eth1"//enx00e04c360a7d
|
#define LINUX_NETWORK_DEV "eth0"//enx00e04c360a7d
|
||||||
#define LINUX_CMD_STR_MAX_SIZE (128)
|
#define LINUX_CMD_STR_MAX_SIZE (128)
|
||||||
|
|
||||||
/* Private types -------------------------------------------------------------*/
|
/* Private types -------------------------------------------------------------*/
|
||||||
|
Reference in New Issue
Block a user