From a8838b8949d43578c8697cd12b145d0eba53eeb4 Mon Sep 17 00:00:00 2001 From: tangchao0503 <735056338@qq.com> Date: Sun, 11 Jun 2023 18:22:00 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E7=A6=81=E6=AD=A2=E7=AC=AC=E4=BA=8C?= =?UTF-8?q?=E6=AC=A1=E5=90=AF=E5=8A=A8=E7=B3=BB=E7=BB=9F=EF=BC=8C=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E7=9B=B8=E6=9C=BA=E6=8A=A5=E9=94=99=EF=BC=9B=202.=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=95=8C=E9=9D=A2=E4=B8=8A=E7=9A=84=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E9=87=87=E9=9B=86=E5=8A=9F=E8=83=BD=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sample/api_sample/widget/test_widget.c | 33 +++++++++++++++---- .../cn_big_screen/widget_config.json | 10 ++++-- .../en_big_screen/widget_config.json | 8 ++++- 3 files changed, 42 insertions(+), 9 deletions(-) diff --git a/sample/api_sample/widget/test_widget.c b/sample/api_sample/widget/test_widget.c index f44fa8a..f6c50be 100644 --- a/sample/api_sample/widget/test_widget.c +++ b/sample/api_sample/widget/test_widget.c @@ -549,6 +549,7 @@ static T_PsdkReturnCode PsdkTestWidget_GetWidgetValue(E_PsdkWidgetType widgetTyp } int frameRateGlobel = 0; +int systemON_Control = 0; static T_PsdkReturnCode PsdkTestWidget_SetWidgetValue_StartRecord(E_PsdkWidgetType widgetType, uint32_t index, int32_t value, void *userData) { @@ -568,12 +569,23 @@ static T_PsdkReturnCode PsdkTestWidget_SetWidgetValue_StartRecord(E_PsdkWidgetTy } else if (value==1)//系统启动 { - strcpy(s_strUIMessage,"系统启动中,超过60s未成功,请重新启动系统!"); - messageTimeCounter = 0; - messageTimespan = 1000; + systemON_Control++; - char* command = "1"; - sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server)); + if (systemON_Control>=2) + { + strcpy(s_strUIMessage,"请重启300TC!"); + messageTimeCounter = 0; + messageTimespan = 1000; + } + else + { + strcpy(s_strUIMessage,"系统启动中,超过60s未成功,请重新启动系统!"); + messageTimeCounter = 0; + messageTimespan = 1000; + + char* command = "1"; + sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server)); + } } break; case 6://设置帧率 @@ -754,8 +766,9 @@ static T_PsdkReturnCode PsdkTestWidget_SetWidgetValue_StartRecord(E_PsdkWidgetTy if (value==0)//等待指令 { } - if (value==1) + if (value==1)//更新 { + system("/home/pi/tc_ShellScripts/update.sh &> /media/nvme/300TC/update/log"); } else if (value==2)//重启电脑 { @@ -765,6 +778,14 @@ static T_PsdkReturnCode PsdkTestWidget_SetWidgetValue_StartRecord(E_PsdkWidgetTy { system("shutdown now"); } + else if (value==4) + { + system("/home/300tc/projects_source/udpClient/cmake-build-debug/udpClient 127.0.0.1 9,1"); + } + else if (value==5) + { + system("/home/300tc/projects_source/udpClient/cmake-build-debug/udpClient 127.0.0.1 9,0"); + } break; default: break; diff --git a/sample/api_sample/widget/widget_file/cn_big_screen/widget_config.json b/sample/api_sample/widget/widget_file/cn_big_screen/widget_config.json index dd715d8..a96adc3 100644 --- a/sample/api_sample/widget/widget_file/cn_big_screen/widget_config.json +++ b/sample/api_sample/widget/widget_file/cn_big_screen/widget_config.json @@ -110,13 +110,19 @@ "item_name": "等待指令" }, { - "item_name": "采集HSI" + "item_name": "更新" }, { - "item_name": "重启300TC" + "item_name": "重启电脑" }, { "item_name": "关机" + }, + { + "item_name": "测试采集" + }, + { + "item_name": "停止采集" } ] } diff --git a/sample/api_sample/widget/widget_file/en_big_screen/widget_config.json b/sample/api_sample/widget/widget_file/en_big_screen/widget_config.json index fdf52bc..0202ed4 100644 --- a/sample/api_sample/widget/widget_file/en_big_screen/widget_config.json +++ b/sample/api_sample/widget/widget_file/en_big_screen/widget_config.json @@ -110,13 +110,19 @@ "item_name": "等待指令" }, { - "item_name": "采集HSI" + "item_name": "更新" }, { "item_name": "重启电脑" }, { "item_name": "关机" + }, + { + "item_name": "测试采集" + }, + { + "item_name": "停止采集" } ] }