1 && $_POST['inPumpManufName']>0 )
{
$varAfterChange_01= str_replace(",", ".", $_POST['inPumpLg']);
$varAfterChange_02= str_replace(",", ".", $_POST['inPumpWeig']);
$varAfterChange_03= str_replace(",", ".", $_POST['inPumpDiam']);
mysql_query("UPDATE seg_pumps SET PUP_MCF_ID=".$_POST['inPumpManufName'].",PUP_NAME='".$_POST['inPumpName']."',PUP_PUMP_LENGTH=$varAfterChange_01,PUP_WEIGHT=$varAfterChange_02,PUP_DIAMETER=$varAfterChange_03 WHERE PUP_ID=".$_POST['pup']);
$count=0;
$wynik = mysql_query("select PEP_ID from seg_pump_eng_param where PEP_TYPE='H' and PEP_PUP_ID=".$_POST['pup']." order by PEP_X_PARAM");
if($wynik)while ($r = mysql_fetch_array($wynik))
{
$fieldID = $r["PEP_ID"];
$vName = "inPump_H_".$fieldID;
$vValue = str_replace(",", ".",$_POST[$vName]);
mysql_query("UPDATE seg_pump_eng_param SET PEP_Y_PARAM=$vValue WHERE PEP_ID=$fieldID");
$count++;
if ($count==3)
mysql_query("UPDATE seg_pumps SET PUP_H_MAX=$vValue WHERE PUP_ID=".$_POST['pup']);
else if ($count==5)
mysql_query("UPDATE seg_pumps SET PUP_H_P=$vValue WHERE PUP_ID=".$_POST['pup']);
else if ($count==7)
mysql_query("UPDATE seg_pumps SET PUP_H_MIN=$vValue WHERE PUP_ID=".$_POST['pup']);
}
$count=0;
$wynik = mysql_query("select PEP_ID from seg_pump_eng_param where PEP_TYPE='ETA' and PEP_PUP_ID=".$_POST['pup']." order by PEP_X_PARAM");
if($wynik)while ($r = mysql_fetch_array($wynik))
{
$fieldID = $r["PEP_ID"];
$vName = "inPump_ETA_".$fieldID;
$vValue = str_replace(",", ".",$_POST[$vName]);
mysql_query("UPDATE seg_pump_eng_param SET PEP_Y_PARAM=$vValue WHERE PEP_ID=$fieldID");
$count++;
if ($count==5)
mysql_query("UPDATE seg_pumps SET PUP_ETA_MAX=$vValue WHERE PUP_ID=".$_POST['pup']);
}
include"./site203inf_xy_formula.php";
echo"
$lab_Field_site803_015
";
}
$wynik = mysql_query("select PUP_NAME,MCF_NAME,(PUP_Q_N/60) PUP_Q_N,(PUP_Q_MIN/60) PUP_Q_MIN ,(PUP_Q_MAX/60) PUP_Q_MAX,PUP_H_P,PUP_H_MIN,PUP_H_MAX,PUP_ETA_MAX,PUP_PUMP_LENGTH,PUP_DIAMETER,PUP_WEIGHT from seg_pumps left join seg_manufacturers on PUP_MCF_ID=MCF_ID where PUP_ID=".$_GET['pup']);
if($wynik)while ($r = mysql_fetch_array($wynik))
{
$sql_1 = $r["PUP_NAME"];
$sql_2 = $r["MCF_NAME"];
$sql_3 = getStringFloatRound($r["PUP_Q_N"]);
$sql_4 = getStringFloatRound($r["PUP_Q_MIN"]);
$sql_5 = getStringFloatRound($r["PUP_Q_MAX"]);
$sql_6 = getStringFloatRound($r["PUP_H_P"]);
$sql_7 = getStringFloatRound($r["PUP_H_MIN"]);
$sql_8 = getStringFloatRound($r["PUP_H_MAX"]);
$sql_9 = getStringFloatRound($r["PUP_ETA_MAX"]);
$sql_10 = getStringFloatRound($r["PUP_PUMP_LENGTH"]);
$sql_11 = getStringFloatRound($r["PUP_DIAMETER"]);
$sql_12 = getStringFloatRound($r["PUP_WEIGHT"]);
}
?>
|
|
|
|
$licz. |
$param_1 |
$param_2 |
$param_3 |
";
$licz++;
}
?>
|
|
|
|
$param_4 |
$param_5 |
$param_6 |
$param_7 |
";
}
?>
1 && sqlValue("select COUNT(1) from seg_pump_eng_param where PEP_Y_PARAM=0 and PEP_TYPE='H' and PEP_PUP_ID=".$_GET['pup'])==0)
{
// Wysokość podnoszenia
// =======================================================================================//
require_once('./polynomial/plot.php' );
$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); //$xMax = ceil($xMax+1);
//$xMax = ceil($xMax+1);
$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/4;
$X_MinorScale = $X_MajorScale / 2;
// jeżeli przeliczamy parametry dla zadaneo Q
$Y_MajorScale = $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
$font = './fonts/verdana.ttf';
imagettftext($image, 8, 0, 10,15, $colorMap["Black"], $font, 'H[m]');
imagettftext($image, 8, 0, 350,325, $colorMap["Black"], $font, 'Q[m3/min]');
// 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);
unset($scope);
unset($data);
//unset($newParam);
// =======================================================================================//
}
if ($licz>1 && sqlValue("select COUNT(1) from seg_pump_eng_param where PEP_Y_PARAM=0 and PEP_TYPE='ETA' and PEP_PUP_ID=".$_GET['pup'])<2)
{
// Sprawność
// =======================================================================================//
require_once('./polynomial/plot1.php' );
$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='H' and PEP_PUP_ID=".$_GET['pup']);
$xMaxLine = ceil($xMax); //$xMax = ceil($xMax+1);
$X_MajorScale = $xMax/4;
$X_MinorScale = $X_MajorScale / 2;
// jeżeli przeliczamy parametry dla zadaneo Q
$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
imagettftext($image1, 8, 0, 10,15, $colorMap["Black"], $font, 'n');
imagettftext($image1, 8, 0, 350,325, $colorMap["Black"], $font, 'Q[m3/min]');
// 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);
// =======================================================================================//
}
?>
1 && sqlValue("select COUNT(1) from seg_pump_eng_param where PEP_Y_PARAM=0 and PEP_TYPE='H' and PEP_PUP_ID=".$_GET['pup'])==0)
echo"

";
else
echo $lab_Field_site203_017;
?>
1 && sqlValue("select COUNT(1) from seg_pump_eng_param where PEP_Y_PARAM=0 and PEP_TYPE='ETA' and PEP_PUP_ID=".$_GET['pup'])<2)
echo"

";
else
echo $lab_Field_site203_017;
?>
$param_1) { $_POST['inQ4count']=$param_1; $erMess=$lab_Field_site203_021;}
else if ($_POST['subQ4Recount']==$lab_ButtonName_Recount && $_POST['inQ4count']<0) { $_POST['inQ4count']=0; $erMess=$lab_Field_site203_021; }
if ($_POST['inQ4count']<$scope1[2]) $style4Q = 'red_value';
else if ($_POST['inQ4count']>=$scope1[2] && $_POST['inQ4count']<$scope1[3]) $style4Q = 'yellow_value';
else if ($_POST['inQ4count']>=$scope1[3] && $_POST['inQ4count']<$scope1[5]) $style4Q = 'green_value';
else if ($_POST['inQ4count']>=$scope1[5] && $_POST['inQ4count']<$scope1[6]) $style4Q = 'yellow_value';
else if ($_POST['inQ4count']>=$scope1[6]) $style4Q = 'red_value';
$param_1 = str_replace(".",",",$param_1);
$_POST['inQ4count'] = str_replace(".",",",$_POST['inQ4count']);
?>