diff --git a/fhem/webfrontend/pgm3/CHANGED b/fhem/webfrontend/pgm3/CHANGED index ece1be80d..e7c7d4545 100644 --- a/fhem/webfrontend/pgm3/CHANGED +++ b/fhem/webfrontend/pgm3/CHANGED @@ -110,3 +110,4 @@ Changelog -- Feature: WS300 is now supported -- Internal: Adjusted to the new internal structure of FHEM. YOU MUST HAVE FHEM >=4.0 -- Internal: random-device for one-time at-order (define at set ...) +-- Feature: new arrangement of the graphics, FHT-Pulldown will now called by "adjust", FHT-PHP-Graphics now with Temperature/desired-temp and actuator diff --git a/fhem/webfrontend/pgm3/HISTORY b/fhem/webfrontend/pgm3/HISTORY index 3241177ec..da8db15af 100644 --- a/fhem/webfrontend/pgm3/HISTORY +++ b/fhem/webfrontend/pgm3/HISTORY @@ -4,3 +4,9 @@ - Martin 2007-03-19 - Feature: WS300 ist now supported - Adjusted to new structure of FHEM (IT NEEDS now FHZ1000/FHEM >= v3.4!) + +- Martin 2007-03-22 + - New arrangement of the graphics. + - Better support for WS300 + - FHT-Pulldown will now be called by the button "adjust" + - FHT-PHP-Grafics now with temperature, desired-temp and actuator diff --git a/fhem/webfrontend/pgm3/config.php b/fhem/webfrontend/pgm3/config.php index e22af767f..3dbeb66ba 100644 --- a/fhem/webfrontend/pgm3/config.php +++ b/fhem/webfrontend/pgm3/config.php @@ -1,16 +1,16 @@ global" $fhz1000port="7072"; # port of fhz1000.pl $logpath="/var/tmp"; # where are your logs? - $fhz1000_pl="/home/FHEM/fhem/fhem.pl"; #only required if you are using PHP4 + $fhz1000_pl="/home/FHZ/fhz1000/fhz1000.pl"; #only required if you are using PHP4 ################################################################################## ###### nice to have @@ -67,11 +67,17 @@ ############################################################################################## ## FHT-Devices - $imgmaxxfht=450; #Size of the pictures Default: 450 for faster systems else 380 + $imgmaxxfht=685; #Size of the pictures Default: 685 $imgmaxyfht=52; $show_desiredtemp=1; # show the desired_temp as a graphic (0/1) + $desR='255'; $desG='255'; $desB='255'; # Color of desired-temp-line Red/Green/Blue (Default: 255/255/255) + $show_actuator=1; # show the actuator-value as a graphic (0/1) + $actR='255'; $actG='247'; $actB='200'; # Color of Actuator-line Red/Green/Blue (Default: 255/247/200) $FHTyrange='15:31'; # Temperature in gnuplot. Default 15 to 31 (Celsius) $FHTy2range='0:70'; # Actuator in gnuplot. Default 0 to 70 (Percent) + $maxcount='460'; # Maximum count of pixel (from right to left) (Default:460) + $XcorrectDate=325; # Text of e.g. Date from the right side (Default:325) + $XcorrectMainText=35; # Text of main text from the right side (Default: 35) $logrotateFHTlines=4300; # automatic Logrotate; $logrotate must be 'yes'. # Default:4300 # read docs/logrotate if you want adjust it manually! @@ -83,8 +89,10 @@ ############################################################################################## ## HMS-Devices - $imgmaxxhms=620; #Size of the pictures. Default: 620 for faster systems else 380 + $imgmaxxhms=685; #Size of the pictures. Default: 685 $imgmaxyhms=52; + $maxcountHMS='525'; # Maximum count of pixel (from right to left) (Default:525) + $XcorrectMainTextHMS=25; # Text of main text from the right side (Default:) $logrotateHMSlines=1200; # automatic Logrotate; $logrotate must be 'yes'. # Default:1200 # read docs/logrotate if you want adjust it manually! @@ -94,13 +102,15 @@ ############################################################################################## ## KS300-Device - $imgmaxxks=620; #Size of the pictures Default: 620 for faster systems else 380 + $imgmaxxks=685; #Size of the pictures Default: 685 $imgmaxyks=52; $showbft=1; # Display values additionaly in Beafort. Values: 0 /1 Default:1 + $maxcountKS='525'; # Maximum count of pixel (from right to left) (Default:525) + $XcorrectMainTextKS=35; # Text of main text from the right side (Default: 35) $logrotateKS300lines=2000; # automatic Logrotate; $logrotate must be 'yes'. - # Default:1900 + # Default:2000 # read docs/logrotate if you want adjust it manually # otherwise the system will slow down # pgm3 (user www-data) needs the rights to write the logs diff --git a/fhem/webfrontend/pgm3/include/fht.php b/fhem/webfrontend/pgm3/include/fht.php index b085cef4d..6fbb0df75 100755 --- a/fhem/webfrontend/pgm3/include/fht.php +++ b/fhem/webfrontend/pgm3/include/fht.php @@ -35,6 +35,8 @@ setlocale (LC_ALL, 'de_DE.utf8'); $yellow= ImageColorAllocate($im, 255, 255, 0); $lightyellow= ImageColorAllocate($im, 255, 247,222 ); $orange= ImageColorAllocate($im, 255, 230, 25); + $actuatorcolor = ImageColorAllocate($im, $actR, $actG, $actB); + $desiredcolor = ImageColorAllocate($im, $desR, $desG, $desB); ImageFill($im, 0, 0, $bg2p); @@ -47,6 +49,7 @@ setlocale (LC_ALL, 'de_DE.utf8'); $actuator_date="unknown"; $counter=count($array); $arraydesired=array(); + $arrayactuator=array(); #echo $counter; exit; @@ -69,12 +72,14 @@ setlocale (LC_ALL, 'de_DE.utf8'); $oldhour=$array[$x][12]; array_push( $_SESSION["arraydata"],array($date,$type,$temp)); array_push( $arraydesired,$desired_temp); + array_push( $arrayactuator,$actuator); } } $resultreverse = array_reverse($_SESSION["arraydata"]); $reversedesired = array_reverse($arraydesired); + $reverseactuator = array_reverse($arrayactuator); $xold=$imgmaxxfht; if ( $imgmaxxfht > count ($resultreverse) ) @@ -95,68 +100,75 @@ setlocale (LC_ALL, 'de_DE.utf8'); $tempdiff=$maxtemp-$mintemp; if ($tempdiff==0) $tempdiff=1; $fac=$imgmaxyfht/$tempdiff; + $fac2=$imgmaxyfht/100; $yold=round($imgmaxyfht-(($resultreverse[0][1]-$mintemp)*$fac)); ################### - - for ($x = 0; $x < $_SESSION["maxdata"]; $x++) + + if ($maxcount > $_SESSION["maxdata"]) {$counter=$_SESSION["maxdata"];} else {$counter=$maxcount;}; + for ($x = 0; $x < $counter; $x++) { $parts = explode("_", $resultreverse[$x][0]); if ( ($parts[0] != $olddate) ) { $olddate=$parts[0]; - #ImageLine($im, $imgmaxxfht-$x, 0,$imgmaxxfht-$x , $imgmaxyfht, $bg1p); ImageLine($im, $imgmaxxfht-$x, 0,$imgmaxxfht-$x , $imgmaxyfht, $bg1p); }; $y = round($imgmaxyfht-(($resultreverse[$x][2]-$mintemp)*$fac)); $y2 = round($imgmaxyfht-(($reversedesired[$x]-$mintemp)*$fac)); - #ImageLine($im, $imgmaxxfht-$x, $y2, $xold, $yold2, $bg1p); - if ($show_desiredtemp == 1) ImageLine($im, $imgmaxxfht-$x+1, $y2, $xold, $yold2, $lightyellow); + $y3 = round($imgmaxyfht-(($reverseactuator[$x])*$fac2)); + if ($show_actuator== 1) ImageLine($im, $imgmaxxfht-$x+1, $y3, $xold, $yold3, $actuatorcolor); + if ($show_desiredtemp == 1) ImageLine($im, $imgmaxxfht-$x+1, $y2, $xold, $yold2, $desiredcolor); ImageLine($im, $imgmaxxfht-$x, $y, $xold, $yold, $red); $xold=$imgmaxxfht-$x; $yold=$y; $yold2=$y2; + $yold3=$y3; }; #print_r($resultreverse); #print_r($reversedesired); #exit; ImageLine($im, $imgmaxxfht-$x, 0,$imgmaxxfht-$x , $imgmaxyfht, $yellow); + ImageLine($im, $imgmaxxfht-$maxcount, 0,$imgmaxxfht-$maxcount , $imgmaxyfht, $white); ###ttf + +# $text2=$resultreverse[0][0]; $text="Temperature"; $fontsize=7; $txtcolor=$bg3p; - ImageTTFText ($im, $fontsize, 0, 5, 12, $txtcolor, $fontttf, $text); + ImageTTFText ($im, $fontsize, 0, 3, 10, $txtcolor, $fontttf, $text); $text=$resultreverse[0][2]." °C"; - ImageTTFText ($im, 9, 0, 90, 35, $txtcolor, $fontttfb, $text); + ImageTTFText ($im, 9, 0, 90-$XcorrectMainText, 37, $txtcolor, $fontttfb, $text); $text= $drawfht; - ImageTTFText ($im, 8, 0, 90, 18, $txtcolor, $fontttfb, $text); + ImageTTFText ($im, 8, 0, 90-$XcorrectMainText, 22, $txtcolor, $fontttfb, $text); $txtcolor=$bg3p; $fontsize=7; $text="min= $mintemp max= $maxtemp"; - ImageTTFText ($im, $fontsize, 0, 67, 47, $txtcolor, $fontttf, $text); + ImageTTFText ($im, $fontsize, 0, 67-$XcorrectMainText, 49, $txtcolor, $fontttf, $text); $text=$txtroom.$room; - ImageTTFText ($im, $fontsize, 0, 5, $imgmaxyfht-7, $txtcolor, $fontttf, $text); + ImageTTFText ($im, $fontsize, 0, 3, 49, $txtcolor, $fontttf, $text); $text="desired-temp: $desired_temp"; - ImageTTFText ($im, $fontsize, 0, $imgmaxxfht-230, 23, $txtcolor, $fontttf, $text); + ImageTTFText ($im, $fontsize, 0, $imgmaxxfht-230-$XcorrectDate, 23, $txtcolor, $fontttf, $text); - $text=$desired_date; - ImageTTFText ($im, $fontsize, 0, $imgmaxxfht-127, 23, $txtcolor, $fontttf, $text); + #$text=$desired_date; + #ImageTTFText ($im, $fontsize, 0, $imgmaxxfht-127-$XcorrectDate, 23, $txtcolor, $fontttf, $text); $text="Actuator [%]: $actuator"; - ImageTTFText ($im, $fontsize, 0, $imgmaxxfht-230, 33, $txtcolor, $fontttf, $text); + ImageTTFText ($im, $fontsize, 0, $imgmaxxfht-230-$XcorrectDate, 33, $txtcolor, $fontttf, $text); - $text=$actuator_date; - ImageTTFText ($im, $fontsize, 0, $imgmaxxfht-127, 33, $txtcolor, $fontttf, $text); + #$text=$actuator_date; + #ImageTTFText ($im, $fontsize, 0, $imgmaxxfht-127-$XcorrectDate, 33, $txtcolor, $fontttf, $text); $text=$resultreverse[0][0]; ImageTTFText ($im, $fontsize, 0, $imgmaxxfht-127, 13, $txtcolor, $fontttf, $text); + #ImageTTFText ($im, $fontsize, 0, $imgmaxxfht-127-$XcorrectDate, 13, $txtcolor, $fontttf, $text); header("Content-type: image/png"); imagePng($im); diff --git a/fhem/webfrontend/pgm3/include/fhtpulldown.php b/fhem/webfrontend/pgm3/include/fhtpulldown.php index 90ef0805c..8c46fabae 100644 --- a/fhem/webfrontend/pgm3/include/fhtpulldown.php +++ b/fhem/webfrontend/pgm3/include/fhtpulldown.php @@ -12,7 +12,7 @@ echo " - FHT: + FHT:
"; # # @@ -86,7 +86,7 @@ echo ""; echo ""; } - + if (isset($valuetime)) echo""; echo""; #$order="$atorder $attime set $fhtdev $orderpulldown $valuetime"; diff --git a/fhem/webfrontend/pgm3/include/fs20pulldown.php b/fhem/webfrontend/pgm3/include/fs20pulldown.php index fa7f93a1a..fc5ca7173 100644 --- a/fhem/webfrontend/pgm3/include/fs20pulldown.php +++ b/fhem/webfrontend/pgm3/include/fs20pulldown.php @@ -10,7 +10,7 @@ echo " - FS20: + FS20: diff --git a/fhem/webfrontend/pgm3/include/hms100.php b/fhem/webfrontend/pgm3/include/hms100.php index 1f342954f..b3dcccb3c 100755 --- a/fhem/webfrontend/pgm3/include/hms100.php +++ b/fhem/webfrontend/pgm3/include/hms100.php @@ -47,6 +47,7 @@ $supported_HMS= array('HMS100T','HMS100TF','HMS100WD','HMS100MG','HMS100TFK','HM $mintemp=100; $maxtemp=-100; $counter=count($array); + #if ($maxcountHMS < $counter) {$counter=$maxcountHMS;}; #Logrotate if ((($logrotateHMSlines+100) < $counter) and ($logrotate == 'yes')) LogRotate($array,$file,$logrotateHMSlines); @@ -94,7 +95,8 @@ if ( $type == "HMS100T" or $type == "HMS100TF" ) ## hms100t-Device. ################### - for ($x = 0; $x <= $_SESSION["maxdata"]; $x++) + if ($maxcountHMS < $_SESSION["maxdata"]) {$anzlines=$maxcountHMS;} else {$anzlines= $_SESSION["maxdata"];} + for ($x = 0; $x < $anzlines; $x++) { $parts = explode("_", $resultreverse[$x][0]); @@ -109,6 +111,7 @@ if ( $type == "HMS100T" or $type == "HMS100TF" ) ## hms100t-Device. $yold=$y; }; ImageLine($im, $imgmaxxhms-$x, 0,$imgmaxxhms-$x , $imgmaxyhms, $yellow); + ImageLine($im, $imgmaxxhms-$maxcountHMS, 0,$imgmaxxhms-$maxcountHMS , $imgmaxyhms, $white); $tempTEMP=$temp; }; #HMS100T @@ -121,7 +124,8 @@ if ( $type == "HMS100TF") ## hms100tf-Device. $min=100; $max=-100; - for ($x = 0; $x <= $_SESSION["maxdata"]; $x++) + if ($maxcountHMS < $_SESSION["maxdata"]) {$anzlines=$maxcountHMS;} else {$anzlines= $_SESSION["maxdata"];} + for ($x = 0; $x < $anzlines; $x++) { $temp=$resultreverse[$x][2]; if ( $temp > $max ) $max=$temp; @@ -135,7 +139,9 @@ if ( $type == "HMS100TF") ## hms100tf-Device. $xold=$imgmaxxhms; $yold=round($imgmaxyhms-(($resultreverse[0][2]-$min)*$fac)); - for ($x = 0; $x < count($resultreverse); $x++) + if ($maxcountHMS < $_SESSION["maxdata"]) {$anzlines=$maxcountHMS;} else {$anzlines= $_SESSION["maxdata"];} + for ($x = 0; $x < $anzlines; $x++) + #for ($x = 0; $x < count($resultreverse); $x++) { $y = round($imgmaxyhms-(($resultreverse[$x][2]-$min)*$fac)); ImageLine($im, $imgmaxxhms-$x, $y, $xold, $yold, $white); @@ -180,17 +186,17 @@ if ( $type == "HMS100T" or $type == "HMS100TF" ) $text="Temperature"; $fontsize=7; $txtcolor=$bg3p; - ImageTTFText ($im, $fontsize, 0, 5, 12, $txtcolor, $fontttf, $text); + ImageTTFText ($im, $fontsize, 0, 3, 10, $txtcolor, $fontttf, $text); $txtcolor=$bg3p; $fontsize=9; $text=$tempTEMP." °C"; $tvalue=$tempTEMP; - ImageTTFText ($im, $fontsize, 0, 80, 35, $txtcolor, $fontttfb, $text); + ImageTTFText ($im, $fontsize, 0, 90-$XcorrectMainTextHMS, 37, $txtcolor, $fontttfb, $text); $txtcolor=$bg3p; $fontsize=7; $text="min= $mintemp max= $maxtemp"; - ImageTTFText ($im, $fontsize, 0, 62, 47, $txtcolor, $fontttf, $text); + ImageTTFText ($im, $fontsize, 0, 67-$XcorrectMainTextHMS, 49, $txtcolor, $fontttf, $text); $text=$resultreverse[0][0]; ImageTTFText ($im, $fontsize, 0, $imgmaxxhms-127, 13, $txtcolor, $fontttf, $text); }; @@ -199,10 +205,10 @@ if ( $type == "HMS100T" or $type == "HMS100TF" ) $txtcolor=$bg3p; $fontsize=9; $text= $drawhms; - ImageTTFText ($im, 8, 0, 80, 18, $txtcolor, $fontttfb, $text); + ImageTTFText ($im, 8, 0,90-$XcorrectMainTextHMS, 22, $txtcolor, $fontttfb, $text); $fontsize=7; $text=$txtroom.$room; - ImageTTFText ($im, $fontsize, 0, 5, $imgmaxyhms-7, $txtcolor, $fontttf, $text); + ImageTTFText ($im, $fontsize, 0, 3, $imgmaxyhms-7, $txtcolor, $fontttf, $text); $text=$type; ImageTTFText ($im, $fontsize, 0, 5, $imgmaxyhms-17, $txtcolor, $fontttf, $text); @@ -232,8 +238,8 @@ if ( $type == "HMS100WD" or $type == "HMS100MG" or $type == "HMS100W" else { $_SESSION["maxdata"] = $imgmaxxhms; }; - for ($x = 0; $x < $_SESSION["maxdata"]-1; $x++) - + if ($maxcountHMS < $_SESSION["maxdata"]) {$anzlines=$maxcountHMS;} else {$anzlines= $_SESSION["maxdata"];} + for ($x = 0; $x < $anzlines; $x++) { $parts = explode("_", $resultreverse[$x][0]); if ( ($parts[0] != $olddate) ) diff --git a/fhem/webfrontend/pgm3/include/ks300.php b/fhem/webfrontend/pgm3/include/ks300.php index b4bc3a26a..e7e7c739e 100755 --- a/fhem/webfrontend/pgm3/include/ks300.php +++ b/fhem/webfrontend/pgm3/include/ks300.php @@ -13,7 +13,7 @@ $drawks=$_GET['drawks']; $room=$_GET['room']; $avgday=$_GET['avgday']; $avgmonth=$_GET['avgmonth']; - +#$drawks="ks300"; $file="$logpath/$drawks.log"; if (! file_exists($file)) show_error($file,$drawks,$imgmaxxks,$imgmaxyks); @@ -94,8 +94,8 @@ $avgmonth=$_GET['avgmonth']; $yold=round($imgmaxyks-(($resultreverse[0][1]-$mintemp)*$fac)); ################### - - for ($x = 0; $x <= $maxdata; $x++) + if ($maxcountKS < $maxdata) {$anzlines=$maxcountKS;} else {$anzlines=$maxdata;} + for ($x = 0; $x < $anzlines; $x++) { $y = round($imgmaxyks-(($resultreverse[$x][1]-$mintemp)*$fac)); ImageLine($im, $imgmaxxks-$x, $y, $xold, $yold, $red); @@ -109,6 +109,7 @@ $avgmonth=$_GET['avgmonth']; }; }; ImageLine($im, $imgmaxxks-$x, 0,$imgmaxxks-$x , $imgmaxyks, $yellow); + ImageLine($im, $imgmaxxks-$maxcountKS, 0,$imgmaxxks-$maxcountKS , $imgmaxyks, $white); if ($mintemp < 0) { $y = round($imgmaxyks-((0-$mintemp)*$fac)); @@ -117,15 +118,15 @@ $avgmonth=$_GET['avgmonth']; $text="Temperature"; $fontsize=7; $txtcolor=$bg3p; - ImageTTFText ($im, $fontsize, 0, 5, 12, $txtcolor, $fontttf, $text); + ImageTTFText ($im, $fontsize, 0, 3, 10, $txtcolor, $fontttf, $text); $fontsize=9; $text=$temp." °C"; - ImageTTFText ($im, $fontsize, 0, 80, 35, $txtcolor, $fontttfb, $text); + ImageTTFText ($im, $fontsize, 0, 90-$XcorrectMainTextKS, 37, $txtcolor, $fontttfb, $text); $text= $drawks; - ImageTTFText ($im, 8, 0, 80, 18, $txtcolor, $fontttfb, $text); + ImageTTFText ($im, 8, 0, 90-$XcorrectMainTextKS, 22, $txtcolor, $fontttfb, $text); $fontsize=7; $text="min= $mintemp max= $maxtemp"; - ImageTTFText ($im, $fontsize, 0, 60, 47, $txtcolor, $fontttf, $text); + ImageTTFText ($im, $fontsize, 0, 67-$XcorrectMainTextKS, 49, $txtcolor, $fontttf, $text); $imt=$im; #humidity @@ -140,7 +141,8 @@ $avgmonth=$_GET['avgmonth']; $min=100; $max=-100; - for ($x = 0; $x <= $maxdata-1; $x++) + if ($maxcountKS < $maxdata) {$anzlines=$maxcountKS;} else {$anzlines=$maxdata;} + for ($x = 0; $x < $anzlines; $x++) { $temp=$resultreverse[$x][2]; if ( $temp > $max ) $max=$temp; @@ -156,7 +158,9 @@ $avgmonth=$_GET['avgmonth']; $yold=round($imgmaxyks-(($resultreverse[0][2]-$min)*$fac)); $olddate = ($resultreverse[0][0][9]); - for ($x = 0; $x < count($resultreverse); $x++) + $countresultrev=count($resultreverse); + if ($maxcountKS < $countresultrev) {$anzlines=$maxcountKS;}else {$anzlines=$countresultrev;} + for ($x = 0; $x < $anzlines; $x++) { $y = round($imgmaxyks-(($resultreverse[$x][2]-$min)*$fac)); ImageLine($im, $imgmaxxks-$x, $y, $xold, $yold, $red); @@ -170,16 +174,17 @@ $avgmonth=$_GET['avgmonth']; }; }; ImageLine($im, $imgmaxxks-$x, 0,$imgmaxxks-$x , $imgmaxyks, $yellow); + ImageLine($im, $imgmaxxks-$maxcountKS, 0,$imgmaxxks-$maxcountKS , $imgmaxyks, $white); $text="Humidity"; $fontsize=7; $txtcolor=$bg3p; - ImageTTFText ($im, $fontsize, 0, 5, 12, $txtcolor, $fontttf, $text); + ImageTTFText ($im, $fontsize, 0, 3, 10, $txtcolor, $fontttf, $text); $fontsize=9; $text=$temp." %"; - ImageTTFText ($im, $fontsize, 0, 80, 35, $txtcolor, $fontttfb, $text); + ImageTTFText ($im, $fontsize, 0, 90-$XcorrectMainText, 37, $txtcolor, $fontttfb, $text); $fontsize=7; $text="min= $min max= $max"; - ImageTTFText ($im, $fontsize, 0, 60, 47, $txtcolor, $fontttf, $text); + ImageTTFText ($im, $fontsize, 0, 67-$XcorrectMainText, 49, $txtcolor, $fontttf, $text); $imh=$im; @@ -192,7 +197,8 @@ $avgmonth=$_GET['avgmonth']; $min=120000; $max=-100; - for ($x = 0; $x <= $maxdata; $x++) + if ($maxcountKS < $maxdata) {$anzlines=$maxcountKS;} else {$anzlines=$maxdata;} + for ($x = 0; $x < $anzlines; $x++) { $temp=$resultreverse[$x][3]; if ( $temp > $max ) $max=$temp; @@ -207,7 +213,9 @@ $avgmonth=$_GET['avgmonth']; $xold=$imgmaxxks; $yold=round($imgmaxyks-(($resultreverse[0][3]-$min)*$fac)); - for ($x = 0; $x < count($resultreverse); $x++) + $countresultrev=count($resultreverse); + if ($maxcountKS < $countresultrev) {$anzlines=$maxcountKS;}else {$anzlines=$countresultrev;} + for ($x = 0; $x < $anzlines; $x++) { $y = round($imgmaxyks-(($resultreverse[$x][3]-$min)*$fac)); ImageLine($im, $imgmaxxks-$x, $y, $xold, $yold, $red); @@ -221,26 +229,27 @@ $avgmonth=$_GET['avgmonth']; }; }; ImageLine($im, $imgmaxxks-$x, 0,$imgmaxxks-$x , $imgmaxyks, $yellow); + ImageLine($im, $imgmaxxks-$maxcountKS, 0,$imgmaxxks-$maxcountKS , $imgmaxyks, $white); if (isset($willi)) $text="Air Pressure"; else $text="Wind"; $fontsize=7; $txtcolor=$bg3p; - ImageTTFText ($im, $fontsize, 0, 5, 12, $txtcolor, $fontttf, $text); + ImageTTFText ($im, $fontsize, 0, 3, 10, $txtcolor, $fontttf, $text); $fontsize=9; if (isset($willi)) $text=$temp." hPa"; else $text=$temp." km/h"; - ImageTTFText ($im, $fontsize, 0, 80, 35, $txtcolor, $fontttfb, $text); + ImageTTFText ($im, $fontsize, 0, 80-$XcorrectMainTextKS, 37, $txtcolor, $fontttfb, $text); $fontsize=7; if (($showbft==1) and (! isset($willi))) { $text="( ".bft($temp)." Bft)"; - ImageTTFText ($im, $fontsize, 0, 150, 35, $txtcolor, $fontttfb, $text); + ImageTTFText ($im, $fontsize, 0, 140-$XcorrectMainTextKS, 37, $txtcolor, $fontttfb, $text); $text2="min= $min max= $max (".bft($max)." Bft)"; } else { $text2="min= $min max= $max"; } - ImageTTFText ($im, $fontsize, 0, 60, 47, $txtcolor, $fontttf, $text2); + ImageTTFText ($im, $fontsize, 0, 57-$XcorrectMainTextKS, 49, $txtcolor, $fontttf, $text2); $imw=$im; @@ -256,7 +265,8 @@ if (! isset($willi)) $min=120; $max=-100; - for ($x = 0; $x <= $maxdata; $x++) + if ($maxcountKS < $maxdata) {$anzlines=$maxcountKS;} else {$anzlines=$maxdata;} + for ($x = 0; $x < $anzlines; $x++) { $temp=$resultreverse[$x][4]; if ( $temp > $max ) $max=$temp; @@ -272,7 +282,8 @@ if (! isset($willi)) $xold=$imgmaxxks; $yold=round($imgmaxyks-(($resultreverse[0][4]-$min)*$fac)); - for ($x = 0; $x <= $maxdata; $x++) + if ($maxcountKS < $maxdata) {$anzlines=$maxcountKS;} else {$anzlines=$maxdata;} + for ($x = 0; $x < $anzlines; $x++) { $parts = explode("_", $resultreverse[$x][0]); if ( ($parts[0] != $olddate) ) @@ -293,6 +304,7 @@ if (! isset($willi)) }; ImageLine($im, $imgmaxxks-$x, 0,$imgmaxxks-$x , $imgmaxyks, $yellow); + ImageLine($im, $imgmaxxks-$maxcountKS, 0,$imgmaxxks-$maxcountKS , $imgmaxyks, $white); $fontsize=7; $text="Is raining:"; ImageTTFText ($im, $fontsize, 0, 50, 14, $txtcolor, $fontttf, $text); @@ -304,21 +316,21 @@ if (! isset($willi)) $text="Rain"; $fontsize=7; $txtcolor=$bg3p; - ImageTTFText ($im, $fontsize, 0, 5, 12, $txtcolor, $fontttf, $text); + ImageTTFText ($im, $fontsize, 0, 3, 10, $txtcolor, $fontttf, $text); $fontsize=9; $text=$temp." l/m2"; - ImageTTFText ($im, $fontsize, 0, 80, 35, $txtcolor, $fontttfb, $text); + ImageTTFText ($im, $fontsize, 0, 90-$XcorrectMainTextKS, 37, $txtcolor, $fontttfb, $text); $fontsize=7; $text="min= $min max= $max"; ImageTTFText ($im, $fontsize, 0, $imgmaxxks-130, 30, $txtcolor, $fontttf, $text); $text=$resultreverse[0][0]; ImageTTFText ($im, $fontsize, 0, $imgmaxxks-130, 15, $txtcolor, $fontttf, $text); $text="avg_day: ".$avgday; - ImageTTFText ($im, $fontsize, 0, 70, 47, $txtcolor, $fontttf, $text); + ImageTTFText ($im, $fontsize, 0, 70, 49, $txtcolor, $fontttf, $text); $text="avg_mon: ".$avgmonth; - ImageTTFText ($im, $fontsize, 0, 320, 47, $txtcolor, $fontttf, $text); + ImageTTFText ($im, $fontsize, 0, 320, 49, $txtcolor, $fontttf, $text); $text=$room; - ImageTTFText ($im, $fontsize, 0, 7, 47, $txtcolor, $fontttf, $text); + ImageTTFText ($im, $fontsize, 0, 3, 49, $txtcolor, $fontttf, $text); $imr=$im; } else # Willi: @@ -331,7 +343,8 @@ else # Willi: $min=120000; $max=-100; - for ($x = 0; $x <= $maxdata; $x++) + if ($maxcountKS < $maxdata) {$anzlines=$maxcountKS;} else {$anzlines=$maxdata;} + for ($x = 0; $x < $anzlines; $x++) { $temp=$resultreverse[$x][4]; if ( $temp > $max ) $max=$temp; @@ -360,6 +373,7 @@ else # Willi: }; }; ImageLine($im, $imgmaxxks-$x, 0,$imgmaxxks-$x , $imgmaxyks, $yellow); + ImageLine($im, $imgmaxxks-$maxcountKS, 0,$imgmaxxks-$maxcountKS , $imgmaxyks, $white); $text="Willi"; $fontsize=7; $txtcolor=$bg3p; @@ -373,7 +387,8 @@ else # Willi: ImageTTFText ($im, $fontsize, 0, 60, 47, $txtcolor, $fontttf, $text2); $text=$resultreverse[0][0]; ImageTTFText ($im, $fontsize, 0, $imgmaxxks-130, 15, $txtcolor, $fontttf, $text); - + $text=$room; + ImageTTFText ($im, $fontsize, 0, 7, 47, $txtcolor, $fontttf, $text); $imr=$im; } diff --git a/fhem/webfrontend/pgm3/index.php b/fhem/webfrontend/pgm3/index.php index 9e5a31a14..eb4ef2aeb 100644 --- a/fhem/webfrontend/pgm3/index.php +++ b/fhem/webfrontend/pgm3/index.php @@ -141,7 +141,7 @@ $pgm3version='0.8.0cvs'; if (isset ($showat)) { $forwardurl=$forwardurl.'&showat';}; if (isset ($showhist)) { $forwardurl=$forwardurl.'&showhist';}; if (isset ($showmenu)) - { $forwardurl=$forwardurl.'&fs20dev='.$fs20dev.'&orderpulldown='.$orderpulldown.'&showmenu='.$showmenu.'&showroom='.$showroom;} + { $forwardurl=$forwardurl.'&fs20dev='.$fs20dev.'&orderpulldown='.$orderpulldown.'&valuetime='.$valuetime.'&showmenu='.$showmenu.'&showroom='.$showroom;} unset($link); if (isset ($showlogs)) $link=$link.'&showlogs'; if (isset ($shownoti)) $link=$link.'&shownoti'; @@ -384,6 +384,7 @@ xml_parser_free($xml_parser); #print_r($rooms); echo "Count: $countrooms"; exit; #print_r($fs20devs); exit; +#echo count($stack[0][children]);exit; # Print Array on Screen @@ -428,22 +429,26 @@ xml_parser_free($xml_parser); echo ""; - if (($show_general=='1') AND ($showmenu=='1')) - {echo " + if ($showmenu=='1') + { + if ($show_general=='1') + {echo " - - General: + General: + - "; - }; + + "; + }; - if (($show_fs20pulldown=='1') AND ($showmenu=='1')) include 'include/fs20pulldown.php'; - if (($show_fhtpulldown=='1') AND ($showmenu=='1')) include 'include/fhtpulldown.php'; + if ($show_fs20pulldown=='1') include 'include/fs20pulldown.php'; + if ($show_fhtpulldown=='1') include 'include/fhtpulldown.php'; + }; ############################ ROOMS if (($showroombuttons==1) and (count($rooms)>1)) @@ -468,6 +473,13 @@ xml_parser_free($xml_parser); } ##################################################################################################################### + + ##### Check Version of FHEM + if (! ($stack[0][children][0][name]=='Internal_LIST')) ##older FHZ100 have no Internal_LIST + {echo "Error!! You need at least FHEM-4.0 to run this pgm3!!";} + + + ##### Let's go.... :-))))) for($i=0; $i < count($stack[0][children]); $i++) { @@ -538,7 +550,9 @@ xml_parser_free($xml_parser); - ";} + + adjust"; + } else {echo "
@@ -546,24 +560,11 @@ xml_parser_free($xml_parser); -
"; - }; - echo " - $FHTdev -
desired-temp - - - - - "; - echo " -
- "; + + adjust"; + }; - echo " + echo " "; echo ""; @@ -577,16 +578,18 @@ xml_parser_free($xml_parser);
"; } + if ( $showfht==$FHTdev) + { + echo ""; for($k=0; $k < count($stack[0][children][$i][children][$j][children]); $k++) { - if ( $showfht==$FHTdev) - { - $name=$stack[0][children][$i][children][$j][children][$k][attrs][name]; + $name=$stack[0][children][$i][children][$j][children][$k][attrs][key]; $value=$stack[0][children][$i][children][$j][children][$k][attrs][value]; $measured=$stack[0][children][$i][children][$j][children][$k][attrs][measured]; - echo ""; + echo ""; } + echo "
$FHTdev (FHT): $name$value - $measured
$FHTdev (FHT): $name$value + $measured
"; } } } @@ -613,21 +616,20 @@ xml_parser_free($xml_parser); $HMSdev=$stack[0][children][$i][children][$j][attrs][name]; if ($type=="HMS100T" or $type=="HMS100TF") { - if ($showhmsgnu== $HMSdev) - {$formvalue="hide";$gnuvalue="";} + if ($showhmsgnu== $HMSdev) {$formvalue="hide";$gnuvalue="";} else {$formvalue="show";$gnuvalue=$HMSdev;}; - echo " + echo "
-
"; + "; } else - echo ""; - echo " $HMSdev - "; + {echo "";} + + echo " "; if ($showhmsgnu == $HMSdev and $showgnuplot == 1) { drawgnuplot($HMSdev,$type,$gnuplot,$pictype,$logpath,0,0); @@ -655,7 +657,11 @@ xml_parser_free($xml_parser); $check=$stack[0][children][$i][children][$j][children][$k][attrs][key]; $check2=$stack[0][children][$i][children][$j][children][$k][attrs][name]; if ($check=='room') $room=$stack[0][children][$i][children][$j][children][$k][attrs][value]; - + elseif ($check=='willi') $willi=1; + elseif ($check=='avg_day') $KSavgday=$stack[0][children][$i][children][$j][children][$k][attrs][value]; + elseif ($check=='temperature') $KSmeasured=$stack[0][children][$i][children][$j][children][$k][attrs][measured]; + elseif ($check=='avg_month') $KSavgmonth=$stack[0][children][$i][children][$j][children][$k][attrs][value]; + # for older versions... if ($check2=='avg_month') $KSavgmonth=$stack[0][children][$i][children][$j][children][$k][attrs][value]; elseif ($check2=='avg_day') $KSavgday=$stack[0][children][$i][children][$j][children][$k][attrs][value]; elseif ($check2=='temperature') $KSmeasured=$stack[0][children][$i][children][$j][children][$k][attrs][measured]; @@ -688,7 +694,7 @@ xml_parser_free($xml_parser); "; }; - echo " $KSdev
"; + echo ""; echo ""; echo ""; if (! isset ($willi)) $drawtype="KS300"; else $drawtype="WS300";