diff --git a/samples/sample_c/module_sample/widget/test_widget.c b/samples/sample_c/module_sample/widget/test_widget.c index 235954b..d85c363 100644 --- a/samples/sample_c/module_sample/widget/test_widget.c +++ b/samples/sample_c/module_sample/widget/test_widget.c @@ -113,14 +113,13 @@ static const T_DjiWidgetHandlerListItem s_widgetHandlerList[] = { {1, DJI_WIDGET_TYPE_LIST, 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}, - {4, DJI_WIDGET_TYPE_BUTTON, DjiTestWidget_SetWidgetValue, DjiTestWidget_GetWidgetValue, NULL}, + {4, DJI_WIDGET_TYPE_LIST, PsdkTestWidget_SetWidgetValue_StartRecord, DjiTestWidget_GetWidgetValue, NULL}, {5, DJI_WIDGET_TYPE_SWITCH, PsdkTestWidget_SetWidgetValue_StartRecord, DjiTestWidget_GetWidgetValue, NULL}, {6, DJI_WIDGET_TYPE_INT_INPUT_BOX, PsdkTestWidget_SetWidgetValue_StartRecord, DjiTestWidget_GetWidgetValue, NULL}, {7, DJI_WIDGET_TYPE_BUTTON, PsdkTestWidget_SetWidgetValue_StartRecord, 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[] = { @@ -477,14 +476,11 @@ static void *PsdkTest_IrisRecordSystemChanged(void *arg)// case 0: s_strStateOfSbg="未打开"; - if (systemON_Control == 0 || systemON_Control == 3 || systemON_Control == 4) - { - strcpy(s_strUIMessage,"系统已就绪!"); - messageTimeCounter = 0; - messageTimespan = 1000; + strcpy(s_strUIMessage,"系统已就绪!"); + messageTimeCounter = 0; + messageTimespan = 1000; - systemON_Control = 1;//ximeaAirborneSystem系统一启动就会发送此信息 → 代表采集系统就绪; - } + systemON_Control = 1;//ximeaAirborneSystem系统一启动就会发送此信息 → 代表采集系统就绪; break; case 1: @@ -682,6 +678,35 @@ static T_DjiReturnCode PsdkTestWidget_SetWidgetValue_StartRecord(E_DjiWidgetType switch (index) { + case 4: + 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 5://系统启动关闭 if (value==0)//系统关闭 { @@ -893,35 +918,6 @@ static T_DjiReturnCode PsdkTestWidget_SetWidgetValue_StartRecord(E_DjiWidgetType } 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)//等待指令 { } @@ -1021,7 +1017,7 @@ static void extractSpectralBinAndBandnumber(bool isModifyBin) pclose(fp); } - s_widgetValueList[11] = spectralBin; + s_widgetValueList[10] = spectralBin; if (!isModifyBin) { diff --git a/samples/sample_c/module_sample/widget/widget_file/cn_big_screen/widget_config.json b/samples/sample_c/module_sample/widget/widget_file/cn_big_screen/widget_config.json index 489c729..74ccd22 100644 --- a/samples/sample_c/module_sample/widget/widget_file/cn_big_screen/widget_config.json +++ b/samples/sample_c/module_sample/widget/widget_file/cn_big_screen/widget_config.json @@ -16,6 +16,31 @@ }, "config_interface": { "widget_list": [ + { + "widget_index": 4, + "widget_type": "list", + "widget_name": "高级指令", + "list_item": [ + { + "item_name": "其他" + }, + { + "item_name": "重启" + }, + { + "item_name": "关机" + }, + { + "item_name": "测试采集" + }, + { + "item_name": "停止采集" + }, + { + "item_name": "更新" + } + ] + }, { "widget_index": 5, "widget_type": "switch", @@ -46,31 +71,6 @@ { "widget_index": 10, "widget_type": "list", - "widget_name": "系统指令", - "list_item": [ - { - "item_name": "其他" - }, - { - "item_name": "重启" - }, - { - "item_name": "关机" - }, - { - "item_name": "测试采集" - }, - { - "item_name": "停止采集" - }, - { - "item_name": "更新" - } - ] - }, - { - "widget_index": 11, - "widget_type": "list", "widget_name": "bin", "list_item": [ { diff --git a/samples/sample_c/module_sample/widget/widget_file/en_big_screen/widget_config.json b/samples/sample_c/module_sample/widget/widget_file/en_big_screen/widget_config.json index 489c729..74ccd22 100644 --- a/samples/sample_c/module_sample/widget/widget_file/en_big_screen/widget_config.json +++ b/samples/sample_c/module_sample/widget/widget_file/en_big_screen/widget_config.json @@ -16,6 +16,31 @@ }, "config_interface": { "widget_list": [ + { + "widget_index": 4, + "widget_type": "list", + "widget_name": "高级指令", + "list_item": [ + { + "item_name": "其他" + }, + { + "item_name": "重启" + }, + { + "item_name": "关机" + }, + { + "item_name": "测试采集" + }, + { + "item_name": "停止采集" + }, + { + "item_name": "更新" + } + ] + }, { "widget_index": 5, "widget_type": "switch", @@ -46,31 +71,6 @@ { "widget_index": 10, "widget_type": "list", - "widget_name": "系统指令", - "list_item": [ - { - "item_name": "其他" - }, - { - "item_name": "重启" - }, - { - "item_name": "关机" - }, - { - "item_name": "测试采集" - }, - { - "item_name": "停止采集" - }, - { - "item_name": "更新" - } - ] - }, - { - "widget_index": 11, - "widget_type": "list", "widget_name": "bin", "list_item": [ {