Files
controls-web/overviews/data/boilersslim.php
2026-02-17 12:44:37 -06:00

95 lines
3.6 KiB
PHP

<?php
// phpcs:ignoreFile
declare(strict_types=1);
include __DIR__ . '/../../items.php';
require_once __DIR__ . '/module-helpers.php';
$steamFlowTotal = module_numeric($value['TTL_STEAMFLOW2']);
$liveSteam = module_numeric($value['PT_001']);
if ($liveSteam === null) {
$liveSteamPill = module_status('No Signal', 'module-pill--alert');
} elseif ($liveSteam < 156) {
$liveSteamPill = module_status('Low', 'module-pill--alert');
} elseif ($liveSteam <= 165) {
$liveSteamPill = module_status('Watch', 'module-pill--warn');
} else {
$liveSteamPill = module_status('Optimal', 'module-pill--success');
}
$exhaustMode = module_mode(isset($value['ExhaustAM']) ? (int) $value['ExhaustAM'] : null, 0);
$exhaustPressure = module_numeric($ID['00244'] ?? null);
if ($exhaustPressure === null) {
$exhaustPill = module_status('No Signal', 'module-pill--alert');
} elseif ($exhaustPressure < 10) {
$exhaustPill = module_status('Low', 'module-pill--alert');
} elseif ($exhaustPressure < 14) {
$exhaustPill = module_status('Watch', 'module-pill--warn');
} else {
$exhaustPill = module_status('Optimal', 'module-pill--success');
}
$vaporHeader = module_numeric($value['VAPOR HDR PRES']);
$boilers = [
['label' => 'Boiler 1', 'value' => module_numeric($ID['00252'] ?? null)],
['label' => 'Boiler 2', 'value' => module_numeric($ID['00256'] ?? null)],
['label' => 'Boiler 3', 'value' => module_numeric($value['FT_301'] ?? null)],
['label' => 'Boiler 4', 'value' => module_numeric($value['FT_401'] ?? null)],
['label' => 'Boiler 5', 'value' => module_numeric($value['FT_501'] ?? null)],
['label' => 'Boiler 6', 'value' => module_numeric($value['FT_601'] ?? null)],
['label' => 'Boiler 7', 'value' => module_numeric($ID['00046'] ?? null)],
['label' => 'Boiler 8', 'value' => module_numeric($ID['00074'] ?? null)],
];
?>
<section class="module-card module-card--tight">
<div class="module-heading">
<h2 class="module-heading__title">Boilers</h2>
<span class="module-heading__meta">Steam production overview</span>
</div>
<div class="module-metric-grid">
<div class="module-metric">
<span class="module-metric__label">Total Steam Flow</span>
<span class="module-metric__value"><?php echo module_number($steamFlowTotal); ?></span>
<span class="module-metric__note">kpph</span>
</div>
<div class="module-metric">
<span class="module-metric__label">Live Steam Pressure</span>
<span class="module-metric__value"><?php echo module_number($liveSteam, 1); ?></span>
<span class="module-metric__note">psi</span>
<div><?php echo $liveSteamPill; ?></div>
</div>
<div class="module-metric">
<span class="module-metric__label">Exhaust Pressure</span>
<span class="module-metric__value"><?php echo module_number($exhaustPressure, 1); ?></span>
<span class="module-metric__note">psi</span>
<div><?php echo $exhaustPill; ?></div>
</div>
<div class="module-metric">
<span class="module-metric__label">Vapor Header Pressure</span>
<span class="module-metric__value"><?php echo module_number($vaporHeader, 1); ?></span>
<span class="module-metric__note">psi</span>
</div>
</div>
<div class="module-row">
<span class="module-row__label">Exhaust Control</span>
<div class="module-row__value"><?php echo $exhaustMode; ?></div>
</div>
<div class="module-divider"></div>
<div class="module-metric-grid">
<?php foreach ($boilers as $boiler) : ?>
<div class="module-metric">
<span class="module-metric__label"><?php echo module_html($boiler['label']); ?></span>
<span class="module-metric__value"><?php echo module_number($boiler['value']); ?></span>
<span class="module-metric__note">kpph</span>
</div>
<?php endforeach; ?>
</div>
</section>