추세 분석 Trend

온습도 추이 0): ?> · 최근 개

온도(°C) 습도(%)
1): ?>
>
'오늘', '3d' => '3일', '7d' => '7일'] as $rk => $rlabel): ?> >
= 2): ?>
$p['temp'], $chart_points), fn($v) => $v !== null)); $hums = array_values(array_filter(array_map(fn($p) => $p['hum'], $chart_points), fn($v) => $v !== null)); // 온도 축 범위 (여유 패딩) $t_min = !empty($temps) ? min($temps) : 0; $t_max = !empty($temps) ? max($temps) : 1; if ($t_min === $t_max) { $t_min -= 1; $t_max += 1; } $t_pad = ($t_max - $t_min) * 0.1; $t_min -= $t_pad; $t_max += $t_pad; // 습도 축 범위 $h_min = !empty($hums) ? min($hums) : 0; $h_max = !empty($hums) ? max($hums) : 1; if ($h_min === $h_max) { $h_min -= 1; $h_max += 1; } $h_pad = ($h_max - $h_min) * 0.1; $h_min -= $h_pad; $h_max += $h_pad; $x_at = function (int $i) use ($pad_l, $plot_w, $n): float { if ($n <= 1) { return $pad_l; } return $pad_l + ($plot_w * $i / ($n - 1)); }; $y_temp = function (?float $v) use ($pad_t, $plot_h, $t_min, $t_max): ?float { if ($v === null) { return null; } $r = ($t_max - $t_min) ?: 1; return $pad_t + $plot_h * (1 - (($v - $t_min) / $r)); }; $y_hum = function (?float $v) use ($pad_t, $plot_h, $h_min, $h_max): ?float { if ($v === null) { return null; } $r = ($h_max - $h_min) ?: 1; return $pad_t + $plot_h * (1 - (($v - $h_min) / $r)); }; // 결측(null)은 구간을 끊어 polyline 들을 만든다 $build_segments = function (string $key, callable $y_fn) use ($chart_points, $x_at): array { $segments = []; $current = []; foreach ($chart_points as $i => $p) { $val = $p[$key]; if ($val === null) { if (count($current) >= 2) { $segments[] = $current; } $current = []; continue; } $current[] = sprintf('%.1f,%.1f', $x_at($i), $y_fn((float)$val)); } if (count($current) >= 2) { $segments[] = $current; } return $segments; }; $temp_segments = $build_segments('temp', $y_temp); $hum_segments = $build_segments('hum', $y_hum); // 각 계열의 마지막 유효 지점(끝점 마커 + 최신값 라벨용) $last_temp_i = null; $last_temp_v = null; $last_hum_i = null; $last_hum_v = null; foreach ($chart_points as $i => $p) { if ($p['temp'] !== null) { $last_temp_i = $i; $last_temp_v = (float)$p['temp']; } if ($p['hum'] !== null) { $last_hum_i = $i; $last_hum_v = (float)$p['hum']; } } $fmt = fn($v) => rtrim(rtrim(number_format($v, 1, '.', ''), '0'), '.'); ?> 1 ? [0, intdiv($n - 1, 2), $n - 1] : [0]; foreach ($label_idx as $li): $lx = $x_at($li); $anchor = $li === 0 ? 'start' : ($li === $n - 1 ? 'end' : 'middle'); $tlabel = substr($chart_points[$li]['t'], 5, 11); // MM-DD HH:MM ?> $pad_t + $plot_h) { continue; } // 스케일 밖 $thr_line_cls = $axis === 'temp' ? 'line-temp' : 'line-hum'; $thr_label_cls = $axis === 'temp' ? 'axis-temp' : 'axis-hum'; $thr_lx = $axis === 'temp' ? ($pad_l + 4) : ($pad_l + $plot_w - 4); $thr_anchor = $axis === 'temp' ? 'start' : 'end'; ?>
추이를 표시할 측정 데이터가 충분하지 않습니다 (2개 이상 필요).

화재감시 추이 (PM) · 최근 개

PM2.5(µg/m³) PM10(µg/m³)
= 2): ?>
$p) { $val = $p[$key]; if ($val === null) { if (count($cur) >= 2) { $segments[] = $cur; } $cur = []; continue; } $cur[] = sprintf('%.1f,%.1f', $pmx($i), $pmy((float)$val)); } if (count($cur) >= 2) { $segments[] = $cur; } return $segments; }; $pm25_segs = $pm_build('pm25'); $pm10_segs = $pm_build('pm10'); $pm_fmt = fn($v) => rtrim(rtrim(number_format($v, 1, '.', ''), '0'), '.'); ?> 1 ? [0, intdiv($pmn - 1, 2), $pmn - 1] : [0]; foreach ($pm_lbl_idx as $li): $anchor = $li === 0 ? 'start' : ($li === $pmn - 1 ? 'end' : 'middle'); $tlabel = substr($chart_pm_points[$li]['t'], 5, 11); ?> $pmp_t + $pmplot_h) { continue; } ?>

임계 — PM2.5 · PM10 µg/m³ 초과 시 경보

화재감시(PM) 추이를 표시할 측정 데이터가 충분하지 않습니다 (2개 이상 필요).

경보·가동 통계

경보 발생 추이 최근 7일 · 유형별

온습도 경보 화재의심 누수 감지
1 ? $tpl + $tplot_w * $i / ($tn - 1) : $tpl; }; $t_y = function ($v) use ($tpt, $tplot_h, $trend_max) { return $tpt + $tplot_h * (1 - $v / $trend_max); }; $t_line = function (array $vals) use ($t_x, $t_y) { $pts = []; foreach ($vals as $i => $v) { $pts[] = sprintf('%.1f,%.1f', $t_x($i), $t_y($v)); } return implode(' ', $pts); }; $t_peak_i = 0; foreach ($trend_metric as $i => $v) { if ($v > $trend_metric[$t_peak_i]) { $t_peak_i = $i; } } ?> 0): ?> 0): ?> 1 ? [0, intdiv($tn - 1, 2), $tn - 1] : [0]; foreach ($t_lbl_idx as $li): $anchor = $li === 0 ? 'start' : ($li === $tn - 1 ? 'end' : 'middle'); ?>

경보 종류 최근 30일

0): ?>
건

단위 — 온습도·화재의심: 비정상 측정 건수 · 누수: 감지 이벤트 건수

최근 30일 경보 없음

가동률 온라인 센서

% / 온라인
7일 경보 $spv) { $spx = $sp_n > 1 ? $spi * (84 / ($sp_n - 1)) : 42; $spy = 4 + (1 - $spv / $sp_max) * 22; $sp_pts[] = sprintf('%.1f,%.1f', $spx, $spy); } $sp_last = explode(',', end($sp_pts)); ?>

경보 최다 센서 30일 · TOP

$br): $b_w = $board_max > 0 ? (int)round((int)$br['c'] / $board_max * 100) : 0; ?>
건