Hamburger Hamburger

Heating and Ventilation Control

/HV_colorMap

Keine Erläuterungen gefunden.

<?php 
/* published under GPL www.gnu.org/licenses/gpl.html */
  /*
   echo "<html><table>";
   $bar = HV_colorMap("bar");
   echo $bar;
   }
   echo "</table></html>";
  */

function HV_colorMap($T){
  /* old set
  $bgc["-10"]=" #000066"; $txt["-10"]="white";
  $bgc["0"]  =" #0000ff"; $txt["0"]  ="white";
  $bgc["10"] =" #0066ff"; $txt["10"] ="black";
  $bgc["20"] =" #00ffd6"; $txt["20"] ="black";
  $bgc["30"] =" #00ff33"; $txt["30"] ="black";
  $bgc["40"] =" #ffff00"; $txt["40"] ="black";
  $bgc["50"] =" #ff9900"; $txt["50"] ="black";
  $bgc["60"] =" #ff0000"; $txt["60"] ="white";
  $bgc["70"] =" #b80096"; $txt["70"] ="white";
  $bgc["80"] ="fuchsia"; $txt["80"] ="black";
  */
  $bgc["-1000"]=" #ffffff"; $txt["-1000"]="white";
  $bgc["-10"]=" #01006c"; $txt["-10"]="white";
  $bgc["-5"] =" #0000fe"; $txt["-5"] ="white";
  $bgc["0"]  =" #0c2df6"; $txt["0"]  ="white";
  $bgc["5"]  =" #0062ff"; $txt["5"]  ="white";
  $bgc["10"] =" #0099ff"; $txt["10"] ="black";
  $bgc["15"] =" #00ccff"; $txt["15"] ="black";
  $bgc["20"] =" #339933"; $txt["20"] ="white";
  $bgc["25"] =" #009900"; $txt["25"] ="white";
  $bgc["30"] =" #33cc33"; $txt["30"] ="black";
  $bgc["35"] =" #69ff65"; $txt["35"] ="black";
  $bgc["40"] =" #ffff66"; $txt["40"] ="black";
  $bgc["45"] =" #ffff00"; $txt["45"] ="black";
  $bgc["50"] =" #ff9703"; $txt["50"] ="black";
  $bgc["55"] =" #fc6700"; $txt["55"] ="black";
  $bgc["60"] =" #ff3300"; $txt["60"] ="white";
  $bgc["65"] =" #ff68a5"; $txt["65"] ="white";
  $bgc["70"] =" #cc3467"; $txt["70"] ="white";
  $bgc["75"] ="fuchsia"; $txt["75"] ="black";

  if($T=="bar"){
    $colorBar ="<table>";
    $keys = array_keys($bgc);
    $NoColors=count($bgc);
    for($c=0;$c<$NoColors;$c++){
      $cc=$NoColors-$c-1;
      $colorBar.="<tr><td align='right'
                  style='background-color:".$bgc[$keys[$cc]].";
                  color:".$txt[$keys[$cc]].";'>".$keys[$cc]."</td></tr>";
    } #c
    $colorBar.="</table>";
    return $colorBar;
  }else{
    $keys = array_keys($bgc);
    $NoColors=count($bgc);
    for($c=0;$c<$NoColors;$c++){
      $thisKey=$keys[$NoColors-$c-1];
      if($T>1.0*$thisKey-2.5){
	return array($bgc[$thisKey],$txt[$thisKey]);
      } #fi
    } #c
    return array("white","black");
  }
}
?>

python

1/HvcLightControl.py
2/HvcHCSR04ultrasonic.py
3/HvcPV.py
4/HvcMotorDriver.py
5/HvcRollerShutter.py
6/manGenMqttMap.py
7/HvcReadSPI.py
8/HvcMqtt.py
9/HvcTables.py
10/HvcMain.py
11/HvcSetGPIO.py
12/HvcWifiRelay.py
13/HvcOperationMode.py
14/HvcControl.py
15/HvcRaw2phys.py
16/HvcWeather.py
17/HvcOneWire.py
18/makeDoc.py
19/HvcFronius.py
20/EnergyManager.py
21/HvcSendI2C.py

php

1/HV_colorMap.php
2/HV_Admin_Login.php
3/HV_readOperationState.php
4/HV_setParameters.php
5/HV_config.php
6/EM_handleJSON.php
7/index.php
8/readFilenames.php
9/HV_restart.php
10/HV_moveGate.php
11/HV_showLog.php
12/HV_RollerShutter.php
13/EM_editParameter.php
14/HV_serviceLog.php
15/HV_H2Olevel.php
16/HV_TempCal.php
17/HV_Fronius.php
18/EM_plot.php
19/readNamedData.php
20/HV_composeH2Oplot.php
21/HVdoc.php
22/HV_showWeatherForecast.php
23/HV_showHouse.php

Der gesamte Sourcecode darf gemäß GNU General Public License weiterverbreitet werden.