|
|
|
$param_4 |
$param_5 |
$param_6 |
";
}
?>
0)
{
$fileName1="./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."_chart_203inf_01.png";
$fileName2="./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."_chart_203inf_02.png";
if (file_exists( $fileName1)) unlink($fileName1);
if (file_exists( $fileName2)) unlink($fileName2);
// Wysokość podnoszenia
// =======================================================================================//
require_once('./polynomial/PolynomialRegression.php' );
require_once('./polynomial/plot.php' );
unset($scope);
unset($data);
unset($newParam);
$i=0; $j=0;
$wynik = mysql_query("select (PEP_X_PARAM/60) PEP_X_PARAM,PEP_Y_PARAM from seg_pump_eng_param where PEP_TYPE='H' and PEP_PUP_ID=".$_GET['pup']." order by PEP_X_PARAM");
if($wynik)while ($r = mysql_fetch_array($wynik))
{
$newParam[$i][$j] = $r["PEP_X_PARAM"];
$scope[] = $r["PEP_X_PARAM"];
$j++;
$newParam[$i][$j] = $r["PEP_Y_PARAM"];
$i++; $j=0;
}
$xMin = 0;
$xMinLine = $xMin;
$xMax = sqlValue("select max(PEP_X_PARAM/60) from seg_pump_eng_param where PEP_TYPE='H' and PEP_PUP_ID=".$_GET['pup']);
$xMaxLine = ceil($xMax);
$yMax = sqlValue("select max(PEP_Y_PARAM) from seg_pump_eng_param where PEP_TYPE='H' and PEP_PUP_ID=".$_GET['pup']);
$yMax = ceil($yMax+10);
$X_MajorScale = $xMax/5;
$X_MinorScale = $X_MajorScale / 2;
$Y_MajorScale = ceil($yMax/4);
$Y_MinorScale = $Y_MajorScale / 2;
$data = $newParam;
// Precision digits in BC math.
bcscale( 10 );
// Start a regression class with a maximum of 4rd degree polynomial.
$polynomialRegression = new PolynomialRegression( 4 );
// Add all the data to the regression analysis.
foreach ( $data as $dataPoint )
$polynomialRegression->addData( $dataPoint[ 0 ], $dataPoint[ 1 ] );
// Add raw data to plot.
plotRenderData( $data, $colorMap[ "Blue" ] );
$plot->setX_Span( 0, $xMax);
$plot->setY_Span( 0, ceil($yMax/4)*4 );
plotAddScale();
// Render the points to image
$plot->setCircleSize( 3 );
$plot->renderPoints();
// Get coefficients for the polynomial.
$coefficients = $polynomialRegression->getCoefficients();
// Place text
imageString($image,5,0,0,'H[m]',$colorMap[ "Black" ]);
imageString($image,3,355,313,'Q[m3/min]',$colorMap[ "Black" ]);
// rysuje punkty
// plotRenderRegression( $polynomialRegression, $coefficients, $xMinLine, $xMaxLine, $colorMap[ "Red" ] );
plotRenderRegression( $polynomialRegression, $coefficients, $scope[0], $scope[2], $colorMap[ "Red" ] );
plotRenderRegression( $polynomialRegression, $coefficients, $scope[2], $scope[3], $colorMap[ "DarkYellow" ] );
plotRenderRegression( $polynomialRegression, $coefficients, $scope[3], $scope[5], $colorMap[ "Green" ] );
plotRenderRegression( $polynomialRegression, $coefficients, $scope[5], $scope[6], $colorMap[ "DarkYellow" ] );
plotRenderRegression( $polynomialRegression, $coefficients, $scope[6], $xMaxLine, $colorMap[ "Red" ] );
imagePNG( $image,$fileName1);
// =======================================================================================//
require_once('./polynomial/plot1.php' );
unset($scope1);
unset($data);
unset($newParam);
$i=0; $j=0;
$wynik = mysql_query("select (PEP_X_PARAM/60) PEP_X_PARAM,PEP_Y_PARAM from seg_pump_eng_param where PEP_TYPE='ETA' and PEP_PUP_ID=".$_GET['pup']." order by PEP_X_PARAM");
if($wynik)while ($r = mysql_fetch_array($wynik))
{
$newParam1[$i][$j] = $r["PEP_X_PARAM"];
$scope1[] = $r["PEP_X_PARAM"];
$j++;
$newParam1[$i][$j] = $r["PEP_Y_PARAM"];
$i++; $j=0;
}
$xMin = 0;
$xMinLine = $xMin;
$xMax = sqlValue("select max(PEP_X_PARAM/60) from seg_pump_eng_param where PEP_TYPE='ETA' and PEP_PUP_ID=".$_GET['pup']);
$xMaxLine = ceil($xMax);
$X_MajorScale = $xMax/5;
$X_MinorScale = $X_MajorScale / 2;
$Y_MajorScale = 0.2;
$Y_MinorScale = $Y_MajorScale / 2;
$data1 = $newParam1;
// Precision digits in BC math.
bcscale( 10 );
// Start a regression class with a maximum of 4rd degree polynomial.
$polynomialRegression1 = new PolynomialRegression( 4 );
// Add all the data to the regression analysis.
foreach ( $data1 as $dataPoint1 )
$polynomialRegression1->addData( $dataPoint1[ 0 ], $dataPoint1[ 1 ] );
// Add raw data to plot.
plotRenderData( $data1, $colorMap[ "Blue" ] );
$plot->setX_Span( 0, $xMax );
$plot->setY_Span( 0, 1 );
plotAddScale();
// Render the points to image
$plot->setCircleSize( 3 );
$plot->renderPoints();
// Get coefficients for the polynomial.
$coefficients = $polynomialRegression1->getCoefficients();
// Place text
imageString($image1,5,0,0,'n',$colorMap[ "Black" ]);
imagerectangle($image1,6,12,7,17,$colorMap[ "Black" ]);
imageString($image1,3,355,313,'Q[m3/min]',$colorMap[ "Black" ]);
// rysuje punkty
// plotRenderRegression( $polynomialRegression1, $coefficients, $xMinLine, $xMaxLine, $colorMap[ "Red" ] );
plotRenderRegression( $polynomialRegression1, $coefficients, $scope1[0], $scope1[2], $colorMap[ "Red" ] );
plotRenderRegression( $polynomialRegression1, $coefficients, $scope1[2], $scope1[3], $colorMap[ "DarkYellow" ] );
plotRenderRegression( $polynomialRegression1, $coefficients, $scope1[3], $scope1[5], $colorMap[ "Green" ] );
plotRenderRegression( $polynomialRegression1, $coefficients, $scope1[5], $scope1[6], $colorMap[ "DarkYellow" ] );
plotRenderRegression( $polynomialRegression1, $coefficients, $scope1[6], $xMaxLine, $colorMap[ "Red" ] );
imagePNG( $image1,$fileName2);
}
?>
0)
echo"

";
else
echo $lab_Field_site203_017;
?>
0)
echo"

";
else
echo $lab_Field_site203_017;
?>