Files
controls-web/controls-rework/overviews/data/boilersfull.php
2026-02-17 09:29:34 -06:00

195 lines
10 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($ID['00242']) ? (int) $ID['00242'] : null, 0);
$exhaustPressure = module_numeric($ID['00244'] ?? null);
if ($exhaustPressure === null) {
$exhaustPill = module_status('No Signal', 'module-pill--alert');
} elseif ($exhaustPressure < 6) {
$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',
'steam' => ['value' => module_numeric($ID['00252'] ?? null), 'capacity' => 110],
'metrics' => [
['label' => 'Drum Level', 'value' => module_numeric($value['LT_102'] ?? null), 'unit' => '%', 'decimals' => 0],
['label' => 'Feed Water', 'value' => module_numeric($value['FT_103'] ?? null), 'unit' => 'kpph', 'decimals' => 0],
['label' => 'Drum Pressure', 'value' => module_numeric($value['PT_105'] ?? null), 'unit' => 'psi', 'decimals' => 0],
['label' => 'ID Fan Speed', 'value' => module_numeric($value['SIT_104'] ?? null), 'unit' => 'rpm', 'decimals' => 0],
],
],
[
'label' => 'Boiler 2',
'steam' => ['value' => module_numeric($ID['00256'] ?? null), 'capacity' => 105],
'metrics' => [
['label' => 'Drum Level', 'value' => module_numeric($value['LT_202'] ?? null), 'unit' => '%', 'decimals' => 0],
['label' => 'Feed Water', 'value' => module_numeric($value['FT_203'] ?? null), 'unit' => 'kpph', 'decimals' => 0],
['label' => 'Drum Pressure', 'value' => module_numeric($value['PT_205'] ?? null), 'unit' => 'psi', 'decimals' => 0],
['label' => 'ID Fan Speed', 'value' => module_numeric($value['SIT_204'] ?? null), 'unit' => 'rpm', 'decimals' => 0],
],
],
[
'label' => 'Boiler 3',
'steam' => ['value' => module_numeric($value['FT_301'] ?? null), 'capacity' => 100],
'metrics' => [
['label' => 'Drum Level', 'value' => module_numeric($value['LT_302'] ?? null), 'unit' => '%', 'decimals' => 0],
['label' => 'Feed Water', 'value' => module_numeric($value['FT_303'] ?? null), 'unit' => 'kpph', 'decimals' => 0],
['label' => 'Drum Pressure', 'value' => module_numeric($value['PT_305'] ?? null), 'unit' => 'psi', 'decimals' => 0],
['label' => 'ID Fan Speed', 'value' => module_numeric($value['SIT_304'] ?? null), 'unit' => 'rpm', 'decimals' => 0],
],
],
[
'label' => 'Boiler 4',
'steam' => ['value' => module_numeric($value['FT_401'] ?? null), 'capacity' => 60],
'metrics' => [
['label' => 'Drum Level', 'value' => module_numeric($value['LT_402'] ?? null), 'unit' => '%', 'decimals' => 0],
['label' => 'Feed Water', 'value' => module_numeric($value['FT_403'] ?? null), 'unit' => 'kpph', 'decimals' => 0],
['label' => 'Drum Pressure', 'value' => module_numeric($value['PT_405'] ?? null), 'unit' => 'psi', 'decimals' => 0],
['label' => 'ID Fan Speed', 'value' => module_numeric($value['SIT_404'] ?? null), 'unit' => 'rpm', 'decimals' => 0],
],
],
[
'label' => 'Boiler 5',
'steam' => ['value' => module_numeric($value['FT_501'] ?? null), 'capacity' => 55],
'metrics' => [
['label' => 'Drum Level', 'value' => module_numeric($value['LT_502'] ?? null), 'unit' => '%', 'decimals' => 0],
['label' => 'Feed Water', 'value' => module_numeric($value['FT_503'] ?? null), 'unit' => 'kpph', 'decimals' => 0],
['label' => 'Drum Pressure', 'value' => module_numeric($value['PT_505'] ?? null), 'unit' => 'psi', 'decimals' => 0],
['label' => 'ID Fan Speed', 'value' => module_numeric($value['SIT_504'] ?? null), 'unit' => 'rpm', 'decimals' => 0],
],
],
[
'label' => 'Boiler 6',
'steam' => ['value' => module_numeric($value['FT_601'] ?? null), 'capacity' => 90],
'metrics' => [
['label' => 'Drum Level', 'value' => module_numeric($value['LT_602'] ?? null), 'unit' => '%', 'decimals' => 0],
['label' => 'Feed Water', 'value' => module_numeric($value['FT_603'] ?? null), 'unit' => 'kpph', 'decimals' => 0],
['label' => 'Drum Pressure', 'value' => module_numeric($value['PT_605'] ?? null), 'unit' => 'psi', 'decimals' => 0],
['label' => 'ID Fan Speed', 'value' => module_numeric($value['SIT_604'] ?? null), 'unit' => 'rpm', 'decimals' => 0],
],
],
[
'label' => 'Boiler 7',
'steam' => ['value' => module_numeric($ID['00046'] ?? null), 'capacity' => 270],
'metrics' => [
['label' => 'Drum Level', 'value' => module_numeric($ID['00004'] ?? null), 'unit' => '%', 'decimals' => 0],
['label' => 'Feed Water', 'value' => module_numeric($ID['00014'] ?? null), 'unit' => 'kpph', 'decimals' => 0],
['label' => 'Drum Pressure', 'value' => module_numeric($ID['00010'] ?? null), 'unit' => 'psi', 'decimals' => 0],
['label' => 'ID Fan Speed', 'value' => module_numeric($ID['00020'] ?? null), 'unit' => 'rpm', 'decimals' => 0],
],
],
[
'label' => 'Boiler 8',
'steam' => ['value' => module_numeric($ID['00074'] ?? null), 'capacity' => 270],
'metrics' => [
['label' => 'Drum Level', 'value' => module_numeric($ID['00032'] ?? null), 'unit' => '%', 'decimals' => 0],
['label' => 'Feed Water', 'value' => module_numeric($ID['00042'] ?? null), 'unit' => 'kpph', 'decimals' => 0],
['label' => 'Drum Pressure', 'value' => module_numeric($ID['00038'] ?? null), 'unit' => 'psi', 'decimals' => 0],
['label' => 'ID Fan Speed', 'value' => module_numeric($ID['00048'] ?? null), 'unit' => 'rpm', 'decimals' => 0],
],
],
];
$boilerGroups = array_chunk($boilers, 4);
?>
<section class="module-card">
<div class="module-heading">
<h2 class="module-heading__title">Boiler Performance</h2>
<span class="module-heading__meta">Detailed steam and drum metrics</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-grid module-grid--two">
<?php foreach ($boilerGroups as $group) : ?>
<div class="module-stack">
<?php foreach ($group as $boiler) : ?>
<?php
$steamValue = $boiler['steam']['value'];
$steamCapacity = $boiler['steam']['capacity'];
$steamPercent = 0.0;
if ($steamValue !== null && $steamCapacity > 0) {
$steamPercent = max(0.0, min(100.0, ($steamValue / $steamCapacity) * 100));
}
?>
<div class="module-subcard">
<div class="module-subcard__title"><?php echo module_html($boiler['label']); ?></div>
<div class="module-row">
<span class="module-row__label">Steam Flow</span>
<span class="module-row__value"><?php echo module_number($steamValue, 0); ?> kpph</span>
</div>
<div class="module-progress">
<div class="module-bar">
<div class="module-bar__fill" style="width: <?php echo number_format($steamPercent, 2); ?>%;"></div>
</div>
<span class="module-notes">Capacity <?php echo number_format($steamCapacity); ?> kpph</span>
</div>
<?php foreach ($boiler['metrics'] as $metric) : ?>
<div class="module-row">
<span class="module-row__label"><?php echo module_html($metric['label']); ?></span>
<span class="module-row__value"><?php echo module_number($metric['value'], $metric['decimals'] ?? 0); ?> <?php echo module_html($metric['unit']); ?></span>
</div>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
</div>
</section>