1
0
Fork 0
develop
李静 2023-07-24 14:13:20 +08:00
parent 132c36e9ef
commit f11d16251d
1 changed files with 8 additions and 0 deletions

View File

@ -448,6 +448,10 @@ class DeviceLogService
switch ($key) {
case 'wind_samples':
$attributes['wind_degree'] = value(function (array $windSamples) {
if (empty($windSamples)) {
return null;
}
$x = 0;
$y = 0;
@ -477,6 +481,10 @@ class DeviceLogService
}, $item);
$attributes['wind_direction'] = value(function ($windDegree) {
if (is_null($windDegree)) {
return null;
}
if ($windDegree >= 22.5 && $windDegree < 67.5) {
return MeteorologicalDailyReport::WIND_DIRECTION_NORTHEAST;
} elseif ($windDegree >= 67.5 && $windDegree < 112.5) {