Files
2026-09-03 11:24:19 +02:00

181 lines
6.4 KiB
PHP

<?php
if (!empty($_SESSION['site406']))
{
$wynik = mysql_query("select PUP_ID,PUP_NAME,TST_PUP_SN_NO,ENG_ID,ENG_NAME,TST_ENG_SN_NO,SUBSTRING(TST_AUDIT_CD,1,10) CD from tst_tests left join seg_pumps on TST_PUP_ID=PUP_ID left join seg_engines on TST_ENG_ID=ENG_ID where TST_ID=".$_GET['t']);
if($wynik)while ($r = mysql_fetch_array($wynik))
{
$pID = $r["PUP_ID"];
$pName = $r["PUP_NAME"];
$pNo = $r["TST_PUP_SN_NO"];
$sName = $r["ENG_NAME"];
$sNo = $r["TST_ENG_SN_NO"];
$tDate = $r["CD"];
}
$title = "Cyfrowe charakterystyki dla agregatu [$pName,$sName] ze Stacji prób";
$wynik = mysql_query("select PEP_X_PARAM from seg_pump_eng_param where PEP_TYPE='H' and PEP_PUP_ID=".$pID." order by PEP_X_PARAM");
if($wynik)while ($r = mysql_fetch_array($wynik))
{
$scope[] = $r["PEP_X_PARAM"]/60;
}
$ilPkt = count($scope)-1;
// położeniu punktów na wykresie
// =============================================================================================================== //
$wynik = mysql_query("select PUF_A,PUF_B,PUF_C,PUF_D from tst_xy_formula where PUF_TST_ID=".$_GET['t']." and PUF_TYPE='H' limit 1");
if($wynik)while ($r = mysql_fetch_array($wynik))
{
$pA = $r["PUF_A"];
$pB = $r["PUF_B"];
$pC = $r["PUF_C"];
$pD = $r["PUF_D"];
$hp_H = $pA*($_GET['q']*$_GET['q']*$_GET['q']) + $pB*($_GET['q']*$_GET['q']) + $pC*$_GET['q'] + $pD;
}
$wynik = mysql_query("select PUF_A,PUF_B,PUF_C,PUF_D from tst_xy_formula where PUF_TST_ID=".$_GET['t']." and PUF_TYPE='P' limit 1");
if($wynik)while ($r = mysql_fetch_array($wynik))
{
$pA = $r["PUF_A"];
$pB = $r["PUF_B"];
$pC = $r["PUF_C"];
$pD = $r["PUF_D"];
$hp_P = $pA*($_GET['q']*$_GET['q']*$_GET['q']) + $pB*($_GET['q']*$_GET['q']) + $pC*$_GET['q'] + $pD;
}
$wynik = mysql_query("select PUF_A,PUF_B,PUF_C,PUF_D from tst_xy_formula where PUF_TST_ID=".$_GET['t']." and PUF_TYPE='ETA' limit 1");
if($wynik)while ($r = mysql_fetch_array($wynik))
{
$pA = $r["PUF_A"];
$pB = $r["PUF_B"];
$pC = $r["PUF_C"];
$pD = $r["PUF_D"];
$hp_ETA = $pA*($_GET['q']*$_GET['q']*$_GET['q']) + $pB*($_GET['q']*$_GET['q']) + $pC*$_GET['q'] + $pD;
}
// =============================================================================================================== //
?>
<div class="tag100">
<div class="head_tag"><?php echo $title;?></div>
<div class="tag">
<table WIDTH="100%" class="tag">
<TR>
<TD class="desc">Numer próby</TD>
<TD CLASS="desc_value"><?php echo $_GET['t']; ?></TD>
<TD class="desc">Data</TD>
<TD CLASS="desc_value"><?php echo $tDate; ?></TD>
</TR>
<TR>
<TD class="desc">Typ pompy</TD>
<TD CLASS="desc_value"><?php echo $pName; ?></TD>
<TD class="desc">Typ silnika</TD>
<TD CLASS="desc_value"><?php echo $sName; ?></TD>
</TR>
<TR>
<TD class="desc">Numer pompy</TD>
<TD CLASS="desc_value"><?php echo $pNo; ?></TD>
<TD class="desc">Numer silnika</TD>
<TD CLASS="desc_value"><?php echo $sNo; ?></TD>
</TR>
<TR>
<TD class="desc">Zadana wartość Q [m<sup>3</sup>/min]</TD>
<TD CLASS="desc_value"><?php echo str_replace('.',',',round($_GET['q']/60,2)); ?></TD>
<TD class="desc">Podnoszenie H(Q)</TD>
<TD CLASS="desc_value"><?php echo str_replace('.',',',round($hp_H,2)); ?></TD>
</TR>
<TR>
<TD class="desc">Moc P(Q)</TD>
<TD CLASS="desc_value"><?php echo str_replace('.',',',round($hp_P,2)); ?></TD>
<TD class="desc">Sprawność agregatu &eta;A(Q)</TD>
<TD CLASS="desc_value"><?php echo str_replace('.',',',round($hp_ETA,2)); ?></TD>
</TR>
</table>
</div>
<?php
$wynik = mysql_query("select PEP_X_PARAM from seg_pump_eng_param where PEP_TYPE='H' and PEP_PUP_ID=".$pID." order by PEP_X_PARAM");
if($wynik)while ($r = mysql_fetch_array($wynik))
$dataP[] = $r["PEP_X_PARAM"];
$wynik = mysql_query("select TSD_VAL_04,TSD_VAL_08,TSD_VAL_14,TSD_VAL_18 from tst_tests left join tst_test_details on TSD_TST_ID=TST_ID where TST_ID=".$_GET['t']." order by TSD_MSR_STEP");
if($wynik)while ($r = mysql_fetch_array($wynik))
{
$dataH[] = array(
getFloatValue($r["TSD_VAL_04"]),
getFloatValue($r["TSD_VAL_08"])
);
$dataPe[] = array(
getFloatValue($r["TSD_VAL_04"]),
getFloatValue($r["TSD_VAL_14"])
);
$dataEta[] = array(
getFloatValue($r["TSD_VAL_04"]),
getFloatValue($r["TSD_VAL_18"])
);
}
$fileName1=createChartFileNamePng("site406charts_01");
if (file_exists( $fileName1)) unlink($fileName1);
include("./polynomial/hpCharts.php");
createHpTestChart($dataP, $dataH, 0, $fileName1, 969, 330, 20, 10, 1);
$fileName2=createChartFileNamePng("site406charts_02");
if (file_exists( $fileName2)) unlink($fileName2);
include("./polynomial/peCharts.php");
createPeTestChart($dataP, $dataPe, 0, $fileName2, 969, 330, 20, 10, 1);
$fileName3=createChartFileNamePng("site406charts_03");
if (file_exists( $fileName3)) unlink($fileName3);
include("./polynomial/etaCharts.php");
createEtaTestChart($dataP, $dataEta, 0, $fileName3, 969, 330, 20, 10, 1);
?>
<div class="head_tag">Podnoszenie H(Q) </div>
<div class="tag">
<img SRC="<?php echo $fileName1; ?>">
</div>
<div class="head_tag"><?php echo $lab_Field_site501_009; ?> P(Q) </div>
<div class="tag">
<img SRC="<?php echo $fileName2; ?>">
</div>
<div class="head_tag"><?php echo $lab_Tag_site203_005; ?> &eta;A(Q) </div>
<div class="tag">
<img SRC="<?php echo $fileName3; ?>">
</div>
</div>
<div class="tag50_left">
<div class="tag_buttons" style="text-align: left;">
<button type="button" class="btn btn-default btn-sm" onclick="window.print();">Drukuj</button>
</div>
</div>
<div class="tag50_right">
<div class="tag_buttons">
<a class="btn btn-info btn-sm" style="text-decoration: none;" href="./?pg=site406_5&q=<?php echo $_GET['q']; ?>" role="button"><?php echo $lab_ButtonName_BackToList; ?></a>
</div>
</div>
<?php
}
else showFooterWarningAccessNotification($lab_FooterWarningAccessNotification_001);
?>