Folder reorganize 1

This commit is contained in:
Rucus
2026-02-17 12:44:37 -06:00
parent ec99d85bc2
commit f0ae0ab905
17427 changed files with 2071 additions and 1059030 deletions

View File

@@ -1,5 +1,5 @@
<?php
include("../includes/items.php");
include("../../items.php");
?>
<!-- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv BOILERS vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -->
@@ -34,9 +34,9 @@ include("../includes/items.php");
<td bgcolor="#DF9401" align="center"><font color="#000000">Steam Flow</font></td>
<td width="40" bgcolor="#DF9401" align="center"><font color="#009900"><?php echo round(($value['FT_601']),0); ?></font></td>
<td bgcolor="#DF9401" align="center"><font color="#000000">Steam Flow</font></td>
<td width="40" bgcolor="#DF9401" align="center"><font color="#009900"><?php echo round(($ID['00050']),0); ?></font></td>
<td width="40" bgcolor="#DF9401" align="center"><font color="#009900"><?php echo round(($ID['00046']),0); ?></font></td>
<td bgcolor="#DF9401" align="center"><font color="#000000">Steam Flow</font></td>
<td width="40" bgcolor="#DF9401" align="center"><font color="#009900"><?php echo round(($ID['00078']),0); ?></font></td>
<td width="40" bgcolor="#DF9401" align="center"><font color="#009900"><?php echo round(($ID['00074']),0); ?></font></td>
</tr>
</table>
@@ -71,14 +71,14 @@ include("../includes/items.php");
<?php
$color = "#FFFFFF";
if (($ID['00302'] >= 0) && ($ID['00302'] <= 9))
if (($ID['00192'] >= 0) && ($ID['00192'] <= 9))
$color = "#FF0000";
else if (($ID['00192'] >= 6) && ($ID['00302'] <= 13))
else if (($ID['00192'] >= 6) && ($ID['00192'] <= 13))
$color = "#FFFF00";
else if ($ID['00192'] >= 14)
$color = "#00FF00";
echo "<td bgcolor=\"#2E2E2E\" align=\"right\" width=\"75\"><font color=\"$color\"><b>". $ID['V'] ."</b></font></td>";
echo "<td bgcolor=\"#2E2E2E\" align=\"right\" width=\"75\"><font color=\"$color\"><b>". $ID['00192'] ."</b></font></td>";
?>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">PSI</font></td>

View File

@@ -1,245 +1,194 @@
<?php
include("../includes/items.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);
?>
<!-- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv BOILERS vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -->
<table class="tftable2">
<tr>
<td width="1000%" align="center" colspan="6" border="0"><font color="#00BFFF"><i>BOILERS</i></font></td>
</tr>
</table>
<!-- ****************************************** ROW START ******************************************** -->
<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>
<table class="tftable1">
<tr>
<td colspan="2"><font color="#e0e0e0">Total Steam Flow:</font></td>
<td align="right" width="75"><font color="00FF00"><b><?php echo round(($value['TTL_STEAMFLOW2']),0); ?></b></font></td>
<td><font color="#e0e0e0">Kpph</font></td>
<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>
<td bgcolor="#2E2E2E" colspan="2"><font color="#e0e0e0">Vapor Header Pressure:</font></td>
<td bgcolor="#2E2E2E" align="right" width="75" id="lsp"><font color="00FF00"><b><?php echo $value ['VAPOR HDR PRES']; ?></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">PSI</font></td>
<div class="module-row">
<span class="module-row__label">Exhaust Control</span>
<div class="module-row__value"><?php echo $exhaustMode; ?></div>
</div>
<td colspan="2"><font color="#e0e0e0">Live Steam Pressure:</font></td>
<?php
$color = "#e0e0e0";
<div class="module-divider"></div>
if (($value['PT_001'] >= 0) && ($value['PT_001'] <= 155))
$color = "#FF0000";
else if (($value['PT_001'] >= 156) && ($value['PT_001'] <= 165))
$color = "#FFFF00";
else if ($value['PT_001'] >= 165)
$color = "#00FF00";
echo "<td align=\"right\" width=\"75\"><font color=\"$color\"><b> ".$value['PT_001']." </b></font></td>";
?>
<td><font color="#e0e0e0">PSI</font></td>
</tr>
<!-- ****************************************** ROW END ******************************************** -->
<!-- ****************************************** ROW START ******************************************** -->
<tr>
<td><font color="#e0e0e0">Exhaust Pressure:</font></td>
<?php
if ($ID['00302'] == 0)
echo "<td align=\"center\" bgcolor=\"#0B3B17\"><font color=\"#e0e0e0\">A</font></td>";
if ($ID['00302'] == 1)
echo "<td align=\"center\" bgcolor=\"#8A0808\"><font color=\"#e0e0e0\">M</font></td>";
?>
<?php
$color = "#e0e0e0";
if (($ID['00302'] >= 0) && ($ID['00302'] <= 5))
$color = "#FF0000";
else if (($ID['00302'] >= 6) && ($ID['00302'] <= 13))
$color = "#FFFF00";
else if ($ID['00302'] >= 14)
$color = "#00FF00";
echo "<td align=\"right\"><font color=\"$color\"><b> ".$ID['00302']." </b></font></td>";
?>
<td><font color="#e0e0e0">PSI</font></td>
<td bgcolor="#2E2E2E" colspan="2"><font color="#e0e0e0"></font></td>
<td bgcolor="#2E2E2E" align="right"><font color="00FF00"><b></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0"></font></td>
<td colspan="2"><font color="#e0e0e0"></font></td>
<td align="right"><font color="00FF00"><b></b></font></td>
<td><font color="#e0e0e0"></font></td>
</tr>
</table>
<!-- ****************************************** ROW END ******************************************** -->
<!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ START OF BOILERS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -->
<table class="tftable5" border="1">
<tr>
<td colspan="4" bgcolor="#e06b04" align="center" width="25%"><font color="#000000">Boiler 1</font></td>
<td colspan="4" bgcolor="#b36537" align="center" width="25%"><font color="#000000">Boiler 2</font></td>
<td colspan="4" bgcolor="#e06b04" align="center" width="25%"><font color="#000000">Boiler 3</font></td>
<td colspan="4" bgcolor="#b36537" align="center" width="25%"><font color="#000000">Boiler 4</font></td>
</tr>
<tr>
<td align="left"><font color="#e0e0e0">Steam Flow</font></td>
<td align="left" width="100"><progress id="progressboilers" max="110" value="<?php echo $ID['00310']; ?>"></progress></td>
<td align="right" width="80"><font color="#e60000"><?php echo $ID['00310']; ?></font></td>
<td align="left" width="65"><font color="#e0e0e0">kpph</font></td>
<td align="left"><font color="#e0e0e0">Steam Flow</font></td>
<td align="left" width="100"><progress id="progressboilers" max="105" value="<?php echo $ID['00314']; ?>"></progress></td>
<td align="right" width="80"><font color="#e60000"><?php echo $ID['00314']; ?></font></td>
<td align="left" width="65"><font color="#e0e0e0">kpph</font></td>
<td align="left"><font color="#e0e0e0">Steam Flow</font></td>
<td align="left" width="100"><progress id="progressboilers" max="100" value="<?php echo $value['FT_301']; ?>"></progress></td>
<td align="right" width="80"><font color="#e60000"><?php echo $value['FT_301']; ?></font></td>
<td align="left" width="65"><font color="#e0e0e0">kpph</font></td>
<td align="left"><font color="#e0e0e0">Steam Flow</font></td>
<td align="left" width="100"><progress id="progressboilers" max="60" value="<?php echo $value['FT_401']; ?>"></progress></td>
<td align="right" width="80"><font color="#e60000"><?php echo $value['FT_401']; ?></font></td>
<td align="left" width="65"><font color="#e0e0e0">kpph</font></td>
</tr>
<tr>
<td align="left" colspan="2"><font color="#e0e0e0">Drum Level</font></td>
<td align="right" width="50"><font color="#12bd5a"><?php echo $value['LT_102']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">%</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Drum Level</font></td>
<td align="right" width="50"><font color="#12bd5a"><?php echo $value['LT_202']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">%</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Drum Level</font></td>
<td align="right" width="50"><font color="#12bd5a"><?php echo $value['LT_302']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">%</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Drum Level</font></td>
<td align="right" width="50"><font color="#12bd5a"><?php echo $value['LT_402']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">%</font></td>
</tr>
<tr>
<td align="left" colspan="2"><font color="#e0e0e0">Feed Water</font></td>
<td align="right" width="50"><font color="#129dbd"><?php echo $value['FT_103']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Feed Water</font></td>
<td align="right" width="50"><font color="#129dbd"><?php echo $value['FT_203']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Feed Water</font></td>
<td align="right" width="50"><font color="#129dbd"><?php echo $value['FT_303']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Feed Water</font></td>
<td align="right" width="50"><font color="#129dbd"><?php echo $value['FT_403']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>
</tr>
<tr>
<td align="left" colspan="2"><font color="#e0e0e0">Drum Pressure</font></td>
<td align="right" width="50"><font color="#e2c211"><?php echo $value['PT_105']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">psi</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Drum Pressure</font></td>
<td align="right" width="50"><font color="#e2c211"><?php echo $value['PT_205']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">psi</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Drum Pressure</font></td>
<td align="right" width="50"><font color="#e2c211"><?php echo $value['PT_305']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">psi</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Drum Pressure</font></td>
<td align="right" width="50"><font color="#e2c211"><?php echo $value['PT_405']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">psi</font></td>
</tr>
<tr>
<td align="left" colspan="2"><font color="#e0e0e0">ID Fan Speed</font></td>
<td align="right" width="50"><font color="#0c7300"><?php echo $value['SIT_104']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">rpm</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">ID Fan Speed</font></td>
<td align="right" width="50"><font color="#0c7300"><?php echo $value['SIT_204']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">rpm</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">ID Fan Speed</font></td>
<td align="right" width="50"><font color="#0c7300"><?php echo $value['SIT_304']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">rpm</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">ID Fan Speed</font></td>
<td align="right" width="50"><font color="#0c7300"><?php echo $value['SIT_404']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">rpm</font></td>
</tr>
</table>
<table class="tftable5" border="1">
<tr>
<td colspan="4" bgcolor="#b36537" align="center" width="25%"><font color="#000000">Boiler 5</font></td>
<td colspan="4" bgcolor="#e06b04" align="center" width="25%"><font color="#000000">Boiler 6</font></td>
<td colspan="4" bgcolor="#b36537" align="center" width="25%"><font color="#000000">Boiler 7</font></td>
<td colspan="4" bgcolor="#e06b04" align="center" width="25%"><font color="#000000">Boiler 8</font></td>
</tr>
<tr>
<td align="left"><font color="#e0e0e0">Steam Flow</font></td>
<td align="left" width="100"><progress id="progressboilers" max="55" value="<?php echo $value['FT_501']; ?>"></progress></td>
<td align="right" width="80"><font color="#e60000"><?php echo $value['FT_501']; ?></font></td>
<td align="left" width="65"><font color="#e0e0e0">kpph</font></td>
<td align="left"><font color="#e0e0e0">Steam Flow</font></td>
<td align="left" width="100"><progress id="progressboilers" max="90" value="<?php echo $value['FT_601']; ?>"></progress></td>
<td align="right" width="80"><font color="#e60000"><?php echo $value['FT_601']; ?></font></td>
<td align="left" width="65"><font color="#e0e0e0">kpph</font></td>
<td align="left"><font color="#e0e0e0">Steam Flow</font></td>
<td align="left" width="100"><progress id="progressboilers" max="270" value="<?php echo $ID['00048']; ?>"></progress></td>
<td align="right" width="80"><font color="#e60000"><?php echo $ID['00048']; ?></font></td>
<td align="left" width="65"><font color="#e0e0e0">kpph</font></td>
<td align="left"><font color="#e0e0e0">Steam Flow</font></td>
<td align="left" width="100"><progress id="progressboilers" max="270" value="<?php echo $ID['00078']; ?>"></progress></td>
<td align="right" width="80"><font color="#e60000"><?php echo $ID['00078']; ?></font></td>
<td align="left" width="65"><font color="#e0e0e0">kpph</font></td>
</tr>
<tr>
<td align="left" colspan="2"><font color="#e0e0e0">Drum Level</font></td>
<td align="right" width="50"><font color="#12bd5a"><?php echo $value['LT_502']; ?><font></td>
<td align="left" width="50"><font color="#e0e0e0">%</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Drum Level</font></td>
<td align="right" width="50"><font color="#12bd5a"><?php echo $value['LT_602']; ?><font></td>
<td align="left" width="50"><font color="#e0e0e0">%</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Drum Level</font></td>
<td align="right" width="50"><font color="#12bd5a"><?php echo $ID['00004']; ?><font></td>
<td align="left" width="50"><font color="#e0e0e0">%</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Drum Level</font></td>
<td align="right" width="50"><font color="#12bd5a"><?php echo $ID['00032']; ?><font></td>
<td align="left" width="50"><font color="#e0e0e0">%</font></td>
</tr>
<tr>
<td align="left" colspan="2"><font color="#e0e0e0">Feed Water</font></td>
<td align="right" width="50"><font color="#129dbd"><?php echo $value['FT_503']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Feed Water</font></td>
<td align="right" width="50"><font color="#129dbd"><?php echo $value['FT_603']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Feed Water</font></td>
<td align="right" width="50"><font color="#129dbd"><?php echo $ID['00014']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Feed Water</font></td>
<td align="right" width="50"><font color="#129dbd"><?php echo $ID['00042']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">kpph</font></td>
</tr>
<tr>
<td align="left" colspan="2"><font color="#e0e0e0">Drum Pressure</font></td>
<td align="right" width="50"><font color="#e2c211"><?php echo $value['PT_505']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">psi</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Drum Pressure</font></td>
<td align="right" width="50"><font color="#e2c211"><?php echo $value['PT_605']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">psi</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Drum Pressure</font></td>
<td align="right" width="50"><font color="#e2c211"><?php echo $ID['00010']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">psi</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">Drum Pressure</font></td>
<td align="right" width="50"><font color="#e2c211"><?php echo $ID['00038']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">psi</font></td>
</tr>
<tr>
<td align="left" colspan="2"><font color="#e0e0e0">ID Fan Speed</font></td>
<td align="right" width="50"><font color="#0c7300"><?php echo $value['SIT_504']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">rpm</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">ID Fan Speed</font></td>
<td align="right" width="50"><font color="#0c7300"><?php echo $value['SIT_604']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">rpm</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">ID Fan Speed</font></td>
<td align="right" width="50"><font color="#0c7300"><?php echo $ID['00020']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">rpm</font></td>
<td align="left" colspan="2"><font color="#e0e0e0">ID Fan Speed</font></td>
<td align="right" width="50"><font color="#0c7300"><?php echo $ID['00048']; ?></font></td>
<td align="left" width="50"><font color="#e0e0e0">rpm</font></td>
</tr>
</table>
<!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF BOILERS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -->
<!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF PAGE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -->
<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>

View File

@@ -1,98 +1,94 @@
<?php
include("../includes/items.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)],
];
?>
<!-- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv BOILERS vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -->
<table class="tftable2">
<tr>
<td width="1000%" align="center" colspan="6" border="0"><font color="#00BFFF"><i>BOILERS</i></font></td>
</tr>
</table>
<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>
<table class="tftable1">
<tr>
<td bgcolor="#2E2E2E" colspan="2"><font color="#e0e0e0">Total Steam Flow:</font></td>
<td bgcolor="#2E2E2E" align="right" width="75"><font color="00FF00"><b><?php echo round(($value['TTL_STEAMFLOW2']),0); ?></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Kpph</font></td>
<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>
<td colspan="2"><font color="#e0e0e0">Live Steam Pressure:</font></td>
<?php
$color = "#FFFFFF";
<div class="module-row">
<span class="module-row__label">Exhaust Control</span>
<div class="module-row__value"><?php echo $exhaustMode; ?></div>
</div>
if (($value['PT_001'] >= 0) && ($value['PT_001'] <= 155))
$color = "#c46666ff";
else if (($value['PT_001'] >= 156) && ($value['PT_001'] <= 165))
$color = "#FFFF00";
else if ($value['PT_001'] >= 165)
$color = "#00FF00";
<div class="module-divider"></div>
echo "<td align=\"right\" width=\"75\"><font color=\"$color\"><b>". $value['PT_001'] ."</b></font></td>";
?>
<td><font color="#e0e0e0">PSI</font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Exhaust Pressure:</font></td>
<?php
if ($value['ExhaustAM'] == 0)
echo "<td align=\"center\" bgcolor=\"#0B3B17\"><font color=\"#e0e0e0\">A</font></td>";
if ($value['ExhaustAM'] == 1)
echo "<td bgcolor=\"#2E2E2E\" align=\"center\" bgcolor=\"#8A0808\"><font color=\"#e0e0e0\">M</font></td>";
?>
<?php
$color = "#FFFFFF";
if (($ID['00302'] >= 0) && ($ID['00302'] <= 9))
$color = "#FF0000";
else if (($ID['00302'] >= 6) && ($ID['00302'] <= 13))
$color = "#FFFF00";
else if ($ID['00302'] >= 14)
$color = "#00FF00";
echo "<td bgcolor=\"#2E2E2E\" align=\"right\" width=\"75\"><font color=\"$color\"><b>". $ID['00302'] ."</b></font></td>";
?>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">PSI</font></td>
<td colspan="2"><font color="#e0e0e0">Vapor Header Pressure:</font></td>
<td align="right" width="75" id="lsp"><font color="00FF00"><b><?php echo $value['VAPOR HDR PRES']; ?></b></font></td>
<td><font color="#e0e0e0">PSI</font></td>
</tr>
</table>
<table class="tftable1" border="1">
<tr>
<td colspan="2" bgcolor="#DF9401" align="center" width="12.5%"><font color="#000000">Boiler 1</font></td>
<td colspan="2" bgcolor="#DF9401" align="center" width="12,5%"><font color="#000000">Boiler 2</font></td>
<td colspan="2" bgcolor="#DF9401" align="center" width="12.5%"><font color="#000000">Boiler 3</font></td>
<td colspan="2" bgcolor="#DF9401" align="center" width="12.5%"><font color="#000000">Boiler 4</font></td>
<td colspan="2" bgcolor="#DF9401" align="center" width="12.5%"><font color="#000000">Boiler 5</font></td>
<td colspan="2" bgcolor="#DF9401" align="center" width="12.5%"><font color="#000000">Boiler 6</font></td>
<td colspan="2" bgcolor="#DF9401" align="center" width="12.5%"><font color="#000000">Boiler 7</font></td>
<td colspan="2" bgcolor="#DF9401" align="center" width="12.5%"><font color="#000000">Boiler 8</font></td>
</tr>
<tr>
<td bgcolor="#DF9401" align="center"><font color="#000000">Steam Flow</font></td>
<td width="40" bgcolor="#DF9401" align="center"><font color="#009900"><?php echo round(($ID['00310']),0); ?></font></td>
<td bgcolor="#DF9401" align="center"><font color="#000000">Steam Flow</font></td>
<td width="40" bgcolor="#DF9401" align="center"><font color="#009900"><?php echo round(($ID['00314']),0); ?></font></td>
<td bgcolor="#DF9401" align="center"><font color="#000000">Steam Flow</font></td>
<td width="40" bgcolor="#DF9401" align="center"><font color="#009900"><?php echo round(($value['FT_301']),0); ?></font></td>
<td bgcolor="#DF9401" align="center"><font color="#000000">Steam Flow</font></td>
<td width="40" bgcolor="#DF9401" align="center"><font color="#009900"><?php echo round(($value['FT_401']),0); ?></font></td>
<td bgcolor="#DF9401" align="center"><font color="#000000">Steam Flow</font></td>
<td width="40" bgcolor="#DF9401" align="center"><font color="#009900"><?php echo round(($value['FT_501']),0); ?></font></td>
<td bgcolor="#DF9401" align="center"><font color="#000000">Steam Flow</font></td>
<td width="40" bgcolor="#DF9401" align="center"><font color="#009900"><?php echo round(($value['FT_601']),0); ?></font></td>
<td bgcolor="#DF9401" align="center"><font color="#000000">Steam Flow</font></td>
<td width="40" bgcolor="#DF9401" align="center"><font color="#009900"><?php echo round(($ID['00050']),0); ?></font></td>
<td bgcolor="#DF9401" align="center"><font color="#000000">Steam Flow</font></td>
<td width="40" bgcolor="#DF9401" align="center"><font color="#009900"><?php echo round(($ID['00078']),0); ?></font></td>
</tr>
</table>
<!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF BOILERS ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -->
<?php
?>
<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>

View File

@@ -0,0 +1,29 @@
<?php
$serverName = "CBM2K12\SQLEXPRESS";
$uid = "cbmclient";
$pwd = "ascbm2k";
$connectionInfo = array( "UID"=>$uid, "PWD"=>$pwd,'ReturnDatesAsStrings'=> true, "CharacterSet" => 'utf-8', "Database"=>"SugarCaneScale" );
/* Connect using SQL Server Authentication. */
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false )
{
echo "Unable to connect.</br>";
die( print_r( sqlsrv_errors(), true));
}
$sql = "SELECT CropDay FROM Parameters";
$stmt = sqlsrv_query( $conn, $sql );
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
}
while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {
echo $row['CropDay'];
}
sqlsrv_free_stmt( $stmt);
sqlsrv_close( $conn);
?>

View File

@@ -1,5 +1,5 @@
<?php
include("../includes/items.php");
include("../../items.php");
?>
<table width="100%" class="tftable1" border="1" cellspacing="0" cellpadding="4">
<tr>
@@ -157,7 +157,8 @@ include("../includes/items.php");
echo "<td width=\"6.66%\" id=\"dryersoff\">ERROR</td>";
}
//A15
if ($value['A15Running'] == 1) {
echo "<td width=\"6.66%\" id=\"dryersonoffblank\" align=\"center\">A15</td>";
/* if ($value['A15Running'] == 1) {
echo "<td width=\"6.66%\" id=\"dryerson\">A15</td>";
}
else if ($value['A15Running'] == 0) {
@@ -165,7 +166,7 @@ include("../includes/items.php");
}
else {
echo "<td width=\"6.66%\" id=\"dryersoff\">ERROR</td>";
}
}*/
?>
</tr>
</table>

View File

@@ -1,5 +1,5 @@
<?php
include("../includes/itemsAI.php");
include("../../items.php");
?>
<table class="tftable1">
<tr>
@@ -134,23 +134,23 @@ include("../includes/itemsAI.php");
<td colspan="1" bgcolor="#404040" align="center"><font color="#FFFFFF">Heater 8</font></td>
</tr>
<td colspan="1" width="11.11%" bgcolor="#404040" align="center"><font color="#FFFFFF">Temp</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['Heater 1 Temp']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['Heater 2 Temp']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['Heater 3 Temp']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['Heater 4 Temp']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['Heater 5 Temp']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['Heater 6 Temp']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['Heater 7 Temp']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['Heater 8 Temp']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['TubeHeater1Temp']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['TubeHeater2Temp']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['TubeHeater3Temp']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['TubeHeater4Temp']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['TubeHeater5Temp']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['TubeHeater6Temp']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['TubeHeater7Temp']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['TubeHeater8TempPV']; ?></font></td>
<tr>
<td colspan="1" bgcolor="#404040" align="center"><font color="#FFFFFF">Setpoint</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['Heater 2 SP']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['Heater 2 SP']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['Heater 3 SP']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['Heater 4 SP']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['Heater 5 SP']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['Heater 6 SP']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['Heater 7 SP']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['Heater 8 SP']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['TubeHeater1SP']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['TubeHeater2SP']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['TubeHeater3SP']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['TubeHeater4SP']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['TubeHeater5SP']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['TubeHeater6SP']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['TubeHeater7SP']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['TubeHeater8TempSP']; ?></font></td>
</tr>
</table>

View File

@@ -3,7 +3,7 @@
</head>
<table class="tftable1">
<tr>
<td width="50%" align="left" border="0"><font color="#00BFFF"><i>LASUCA CONTROLS &nbsp<?php date_default_timezone_set('America/Chicago'); $date = date('M j, Y g:i:s A'); echo "$date";?> &nbsp Crop Day <?php include("../includes/cropday.php");?></i></font></td>
<td width="50%" align="left" border="0"><font color="#00BFFF"><i>LASUCA CONTROLS &nbsp<?php date_default_timezone_set('America/Chicago'); $date = date('M j, Y g:i:s A'); echo "$date";?> &nbsp Crop Day <?php include("cropday.php");?></i></font></td>
<td width="50%" align="right" border="0"><font color="#00BFFF"><i>CONTROLS OVERVIEW</i></font></td>
</tr>
</table>

View File

@@ -1,5 +1,5 @@
<?php
include("../includes/itemsAI.php");
include("../../items.php");
?>
<table class="tftable1">
<tr>
@@ -14,24 +14,24 @@ include("../includes/itemsAI.php");
<td colspan="1" bgcolor="#404040" align="center"><font color="#FFFFFF">Heater 8</font></td>
</tr>
<td colspan="1" width="11.11%" bgcolor="#404040" align="center"><font color="#FFFFFF">Temp</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['Heater 1 Temp']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['Heater 2 Temp']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['Heater 3 Temp']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['Heater 4 Temp']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['Heater 5 Temp']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['Heater 6 Temp']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['Heater 7 Temp']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['Heater 8 Temp']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['TubeHeater1Temp']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['TubeHeater2Temp']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['TubeHeater3Temp']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['TubeHeater4Temp']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['TubeHeater5Temp']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['TubeHeater6Temp']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['TubeHeater7Temp']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $rounded['TubeHeater8TempPV']; ?></font></td>
<tr>
<td colspan="1" bgcolor="#404040" align="center"><font color="#FFFFFF">Setpoint</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['Heater 2 SP']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['Heater 2 SP']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['Heater 3 SP']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['Heater 4 SP']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['Heater 5 SP']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['Heater 6 SP']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['Heater 7 SP']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['Heater 8 SP']; ?>&deg</font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['TubeHeater1SP']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['TubeHeater2SP']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['TubeHeater3SP']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['TubeHeater4SP']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['TubeHeater5SP']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['TubeHeater6SP']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['TubeHeater7SP']; ?></font></td>
<td colspan="1" width="11.11%" bgcolor="#272727" align="center"><font color="#FFFFFF"><?php echo $value['TubeHeater8TempSP']; ?></font></td>
</tr>
</table>

View File

@@ -1,7 +1,951 @@
<?php include("header.php");?>
<?php // include("maintenence.php");?>
<?php include("newgeneral.php");?>
<?php include("newmills.php");?>
<?php include("boilersslim.php");?>
<?php include("tanklevelswrap.php");?>
<?php include("tablesandtd.php");?>
<?php
declare(strict_types=1);
// phpcs:disable
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Pragma: no-cache');
header('Content-Type: text/html; charset=UTF-8');
date_default_timezone_set('America/Chicago');
/**
* Capture the rendered output of a partial include and return it as a string.
*/
function capture_include(string $relativePath): string
{
ob_start();
include __DIR__ . '/' . $relativePath;
return trim(ob_get_clean());
}
/**
* Safely fetch a value from an array.
*
* @param array<mixed> $source
*/
function array_value(array $source, string $key)
{
return array_key_exists($key, $source) ? $source[$key] : null;
}
function numeric_or_null($value): ?float
{
if ($value === null) {
return null;
}
if (is_numeric($value)) {
return (float) $value;
}
$normalised = str_replace([',', ' '], '', (string) $value);
$normalised = preg_replace('/[^0-9.\-]/', '', $normalised ?? '');
if ($normalised === '' || !is_numeric($normalised)) {
return null;
}
return (float) $normalised;
}
function format_number($value, int $decimals = 0): string
{
$numeric = numeric_or_null($value);
return $numeric === null ? '—' : number_format($numeric, $decimals);
}
function format_with_unit($value, string $unit, int $decimals = 0): string
{
$formatted = format_number($value, $decimals);
return $formatted === '—' ? $formatted : $formatted . ' ' . $unit;
}
/**
* @param array<float|null> $values
*/
function sum_numeric(array $values): ?float
{
$total = 0.0;
$found = false;
foreach ($values as $value) {
$numeric = numeric_or_null($value);
if ($numeric === null) {
continue;
}
$total += $numeric;
$found = true;
}
return $found ? $total : null;
}
function clamp_percent(?float $value): float
{
if ($value === null) {
return 0.0;
}
return max(0.0, min(100.0, $value));
}
function percent_label($value, int $decimals = 0): string
{
$numeric = numeric_or_null($value);
return $numeric === null ? '—' : format_number($numeric, $decimals) . '%';
}
function html(string $value): string
{
return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
}
/**
* @param array<mixed> $source
*/
function value_num(array $source, string $key): ?float
{
return numeric_or_null(array_value($source, $key));
}
/**
* @param array<mixed> $source
*/
function value_as_int(array $source, string $key): ?int
{
$numeric = value_num($source, $key);
return $numeric === null ? null : (int) round($numeric);
}
function build_status(?int $rawValue, bool $autoIsZero = true): ?array
{
if ($rawValue === null) {
return null;
}
$isAuto = $autoIsZero ? $rawValue === 0 : $rawValue === 1;
return [
'label' => $isAuto ? 'Auto' : 'Manual',
'class' => $isAuto ? 'status-pill--ok' : 'status-pill--alert',
];
}
function build_switch(?int $rawValue, string $labelOn = 'On', string $labelOff = 'Off'): ?array
{
if ($rawValue === null) {
return null;
}
$isOn = $rawValue === 0;
return [
'label' => $isOn ? $labelOn : $labelOff,
'class' => $isOn ? 'status-pill--ok' : 'status-pill--warn',
];
}
function classify_live_steam(?float $value): ?array
{
if ($value === null) {
return null;
}
if ($value <= 155) {
return ['label' => 'Low', 'class' => 'status-pill--alert'];
}
if ($value <= 165) {
return ['label' => 'Watch', 'class' => 'status-pill--warn'];
}
return ['label' => 'Stable', 'class' => 'status-pill--ok'];
}
function classify_exhaust(?float $value): ?array
{
if ($value === null) {
return null;
}
if ($value <= 9) {
return ['label' => 'Low', 'class' => 'status-pill--alert'];
}
if ($value <= 13) {
return ['label' => 'Watch', 'class' => 'status-pill--warn'];
}
return ['label' => 'Stable', 'class' => 'status-pill--ok'];
}
function tank_level_state(?float $value): ?string
{
if ($value === null) {
return null;
}
if ($value <= 20) {
return 'low';
}
if ($value >= 90) {
return 'caution';
}
return null;
}
include '../../items.php';
$valuesZero = $value ?? [];
$roundedZero = $rounded ?? [];
$idsZero = $ID ?? [];
$roundedOneZero = $rounded1 ?? [];
include '../../items2dec.php';
$valuesTwo = $value ?? [];
$idsTwo = $ID ?? [];
$value = $valuesZero;
$rounded = $roundedZero;
$ID = $idsZero;
$rounded1 = $roundedOneZero;
$now = new DateTimeImmutable('now', new DateTimeZone('America/Chicago'));
$generatedAt = $now->format(DateTimeInterface::RFC3339);
$cropDayRaw = capture_include('cropday.php');
$cropDay = $cropDayRaw !== '' ? $cropDayRaw : null;
$tonsIn = numeric_or_null(capture_include('tonsin.php'));
$recordTons = numeric_or_null(capture_include('record.php'));
$recordDateRaw = capture_include('recorddate.php');
$recordDate = $recordDateRaw !== '' ? $recordDateRaw : null;
$westAvg = numeric_or_null(capture_include('west15minavg.php'));
$groundToday = sum_numeric([
value_num($value, 'CANETOT'),
value_num($value, 'W TONS GROUND'),
]);
$groundYesterday = sum_numeric([
value_num($value, 'PREVTONS'),
value_num($value, 'WPREVGROUND'),
]);
$runHours = value_num($value, 'RUNHRSTODAY');
$prevRunHours = value_num($value, 'PREVTIME');
$totalTonsPerHour = sum_numeric([
value_num($value, 'TONS_PER_HOUR'),
value_num($value, 'RATE'),
]);
$lossTime = value_num($value, 'LOSSTIME');
$eastAverage = value_num($value, 'AVG_TONS_PER_HOUR');
$summaryCards = [
[
'label' => 'Cane In Today',
'value' => format_number($tonsIn),
'unit' => 'tons',
],
[
'label' => 'Ground Today',
'value' => format_number($groundToday),
'unit' => 'tons',
],
[
'label' => 'Total Ground Yesterday',
'value' => format_number($groundYesterday),
'unit' => 'tons',
],
[
'label' => 'Run Hours',
'value' => format_number($runHours, 1),
'unit' => 'hours',
],
[
'label' => 'Prev Run Hours',
'value' => format_number($prevRunHours, 1),
'unit' => 'hours',
],
[
'label' => 'Total Tons per Hour',
'value' => format_number($totalTonsPerHour),
'unit' => 'tons/hr',
],
[
'label' => 'East 15 Minute Avg',
'value' => format_number($eastAverage),
'unit' => 'tons/hr',
],
[
'label' => 'West 15 Minute Avg',
'value' => format_number($westAvg),
'unit' => 'tons/hr',
],
[
'label' => 'Loss Time Today',
'value' => format_number($lossTime, 2),
'unit' => 'hours',
],
[
'label' => 'Record Day',
'value' => format_number($recordTons),
'unit' => 'tons',
'note' => $recordDate ? 'on ' . $recordDate : null,
],
];
$levelThroughputSwitch = value_as_int($value, 'LEVEL_THROUGHPUT_SWITCH');
$millFourUnit = $levelThroughputSwitch === 1 ? 'tons/hr' : '%';
$eastStages = [
[
'label' => 'Mill 1',
'stage' => '1',
'level' => value_num($value, 'MILL1LVLPV'),
'setpoint' => value_num($value, 'MILL1SP'),
'setpointUnit' => '%',
'rpm' => value_num($value, 'EMILL1RPM'),
'outputLabel' => 'Mill 1 OP',
'outputValue' => value_num($value, 'MILL1OUTPUT'),
'outputUnit' => '%',
'mode' => build_status(value_as_int($value, 'MILL1AUTOMAN'), true),
],
[
'label' => 'Mill 2',
'stage' => '2',
'level' => value_num($value, 'M2LVL'),
'setpoint' => value_num($value, 'MILL2SP'),
'setpointUnit' => '%',
'rpm' => value_num($value, 'EMILL2RPM'),
'outputLabel' => 'MCC Output',
'outputValue' => value_num($value, 'MCCOUTPUT'),
'outputUnit' => '%',
'mode' => null,
],
[
'label' => 'Mill 3',
'stage' => '3',
'level' => value_num($value, 'MIL3LVL'),
'setpoint' => value_num($value, 'MILL3SP'),
'setpointUnit' => '%',
'rpm' => value_num($value, 'EMILL3RPM'),
'outputLabel' => 'MCC Tons',
'outputValue' => value_num($rounded1, 'MCCTONS'),
'outputUnit' => 'tons',
'mode' => null,
],
[
'label' => 'Mill 4',
'stage' => '4',
'level' => value_num($value, 'MIL4LVL'),
'setpoint' => value_num($value, 'MILL4SP'),
'setpointUnit' => '%',
'rpm' => value_num($value, 'EMILL4RPM'),
'outputLabel' => 'Mill 1 SP',
'outputValue' => value_num($value, 'WEIGHT_WSP'),
'outputUnit' => $millFourUnit,
'mode' => build_status(value_as_int($value, 'MILL1AUTOMAN1'), false),
],
[
'label' => 'Mill 5',
'stage' => '5',
'level' => value_num($value, 'MIL5LVL'),
'setpoint' => value_num($value, 'MILL5SP'),
'setpointUnit' => '%',
'rpm' => value_num($value, 'EMILL5RPM'),
'outputLabel' => 'Grinding Rate',
'outputValue' => value_num($value, 'TONS_PER_HOUR'),
'outputUnit' => 'tons/hr',
'mode' => null,
],
[
'label' => 'Mill 6',
'stage' => '6',
'level' => value_num($value, 'MIL6LVL'),
'setpoint' => value_num($value, 'MILL6SP'),
'setpointUnit' => '%',
'rpm' => value_num($value, 'EMILL6RPM'),
'outputLabel' => 'Average Rate',
'outputValue' => value_num($value, 'AVG_TONS_PER_HOUR'),
'outputUnit' => 'tons/15 min',
'mode' => null,
],
];
$eastFooterMetrics = [
['label' => 'Imbibition 6 Flow', 'value' => format_with_unit(value_num($value, 'IMBFLOW'), 'gpm')],
['label' => 'Imbibition 6 SP', 'value' => format_with_unit(value_num($value, 'IMBSP'), 'gpm')],
['label' => 'Imbibition 5 Flow', 'value' => format_with_unit(value_num($value, 'IMBFLOW'), 'gpm')],
['label' => 'Imbibition 5 SP', 'value' => format_with_unit(value_num($value, 'IMB5SP'), 'gpm')],
];
$westStages = [
[
'label' => 'Mill 1',
'stage' => '1',
'level' => value_num($ID, '00654'),
'setpoint' => null,
'setpointUnit' => '%',
'rpm' => value_num($ID, '00666'),
'outputLabel' => 'MCC FPM',
'outputValue' => value_num($value, 'Feet/Minute'),
'outputUnit' => 'fpm',
'mode' => null,
],
[
'label' => 'Mill 2',
'stage' => '2',
'level' => value_num($ID, '00656'),
'setpoint' => null,
'setpointUnit' => '%',
'rpm' => value_num($ID, '00670'),
'outputLabel' => 'MCC Output',
'outputValue' => value_num($ID, '00638'),
'outputUnit' => '%',
'mode' => null,
],
[
'label' => 'Mill 4',
'stage' => '4',
'level' => value_num($ID, '00658'),
'setpoint' => null,
'setpointUnit' => '%',
'rpm' => value_num($ID, '00674'),
'outputLabel' => 'Mill 1 SP',
'outputValue' => null,
'outputUnit' => '%',
'mode' => null,
],
[
'label' => 'Mill 5',
'stage' => '5',
'level' => value_num($ID, '00660'),
'setpoint' => null,
'setpointUnit' => '%',
'rpm' => value_num($ID, '00680'),
'outputLabel' => 'Grinding Rate',
'outputValue' => value_num($value, 'RATE'),
'outputUnit' => 'tons/hr',
'mode' => null,
],
];
$westFooterMetrics = [
['label' => 'Imbibition Flow', 'value' => format_with_unit(value_num($ID, '00624'), 'gpm')],
['label' => 'Average Rate', 'value' => format_with_unit($westAvg, 'tons/15 min')],
];
$steamFlow = value_num($value, 'TTL_STEAMFLOW2');
$liveSteam = value_num($value, 'PT_001');
$exhaustPressure = value_num($ID, '00244');
$exhaustMode = build_status(value_as_int($value, 'ExhaustAM'), true);
$vaporHeader = value_num($value, 'VAPOR HDR PRES');
$boilerOverview = [
[
'label' => 'Total Steam Flow',
'value' => format_number($steamFlow),
'unit' => 'kpph',
],
[
'label' => 'Live Steam Pressure',
'value' => format_number($liveSteam),
'unit' => 'psi',
'status' => classify_live_steam($liveSteam),
],
[
'label' => 'Exhaust Pressure',
'value' => format_number($exhaustPressure),
'unit' => 'psi',
'status' => classify_exhaust($exhaustPressure),
'mode' => $exhaustMode,
],
[
'label' => 'Vapor Header Pressure',
'value' => format_number($vaporHeader),
'unit' => 'psi',
],
];
$boilerFlows = [
['label' => 'Boiler 1', 'value' => format_number(value_num($ID, '00252'))],
['label' => 'Boiler 2', 'value' => format_number(value_num($ID, '00256'))],
['label' => 'Boiler 3', 'value' => format_number(value_num($value, 'FT_301'))],
['label' => 'Boiler 4', 'value' => format_number(value_num($value, 'FT_401'))],
['label' => 'Boiler 5', 'value' => format_number(value_num($value, 'FT_501'))],
['label' => 'Boiler 6', 'value' => format_number(value_num($value, 'FT_601'))],
['label' => 'Boiler 7', 'value' => format_number(value_num($ID, '00046'))],
['label' => 'Boiler 8', 'value' => format_number(value_num($ID, '00074'))],
];
$syrupOverflow = value_num($value, 'Syrup Overflow Lvl');
$syrupReceiver = value_num($value, 'Syrup RCVR');
$totalSyrup = null;
if ($syrupOverflow !== null || $syrupReceiver !== null) {
$totalSyrup = 0.0;
if ($syrupOverflow !== null) {
$totalSyrup += $syrupOverflow * 0.82569;
}
if ($syrupReceiver !== null) {
$totalSyrup += $syrupReceiver * 0.17431;
}
}
$tankLevels = [
['label' => 'Juice Tank 1', 'value' => value_num($value, 'Juice Tank1')],
['label' => 'Juice Tank 2', 'value' => value_num($value, 'Juice Tank2')],
['label' => 'Syrup Receiver', 'value' => $syrupReceiver],
['label' => 'Syrup Overflow', 'value' => $syrupOverflow],
['label' => 'Total Syrup', 'value' => $totalSyrup],
['label' => 'Condensate Water', 'value' => value_num($value, 'CondensateWater')],
['label' => 'Sweet Water', 'value' => value_num($value, 'SweetwaterTank')],
['label' => 'Cold Water INJ', 'value' => value_num($value, 'Cold Water Injection LVL')],
['label' => 'A1 Receiver', 'value' => value_num($value, 'A1 RCVR')],
['label' => 'A1 Overflow', 'value' => value_num($value, 'A1 Molasses Overflow Lvl')],
['label' => 'A2 Receiver', 'value' => value_num($value, 'A2 RCVR')],
['label' => 'A2 Overflow', 'value' => value_num($value, 'A2 Molasses Overflow Lvl')],
['label' => 'B Receiver', 'value' => value_num($value, 'B RCVR')],
['label' => 'B Overflow', 'value' => value_num($value, 'B Molasses Overflow Lvl')],
['label' => 'Flash Tank', 'value' => value_num($value, 'FlashTankLVL')],
];
$truckDumpState = build_status(value_as_int($value, 'LATCHON'), true);
$truckDumpMetrics = [
['label' => 'PV', 'value' => format_number(value_num($valuesTwo, 'TD INPUT'), 1)],
[
'label' => 'Setpoint',
'value' => format_number(
value_as_int($value, 'TD SP3 ON/OFF') === 1
? value_num($valuesTwo, 'TD SP3')
: value_num($valuesTwo, 'TD SP1'),
1
),
'suffix' => value_as_int($value, 'TD SP3 ON/OFF') === 1 ? 'SP3' : 'SP',
],
['label' => 'Output', 'value' => format_with_unit(value_num($valuesTwo, 'TD OUTPUT'), '%', 1)],
['label' => 'Ratio', 'value' => format_number(value_num($valuesTwo, 'TD RATIO'), 2)],
['label' => 'Belt Scale', 'value' => format_with_unit(value_num($valuesTwo, 'TDBELTSCALE'), 'lbs', 0)],
[
'label' => 'Belt State',
'status' => build_switch(value_as_int($value, 'TDBELTSCALEONOFF'), 'Scale On', 'Scale Off'),
],
[
'label' => 'Mode',
'value' => value_as_int($value, 'TD MILLGROUND') === null
? '—'
: (
value_as_int($value, 'TD MILLGROUND') === 0
? 'Dump Mill'
: 'Dump Ground'
),
],
];
$tables = [
[
'label' => 'S Table',
'pv' => format_number(value_num($valuesTwo, 'SE SCALE'), 1),
'sp' => format_number(
value_as_int($value, 'STABLE SP3 ON/OFF') === 1
? value_num($valuesTwo, 'STABLE SP1')
: value_num($valuesTwo, 'SE SETPOINT'),
1
),
'spLabel' => value_as_int($value, 'STABLE SP3 ON/OFF') === 1 ? 'SP3' : 'SP',
'output' => format_with_unit(value_num($valuesTwo, 'SE OUTPUT'), '%', 1),
'mode' => build_status(value_as_int($value, 'SAM'), true),
],
[
'label' => 'NE Table',
'pv' => format_number(value_num($valuesTwo, 'NE SCALE'), 1),
'sp' => format_number(
value_as_int($value, 'NE SP SWITCH') === 1
? value_num($valuesTwo, 'NE SETPOINT2')
: value_num($valuesTwo, 'NE SETPOINT'),
1
),
'spLabel' => value_as_int($value, 'NE SP SWITCH') === 1 ? 'SP3' : 'SP',
'output' => format_with_unit(value_num($valuesTwo, 'NE OUTPUT'), '%', 1),
'mode' => build_status(value_as_int($value, 'NAM'), true),
],
[
'label' => 'W Table',
'pv' => format_number(value_num($valuesTwo, 'W SCALE'), 1),
'sp' => format_number(
value_as_int($value, 'W SP SWITCH') === 1
? value_num($valuesTwo, 'W SETPOINT2')
: value_num($valuesTwo, 'W SETPOINT'),
1
),
'spLabel' => value_as_int($value, 'W SP SWITCH') === 1 ? 'SP3' : 'SP',
'output' => format_with_unit(value_num($valuesTwo, 'W OUTPUT'), '%', 1),
'mode' => build_status(value_as_int($value, 'WAM'), true),
],
];
$knives = [
[
'label' => 'Knife 1',
'pressure' => format_with_unit(value_num($valuesTwo, 'KNF1PRES'), 'psi', 1),
'speed' => format_with_unit(value_num($valuesTwo, 'K1SPD'), 'rpm', 0),
'output' => format_with_unit(value_num($valuesTwo, 'KNIFE1OP'), '%', 1),
'mode' => value_as_int($value, 'KC1') === null
? null
: (
value_as_int($value, 'KC1') === 1
? ['label' => 'Control', 'class' => 'status-pill--ok']
: ['label' => 'Knife', 'class' => 'status-pill--warn']
),
],
[
'label' => 'Knife 2',
'pressure' => format_with_unit(value_num($valuesTwo, 'KNF2PRES'), 'psi', 1),
'speed' => format_with_unit(value_num($valuesTwo, 'KNF2SPD'), 'rpm', 0),
'output' => format_with_unit(value_num($valuesTwo, 'KNIFE2OP'), '%', 1),
'mode' => value_as_int($value, 'KC2') === null
? null
: (
value_as_int($value, 'KC2') === 1
? ['label' => 'Control', 'class' => 'status-pill--ok']
: ['label' => 'Knife', 'class' => 'status-pill--warn']
),
],
[
'label' => 'Knife 3',
'pressure' => format_with_unit(value_num($valuesTwo, 'KNF3PRES'), 'psi', 1),
'speed' => format_with_unit(value_num($valuesTwo, 'KNF3SPD'), 'rpm', 0),
'output' => format_with_unit(value_num($valuesTwo, 'KNIFE3OP'), '%', 1),
'mode' => value_as_int($value, 'KC3') === null
? null
: (
value_as_int($value, 'KC3') === 1
? ['label' => 'Control', 'class' => 'status-pill--ok']
: ['label' => 'Knife', 'class' => 'status-pill--warn']
),
],
];
?>
<div class="board-stack" data-generated-at="<?php echo html($generatedAt); ?>">
<div class="meta-banner">
<?php if ($cropDay !== null) { ?>
<span>Crop Day <strong><?php echo html($cropDay); ?></strong></span>
<?php } ?>
<span>Server time <strong><?php echo html($now->format('M j, Y g:i:s A')); ?></strong></span>
</div>
<section class="section">
<header class="section__header">
<h2 class="section__title">Key Production Metrics</h2>
<p class="section__meta">Plant-wide summary</p>
</header>
<div class="stat-grid">
<?php foreach ($summaryCards as $card) { ?>
<article class="stat-card">
<p class="stat-card__label"><?php echo html($card['label']); ?></p>
<p class="stat-card__value"><?php echo html($card['value']); ?></p>
<?php if (!empty($card['unit'])) { ?>
<p class="stat-card__unit"><?php echo html($card['unit']); ?></p>
<?php } ?>
<?php if (!empty($card['note'])) { ?>
<p class="stat-card__note"><?php echo html($card['note']); ?></p>
<?php } ?>
</article>
<?php } ?>
</div>
</section>
<section class="section">
<header class="section__header">
<h2 class="section__title">East Tandem</h2>
<p class="section__meta">Six-mill train status</p>
</header>
<div class="tandem-grid">
<?php foreach ($eastStages as $stage) { ?>
<article class="stage-card">
<div class="stage-card__header">
<div class="stage-card__title">
<span class="stage-card__badge"><?php echo html($stage['stage']); ?></span>
<span><?php echo html($stage['label']); ?></span>
</div>
<?php if (!empty($stage['mode'])) { ?>
<span class="status-pill <?php echo html($stage['mode']['class']); ?>">
<?php echo html($stage['mode']['label']); ?>
</span>
<?php } ?>
</div>
<div class="progress">
<div class="progress__track">
<div
class="progress__bar"
style="width: <?php echo clamp_percent(numeric_or_null($stage['level'])); ?>%;"
></div>
</div>
<div class="progress__label">
<span>Level</span>
<span><?php echo html(percent_label($stage['level'])); ?></span>
</div>
</div>
<div class="metric-list">
<div class="metric">
<span class="metric__label">Setpoint</span>
<span class="metric__value">
<?php echo html(format_number($stage['setpoint'])); ?>
<em><?php echo html($stage['setpointUnit']); ?></em>
</span>
</div>
<div class="metric">
<span class="metric__label">RPM</span>
<span class="metric__value">
<?php echo html(format_with_unit($stage['rpm'], 'rpm')); ?>
</span>
</div>
<div class="metric">
<span class="metric__label"><?php echo html($stage['outputLabel']); ?></span>
<span class="metric__value">
<?php echo html(format_with_unit($stage['outputValue'], $stage['outputUnit'])); ?>
</span>
</div>
</div>
</article>
<?php } ?>
</div>
<div class="mini-grid">
<?php foreach ($eastFooterMetrics as $metric) { ?>
<div class="mini-card">
<span class="mini-card__label"><?php echo html($metric['label']); ?></span>
<span class="mini-card__value"><?php echo html($metric['value']); ?></span>
</div>
<?php } ?>
</div>
</section>
<section class="section">
<header class="section__header">
<h2 class="section__title">West Tandem</h2>
<p class="section__meta">Grinding performance</p>
</header>
<div class="tandem-grid">
<?php foreach ($westStages as $stage) { ?>
<article class="stage-card">
<div class="stage-card__header">
<div class="stage-card__title">
<span class="stage-card__badge"><?php echo html($stage['stage']); ?></span>
<span><?php echo html($stage['label']); ?></span>
</div>
</div>
<div class="progress">
<div class="progress__track">
<div
class="progress__bar"
style="width: <?php echo clamp_percent(numeric_or_null($stage['level'])); ?>%;"
></div>
</div>
<div class="progress__label">
<span>Level</span>
<span><?php echo html(percent_label($stage['level'])); ?></span>
</div>
</div>
<div class="metric-list">
<div class="metric">
<span class="metric__label">RPM</span>
<span class="metric__value"><?php echo html(format_with_unit($stage['rpm'], 'rpm')); ?></span>
</div>
<div class="metric">
<span class="metric__label"><?php echo html($stage['outputLabel']); ?></span>
<span class="metric__value"><?php echo html(format_with_unit($stage['outputValue'], $stage['outputUnit'])); ?></span>
</div>
</div>
</article>
<?php } ?>
</div>
<div class="mini-grid">
<?php foreach ($westFooterMetrics as $metric) { ?>
<div class="mini-card">
<span class="mini-card__label"><?php echo html($metric['label']); ?></span>
<span class="mini-card__value"><?php echo html($metric['value']); ?></span>
</div>
<?php } ?>
</div>
</section>
<section class="section">
<header class="section__header">
<h2 class="section__title">Boilers</h2>
<p class="section__meta">Steam generation health</p>
</header>
<div class="stat-grid">
<?php foreach ($boilerOverview as $card) { ?>
<article class="stat-card">
<p class="stat-card__label"><?php echo html($card['label']); ?></p>
<p class="stat-card__value"><?php echo html($card['value']); ?></p>
<p class="stat-card__unit"><?php echo html($card['unit']); ?></p>
<?php if (!empty($card['status'])) { ?>
<p class="stat-card__note">
<span class="status-pill <?php echo html($card['status']['class']); ?>">
<?php echo html($card['status']['label']); ?>
</span>
</p>
<?php } ?>
<?php if (!empty($card['mode'])) { ?>
<p class="stat-card__note">
<span class="status-pill <?php echo html($card['mode']['class']); ?>">
<?php echo html($card['mode']['label']); ?>
</span>
</p>
<?php } ?>
</article>
<?php } ?>
</div>
<div class="mini-grid">
<?php foreach ($boilerFlows as $boiler) { ?>
<div class="mini-card">
<span class="mini-card__label"><?php echo html($boiler['label']); ?></span>
<span class="mini-card__value"><?php echo html($boiler['value']); ?> <small>kpph</small></span>
</div>
<?php } ?>
</div>
</section>
<section class="section">
<header class="section__header">
<h2 class="section__title">Tank Levels</h2>
<p class="section__meta">Percent of capacity</p>
</header>
<div class="tank-grid">
<?php foreach ($tankLevels as $tank) { ?>
<?php $state = tank_level_state($tank['value']); ?>
<article
class="tank-card"
<?php if ($state !== null) { ?>data-level="<?php echo html($state); ?>"<?php } ?>
>
<div class="tank-card__title">
<span><?php echo html($tank['label']); ?></span>
<span class="tank-card__meta"><?php echo html(percent_label($tank['value'])); ?></span>
</div>
<div class="progress">
<div class="progress__track">
<div
class="progress__bar"
style="width: <?php echo clamp_percent(numeric_or_null($tank['value'])); ?>%;"
></div>
</div>
</div>
</article>
<?php } ?>
</div>
</section>
<section class="section">
<header class="section__header">
<h2 class="section__title">Truck Dump & Tables</h2>
<p class="section__meta">Front-end preparation</p>
</header>
<div class="equipment-grid">
<article class="equipment-card">
<div class="equipment-card__title">
<span>Truck Dump</span>
<?php if ($truckDumpState !== null) { ?>
<span class="status-pill <?php echo html($truckDumpState['class']); ?>">
<?php echo html($truckDumpState['label']); ?>
</span>
<?php } ?>
</div>
<div class="equipment-card__rows">
<?php foreach ($truckDumpMetrics as $metric) { ?>
<div class="equipment-row">
<span class="equipment-row__label"><?php echo html($metric['label']); ?></span>
<span class="equipment-row__value">
<?php if (!empty($metric['status'])) { ?>
<span class="status-pill <?php echo html($metric['status']['class']); ?>">
<?php echo html($metric['status']['label']); ?>
</span>
<?php } else { ?>
<?php echo html($metric['value'] ?? '—'); ?>
<?php if (!empty($metric['suffix'])) { ?>
<small><?php echo html($metric['suffix']); ?></small>
<?php } ?>
<?php } ?>
</span>
</div>
<?php } ?>
</div>
</article>
<?php foreach ($tables as $table) { ?>
<article class="equipment-card">
<div class="equipment-card__title">
<span><?php echo html($table['label']); ?></span>
<?php if ($table['mode'] !== null) { ?>
<span class="status-pill <?php echo html($table['mode']['class']); ?>">
<?php echo html($table['mode']['label']); ?>
</span>
<?php } ?>
</div>
<div class="equipment-card__rows">
<div class="equipment-row">
<span class="equipment-row__label">PV</span>
<span class="equipment-row__value"><?php echo html($table['pv']); ?></span>
</div>
<div class="equipment-row">
<span class="equipment-row__label">Setpoint</span>
<span class="equipment-row__value">
<?php echo html($table['sp']); ?>
<small><?php echo html($table['spLabel']); ?></small>
</span>
</div>
<div class="equipment-row">
<span class="equipment-row__label">Output</span>
<span class="equipment-row__value"><?php echo html($table['output']); ?></span>
</div>
</div>
</article>
<?php } ?>
</div>
<div class="equipment-card">
<div class="equipment-card__title">
<span>Knife Train</span>
</div>
<div class="equipment-subgrid">
<?php foreach ($knives as $knife) { ?>
<div class="equipment-mini">
<div class="equipment-mini__title">
<span><?php echo html($knife['label']); ?></span>
<?php if ($knife['mode'] !== null) { ?>
<span class="status-pill <?php echo html($knife['mode']['class']); ?>">
<?php echo html($knife['mode']['label']); ?>
</span>
<?php } ?>
</div>
<div class="equipment-row">
<span class="equipment-row__label">Pressure</span>
<span class="equipment-row__value"><?php echo html($knife['pressure']); ?></span>
</div>
<div class="equipment-row">
<span class="equipment-row__label">Speed</span>
<span class="equipment-row__value"><?php echo html($knife['speed']); ?></span>
</div>
<div class="equipment-row">
<span class="equipment-row__label">Output</span>
<span class="equipment-row__value"><?php echo html($knife['output']); ?></span>
</div>
</div>
<?php } ?>
</div>
</div>
</section>
</div>
<?php // phpcs:enable ?>

View File

@@ -0,0 +1,109 @@
<?php
declare(strict_types=1);
// phpcs:disable
function module_numeric($value): ?float
{
if ($value === null) {
return null;
}
if (is_numeric($value)) {
return (float) $value;
}
$normalised = str_replace([',', ' '], '', (string) $value);
$normalised = preg_replace('/[^0-9.\-]/', '', $normalised ?? '');
if ($normalised === '' || !is_numeric($normalised)) {
return null;
}
return (float) $normalised;
}
function module_number($value, int $decimals = 0, string $placeholder = '—'): string
{
$numeric = module_numeric($value);
return $numeric === null ? $placeholder : number_format($numeric, $decimals);
}
function module_with_unit($value, string $unit, int $decimals = 0, string $placeholder = '—'): string
{
$formatted = module_number($value, $decimals, $placeholder);
return $formatted === $placeholder ? $formatted : $formatted . ' ' . $unit;
}
function module_percent($value, int $decimals = 0, string $placeholder = '—'): string
{
$numeric = module_numeric($value);
if ($numeric === null) {
return $placeholder;
}
return number_format($numeric, $decimals) . '%';
}
function module_clamp_percent($value): float
{
$numeric = module_numeric($value);
if ($numeric === null) {
return 0.0;
}
return max(0.0, min(100.0, $numeric));
}
function module_status(string $label, string $class): string
{
return '<span class="module-pill ' . htmlspecialchars($class, ENT_QUOTES, 'UTF-8') . '">' .
htmlspecialchars($label, ENT_QUOTES, 'UTF-8') .
'</span>';
}
function module_html(string $value): string
{
return htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
}
function module_wrap(string $content, string $class): string
{
return '<div class="' . module_html($class) . '">' . $content . '</div>';
}
function module_if(bool $condition, callable $callback): string
{
return $condition ? (string) $callback() : '';
}
function module_non_empty(?string $value, string $fallback = '—'): string
{
return $value === null || $value === '' ? $fallback : $value;
}
function module_capture(string $path): string
{
ob_start();
include $path;
return trim((string) ob_get_clean());
}
function module_mode(?int $value, int $autoValue = 1, string $fallback = '—'): string
{
if ($value === null) {
return $fallback;
}
$isAuto = (int) $value === $autoValue;
$label = $isAuto ? 'Auto' : 'Manual';
$class = $isAuto ? 'module-pill--success' : 'module-pill--warn';
return module_status($label, $class);
}
// phpcs:enable

View File

@@ -1,78 +1,89 @@
<?php
include("../includes/items.php");
// phpcs:ignoreFile
declare(strict_types=1);
include __DIR__ . '/../../items.php';
require_once __DIR__ . '/module-helpers.php';
$caneToday = module_numeric(module_capture(__DIR__ . '/tonsin.php')) ?? 0.0;
$recordDate = module_capture(__DIR__ . '/recorddate.php');
$recordTonnage = module_numeric(module_capture(__DIR__ . '/record.php')) ?? 0.0;
$runHours = module_numeric($value['RUNHRSTODAY']);
$groundToday = (module_numeric($value['CANETOT']) ?? 0.0) + (module_numeric($value['W TONS GROUND']) ?? 0.0);
$groundYesterday = (module_numeric($value['PREVTONS']) ?? 0.0) + (module_numeric($value['WPREVGROUND']) ?? 0.0);
$prevRunHours = module_numeric($value['PREVTIME']);
$eastAvg = module_numeric($value['AVG_TONS_PER_HOUR']);
$westAvg = module_numeric(module_capture(__DIR__ . '/west15minavg.php'));
$totalTph = (module_numeric($value['TONS_PER_HOUR']) ?? 0.0) + (module_numeric($value['RATE']) ?? 0.0);
$lossTime = module_numeric($value['LOSSTIME']);
?>
<table class="tftable1">
<section class="module-card module-card--tight">
<div class="module-heading">
<h2 class="module-heading__title">General Data</h2>
<span class="module-heading__meta">Live production snapshot</span>
</div>
<!-- ****************************************** ROW START ******************************************** -->
<div class="module-metric-grid">
<div class="module-metric">
<span class="module-metric__label">Cane In Today</span>
<span class="module-metric__value"><?php echo module_number($caneToday); ?></span>
<span class="module-metric__note">tons</span>
</div>
<div class="module-metric">
<span class="module-metric__label">Daily Record</span>
<span class="module-metric__value"><?php echo module_number($recordTonnage); ?></span>
<span class="module-metric__note"><?php echo module_html($recordDate); ?></span>
</div>
<div class="module-metric">
<span class="module-metric__label">Run Hours</span>
<span class="module-metric__value"><?php echo module_number($runHours, 1); ?></span>
<span class="module-metric__note">hours</span>
</div>
</div>
<tr>
<td bgcolor="#2E2E2E" colspan=""><font color="#e0e0e0">Cane In Today:</font></td>
<td bgcolor="#2E2E2E" align="right"><font color="00FF00"><b><?php include("../includes/tonsin.php");?></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Tons</font></td>
<div class="module-metric-grid">
<div class="module-metric">
<span class="module-metric__label">Ground Today</span>
<span class="module-metric__value"><?php echo module_number($groundToday); ?></span>
<span class="module-metric__note">tons</span>
</div>
<div class="module-metric">
<span class="module-metric__label">Total Ground Yesterday</span>
<span class="module-metric__value"><?php echo module_number($groundYesterday); ?></span>
<span class="module-metric__note">tons</span>
</div>
<div class="module-metric">
<span class="module-metric__label">Prev Run Hours</span>
<span class="module-metric__value"><?php echo module_number($prevRunHours, 1); ?></span>
<span class="module-metric__note">hours</span>
</div>
</div>
<td colspan=""><font color="#e0e0e0">Record On:<font size="" color="0eb31d"><b><?php include("../includes/recorddate.php");?></font></font></td>
<td align="right"><font color="00FF00"><b><?php include("../includes/record.php");?></b></font></td>
<td><font color="#e0e0e0">Tons</font></td>
<div class="module-divider"></div>
<td bgcolor="#2E2E2E" colspan=""><font color="#e0e0e0">Run Hours:</font></td>
<td bgcolor="#2E2E2E" align="right"><font color="00FF00"><b><?php echo $value['RUNHRSTODAY']; ?></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Hours</font></td>
</tr>
<div class="module-row">
<span class="module-row__label">Total Tons per Hour</span>
<span class="module-row__value"><?php echo module_number($totalTph, 1); ?></span>
</div>
<!-- ****************************************** ROW END ******************************************** -->
<!-- ****************************************** ROW START ******************************************** -->
<tr>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Ground Today:</font></td>
<td bgcolor="#2E2E2E" align="right"><font color="00FF00"><b><?php echo ($value['CANETOT'] + $value['W TONS GROUND']); ?></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Tons</font></td>
<td colspan=""><font color="#e0e0e0">Total Ground Yesterday:</font></td>
<td align="right"><font color="00FF00"><b><?php echo ($value['PREVTONS'] + $value['WPREVGROUND']); ?></b></font></td>
<td><font color="#e0e0e0">Tons</font></td>
<td bgcolor="#2E2E2E" colspan=""><font color="#e0e0e0">Prev Run Hours:</font></td>
<td bgcolor="#2E2E2E" align="right"><font color="00FF00"><b><?php echo $value['PREVTIME']; ?></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Hours</font></td>
</tr>
<!-- ****************************************** ROW END ******************************************** -->
<!-- ****************************************** ROW START ******************************************** -->
<tr>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">E 15 Min Avg:</font></td>
<td bgcolor="#2E2E2E" align="right"><font color="00FF00"><b><?php echo $value['AVG_TONS_PER_HOUR']; ?></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Tons</font></td>
<td rowspan="2" colspan="" align="center" id="generalTPH"><font color="#e0e0e0">Total Tons/Hr:</font></td>
<td rowspan="2" colspan="2" align="center" id="generalTPH"><font color="00FFFF"><b><?php echo ($ID['00560'] + $value['RATE']); ?></b></font></td>
<td bgcolor="#2E2E2E" colspan=""><font color="#e0e0e0">Today's Loss Time:</font></td>
<td bgcolor="#2E2E2E" align="right" id="lsp"><font color="00FF00"><b><?php echo $value['LOSSTIME']; ?></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Hours</font></td>
</tr>
<!-- ****************************************** ROW END ******************************************** -->
<!-- ****************************************** ROW START ******************************************** -->
<tr>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">W 15 Min Avg:</font></td>
<td bgcolor="#2E2E2E" align="right"><font color="00FF00"><b><?php include("../includes/west15minavg.php");?></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Tons</font></td>
<td bgcolor="#2E2E2E" colspan=""><font color="#e0e0e0"></font></td>
<td bgcolor="#2E2E2E" colspan="2" align="right" id="lsp"><font color="00FF00"><b></b></font></td>
</tr>
<!-- ****************************************** ROW END ******************************************** -->
</table>
<!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF PAGE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -->
<div class="module-metric-grid">
<div class="module-metric">
<span class="module-metric__label">East 15 Min Avg</span>
<span class="module-metric__value"><?php echo module_number($eastAvg, 1); ?></span>
<span class="module-metric__note">tons/hr</span>
</div>
<div class="module-metric">
<span class="module-metric__label">West 15 Min Avg</span>
<span class="module-metric__value"><?php echo module_number($westAvg, 1); ?></span>
<span class="module-metric__note">tons/hr</span>
</div>
<div class="module-metric">
<span class="module-metric__label">Today's Loss Time</span>
<span class="module-metric__value"><?php echo module_number($lossTime, 2); ?></span>
<span class="module-metric__note">hours</span>
</div>
</div>
</section>

View File

@@ -1,125 +1,155 @@
<?php
include("../includes/items.php");
// phpcs:ignoreFile
declare(strict_types=1);
include __DIR__ . '/../../items.php';
require_once __DIR__ . '/module-helpers.php';
$caneToday = module_numeric(module_capture(__DIR__ . '/tonsin.php')) ?? 0.0;
$recordDate = module_capture(__DIR__ . '/recorddate.php');
$recordTonnage = module_numeric(module_capture(__DIR__ . '/record.php')) ?? 0.0;
$runHours = module_numeric($value['RUNHRSTODAY']);
$groundToday = (module_numeric($value['CANETOT']) ?? 0.0) + (module_numeric($value['W TONS GROUND']) ?? 0.0);
$groundYesterday = (module_numeric($value['PREVTONS']) ?? 0.0) + (module_numeric($value['WPREVGROUND']) ?? 0.0);
$prevRunHours = module_numeric($value['PREVTIME']);
$eastAvg = module_numeric($value['AVG_TONS_PER_HOUR']);
$westAvg = module_numeric($value['New Mill Avg1']);
$totalTph = (module_numeric($value['TONS_PER_HOUR']) ?? 0.0) + (module_numeric($value['RATE']) ?? 0.0);
$lossTime = module_numeric($value['LOSSTIME']);
$steamFlow = 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 = (int) ($value['ExhaustAM'] ?? 0);
$exhaustModeLabel = $exhaustMode === 0 ? 'Auto' : 'Manual';
$exhaustModeClass = $exhaustMode === 0 ? 'module-pill--success' : 'module-pill--warn';
$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']);
?>
<table class="tftable1">
<!-- ****************************************** ROW START ******************************************** -->
<section class="module-card module-card--tight">
<div class="module-heading">
<h2 class="module-heading__title">General &amp; Steam Data</h2>
<span class="module-heading__meta">Throughput with live steam signals</span>
</div>
<tr>
<td bgcolor="#2E2E2E" colspan=""><font color="#e0e0e0">Cane In Today:</font></td>
<td bgcolor="#2E2E2E" align="right"><font color="00FF00"><b><?php include("../includes/tonsin.php");?></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Tons</font></td>
<div class="module-grid module-grid--two">
<div class="module-stack">
<div class="module-metric-grid">
<div class="module-metric">
<span class="module-metric__label">Cane In Today</span>
<span class="module-metric__value"><?php echo module_number($caneToday); ?></span>
<span class="module-metric__note">tons</span>
</div>
<div class="module-metric">
<span class="module-metric__label">Daily Record</span>
<span class="module-metric__value"><?php echo module_number($recordTonnage); ?></span>
<span class="module-metric__note"><?php echo module_html($recordDate); ?></span>
</div>
<div class="module-metric">
<span class="module-metric__label">Run Hours</span>
<span class="module-metric__value"><?php echo module_number($runHours, 1); ?></span>
<span class="module-metric__note">hours</span>
</div>
</div>
<td colspan=""><font color="#e0e0e0">Record On:<font size="" color="0eb31d"><b><?php include("../includes/recorddate.php");?></font></font></td>
<td align="right"><font color="00FF00"><b><?php include("../includes/record.php");?></b></font></td>
<td><font color="#e0e0e0">Tons</font></td>
<div class="module-metric-grid">
<div class="module-metric">
<span class="module-metric__label">Ground Today</span>
<span class="module-metric__value"><?php echo module_number($groundToday); ?></span>
<span class="module-metric__note">tons</span>
</div>
<div class="module-metric">
<span class="module-metric__label">Total Ground Yesterday</span>
<span class="module-metric__value"><?php echo module_number($groundYesterday); ?></span>
<span class="module-metric__note">tons</span>
</div>
<div class="module-metric">
<span class="module-metric__label">Prev Run Hours</span>
<span class="module-metric__value"><?php echo module_number($prevRunHours, 1); ?></span>
<span class="module-metric__note">hours</span>
</div>
</div>
<td bgcolor="#2E2E2E" colspan=""><font color="#e0e0e0">Run Hours:</font></td>
<td bgcolor="#2E2E2E" align="right"><font color="00FF00"><b><?php echo $value['RUNHRSTODAY']; ?></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Hours</font></td>
</tr>
<div class="module-divider"></div>
<!-- ****************************************** ROW END ******************************************** -->
<div class="module-row">
<span class="module-row__label">Total Tons per Hour</span>
<span class="module-row__value"><?php echo module_number($totalTph, 1); ?></span>
</div>
<!-- ****************************************** ROW START ******************************************** -->
<div class="module-metric-grid">
<div class="module-metric">
<span class="module-metric__label">East 15 Min Avg</span>
<span class="module-metric__value"><?php echo module_number($eastAvg, 1); ?></span>
<span class="module-metric__note">tons/hr</span>
</div>
<div class="module-metric">
<span class="module-metric__label">West 15 Min Avg</span>
<span class="module-metric__value"><?php echo module_number($westAvg, 1); ?></span>
<span class="module-metric__note">tons/hr</span>
</div>
<div class="module-metric">
<span class="module-metric__label">Today's Loss Time</span>
<span class="module-metric__value"><?php echo module_number($lossTime, 2); ?></span>
<span class="module-metric__note">hours</span>
</div>
</div>
</div>
<tr>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Ground Today:</font></td>
<td bgcolor="#2E2E2E" align="right"><font color="00FF00"><b><?php echo ($value['CANETOT'] + $value['W TONS GROUND']); ?></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Tons</font></td>
<div class="module-stack">
<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($steamFlow); ?></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>
<td colspan=""><font color="#e0e0e0">Total Ground Yesterday:</font></td>
<td align="right"><font color="00FF00"><b><?php echo ($value['PREVTONS'] + $value['WPREVGROUND']); ?></b></font></td>
<td><font color="#e0e0e0">Tons</font></td>
<td bgcolor="#2E2E2E" colspan=""><font color="#e0e0e0">Prev Run Hours:</font></td>
<td bgcolor="#2E2E2E" align="right"><font color="00FF00"><b><?php echo $value['PREVTIME']; ?></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Hours</font></td>
</tr>
<!-- ****************************************** ROW END ******************************************** -->
<!-- ****************************************** ROW START ******************************************** -->
<tr>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">E 15 Min Avg:</font></td>
<td bgcolor="#2E2E2E" align="right"><font color="00FF00"><b><?php echo $value['AVG_TONS_PER_HOUR']; ?></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Tons</font></td>
<td rowspan="2" colspan="" align="center" id="generalTPH"><font color="#e0e0e0">Total Tons/Hr:</font></td>
<td rowspan="2" colspan="2" align="center" id="generalTPH"><font color="00FFFF"><b><?php echo ($ID['00560'] + $value['RATE']); ?></b></font></td>
<td bgcolor="#2E2E2E" colspan=""><font color="#e0e0e0">Today's Loss Time:</font></td>
<td bgcolor="#2E2E2E" align="right" id="lsp"><font color="00FF00"><b><?php echo $value['LOSSTIME']; ?></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Hours</font></td>
</tr>
<!-- ****************************************** ROW END ******************************************** -->
<!-- ****************************************** ROW START ******************************************** -->
<tr>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">W 15 Min Avg:</font></td>
<td bgcolor="#2E2E2E" align="right"><font color="00FF00"><b><?php echo $value['New Mill Avg1']; ?></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Tons</font></td>
<td bgcolor="#2E2E2E" colspan=""><font color="#e0e0e0"></font></td>
<td bgcolor="#2E2E2E" colspan="2" align="right" id="lsp"><font color="00FF00"><b></b></font></td>
</tr>
<!-- ****************************************** ROW END ******************************************** -->
</table>
<table class="tftable1">
<tr>
<td bgcolor="#2E2E2E" colspan="2"><font color="#e0e0e0">Total Steam Flow:</font></td>
<td bgcolor="#2E2E2E" align="right" width="75"><font color="00FF00"><b><?php echo round(($value['TTL_STEAMFLOW2']),0); ?></b></font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Kpph</font></td>
<td colspan="2"><font color="#e0e0e0">Live Steam Pressure:</font></td>
<?php
$color = "#FFFFFF";
if (($value['PT_001'] >= 0) && ($value['PT_001'] <= 155))
$color = "#FF0000";
else if (($value['PT_001'] >= 156) && ($value['PT_001'] <= 165))
$color = "#FFFF00";
else if ($value['PT_001'] >= 165)
$color = "#00FF00";
echo "<td align=\"right\" width=\"75\"><font color=\"$color\"><b>". $value['PT_001'] ."</b></font></td>";
?>
<td><font color="#e0e0e0">PSI</font></td>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">Exhaust Pressure:</font></td>
<?php
if ($value['ExhaustAM'] == 0)
echo "<td align=\"center\" bgcolor=\"#0B3B17\"><font color=\"#e0e0e0\">A</font></td>";
if ($value['ExhaustAM'] == 1)
echo "<td bgcolor=\"#2E2E2E\" align=\"center\" bgcolor=\"#8A0808\"><font color=\"#e0e0e0\">M</font></td>";
?>
<?php
$color = "#FFFFFF";
if (($ID['00302'] >= 0) && ($ID['00302'] <= 9))
$color = "#FF0000";
else if (($ID['00302'] >= 6) && ($ID['00302'] <= 13))
$color = "#FFFF00";
else if ($ID['00302'] >= 14)
$color = "#00FF00";
echo "<td bgcolor=\"#2E2E2E\" align=\"right\" width=\"75\"><font color=\"$color\"><b>". $ID['00302'] ."</b></font></td>";
?>
<td bgcolor="#2E2E2E"><font color="#e0e0e0">PSI</font></td>
<td colspan="2"><font color="#e0e0e0">Vapor Header Pressure:</font></td>
<td align="right" width="75" id="lsp"><font color="00FF00"><b><?php echo $value['VAPOR HDR PRES']; ?></b></font></td>
<td><font color="#e0e0e0">PSI</font></td>
</tr>
</table>
<!-- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF PAGE ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -->
<div class="module-row">
<span class="module-row__label">Exhaust Control</span>
<div class="module-row__value"><?php echo module_status($exhaustModeLabel, $exhaustModeClass); ?></div>
</div>
</div>
</div>
</section>

View File

@@ -1,521 +1,261 @@
<?php
// phpcs:ignoreFile
declare(strict_types=1);
$configuredBaseUrl = getenv('LASUCA_FEED_URL');
include __DIR__ . '/../../items.php';
require_once __DIR__ . '/module-helpers.php';
$roundedid = [];
$rounded = [];
$rounded1 = [];
$ID = [];
$value = [];
$eastMillMode = module_mode(isset($value['MILL1AUTOMAN']) ? (int) $value['MILL1AUTOMAN'] : null, 0);
$eastMillRows = [
[
'stage' => '1',
'level' => module_numeric($value['MILL1LVLPV']),
'sp' => module_numeric($value['MILL1SP']),
'rpm' => module_numeric($value['EMILL1RPM']),
'metric' => 'MCC FPM',
'metric_value' => module_numeric($value['MAINSPD']),
'metric_unit' => 'fpm',
],
[
'stage' => '2',
'level' => module_numeric($value['M2LVL']),
'sp' => module_numeric($value['MILL2SP']),
'rpm' => module_numeric($value['EMILL2RPM']),
'metric' => 'MCC Output',
'metric_value' => module_numeric($value['MCCOUTPUT']),
'metric_unit' => '%',
],
[
'stage' => '3',
'level' => module_numeric($value['MIL3LVL']),
'sp' => module_numeric($value['MILL3SP']),
'rpm' => module_numeric($value['EMILL3RPM']),
'metric' => 'MCC Tons',
'metric_value' => module_numeric($rounded1['MCCTONS'] ?? null),
'metric_unit' => 'tons',
],
[
'stage' => '4',
'level' => module_numeric($value['MIL4LVL']),
'sp' => module_numeric($value['MILL4SP']),
'rpm' => module_numeric($value['EMILL4RPM']),
'metric' => 'Mill 1 SP',
'metric_value' => module_numeric($value['WEIGHT_WSP']),
'metric_unit' => ($value['LEVEL_THROUGHPUT_SWITCH'] ?? 0) == 1 ? 'tons/hr' : '%',
'mode' => module_mode(isset($value['MILL1AUTOMAN1']) ? (int) $value['MILL1AUTOMAN1'] : null, 1),
],
[
'stage' => '5',
'level' => module_numeric($value['MIL5LVL']),
'sp' => module_numeric($value['MILL5SP']),
'rpm' => module_numeric($value['EMILL5RPM']),
'metric' => 'Grinding Rate',
'metric_value' => module_numeric($value['TONS_PER_HOUR']),
'metric_unit' => 'tons/hr',
],
[
'stage' => '6',
'level' => module_numeric($value['MIL6LVL']),
'sp' => module_numeric($value['MILL6SP']),
'rpm' => module_numeric($value['EMILL6RPM']),
'metric' => 'Average Rate',
'metric_value' => module_numeric($value['AVG_TONS_PER_HOUR']),
'metric_unit' => 'tons/15 min',
],
];
$endpointDataLoaded = false;
$endpointErrorMessage = null;
$eastImbibition = [
[
'label' => 'Imbibition 6',
'value' => module_numeric($value['IMBFLOW']),
'unit' => 'gpm',
'sp_label' => 'Imbibition 6 SP',
'sp_value' => module_numeric($value['IMBSP']),
],
[
'label' => 'Imbibition 5',
'value' => module_numeric($value['IMBFLOW']),
'unit' => 'gpm',
'sp_label' => 'Imbibition 5 SP',
'sp_value' => module_numeric($value['IMB5SP']),
],
];
try {
if ($configuredBaseUrl !== false && $configuredBaseUrl !== '') {
$baseUrl = rtrim($configuredBaseUrl, '/');
} else {
$baseUrl = 'https://192.168.0.10';
}
$westAverage = module_numeric(module_capture(__DIR__ . '/west15minavg.php'));
$westRows = [
[
'stage' => '1',
'level' => module_numeric($ID['00654'] ?? null),
'sp' => null,
'rpm' => module_numeric($ID['00666'] ?? null),
'metric' => 'MCC FPM',
'metric_value' => module_numeric($value['Feet/Minute'] ?? null),
'metric_unit' => 'fpm',
],
[
'stage' => '2',
'level' => module_numeric($ID['00656'] ?? null),
'sp' => null,
'rpm' => module_numeric($ID['00670'] ?? null),
'metric' => 'MCC Output',
'metric_value' => module_numeric($ID['00638'] ?? null),
'metric_unit' => '%',
],
[
'stage' => '3',
'level' => module_numeric($ID['00657'] ?? null),
'sp' => null,
'rpm' => module_numeric($ID['00672'] ?? null),
'metric' => 'MCC Tons',
'metric_value' => module_numeric($ID['00640'] ?? null),
'metric_unit' => 'tons',
],
[
'stage' => '4',
'level' => module_numeric($ID['00658'] ?? null),
'sp' => null,
'rpm' => module_numeric($ID['00674'] ?? null),
'metric' => 'Mill 1 SP',
'metric_value' => module_numeric($ID['00642'] ?? null),
'metric_unit' => '%',
],
[
'stage' => '5',
'level' => module_numeric($ID['00660'] ?? null),
'sp' => null,
'rpm' => module_numeric($ID['00680'] ?? null),
'metric' => 'Grinding Rate',
'metric_value' => module_numeric($value['RATE'] ?? null),
'metric_unit' => 'tons/hr',
],
[
'stage' => '—',
'level' => null,
'sp' => null,
'rpm' => null,
'metric' => 'Average Rate',
'metric_value' => $westAverage,
'metric_unit' => 'tons/15 min',
],
];
$endpointUrl = rtrim($baseUrl, '/') . '/shared-endpoint/public/index.php';
$scheme = parse_url($endpointUrl, PHP_URL_SCHEME) ?: 'http';
$context = null;
if (strcasecmp($scheme, 'https') === 0) {
$host = parse_url($endpointUrl, PHP_URL_HOST) ?: 'localhost';
if (in_array($host, ['localhost', '127.0.0.1', '192.168.0.10'], true)) {
$context = stream_context_create([
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
],
]);
}
}
$response = @file_get_contents($endpointUrl, false, $context ?: null);
if ($response === false && strcasecmp($scheme, 'https') === 0) {
$fallbackUrl = preg_replace('#^https#i', 'http', $endpointUrl);
$response = @file_get_contents($fallbackUrl);
if ($response !== false) {
$endpointUrl = $fallbackUrl;
}
}
if ($response === false) {
throw new RuntimeException('Unable to reach shared endpoint: ' . $endpointUrl);
}
try {
$payload = json_decode($response, true, flags: JSON_THROW_ON_ERROR);
} catch (JsonException $exception) {
throw new RuntimeException('Malformed JSON from shared endpoint', 0, $exception);
}
if (($payload['status'] ?? null) !== 'ok') {
$message = $payload['message'] ?? 'unknown error';
throw new RuntimeException('Shared endpoint returned an error: ' . $message);
}
if (!isset($payload['items']) || !is_array($payload['items'])) {
$snippet = substr(strip_tags($response), 0, 200);
throw new RuntimeException('Shared endpoint response missing items. Snippet: ' . $snippet);
}
foreach ($payload['items'] as $item) {
$tagKey = str_pad((string) $item['tagId'], 5, '0', STR_PAD_LEFT);
$value[$item['name']] = $item['value'];
$rounded[$item['name']] = $item['rounded1'];
$rounded1[$item['name']] = $item['rounded2'];
$roundedid[$tagKey] = $item['rounded2'];
$ID[$tagKey] = $item['value'];
}
$endpointDataLoaded = true;
} catch (Throwable $exception) {
$endpointErrorMessage = $exception->getMessage();
error_log('Milling shared endpoint failed: ' . $endpointErrorMessage);
}
$dataSourceLabel = 'Shared endpoint';
if (!$endpointDataLoaded) {
require __DIR__ . '/../items.php';
require __DIR__ . '/../items2dec.php';
$dataSourceLabel = 'Legacy items.php data';
}
// Helper function for rendering data rows
function renderDataRow($label, $value, $unit = "") {
$safeValue = htmlspecialchars($value);
return "<tr>
<td id=\"vtitle\">$label</td>
<td id=\"sum-count\">$safeValue</td>
<td id=\"vtitle\">$unit</td>
</tr>";
}
$westImbibition = module_numeric($ID['00624'] ?? null);
?>
<?php
//if ($value['BC09ONOFF'] == 0) {
//$grindingrate=$value['WTONSHR'];
//}
//else if ($value['BC09ONOFF'] == 1) {
//$grindingrate="0";
//}
?>
<table width="100%">
<tr>
<td width="50%">
<table class="tftable2">
<tr>
<td width="50%" align="center" colspan="5" border="0">
<font color="#00BFFF"><i>EAST MILL TANDEM</i></font>
</td>
</tr>
<section class="module-card">
<div class="module-heading">
<h2 class="module-heading__title">Mill Tandems</h2>
<span class="module-heading__meta">East &amp; West tandem performance</span>
</div>
<div class="module-grid module-grid--two">
<div class="module-stack">
<div class="module-tag">East Tandem</div>
<div class="module-row">
<span class="module-row__label">Mill 1 Output</span>
<span class="module-row__value"><?php echo module_number($value['MILL1OUTPUT'] ?? null); ?>%</span>
</div>
<div class="module-row">
<span class="module-row__label">Control Mode</span>
<div class="module-row__value"><?php echo $eastMillMode; ?></div>
</div>
<table class="module-table module-table--tight">
<thead>
<tr>
<th>Mill</th>
<th>Level</th>
<th>SP</th>
<th>RPM</th>
<th>Metric</th>
<th>Value</th>
<th>Units</th>
<th>Mode</th>
</tr>
</thead>
<tbody>
<?php foreach ($eastMillRows as $row) : ?>
<tr>
<td><?php echo module_html($row['stage']); ?></td>
<td>
<div class="module-progress">
<div class="module-bar">
<div class="module-bar__fill" style="width: <?php echo module_clamp_percent($row['level'] ?? 0); ?>%;"></div>
</div>
<span class="module-notes"><?php echo module_number($row['level'], 0); ?>%</span>
</div>
</td>
<td class="module-table__number"><?php echo module_number($row['sp'], 0); ?></td>
<td class="module-table__number"><?php echo module_number($row['rpm'], 0); ?></td>
<td><?php echo module_html($row['metric']); ?></td>
<td class="module-table__number"><?php echo module_number($row['metric_value'], 1); ?></td>
<td><?php echo module_html(strtoupper($row['metric_unit'])); ?></td>
<td>
<?php echo $row['mode'] ?? '—'; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<table class="tftableEAST">
<tr>
<td align="center">
<font color="#e0e0e0"></font>
</td>
<td align="center">
<font color="#e0e0e0">Level</font>
</td>
<td align="center">
<font color="#e0e0e0">SP</font>
</td>
<td align="center">
<font color="#e0e0e0">RPM</font>
</td>
<td align="left" colspan="1">
<font color="#e0e0e0">Mill 1 OP</font>
</td>
<td align="right">
<font color="#00FF00"><?php echo $value['MILL1OUTPUT']; ?></font>
</td>
<td align="left" colspan="1">
<font color="#e0e0e0">%</font>
</td>
<?php
if ($value['MILL1AUTOMAN'] == 0) {
echo "<td colspan=\"1\" align=\"center\" bgcolor=\"#0B3B17\"><font color=\"#e0e0e0\">A</font></td>";
}
if ($value['MILL1AUTOMAN'] == 1) {
echo "<td colspan=\"1\" align=\"center\" bgcolor=\"#8A0808\"><font color=\"#e0e0e0\">M</font></td>";
}
?>
</tr>
<div class="module-divider"></div>
<tr>
<td bgcolor="#0B3B17" align="center">
<font color="#e0e0e0">1</font>
</td>
<td bgcolor="#0B3B17" align="left"><progress id="progressmills" data-label="<?php echo $value['MILL1LVLPV']; ?>%" max="100" value="<?php echo $value['MILL1LVLPV']; ?>"></progress></td>
<td bgcolor="#0B3B17" align="center">
<font color="#e0e0e0"><?php echo $value['MILL1SP']; ?></font>
</td>
<td bgcolor="#0B3B17" align="center">
<font color="#00FF00"><?php echo $value['EMILL1RPM']; ?></font>
</td>
<td align="left" colspan="1">
<font color="#e0e0e0">MCC FPM</font>
</td>
<td align="right">
<font color="#00FF00"><?php echo $value['MAINSPD']; ?></font>
</td>
<td colspan="2" align="left">
<font color="#e0e0e0">FPM</font>
</td>
<?php foreach ($eastImbibition as $imb) : ?>
<div class="module-row">
<span class="module-row__label"><?php echo module_html($imb['label']); ?></span>
<span class="module-row__value"><?php echo module_number($imb['value'], 0); ?> <?php echo module_html(strtoupper($imb['unit'])); ?></span>
</div>
<div class="module-row">
<span class="module-row__label"><?php echo module_html($imb['sp_label']); ?></span>
<span class="module-row__value"><?php echo module_number($imb['sp_value'], 0); ?> <?php echo module_html(strtoupper($imb['unit'])); ?></span>
</div>
<?php endforeach; ?>
</div>
</tr>
<tr>
<td bgcolor="#D7DF01" align="center">
<font color="#000000">2</font>
</td>
<td bgcolor="#D7DF01" align="left"><progress id="progressmills" data-label="<?php echo $value['M2LVL']; ?>%" max="100" value="<?php echo $value['M2LVL']; ?>"></progress></td>
<td bgcolor="#D7DF01" align="center">
<font color="#ffffff"><?php echo $value['MILL2SP']; ?></font>
</td>
<td bgcolor="#D7DF01" align="center">
<font color="#298A08"><?php echo $value['EMILL2RPM']; ?></font>
</td>
<td align="left" colspan="1">
<font color="#e0e0e0">MCC Output</font>
</td>
<td align="right">
<font color="#00FF00"><?php echo $value['MCCOUTPUT']; ?></font>
</td>
<td colspan="2" align="left">
<font color="#e0e0e0">%</font>
</td>
</tr>
<tr>
<td bgcolor="#04B404" align="center">
<font color="#e0e0e0">3</font>
</td>
<td bgcolor="#04B404" align="left"><progress id="progressmills" data-label="<?php echo $value['MIL3LVL']; ?>%" max="100" value="<?php echo $value['MIL3LVL']; ?>"></progress></td>
<td bgcolor="#04B404" align="center">
<font color="#e0e0e0"><?php echo $value['MILL3SP']; ?></font>
</td>
<td bgcolor="#04B404" align="center">
<font color="#29522b"><?php echo $value['EMILL3RPM']; ?></font>
</td>
<td align="left" colspan="1">
<font color="#e0e0e0">MCC Tons</font>
</td>
<td align="right">
<font color="#00FF00"><?php echo $rounded1['MCCTONS']; ?></font>
</td>
<td colspan="2" align="left">
<font color="#e0e0e0">Tons</font>
</td>
</tr>
<tr>
<td bgcolor="#DF7401" align="center">
<font color="#e0e0e0">4</font>
</td>
<td bgcolor="#DF7401" align="left"><progress id="progressmills" data-label="<?php echo $value['MIL4LVL']; ?>%" max="100" value="<?php echo $value['MIL4LVL']; ?>"></progress></td>
<td bgcolor="#DF7401" align="center">
<font color="#e0e0e0"><?php echo $value['MILL4SP']; ?></font>
</td>
<td bgcolor="#DF7401" align="center">
<font color="#00FF00"><?php echo $value['EMILL4RPM']; ?></font>
</td>
<td colspan="1" align="left">
<font color="#e0e0e0">Mill 1 SP</font>
</td>
<?php
if ($value['LEVEL_THROUGHPUT_SWITCH'] == 1) {
echo "<td align=\"right\"><font color=\"00FF00\"><b> " . $value['WEIGHT_WSP'] . " </b></font></td>";
}
if ($value['LEVEL_THROUGHPUT_SWITCH'] == 0) {
echo "<td align=\"right\"><font color=\"00FF00\"><b> " . $value['WEIGHT_WSP'] . " </b></font></td>";
}
?>
<?php
if ($value['LEVEL_THROUGHPUT_SWITCH'] == 1) {
echo "<td colspan=\"1\"><font color=\"#e0e0e0\">Tons/Hr</font></td>";
}
if ($value['LEVEL_THROUGHPUT_SWITCH'] == 0) {
echo "<td colspan=\"1\"><font color=\"#e0e0e0\">%</font></td>";
}
?>
<?php
if ($value['MILL1AUTOMAN1'] == 1) {
echo "<td colspan=\"1\" align=\"center\" bgcolor=\"#0B3B17\"><font color=\"#e0e0e0\">A</font></td>";
}
if ($value['MILL1AUTOMAN1'] == 0) {
echo "<td colspan=\"1\" align=\"center\" bgcolor=\"#8A0808\"><font color=\"#e0e0e0\">M</font></td>";
}
?>
</tr>
<tr>
<td bgcolor="#5858FA" align="center">
<font color="#e0e0e0">5</font>
</td>
<td bgcolor="#5858FA" align="left"><progress id="progressmills" data-label="<?php echo $value['MIL5LVL']; ?>%" max="100" value="<?php echo $value['MIL5LVL']; ?>"></progress></td>
<td bgcolor="#5858FA" align="center">
<font color="#e0e0e0"><?php echo $value['MILL5SP']; ?></font>
</td>
<td bgcolor="#5858FA" align="center">
<font color="#00FF00"><?php echo $value['EMILL5RPM']; ?></font>
</td>
<td align="left" colspan="1">
<font color="#e0e0e0">Grinding Rate</font>
</td>
<td align="right">
<font color="#00FF00"><?php echo $ID['00560']; ?></font>
</td>
<td colspan="2" align="left">
<font color="#e0e0e0">Tons/Hr</font>
</td>
</tr>
<tr>
<td bgcolor="#8A0808" align="center">
<font color="#e0e0e0">6</font>
</td>
<td bgcolor="#8A0808" align="left"><progress id="progressmills" data-label="<?php echo $value['MIL6LVL']; ?>%" max="100" value="<?php echo $value['MIL6LVL']; ?>"></progress></td>
<td bgcolor="#8A0808" align="center">
<font color="#e0e0e0"><?php echo $value['MILL6SP']; ?></font>
</td>
<td bgcolor="#8A0808" align="center">
<font color="#00FF00"><?php echo $value['EMILL6RPM']; ?></font>
</td>
<td align="left" colspan="1">
<font color="#e0e0e0">Average Rate</font>
</td>
<td align="right">
<font color="#00FF00"><?php echo $value['AVG_TONS_PER_HOUR']; ?></font>
</td>
<td colspan="2" align="left">
<font color="#e0e0e0">Tons/15/Min</font>
</td>
<div class="module-stack">
<div class="module-tag">West Tandem</div>
</tr>
<tr>
<td bgcolor="#2E2E2E" colspan="2">
<font color="#e0e0e0">Imibition 6:</font>
</td>
<td bgcolor="#2E2E2E" align="right" id="lsp">
<font color="00FF00"><b><?php echo $value['IMB6Flow']; ?></b></font>
</td>
<td bgcolor="#2E2E2E">
<font color="#e0e0e0">GPM</font>
</td>
<td colspan="1">
<font color="#e0e0e0">Imibition 6 SP:</font>
</td>
<td align="right" id="lsp">
<font color="00FF00"><b><?php echo $value['IMB6SP']; ?></b></font>
</td>
<td colspan="2">
<font color="#e0e0e0">GPM</font>
</td>
</tr>
<tr>
<td bgcolor="#2E2E2E" colspan="2">
<font color="#e0e0e0">Imibition 5:</font>
</td>
<td bgcolor="#2E2E2E" align="right" id="lsp">
<font color="00FF00"><b><?php echo $value['IMB5Flow']; ?></b></font>
</td>
<td bgcolor="#2E2E2E">
<font color="#e0e0e0">GPM</font>
</td>
<td colspan="1">
<font color="#e0e0e0">Imibition 5 SP:</font>
</td>
<td align="right" id="lsp">
<font color="00FF00"><b><?php echo $ID['00164']; ?></b></font>
</td>
<td colspan="2">
<font color="#e0e0e0">GPM</font>
</td>
</tr>
<table class="module-table module-table--tight">
<thead>
<tr>
<th>Mill</th>
<th>Level</th>
<th>SP</th>
<th>RPM</th>
<th>Metric</th>
<th>Value</th>
<th>Units</th>
</tr>
</thead>
<tbody>
<?php foreach ($westRows as $row) : ?>
<tr>
<td><?php echo module_html($row['stage']); ?></td>
<td>
<div class="module-progress">
<div class="module-bar">
<div class="module-bar__fill" style="width: <?php echo module_clamp_percent($row['level'] ?? 0); ?>%;"></div>
</div>
<span class="module-notes"><?php echo module_number($row['level'], 0); ?>%</span>
</div>
</td>
<td class="module-table__number"><?php echo module_number($row['sp'], 0); ?></td>
<td class="module-table__number"><?php echo module_number($row['rpm'], 0); ?></td>
<td><?php echo module_html($row['metric']); ?></td>
<td class="module-table__number"><?php echo module_number($row['metric_value'], 1); ?></td>
<td><?php echo module_html(strtoupper($row['metric_unit'])); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</td>
<td width="50%">
<table class="tftable2">
<tr>
<td width="50%" align="center" colspan="6" border="0">
<font color="#00BFFF"><i>WEST MILL TANDEM</i></font>
</td>
</tr>
</table>
<table class="tftableWEST">
<tr>
<td align="center">
<font color="#e0e0e0"></font>
</td>
<td align="center">
<font color="#e0e0e0">Level</font>
</td>
<td align="center">
<font color="#e0e0e0">SP</font>
</td>
<td align="center">
<font color="#e0e0e0">RPM</font>
</td>
<td colspan="4" align="center">
<font color="#e0e0e0"></font>
</td>
</tr>
<tr>
<td bgcolor="#0B3B17" align="center">
<font color="#e0e0e0">1</font>
</td>
<td bgcolor="#0B3B17" align="left"><progress id="progressmills" data-label="<?php echo $ID['00914']; ?>%" max="100" value="<?php echo $ID['00654']; ?>"></progress></td>
<td bgcolor="#0B3B17" align="center">
<font color="#e0e0e0"></font>
</td>
<td bgcolor="#0B3B17" align="center">
<font color="#00FF00"><?php echo $ID['00926']; ?></font>
</td>
<td align="left">
<font color="#e0e0e0">BC-09 FPM</font>
</td>
<td align="right">
<font color="#00FF00"><?php echo $value['Feet/Minute']; ?></font>
</td>
<td align="left">
<font color="#e0e0e0">FPM</font>
</td>
</tr>
<tr>
<td bgcolor="#D7DF01" align="center">
<font color="#000000">2</font>
</td>
<td bgcolor="#D7DF01" align="left"><progress id="progressmills" data-label="<?php echo $ID['00916']; ?>%" max="100" value="<?php echo $ID['00656']; ?>"></progress></td>
<td bgcolor="#D7DF01" align="center">
<font color="#ffffff"></font>
</td>
<td bgcolor="#D7DF01" align="center">
<font color="#298A08"><?php echo $ID['00930']; ?></font>
</td>
<td align="left">
<font color="#e0e0e0">BC-09 Output</font>
</td>
<td align="right">
<font color="#00FF00"><?php echo $ID['00690']; ?></font>
</td>
<td align="left">
<font color="#e0e0e0"></font>
</td>
</tr>
<tr>
<td bgcolor="#04B404" align="center">
<font color="#e0e0e0">3</font>
</td>
<td bgcolor="#04B404" align="left"><progress id="progressmills" data-label="<?php echo $ID['00962']; ?>" max="100" value="0"></progress></td>
<td bgcolor="#04B404" align="center">
<font color="#e0e0e0"></font>
</td>
<td bgcolor="#04B404" align="center">
<font color="#00FF00"><?php echo $ID['01018']; ?></font>
</td>
<td align="left">
<font color="#e0e0e0">BC-09 Tons</font>
</td>
<td align="right">
<font color="#00FF00"></font>
</td>
<td align="left">
<font color="#e0e0e0">Tons</font>
</td>
</tr>
<tr>
<td bgcolor="#DF7401" align="center">
<font color="#e0e0e0">4</font>
</td>
<td bgcolor="#DF7401" align="left"><progress id="progressmills" data-label="<?php echo $ID['00918']; ?>%" max="100" value="<?php echo $ID['00658']; ?>"></progress></td>
<td bgcolor="#DF7401" align="center">
<font color="#e0e0e0"></font>
</td>
<td bgcolor="#DF7401" align="center">
<font color="#00FF00"><?php echo $ID['00934']; ?></font>
</td>
<td align="left">
<font color="#e0e0e0">Mill 1 SP</font>
</td>
<td align="right">
<font color="#00FF00"></font>
</td>
<td align="left">
<font color="#e0e0e0">%</font>
</td>
</tr>
<tr>
<td bgcolor="#5858FA" align="center">
<font color="#e0e0e0">5</font>
</td>
<td bgcolor="#5858FA" align="left"><progress id="progressmills" data-label="<?php echo $ID['00920']; ?>%" max="100" value="<?php echo $ID['00660']; ?>"></progress></td>
<td bgcolor="#5858FA" align="center">
<font color="#e0e0e0"></font>
</td>
<td bgcolor="#5858FA" align="center">
<font color="#00FF00"><?php echo $ID['00940']; ?></font>
</td>
<td align="left">
<font color="#e0e0e0">Grinding Rate</font>
</td>
<td align="right">
<font color="#00FF00">
<font><?php echo $value['RATE']; ?></font>
</td>
<td align="left">
<font color="#e0e0e0">Tons/Hr</font>
</td>
</tr>
<tr>
<td bgcolor="#8A0808" colspan="4" align="center">
<font color="#e0e0e0"></font>
</td>
<td align="left">
<font color="#e0e0e0">Average Rate</font>
</td>
<td align="right">
<font color="#00FF00"><?php require "../includes/west15minavg.php"; ?></font>
</td>
<td align="left">
<font color="#e0e0e0">Tons/15Min</font>
</td>
</tr>
<tr>
<td bgcolor="#2E2E2E" colspan="2">
<font color="#e0e0e0">Imibition:</font>
</td>
<td bgcolor="#2E2E2E" align="right" id="lsp">
<font color="00FF00"><b><?php echo $value['IMB5Flow']; ?></b></font>
</td>
<td bgcolor="#2E2E2E">
<font color="#e0e0e0">GPM</font>
</td>
<div class="module-divider"></div>
<td colspan="1">
<font color="#e0e0e0">Imibition SP:</font>
</td>
<td align="right" id="lsp">
<font color="00FF00"><b><?php echo $ID['00164']; ?></b></font>
</td>
<td>
<font color="#e0e0e0">GPM</font>
</td>
</tr>
<tr>
<td colspan="9">
<font color="#e0e0e0">&nbsp</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
<?php
?>
<div class="module-row">
<span class="module-row__label">Imbibition</span>
<span class="module-row__value"><?php echo module_number($westImbibition, 0); ?> GPM</span>
</div>
</div>
</div>
</section>

View File

@@ -1,5 +1,5 @@
<?php
include("../includes/items2dec.php");
include("../../items2dec.php");
?>
<!-- vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv TRUCK DUMP, TABLES AND KNIVES vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -->

View File

@@ -1,44 +1,55 @@
<?php
include("../includes/items.php");
// phpcs:ignoreFile
declare(strict_types=1);
include __DIR__ . '/../../items.php';
require_once __DIR__ . '/module-helpers.php';
$syrupOverflow = module_numeric($value['Syrup Overflow Lvl'] ?? null) ?? 0.0;
$syrupRcvr = module_numeric($value['Syrup RCVR'] ?? null) ?? 0.0;
$totalSyrup = ($syrupOverflow * 0.82569) + ($syrupRcvr * 0.17431);
$tanks = [
['label' => 'Juice Tank 1', 'value' => module_numeric($value['Juice Tank1'] ?? null)],
['label' => 'Juice Tank 2', 'value' => module_numeric($value['Juice Tank2'] ?? null)],
['label' => 'Syrup Receiver', 'value' => module_numeric($value['Syrup RCVR'] ?? null)],
['label' => 'Syrup Overflow', 'value' => module_numeric($value['Syrup Overflow Lvl'] ?? null)],
['label' => 'Total Syrup', 'value' => module_numeric($totalSyrup)],
['label' => 'A1 Receiver', 'value' => module_numeric($value['A1 RCVR'] ?? null)],
['label' => 'A1 Overflow', 'value' => module_numeric($value['A1 Molasses Overflow Lvl'] ?? null)],
['label' => 'A2 Receiver', 'value' => module_numeric($value['A2 RCVR'] ?? null)],
['label' => 'A2 Overflow', 'value' => module_numeric($value['A2 Molasses Overflow Lvl'] ?? null)],
['label' => 'B Receiver', 'value' => module_numeric($value['B RCVR'] ?? null)],
['label' => 'B Overflow', 'value' => module_numeric($value['B Molasses Overflow Lvl'] ?? null)],
];
$tankGroups = array_chunk($tanks, (int) ceil(count($tanks) / 2));
?>
<section class="module-card module-card--tight">
<div class="module-heading">
<h2 class="module-heading__title">Tank Levels</h2>
<span class="module-heading__meta">Percent levels across juice, syrup, and molasses</span>
</div>
<table width="100%" class="tftable2">
<tr>
<td width="100%" align="center" colspan="6" border="0"><font color="#00BFFF"><i>TANK LEVELS</i></font></td>
</tr>
</table>
<table class="tftable1">
<tr>
<td colspan="" width="9.09%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0" >Juice Tank1</font></td>
<td colspan="" width="9.09%" align="center"><font color="#e0e0e0">Juice Tank2</font></td>
<td colspan="" width="9.09%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0" >Syrup Rcvr</font></td>
<td colspan="" width="9.09%" align="center"><font color="#e0e0e0">Syrup Over</font></td>
<td colspan="" width="9.09%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0">Total Syrup</font></td>
<td colspan="" width="9.09%" align="center"><font color="#e0e0e0">A1 Rcvr</font></td>
<td colspan="" width="9.09%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0">A1 Over</font></td>
<td colspan="" width="9.09%" align="center"><font color="#e0e0e0">A2 Rcvr</font></td>
<td colspan="" width="9.09%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0">A2 Over</font></td>
<td colspan="" width="9.09%" align="center"><font color="#e0e0e0">B Rcvr</font></td>
<td colspan="" width="9.09%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0">B Over</font></td>
</tr>
<tr>
<td width="9.09" align="left"><progress id="progresstanks" data-label="<?php echo $value['Juice Tank1']; ?>%" max="100" value="<?php echo $value['Juice Tank1']; ?>"></progress></td>
<td width="9.09" align="left"><progress id="progresstanks" data-label="<?php echo $value['Juice Tank2']; ?>%" max="100" value="<?php echo $value['Juice Tank2']; ?>"></progress></td>
<td width="9.09" bgcolor="#2E2E2E" align="left"><progress id="progresstanks" data-label="<?php echo $value['Syrup RCVR']; ?>%" max="100" value="<?php echo $value['Syrup RCVR']; ?>"></progress></td>
<td width="9.09" align="left"><progress id="progresstanks" data-label="<?php echo $value['Syrup Overflow Lvl']; ?>%" max="100" value="<?php echo $value['Syrup Overflow Lvl']; ?>"></progress></td>
<td width="9.09" bgcolor="#2E2E2E" align="left"><progress id="progresstanks" data-label="<?php echo round(($value['Syrup Overflow Lvl']*.82569)+($value['Syrup RCVR']*.17431),0); ?>%" max="100" value="<?php echo round(($value['Syrup Overflow Lvl']*.82569)+($value['Syrup RCVR']*.17431),0); ?>"></meter></td>
<td width="9.09" align="left"><progress id="progresstanks" data-label="<?php echo $value['A1 RCVR']; ?>%" max="100" value="<?php echo $value['A1 RCVR']; ?>"></progress></td>
<td width="9.09" bgcolor="#2E2E2E" align="left"><progress id="progresstanks" data-label="<?php echo $value['A1 Molasses Overflow Lvl']; ?>%" max="100" value="<?php echo $value['A1 Molasses Overflow Lvl']; ?>"></progress></td>
<td width="9.09" align="left"><progress id="progresstanks" data-label="<?php echo $value['A2 RCVR']; ?>%" max="100" value="<?php echo $value['A2 RCVR']; ?>"></progress></td>
<td width="9.09" bgcolor="#2E2E2E" align="left"><progress id="progresstanks" data-label="<?php echo $value['A2 Molasses Overflow Lvl']; ?>%" max="100" value="<?php echo $value['A2 Molasses Overflow Lvl']; ?>"></progress></td>
<td width="9.09" align="left"><progress id="progresstanks" data-label="<?php echo $value['B RCVR']; ?>%" max="100" value="<?php echo $value['B RCVR']; ?>"></progress></td>
<td width="9.09" bgcolor="#2E2E2E" align="left"><progress id="progresstanks" data-label="<?php echo $value['B Molasses Overflow Lvl']; ?>%" max="100" value="<?php echo $value['B Molasses Overflow Lvl']; ?>"></progress></td>
</tr>
</table>
<?php
?>
<div class="module-grid module-grid--two">
<?php foreach ($tankGroups as $group) : ?>
<div class="module-stack">
<?php foreach ($group as $tank) : ?>
<?php $percent = module_clamp_percent($tank['value']); ?>
<div class="module-subcard module-subcard--compact">
<div class="module-row">
<span class="module-row__label"><?php echo module_html($tank['label']); ?></span>
<span class="module-row__value"><?php echo module_number($tank['value'], 0); ?>%</span>
</div>
<div class="module-progress">
<div class="module-bar">
<div class="module-bar__fill" style="width: <?php echo number_format($percent, 2); ?>%;"></div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
</div>
</section>

View File

@@ -1,59 +1,59 @@
<?php
include("../includes/items.php");
// phpcs:ignoreFile
declare(strict_types=1);
include __DIR__ . '/../../items.php';
require_once __DIR__ . '/module-helpers.php';
$syrupOverflow = module_numeric($value['Syrup Overflow Lvl'] ?? null) ?? 0.0;
$syrupRcvr = module_numeric($value['Syrup RCVR'] ?? null) ?? 0.0;
$totalSyrup = ($syrupOverflow * 0.82569) + ($syrupRcvr * 0.17431);
$tanks = [
['label' => 'Juice Tank 1', 'value' => module_numeric($value['Juice Tank1'] ?? null)],
['label' => 'Juice Tank 2', 'value' => module_numeric($value['Juice Tank2'] ?? null)],
['label' => 'Syrup Receiver', 'value' => module_numeric($value['Syrup RCVR'] ?? null)],
['label' => 'Syrup Overflow', 'value' => module_numeric($value['Syrup Overflow Lvl'] ?? null)],
['label' => 'Total Syrup', 'value' => module_numeric($totalSyrup)],
['label' => 'Condensate Water', 'value' => module_numeric($value['CondensateWater'] ?? null)],
['label' => 'Sweet Water', 'value' => module_numeric($value['SweetwaterTank'] ?? null)],
['label' => 'Cold Water Injection', 'value' => module_numeric($value['Cold Water Injection LVL'] ?? null)],
['label' => 'A1 Receiver', 'value' => module_numeric($value['A1 RCVR'] ?? null)],
['label' => 'A1 Overflow', 'value' => module_numeric($value['A1 Molasses Overflow Lvl'] ?? null)],
['label' => 'A2 Receiver', 'value' => module_numeric($value['A2 RCVR'] ?? null)],
['label' => 'A2 Overflow', 'value' => module_numeric($value['A2 Molasses Overflow Lvl'] ?? null)],
['label' => 'B Receiver', 'value' => module_numeric($value['B RCVR'] ?? null)],
['label' => 'B Overflow', 'value' => module_numeric($value['B Molasses Overflow Lvl'] ?? null)],
['label' => 'Flash Tank', 'value' => module_numeric($value['FlashTankLVL'] ?? null)],
];
$tankGroups = array_chunk($tanks, (int) ceil(count($tanks) / 2));
?>
<section class="module-card module-card--tight">
<div class="module-heading">
<h2 class="module-heading__title">Tank Levels (Stacked)</h2>
<span class="module-heading__meta">Combined juice, syrup, water, and molasses storage</span>
</div>
<table class="tftable2">
<tr>
<td width="1000%" align="center" colspan="8" border="0"><font color="#00BFFF"><i>TANK LEVELS</i></font></td>
</tr>
</table>
<table class="tftable1">
<tr>
<td colspan="" width="12.5%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0" >Juice Tank1</font></td>
<td colspan="" width="12.5%" align="center"><font color="#e0e0e0">Juice Tank2</font></td>
<td colspan="" width="12.5%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0" >Syrup Rcvr</font></td>
<td colspan="" width="12.5%" align="center"><font color="#e0e0e0">Syrup Overflow</font></td>
<td colspan="" width="12.5%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0">Total Syrup</font></td>
<td colspan="" width="12.5%" align="center"><font color="#e0e0e0">Condensate Water</font></td>
<td colspan="" width="12.5%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0">Sweet Water</font></td>
<td colspan="" width="12.5%" align="center"><font color="#e0e0e0">Cold Water INJ</font></td>
</tr>
<tr>
<td width="12.5" align="left"><progress id="progresstanks" data-label="<?php echo $value['Juice Tank1']; ?>%" max="100" value="<?php echo $value['Juice Tank1']; ?>"></progress></td>
<td width="12.5" align="left"><progress id="progresstanks" data-label="<?php echo $value['Juice Tank2']; ?>%" max="100" value="<?php echo $value['Juice Tank2']; ?>"></progress></td>
<td width="12.5" bgcolor="#2E2E2E" align="left"><progress id="progresstanks" data-label="<?php echo $value['Syrup RCVR']; ?>%" max="100" value="<?php echo $value['Syrup RCVR']; ?>"></progress></td>
<td width="12.5" align="left"><progress id="progresstanks" data-label="<?php echo $value['Syrup Overflow Lvl']; ?>%" max="100" value="<?php echo $value['Syrup Overflow Lvl']; ?>"></progress></td>
<td width="12.5" bgcolor="#2E2E2E" align="left"><progress id="progresstanks" data-label="<?php echo round(($value['Syrup Overflow Lvl']*.82569)+($value['Syrup RCVR']*.17431),0); ?>%" max="100" value="<?php echo round(($value['Syrup Overflow Lvl']*.82569)+($value['Syrup RCVR']*.17431),0); ?>"></meter></td>
<td width="12.5" align="left"><progress id="progresstanks" data-label="<?php echo $value['CondensateWater']; ?>" max="100" value="<?php echo $value['CondensateWater']; ?>"></progress></td>
<td width="12.5" bgcolor="#2E2E2E" align="left"><progress id="progresstanks" data-label="<?php echo $value['SweetwaterTank']; ?>" max="100" value="<?php echo $value['SweetwaterTank']; ?>"></progress></td>
<td width="12.5" align="left"><progress id="progresstanks" data-label="<?php echo $value['Cold Water Injection LVL']; ?>" max="100" value="<?php echo $value['Cold Water Injection LVL']; ?>"></progress></td>
</tr>
<tr>
<td colspan="" width="12.5%" align="center"><font color="#e0e0e0">A1 Rcvr</font></td>
<td colspan="" width="12.5%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0">A1 Overflow</font></td>
<td colspan="" width="12.5%" align="center"><font color="#e0e0e0">A2 Rcvr</font></td>
<td colspan="" width="12.5%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0">A2 Overflow</font></td>
<td colspan="" width="12.5%" align="center"><font color="#e0e0e0">B Rcvr</font></td>
<td colspan="" width="12.5%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0">B Overflow</font></td>
<td colspan="" width="12.5%" align="center"><font color="#e0e0e0">Flash Tank</font></td>
<td colspan="" width="12.5%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0"></font></td>
</tr>
<tr>
<td width="12.5" align="left"><progress id="progresstanks" data-label="<?php echo $value['A1 RCVR']; ?>%" max="100" value="<?php echo $value['A1 RCVR']; ?>"></progress></td>
<td width="12.5" bgcolor="#2E2E2E" align="left"><progress id="progresstanks" data-label="<?php echo $value['A1 Molasses Overflow Lvl']; ?>%" max="100" value="<?php echo $value['A1 Molasses Overflow Lvl']; ?>"></progress></td>
<td width="12.5" align="left"><progress id="progresstanks" data-label="<?php echo $value['A2 RCVR']; ?>%" max="100" value="<?php echo $value['A2 RCVR']; ?>"></progress></td>
<td width="12.5" bgcolor="#2E2E2E" align="left"><progress id="progresstanks" data-label="<?php echo $value['A2 Molasses Overflow Lvl']; ?>%" max="100" value="<?php echo $value['A2 Molasses Overflow Lvl']; ?>"></progress></td>
<td width="12.5" align="left"><progress id="progresstanks" data-label="<?php echo $value['B RCVR']; ?>%" max="100" value="<?php echo $value['B RCVR']; ?>"></progress></td>
<td width="12.5" bgcolor="#2E2E2E" align="left"><progress id="progresstanks" data-label="<?php echo $value['B Molasses Overflow Lvl']; ?>%" max="100" value="<?php echo $value['B Molasses Overflow Lvl']; ?>"></progress></td>
<td width="12.5" align="left"><progress id="progresstanks" data-label="<?php echo $value['FlashTankLVL']; ?>" max="100" value="<?php echo $value['FlashTankLVL']; ?>"></progress></td>
<td width="12.5" bgcolor="#2E2E2E" align="left"><progress id="progresstanks" data-label="<?php //echo $value['B RCVR']; ?>" max="100" value="<?php //echo $value['B RCVR']; ?>"></progress></td>
</tr>
</table>
<?php
?>
<div class="module-grid module-grid--two">
<?php foreach ($tankGroups as $group) : ?>
<div class="module-stack">
<?php foreach ($group as $tank) : ?>
<?php $percent = module_clamp_percent($tank['value']); ?>
<div class="module-subcard module-subcard--compact">
<div class="module-row">
<span class="module-row__label"><?php echo module_html($tank['label']); ?></span>
<span class="module-row__value"><?php echo module_number($tank['value'], 0); ?>%</span>
</div>
<div class="module-progress">
<div class="module-bar">
<div class="module-bar__fill" style="width: <?php echo number_format($percent, 2); ?>%;"></div>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
</div>
</section>

View File

@@ -1,142 +1,49 @@
<?php
include("../includes/items.php");
// phpcs:ignoreFile
declare(strict_types=1);
include __DIR__ . '/../../items.php';
require_once __DIR__ . '/module-helpers.php';
$syrupOverflow = module_numeric($value['Syrup Overflow Lvl'] ?? null) ?? 0.0;
$syrupRcvr = module_numeric($value['Syrup RCVR'] ?? null) ?? 0.0;
$totalSyrup = ($syrupOverflow * 0.82569) + ($syrupRcvr * 0.17431);
$tanks = [
['label' => 'Juice Tank 1', 'value' => module_numeric($value['Juice Tank1'] ?? null)],
['label' => 'Juice Tank 2', 'value' => module_numeric($value['Juice Tank2'] ?? null)],
['label' => 'Syrup Receiver', 'value' => module_numeric($value['Syrup RCVR'] ?? null)],
['label' => 'Syrup Overflow', 'value' => module_numeric($value['Syrup Overflow Lvl'] ?? null)],
['label' => 'Total Syrup', 'value' => module_numeric($totalSyrup)],
['label' => 'A1 Receiver', 'value' => module_numeric($value['A1 RCVR'] ?? null)],
['label' => 'A1 Overflow', 'value' => module_numeric($value['A1 Molasses Overflow Lvl'] ?? null)],
['label' => 'A2 Receiver', 'value' => module_numeric($value['A2 RCVR'] ?? null)],
['label' => 'A2 Overflow', 'value' => module_numeric($value['A2 Molasses Overflow Lvl'] ?? null)],
['label' => 'B Receiver', 'value' => module_numeric($value['B RCVR'] ?? null)],
['label' => 'B Overflow', 'value' => module_numeric($value['B Molasses Overflow Lvl'] ?? null)],
['label' => 'Flash Tank', 'value' => module_numeric($value['FlashTankLVL'] ?? null)],
['label' => 'Condensate Water', 'value' => module_numeric($value['CondensateWater'] ?? null)],
['label' => 'Sweet Water', 'value' => module_numeric($value['SweetwaterTank'] ?? null)],
['label' => 'Cold Water Injection', 'value' => module_numeric($value['Cold Water Injection LVL'] ?? null)],
];
?>
<table class="tftable2">
<tr>
<td width="100%" align="center" colspan="6" border="0"><font color="#00BFFF"><i>TANK LEVELS</i></font></td>
</tr>
</table>
<table class="tftable3">
<section class="module-card module-card--tight">
<div class="module-heading">
<h2 class="module-heading__title">Tank Levels (Vertical)</h2>
<span class="module-heading__meta">Quick scan of tank headspace</span>
</div>
<tr>
<td colspan="" width="6.66%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0" >Juice Tank1</font></td>
<td colspan="" width="6.66%" align="center"><font color="#e0e0e0">Juice Tank2</font></td>
<td colspan="" width="6.66%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0" >Syrup Rcvr</font></td>
<td colspan="" width="6.66%" align="center"><font color="#e0e0e0">Syrup Overflow</font></td>
<td colspan="" width="6.66%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0">Total Syrup</font></td>
<td colspan="" width="6.66%" align="center"><font color="#e0e0e0">A1 Rcvr</font></td>
<td colspan="" width="6.66%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0">A1 Over</font></td>
<td colspan="" width="6.66%" align="center"><font color="#e0e0e0">A2 Rcvr</font></td>
<td colspan="" width="6.66%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0">A2 Over</font></td>
<td colspan="" width="6.66%" align="center"><font color="#e0e0e0">B Rcvr</font></td>
<td colspan="" width="6.66%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0">B Over</font></td>
<td colspan="" width="6.66%" align="center"><font color="#e0e0e0">Flash Tank</font></td>
<td colspan="" width="6.66%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0">Condens. Water</font></td>
<td colspan="" width="6.66%" align="center"><font color="#e0e0e0">Sweet Water</font></td>
<td colspan="" width="6.66%" bgcolor="#2E2E2E" align="center"><font color="#e0e0e0">Cold Water INJ</font></td>
</tr>
<tr>
<td width="6.66" align="left">
<div class="barcontainer">
<div class="bar" style="height:<?php echo $value['Juice Tank1']; ?>%">
<div class="bartext"><font color="white"><?php echo $value['Juice Tank1']; ?>%</font></div>
</div>
</div>
</td>
<td width="6.66" align="left">
<div class="barcontainer">
<div class="bar" style="height:<?php echo $value['Juice Tank2']; ?>%">
<div class="bartext"><font color="white"><?php echo $value['Juice Tank2']; ?>%</font></div>
</div>
</div>
</td>
<td width="6.66" align="left">
<div class="barcontainer">
<div class="bar" style="height:<?php echo $value['Syrup RCVR']; ?>%">
<div class="bartext"><font color="white"><?php echo $value['Syrup RCVR']; ?>%</font></div>
</div>
</div>
</td>
<td width="6.66" align="left">
<div class="barcontainer">
<div class="bar" style="height:<?php echo $value['Syrup Overflow Lvl']; ?>%">
<div class="bartext"><font color="white"><?php echo $value['Syrup Overflow Lvl']; ?>%</font></div>
</div>
</div>
</td>
<td width="6.66" align="left">
<div class="barcontainer">
<div class="bar" style="height:<?php echo round(($value['Syrup Overflow Lvl']*.82569)+($value['Syrup RCVR']*.17431),0); ?>%">
<div class="bartext"><font color="white"><?php echo round(($value['Syrup Overflow Lvl']*.82569)+($value['Syrup RCVR']*.17431),0); ?>%</font></div>
</div>
</div>
</td>
<td width="6.66" align="left">
<div class="barcontainer">
<div class="bar" style="height:<?php echo $value['A1 RCVR']; ?>%">
<div class="bartext"><font color="white"><?php echo $value['A1 RCVR']; ?>%</font></div>
</div>
</div>
</td>
<td width="6.66" align="left">
<div class="barcontainer">
<div class="bar" style="height:<?php echo $value['A1 Molasses Overflow Lvl']; ?>%">
<div class="bartext"><font color="white"><?php echo $value['A1 Molasses Overflow Lvl']; ?>%</font></div>
</div>
</div>
</td>
<td width="6.66" align="left">
<div class="barcontainer">
<div class="bar" style="height:<?php echo $value['A2 RCVR']; ?>%">
<div class="bartext"><font color="white"><?php echo $value['A2 RCVR']; ?>%</font></div>
</div>
</div>
</td>
<td width="6.66" align="left">
<div class="barcontainer">
<div class="bar" style="height:<?php echo $value['A2 Molasses Overflow Lvl']; ?>%">
<div class="bartext"><font color="white"><?php echo $value['A2 Molasses Overflow Lvl']; ?>%</font></div>
</div>
</div>
</td>
<td width="6.66" align="left">
<div class="barcontainer">
<div class="bar" style="height:<?php echo $value['B RCVR']; ?>%">
<div class="bartext"><font color="white"><?php echo $value['B RCVR']; ?>%</font></div>
</div>
</div>
</td>
<td width="6.66" align="left">
<div class="barcontainer">
<div class="bar" style="height:<?php echo $value['B Molasses Overflow Lvl']; ?>%">
<div class="bartext"><font color="white"><?php echo $value['B Molasses Overflow Lvl']; ?>%</font></div>
</div>
</div>
</td>
<td width="6.66" align="left">
<div class="barcontainer">
<div class="bar" style="height:<?php echo $value['FlashTankLVL']; ?>%">
<div class="bartext"><font color="white"><?php echo $value['FlashTankLVL']; ?>%</font></div>
</div>
</div>
</td>
<td width="6.66" align="left">
<div class="barcontainer">
<div class="bar" style="height:<?php echo $value['CondensateWater']; ?>%">
<div class="bartext"><font color="white"><?php echo $value['CondensateWater']; ?>%</font></div>
</div>
</div>
</td>
<td width="6.66" align="left">
<div class="barcontainer">
<div class="bar" style="height:<?php echo $value['SweetwaterTank']; ?>%">
<div class="bartext"><font color="white"><?php echo $value['SweetwaterTank']; ?>%</font></div>
</div>
</div>
</td>
<td width="6.66" align="left">
<div class="barcontainer">
<div class="bar" style="height:<?php echo $value['Cold Water Injection LVL']; ?>%">
<div class="bartext"><font color="white"><?php echo $value['Cold Water Injection LVL']; ?>%</font></div>
</div>
</div>
</td>
</tr>
</table>
<?php
?>
<div class="module-vertical-grid">
<?php foreach ($tanks as $tank) : ?>
<?php $percent = module_clamp_percent($tank['value']); ?>
<div class="module-vertical">
<div class="module-vertical__bar">
<div class="module-vertical__fill" style="height: <?php echo number_format($percent, 2); ?>%;"></div>
</div>
<div class="module-vertical__value"><?php echo module_number($tank['value'], 0); ?>%</div>
<div class="module-vertical__label"><?php echo module_html($tank['label']); ?></div>
</div>
<?php endforeach; ?>
</div>
</section>

35
overviews/data/tonsin.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
$serverName = "CBM2K12\SQLEXPRESS";
$uid = "cbmclient";
$pwd = "ascbm2k";
$connectionInfo = array( "UID"=>$uid, "PWD"=>$pwd,'ReturnDatesAsStrings'=> true, "CharacterSet" => 'utf-8', "Database"=>"SugarCaneScale" );
/* Connect using SQL Server Authentication. */
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn === false )
{
echo "Unable to connect.</br>";
die( print_r( sqlsrv_errors(), true));
}
$sql = "SELECT ROUND (Tons,0) AS Tons FROM LoadData WHERE CropDay = ( SELECT Max(CropDay) FROM LoadData)";
$stmt = sqlsrv_query( $conn, $sql );
if( $stmt === false) {
die( print_r( sqlsrv_errors(), true) );
}
$tonsin = 0;
while( $rowtonsin = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) )
{
$tonsin += $rowtonsin['Tons'];
}
//end
?>
<?php echo $tonsin; ?>
<?
$db = null;
?>

View File

@@ -0,0 +1,28 @@
<?php
$servername = "192.168.0.2";
$username = "corey";
$password = "41945549";
$dbname = "controls";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$query = "SELECT DISTINCT PREVTONS FROM totaltons";
$result=$conn->query($query);
$tonsin = 0;
if ($result->num_rows > 0) {
// output data of each row
while($rowtotground = $result->fetch_assoc()) {
$tonsin += $rowtotground['PREVTONS'];
}
} else {
echo "0 results";
}
$conn->close();
?>
<?php echo ($tonsin)+0; ?>

View File

@@ -0,0 +1,13 @@
<?php
include("../../dbinfo.php");
$con=mysqli_connect($host,$username,$password,$database);
$query = "SELECT AVG(wtonshr) AS rate FROM (SELECT wtonshr FROM milling ORDER BY id DESC LIMIT 900) tbl";
$result=mysqli_query($con,$query);
$row3=mysqli_fetch_assoc($result);
mysqli_close($con);
?>
<?php echo round($row3['rate'],0); ?>

View File

@@ -0,0 +1,13 @@
<?php
include("../../dbinfo.php");
$con=mysqli_connect($host,$username,$password,$database);
$query = "SELECT AVG(wtonshr) AS rate FROM (SELECT wtonshr FROM milling ORDER BY id DESC LIMIT 600) tbl";
$result=mysqli_query($con,$query);
$roww24hravg=mysqli_fetch_array($result, MYSQLI_ASSOC);
mysqli_close($con);
echo round($roww24hravg['rate'],0)*24;
?>

View File

@@ -0,0 +1,33 @@
<?php
error_reporting(E_ERROR);
$username="corey";
$password="41945549";
$database="controls";
mysql_connect('127.0.0.1',$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT (SELECT AVG(wtonshr) FROM milling ORDER BY id DESC LIMIT 600) AS rate, (SELECT avgtcd FROM milling ORDER BY id DESC LIMIT 1) AS eavg";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
<?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"rate");
$f2=mysql_result($result,$i,"eavg");
?>
<?php echo round($f1,0)*24; ?>
<?php
$i++;
}
?>

View File

@@ -0,0 +1,15 @@
<?php
include("../dbinfo.php");
$con=mysqli_connect($host,$username,$password,$database);
$query = "SELECT ((SELECT westtotground FROM westtotalground ORDER BY id DESC LIMIT 1) - (SELECT westtotground FROM westtotalground ORDER BY id DESC LIMIT 899, 1))*4 AS westavg";
$result=mysqli_query($con,$query);
$include4=mysqli_fetch_array($result,MYSQLI_ASSOC);
mysqli_close($con);
?>
<?php echo round($include4['westavg']); ?>

View File

@@ -0,0 +1,32 @@
<?php
error_reporting(E_ERROR);
$username="corey";
$password="41945549";
$database="controls";
mysql_connect('127.0.0.1',$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT AVG(wtonshr) AS rate FROM (SELECT wtonshr FROM milling ORDER BY id DESC LIMIT 600) tbl";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
?>
<?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"rate");
?>
<?php echo round($f1,0); ?>
<?php
$i++;
}
?>