From 66c3d0709e91de15e115aa50cbdad7861f09f4ab Mon Sep 17 00:00:00 2001 From: tangchao0503 <735056338@qq.com> Date: Tue, 4 Jul 2023 21:31:04 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=EF=BC=9A=E9=81=A5=E6=8E=A7=E5=99=A8=E8=AE=BE=E7=BD=AE=E5=85=89?= =?UTF-8?q?=E8=B0=B1bin=EF=BC=9B=202=E3=80=81=E8=AE=BE=E7=BD=AE=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7300TC=5F2.31.35.21=EF=BC=8C=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=EF=BC=9A2.psdk.ximeaAirborneSystem.ximeaControlDll=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 | 31 +++++++++++++++++-- .../cn_big_screen/widget_config.json | 16 ++++++++++ .../en_big_screen/widget_config.json | 16 ++++++++++ .../linux/manifold2/application/main.c | 2 +- 4 files changed, 61 insertions(+), 4 deletions(-) diff --git a/sample/api_sample/widget/test_widget.c b/sample/api_sample/widget/test_widget.c index e73cf9a..60e391c 100644 --- a/sample/api_sample/widget/test_widget.c +++ b/sample/api_sample/widget/test_widget.c @@ -88,6 +88,7 @@ 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"; @@ -115,6 +116,7 @@ static const T_PsdkWidgetHandlerListItem s_widgetHandlerList[] = { {8, PSDK_WIDGET_TYPE_INT_INPUT_BOX, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL}, {9, PSDK_WIDGET_TYPE_SWITCH, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL}, {10, PSDK_WIDGET_TYPE_LIST, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},//PsdkTestWidget_SetWidgetValue + {11, PSDK_WIDGET_TYPE_LIST, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL}, }; static char *s_widgetTypeNameArray[] = { @@ -289,8 +291,8 @@ static void *PsdkTest_WidgetTask(void *arg) //snprintf(message, PSDK_WIDGET_FLOATING_WINDOW_MSG_MAX_LEN, "System time: %u ms;\nMAG: %d;\nIMAGER: %d;\nIMU: %d;\nFile: %d;\n", sysTimeMs, s_sbgMagState, s_stateOfXimea, s_stateOfSbg, s_stateOfFile); - snprintf(message, PSDK_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", - s_strUIMessage, s_strStateOfXimea, s_strStateOfSbg, s_strSbgSatelliteCounter, s_strSbgAccuracy, XimeaFramerate, XimeaExposeTime, XimeaExposeMaxValue, s_strPitch, s_strRoll, s_strYaw); + snprintf(message, PSDK_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); psdkStat = PsdkWidgetFloatingWindow_ShowMessage(message); if (psdkStat != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { @@ -409,7 +411,7 @@ static void *PsdkTest_IrisRecordSystemChanged(void *arg)// if (systemON_Control == 3) { - strcpy(s_strUIMessage,"采集系统崩溃,请重启并联系技术工程师!"); + strcpy(s_strUIMessage,"数据量过大,采集系统已经停止,请重新上电!"); messageTimeCounter = 0; messageTimespan = 1000; } @@ -560,6 +562,11 @@ static void *PsdkTest_IrisRecordSystemChanged(void *arg)// messageTimeCounter = 0; messageTimespan = 10; } + else if (strcmp(result[0],"bin") == 0) + { + int spectralBin_tm = atoi(result[2]); + sprintf(spectralBin,"%d",spectralBin_tm); + } } } @@ -859,6 +866,24 @@ static T_PsdkReturnCode PsdkTestWidget_SetWidgetValue_StartRecord(E_PsdkWidgetTy 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; 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 dce8b43..80e746e 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 @@ -125,6 +125,22 @@ "item_name": "更新" } ] + }, + { + "widget_index": 11, + "widget_type": "list", + "widget_name": "bin", + "list_item": [ + { + "item_name": "等待指令" + }, + { + "item_name": "光谱1" + }, + { + "item_name": "光谱2" + } + ] } ] } 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 0795ef6..19cc700 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 @@ -125,6 +125,22 @@ "item_name": "更新" } ] + }, + { + "widget_index": 11, + "widget_type": "list", + "widget_name": "bin", + "list_item": [ + { + "item_name": "等待指令" + }, + { + "item_name": "光谱1" + }, + { + "item_name": "光谱2" + } + ] } ] } diff --git a/sample/platform/linux/manifold2/application/main.c b/sample/platform/linux/manifold2/application/main.c index b44f324..92f2850 100644 --- a/sample/platform/linux/manifold2/application/main.c +++ b/sample/platform/linux/manifold2/application/main.c @@ -398,7 +398,7 @@ int main(void) } //设置负载设备的别称 - if (PsdkProductInfo_SetAlias("300TC_2.30.34.20") != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { + if (PsdkProductInfo_SetAlias("300TC_2.31.35.21") != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) { PsdkLogger_UserLogError("set product alias error."); return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN; }