将最大最小风速风向改为从平均里面取

This commit is contained in:
95384 2024-11-11 15:52:19 +08:00
parent 6d27ad8c87
commit cea097ec44
4 changed files with 63 additions and 63 deletions

View File

@ -493,16 +493,16 @@ void wind_task(void const * argument)
} }
#endif #endif
//osDelay(38); //osDelay(38);
if(flag_init_msc_value== 1){ // if(flag_init_msc_value== 1){
flag_init_msc_value = 0; // flag_init_msc_value = 0;
g_stMcs_Para.min_wind_direction = weather_info.wind_c; // g_stMcs_Para.min_wind_direction = weather_info.wind_c;
g_stMcs_Para.average_wind_direction = weather_info.wind_c; // g_stMcs_Para.average_wind_direction = weather_info.wind_c;
g_stMcs_Para.max_wind_direction = 0; // g_stMcs_Para.max_wind_direction = 0;
//
g_stMcs_Para.min_wind_speed = weather_info.wind_velocity; // g_stMcs_Para.min_wind_speed = weather_info.wind_velocity;
g_stMcs_Para.average_wind_speed = weather_info.wind_velocity; // g_stMcs_Para.average_wind_speed = weather_info.wind_velocity;
g_stMcs_Para.max_wind_speed = 0; // g_stMcs_Para.max_wind_speed = 0;
} // }
// update_mcs_param(weather_info.wind_velocity, weather_info.wind_c); // update_mcs_param(weather_info.wind_velocity, weather_info.wind_c);
} }
/* USER CODE END wind_task */ /* USER CODE END wind_task */
@ -692,23 +692,23 @@ void my_update_mcs_param(float new_wind_speed, float new_wind_dirction)
} }
//默认第一个数据为最大或者最小 //默认第一个数据为最大或者最小
float temp_min_direction = win_10min.direction_data[0]; float temp_min_direction = win_10min.ave_direction_data[0];
float temp_max_direction = win_10min.direction_data[0]; float temp_max_direction = win_10min.ave_direction_data[0];
float temp_min_speed = win_10min.speed_data[0]; float temp_min_speed = win_10min.ave_speed_data[0];
float temp_max_speed = win_10min.speed_data[0]; float temp_max_speed = win_10min.ave_speed_data[0];
//遍历10min内所有数据寻找最大最小 //遍历10min内所有数据寻找最大最小
for (int i = 0; i < win_10min.count; i++) { for (int i = 0; i < win_10min.count; i++) {
if (win_10min.direction_data[i] < temp_min_direction) { if (win_10min.ave_direction_data[i] < temp_min_direction) {
temp_min_direction = win_10min.direction_data[i]; // 更新风向最小值 temp_min_direction = win_10min.ave_direction_data[i]; // 更新风向最小值
} }
if (win_10min.direction_data[i] > temp_max_direction) { if (win_10min.ave_direction_data[i] > temp_max_direction) {
temp_max_direction = win_10min.direction_data[i]; // 更新风向最大值 temp_max_direction = win_10min.ave_direction_data[i]; // 更新风向最大值
} }
if (win_10min.speed_data[i] < temp_min_speed) { if (win_10min.ave_speed_data[i] < temp_min_speed) {
temp_min_speed = win_10min.speed_data[i]; // 更新风速最小值 temp_min_speed = win_10min.ave_speed_data[i]; // 更新风速最小值
} }
if (win_10min.speed_data[i] > temp_max_speed) { if (win_10min.ave_speed_data[i] > temp_max_speed) {
temp_max_speed = win_10min.speed_data[i]; // 更新风速最大值 temp_max_speed = win_10min.ave_speed_data[i]; // 更新风速最大值
} }
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -26,11 +26,11 @@
<CpuHaltOnBreakpointSet>0</CpuHaltOnBreakpointSet> <CpuHaltOnBreakpointSet>0</CpuHaltOnBreakpointSet>
</Jet> </Jet>
<ArmDriver> <ArmDriver>
<EnableCache>0</EnableCache>
<EnforceMemoryConfiguration>1</EnforceMemoryConfiguration> <EnforceMemoryConfiguration>1</EnforceMemoryConfiguration>
<EnableCache>0</EnableCache>
</ArmDriver> </ArmDriver>
<DebugChecksum> <DebugChecksum>
<Checksum>219054755</Checksum> <Checksum>1116029158</Checksum>
</DebugChecksum> </DebugChecksum>
<Exceptions> <Exceptions>
<StopOnUncaught>_ 0</StopOnUncaught> <StopOnUncaught>_ 0</StopOnUncaught>
@ -152,23 +152,6 @@
<ShowTimeSum>1</ShowTimeSum> <ShowTimeSum>1</ShowTimeSum>
<SumSortOrder>0</SumSortOrder> <SumSortOrder>0</SumSortOrder>
</EventLog> </EventLog>
<DisassembleMode>
<mode>0</mode>
</DisassembleMode>
<Breakpoints2>
<Count>0</Count>
</Breakpoints2>
<TermIOLog>
<LoggingEnabled>_ 0</LoggingEnabled>
<LogFile>_ ""</LogFile>
</TermIOLog>
<Aliases>
<A0>_ "D:\GitHub\ARM-software\CMSIS_5.old\CMSIS\DSP\Include\arm_math.h" ""</A0>
<A1>_ "D:\GitHub\ARM-software\CMSIS_5.old\CMSIS\DSP\Source\ComplexMathFunctions\arm_cmplx_mag_f32.c" ""</A1>
<A2>_ "D:\GitHub\ARM-software\CMSIS_5.old\CMSIS\DSP\Source\TransformFunctions\arm_rfft_fast_init_f32.c" ""</A2>
<Count>3</Count>
<SuppressDialog>0</SuppressDialog>
</Aliases>
<DriverProfiling> <DriverProfiling>
<Enabled>0</Enabled> <Enabled>0</Enabled>
<Mode>3</Mode> <Mode>3</Mode>
@ -176,4 +159,21 @@
<Symbiont>0</Symbiont> <Symbiont>0</Symbiont>
<Exclusions /> <Exclusions />
</DriverProfiling> </DriverProfiling>
<TermIOLog>
<LoggingEnabled>_ 0</LoggingEnabled>
<LogFile>_ ""</LogFile>
</TermIOLog>
<DisassembleMode>
<mode>0</mode>
</DisassembleMode>
<Breakpoints2>
<Count>0</Count>
</Breakpoints2>
<Aliases>
<A0>_ "D:\GitHub\ARM-software\CMSIS_5.old\CMSIS\DSP\Include\arm_math.h" ""</A0>
<A1>_ "D:\GitHub\ARM-software\CMSIS_5.old\CMSIS\DSP\Source\ComplexMathFunctions\arm_cmplx_mag_f32.c" ""</A1>
<A2>_ "D:\GitHub\ARM-software\CMSIS_5.old\CMSIS\DSP\Source\TransformFunctions\arm_rfft_fast_init_f32.c" ""</A2>
<Count>3</Count>
<SuppressDialog>0</SuppressDialog>
</Aliases>
</settings> </settings>