0) { $xMax=0; $yMax=0; unset($pupArray); $pupArray = sqlGetResAsArray("select PUP_ID,PUP_H_MAX from seg_pumps where PUP_Q_MIN/60<".$_POST['inQpump']." and PUP_Q_MAX/60>".$_POST['inQpump']." order by PUP_NAME"); for ($i=0; $i0) { if ($_POST['inHpump']>=($tmpVal-5) && $_POST['inHpump']<=($tmpVal+8)) { $finalArray[] = array( 'pupID' => $pupArray[$i]['PUP_ID'], 'hVal' => $tmpVal, 'etaVal' => $tmpValETA ); $pupIDs[] = $pupArray[$i]['PUP_ID']; // dopisuje największą wartośc dla x,y max $tmpCount = 0; $tmpCount = count($tmpArray)-1; if ($tmpArray[$tmpCount]['PEP_X_PARAM']>$xMax) $xMax = $tmpArray[$tmpCount]['PEP_X_PARAM']; if ($pupArray[$i]['PUP_H_MAX']>$yMax) $yMax = $pupArray[$i]['PUP_H_MAX']; // ======================================== } } else { $finalArray[] = array( 'pupID' => $pupArray[$i]['PUP_ID'], 'hVal' => $tmpVal, 'etaVal' => $tmpValETA ); $pupIDs[] = $pupArray[$i]['PUP_ID']; // dopisuje największą wartośc dla x,y max $tmpCount = 0; $tmpCount = count($tmpArray)-1; if ($tmpArray[$tmpCount]['PEP_X_PARAM']>$xMax) $xMax = $tmpArray[$tmpCount]['PEP_X_PARAM']; if ($pupArray[$i]['PUP_H_MAX']>$yMax) $yMax = $pupArray[$i]['PUP_H_MAX']; // ======================================== } } unset($tmpArray); unset($pupArray); $yMax=ceil($yMax/10)*10; if(count($finalArray)>0) { $X_MajorScale = $xMax/5; $X_MinorScale = $X_MajorScale / 4; $Y_MajorScale = $yMax/4; $Y_MinorScale = $Y_MajorScale / 2; $plot = new XY_PlotClass($image); $plot->sizeWindow ( $leftMargin, $topMargin, $imageWidth - $rightMargin, $imageHeight - $bottomMargin ); // =================================================================================================== // $plot->setX_Span( 0, $xMax); $plot->setY_Span( 0, $yMax); plotAddScale(); $font = './fonts/verdana.ttf'; imagettftext($image, 10, 0, 10,15, $colorMap["Black"], $font, 'H[m]'); imagettftext($image, 10, 0, 830,395, $colorMap["Black"], $font, 'Q[m3/min]'); foreach ( $pupIDs as $pupID ) { $i=0; $j=0; $wynik = mysql_query("select (PEP_X_PARAM/60) PEP_X_PARAM,PEP_Y_PARAM,PEP_PUP_ID from seg_pump_eng_param where PEP_TYPE='H' and PEP_PUP_ID=$pupID 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; } $data = $newParam; unset($newParam); bcscale( 10 ); plotRenderData( $data, $colorMap[ "Red" ] ); $plot->setX_Span( 0, $xMax); $plot->setY_Span( 0, $yMax); // $plot->setCircleSize( 4 ); // $plot->renderPoints(); $regression = new PolynomialRegression( 4 ); foreach ( $data as $dataPoint) $regression->addData( $dataPoint[0], $dataPoint[1]); $coefficients = $regression->getCoefficients(); // Plot each of the curves. //plotRenderRegression( $regression, $coefficients, $scope[0], $scope[2], $colorMap[ "Red" ] ); plotRenderRegression( $regression, $coefficients, $scope[2], $scope[3], $colorMap[ "DarkYellow" ] ); plotRenderRegression( $regression, $coefficients, $scope[3], $scope[5], $colorMap[ "Green" ] ); plotRenderRegression( $regression, $coefficients, $scope[5], $scope[6], $colorMap[ "DarkYellow" ] ); //plotRenderRegression( $regression, $coefficients, $scope[6], $scope[7], $colorMap[ "Red" ] ); unset($regression); unset($coefficients); unset($data); unset($dataPoint); unset($scope); } } else imageString($image,5,240,190,$lab_Field_site201_006,$colorMap[ "Red" ]); } // Output image $fileName1="./charts/".$_SESSION['user']."_".date("Ymd")."_".date("His")."_chart_201_01.png"; imagePNG( $image,$fileName1); $_POST['inHpump'] = str_replace(".",",",$_POST['inHpump']); $_POST['inQpump'] = str_replace(".",",",$_POST['inQpump']); ?>

m3/min m

0 && count($pupIDs)>0) { ?>
"; $counter++; } } /* $l=0; foreach ($pupIDs as $scoupeID) { if ($l==0) $internelSQL = $scoupeID; else $internelSQL .= ",".$scoupeID; $l++; } $wynik = mysql_query("select PUP_NAME,ENG_NAME,ENG_POWER,ENG_VOLTAGE,RPE_PUP_ID,PUF_A,PUF_B,PUF_C,PUF_D from seg_pump_engine_rel left join seg_pumps on RPE_PUP_ID=PUP_ID left join seg_engines on RPE_ENG_ID=ENG_ID left join seg_pumps_xy_formula on RPE_PUP_ID=PUF_PUP_ID where RPE_PUP_ID in ($internelSQL) and PUF_TYPE='H' order by ENG_POWER,PUP_NAME,ENG_NAME"); if($wynik)while ($r = mysql_fetch_array($wynik)) { $sql_1 = $r["PUP_NAME"]; $sql_2 = $r["ENG_NAME"]; $sql_3 = $r["ENG_POWER"]; $sql_4 = $r["ENG_VOLTAGE"]; $sql_5 = $r["RPE_PUP_ID"]; $sql_A = $r["PUF_A"]; $sql_B = $r["PUF_B"]; $sql_C = $r["PUF_C"]; $sql_D = $r["PUF_D"]; $y = round($sql_A*$_POST['inQpump']*$_POST['inQpump']*$_POST['inQpump']+$sql_B*$_POST['inQpump']*$_POST['inQpump']+$sql_C*$_POST['inQpump']+$sql_D,2); echo" "; } */ ?>
Lp. Qn [m3/min] Qsz [m3/min] H(Qsz) [m] η(Qsz) ".$counter." ".$tmpArray[$j]['PUP_NAME']." ".$tmpArray[$j]['ENG_NAME']." ".round($tmpArray[$j]['PUP_Q_N'],3)." ".str_replace(".",",",$_POST['inQpump'])." ".round($finalArray[$i]['hVal'],2)." ".round($finalArray[$i]['etaVal'],2)." ".$tmpArray[$j]['ENG_POWER']." ".$tmpArray[$j]['ENG_VOLTAGE']."
$sql_1 $sql_2 ".str_replace(".",",",$_POST['inQpump'])." ".str_replace(".",",",$y)." ".setPumpETAparameterForQ($sql_5,$_POST['inQpump'])." ".str_replace(".",",",$sql_3)." ".str_replace(".",",",$sql_4)."