nicer output if no values are present at a sensor
parent
6cde55068f
commit
8109e077cd
|
|
@ -1,3 +1,8 @@
|
|||
#WeatherstationServer
|
||||
##Overview
|
||||
PHP, CSS, psChart, pChart, DBLib
|
||||
|
||||
# TODO
|
||||
|
||||
* http://www.clemensklug.de/temp/new/?mode=month&year=2014&month=5
|
||||
* wrong min_temp | 04.05.14
|
||||
|
|
|
|||
10
function.php
10
function.php
|
|
@ -57,6 +57,7 @@ function logStats($datas,$type,$alt=false,$outlineAlt=0,$mode=1){
|
|||
$left=80;
|
||||
$max=getMax($type);
|
||||
for($num=0;$num<=$max;$num++){
|
||||
$printValues=true;
|
||||
if($num>0){
|
||||
$left+=300;
|
||||
}
|
||||
|
|
@ -64,14 +65,20 @@ function logStats($datas,$type,$alt=false,$outlineAlt=0,$mode=1){
|
|||
$unit=getUnit($type);
|
||||
$stat=$timePoints=array();
|
||||
if($alt===false){
|
||||
if(is_array($data[$num])){
|
||||
$stat=dataStat($datas[$num],$type);
|
||||
$timePoints=outLinedLogPoints($datas[$num]);
|
||||
}else{
|
||||
$printValues=false;
|
||||
}
|
||||
}else{
|
||||
$stat=$alt[$num];
|
||||
$timePoints=$outlineAlt[$num];
|
||||
$printValues = $stat['min'][1]!=0;
|
||||
}
|
||||
$output.="<div style='position:absolute;left:".$left."px;'>\n";
|
||||
$output.=$type.($num+1)."<br>\n";
|
||||
if($printValues){
|
||||
$output.="minimum: ".$stat['min'][0]." @ ".ttdls((int) $stat['min'][1],$mode)."<br>\n";
|
||||
$output.="maximum: ".$stat['max'][0]." @ ".ttdls((int) $stat['max'][1],$mode)."<br>\n";
|
||||
$output.="average: ".$stat['avg']." @ ".ttdls2($stat['min'][1],$mode)."<br>\n";
|
||||
|
|
@ -82,6 +89,9 @@ function logStats($datas,$type,$alt=false,$outlineAlt=0,$mode=1){
|
|||
$output.=date("H:i:s",(int) $point[1])." - ".$point[0]/$div.$unit."<br>\n";
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$output.="Keine Daten</div>";
|
||||
}
|
||||
$output.="</div>\n";
|
||||
}
|
||||
return $output;
|
||||
|
|
|
|||
Loading…
Reference in New Issue