|
|
@@ -1128,104 +1128,7 @@ static void HMI_Decode(void)
|
|
|
else if (strstr(rx_buffer,"DebugDisable")!=NULL) {
|
|
|
Debug_log_OFF();
|
|
|
}
|
|
|
- //高空
|
|
|
- else if (strstr(rx_buffer,"SwversionV11")!=NULL)
|
|
|
- {
|
|
|
- device_status.dtype = 3;
|
|
|
- if(device_status.version_type != 11)
|
|
|
- {
|
|
|
- device_status.version_type = 11;
|
|
|
- sprintf(device_status.driver, "%s",VERSION_GK);
|
|
|
- ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
|
- ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype)); //版本类型
|
|
|
- MA_save();
|
|
|
- }
|
|
|
- else {
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- //1.0
|
|
|
- else if (strstr(rx_buffer,"SwversionV1")!=NULL)
|
|
|
- {
|
|
|
- if(device_status.version_type != 1)
|
|
|
- {
|
|
|
- device_status.dtype = 3;
|
|
|
- device_status.version_type = 1;
|
|
|
- sprintf(device_status.driver, "%s",VERSION_ZP);
|
|
|
- ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
|
- ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype)); //版本类型
|
|
|
- MA_save();
|
|
|
- }
|
|
|
- else {
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- //4.0
|
|
|
- else if (strstr(rx_buffer,"SwversionV41")!=NULL) {
|
|
|
- device_status.dtype = 3;
|
|
|
- if(device_status.version_type != 41)
|
|
|
- {
|
|
|
- device_status.dtype = 3;
|
|
|
- device_status.version_type = 41;
|
|
|
- sprintf(device_status.driver, "%s",VERSION_HK);
|
|
|
- ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
|
- ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype)); //版本类型+
|
|
|
- DTU_Write("SwversionV41");
|
|
|
- MA_save();
|
|
|
- }
|
|
|
- else {
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- //水稻
|
|
|
- else if (strstr(rx_buffer,"SwversionV4")!=NULL) {
|
|
|
- device_status.dtype = 3;
|
|
|
- if(device_status.version_type != 4)
|
|
|
- {
|
|
|
- device_status.version_type = 4;
|
|
|
- sprintf(device_status.driver, "%s",VERSION_HK_2000W);
|
|
|
- ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
|
- ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype)); //版本类型
|
|
|
- DTU_Write("SwversionV4");
|
|
|
- MA_save();
|
|
|
- }
|
|
|
- else {
|
|
|
|
|
|
- }
|
|
|
- }
|
|
|
- //5.0测报灯
|
|
|
- else if (strstr(rx_buffer,"SwversionV5")!=NULL) {
|
|
|
- device_status.dtype = 3;
|
|
|
- if(device_status.version_type!=5)
|
|
|
- {
|
|
|
- device_status.version_type = 5;
|
|
|
- sprintf(device_status.driver, "%s",VERSION_V5);
|
|
|
- ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
|
- ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype)); //版本类型
|
|
|
- MA_save();
|
|
|
- }
|
|
|
- }
|
|
|
- //吸虫塔
|
|
|
- else if (strstr(rx_buffer,"SwversionV6")!=NULL) {
|
|
|
- device_status.dtype = 3;
|
|
|
- if(device_status.version_type != 6)
|
|
|
- {
|
|
|
- device_status.version_type = 6;
|
|
|
- sprintf(device_status.driver, "%s",VERSION_XCT);
|
|
|
- ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
|
- ef_set_env_blob("dtype",&device_status.dtype,sizeof(device_status.dtype)); //版本类型
|
|
|
- MA_save();
|
|
|
- }
|
|
|
- }
|
|
|
- else if (strstr(rx_buffer,"SwversionV30")!=NULL) {
|
|
|
- if(device_status.version_type != 30)
|
|
|
- {
|
|
|
- device_status.version_type = 30;
|
|
|
- sprintf(device_status.driver, "%s",VERSION_Robot);
|
|
|
- ef_set_env_blob("version_type",&device_status.version_type,sizeof(device_status.version_type)); //版本类型
|
|
|
- MA_save();
|
|
|
- }
|
|
|
- }
|
|
|
else if((strstr(rx_buffer,"SwversionV7")!=NULL)) {
|
|
|
if(device_status.dtype!=7)
|
|
|
{
|
|
|
@@ -1423,11 +1326,12 @@ void thread1_signal_handler(int sig)
|
|
|
counter_sharpness_reduce = 0;
|
|
|
}
|
|
|
|
|
|
- /* 方向策略调整 */
|
|
|
+ /* 方向策略调整,检测到清晰度变大 */
|
|
|
if (current_sharpness > (g_last_sharpness - 3.5f)) { // 噪声容忍阈值3.0
|
|
|
// 保持方向,当接近峰值时自动减小步长
|
|
|
LOG_I("保持方向,当接近峰值时自动减小步长...");
|
|
|
g_last_rising = true;
|
|
|
+ stepSize += 2; //动态调整步幅
|
|
|
} else {
|
|
|
if(g_last_rising){
|
|
|
g_peak_counter++;
|
|
|
@@ -1455,13 +1359,13 @@ void thread1_signal_handler(int sig)
|
|
|
counter_sharpness_diff = 0;
|
|
|
}
|
|
|
|
|
|
- LOG_I("[对焦] 更佳位置:%d (清晰度:%.2f)", g_best_pos, g_best_sharpness);
|
|
|
+ LOG_I("[对焦] 最佳位置:%d (清晰度:%.2f)", g_best_pos, g_best_sharpness);
|
|
|
|
|
|
- if(g_peak_counter>=3&¤t_sharpness>g_best_sharpness-3.0f){
|
|
|
+ if(g_peak_counter>=3&¤t_sharpness>g_best_sharpness-2.0f){
|
|
|
focus_done = true;
|
|
|
}else{
|
|
|
focus_done = false;
|
|
|
- g_best_sharpness -= 3.0f; //降低阈值,防止找不到
|
|
|
+ g_best_sharpness -= 2.0f; //降低阈值,防止找不到
|
|
|
}
|
|
|
|
|
|
/* 终止条件检测 */
|
|
|
@@ -1715,7 +1619,7 @@ void Check_ParamConfig(void)
|
|
|
device_status.cul_time = 1;
|
|
|
device_status.run_sta = 0;
|
|
|
device_status.handle_bugger = 0; //默认排虫
|
|
|
- sprintf(device_status.driver, "%s",VERSION_HK);
|
|
|
+ sprintf(device_status.driver, "%s",VERSION_BZY);
|
|
|
sprintf(device_status.deviceId,"0");
|
|
|
rt_sprintf(device_status.tempture, "-15");
|
|
|
rt_sprintf(device_status.humidity, "31");
|