1Set up the Raspberry Pi
2Electrical Connection of Sensores and Actuators
3Set up the Connection
4Heating Control

no warranty for any of the provided information

HV_setParameters

Is used by:
HV_loop
HV_thermos200
index

Keine Erläuterungen gefunden.

<?php 
/* published under GPL www.gnu.org/licenses/gpl.html */
function HV_showSwitches(){
  include("HV_config.php");
  $menu = "<form action='?what2do=writeConfig' method='POST'>\n";
  $menu.= "<table border='0'>\n";
  $menu.= "<tr><td>Heizmodus:</td>
           <td align='right'>Winter:   <input type='radio' name='heatMode' value='winter'";
  if($GLOBALS['heatMode']=="winter"){$menu.= "checked='checked'";}
  $menu.= "></td>
           <td align='right'>Sommer:   <input type='radio' name='heatMode' value='summer'";
  if($GLOBALS['heatMode']=="summer"){$menu.= "checked='checked'";}
  $menu.= "></td>
           <td align='right'>Urlaub <input type='radio' name='heatMode' value='vacation'";
  if($GLOBALS['heatMode']=="vacation"){$menu.= "checked='checked'";}
  $menu.= "></td></tr>\n";
  $menu.= "<tr><td>Solar:</td>
           <td align='right'>ON   <input type='radio' name='stateSolar' value='on'";
  if($GLOBALS['stateSolar']=="on"){$menu.= "checked='checked'";}
  $menu.= "></td>
           <td align='right'>OFF  <input type='radio' name='stateSolar' value='off'";
  if($GLOBALS['stateSolar']=="off"){$menu.= "checked='checked'";}
  $menu.= "></td>
           <td align='right'>AUTO <input type='radio' name='stateSolar' value='auto'";
  if($GLOBALS['stateSolar']=="auto"){$menu.= "checked='checked'";}
  $menu.= "></td></tr>\n";
  $menu.= "<tr><td>Ofen:</td>
           <td align='right'>ON   <input type='radio' name='stateOven' value='on'";
  if($GLOBALS['stateOven']=="on"){$menu.= "checked='checked'";}
  $menu.= "></td>
           <td align='right'>OFF  <input type='radio' name='stateOven' value='off'";
  if($GLOBALS['stateOven']=="off"){$menu.= "checked='checked'";}
  $menu.= "></td>
           <td align='right'>AUTO <input type='radio' name='stateOven' value='auto'";
  if($GLOBALS['stateOven']=="auto"){$menu.= "checked='checked'";}
  $menu.= "></td></tr>\n";
  $menu.= "<tr><td>Printer:</td>
           <td align='right'>ON   <input type='radio' name='stateServ' value='on'";
  if($GLOBALS['stateServ']=="on"){$menu.= "checked='checked'";}
  $menu.= "></td>
           <td align='right'>OFF  <input type='radio' name='stateServ' value='off'";
  if($GLOBALS['stateServ']=="off"){$menu.= "checked='checked'";}
  $menu.= "></td>
           <td align='right'><!--AUTO <input type='radio' name='stateServ' value='auto'";
  if($GLOBALS['stateServ']=="auto"){$menu.= "checked='checked'";}
  $menu.= ">--></td></tr>\n";
  $menu.= "<tr><td colspan='4' align='center'><input type='submit' value='submit'></td></tr>\n";
  $menu.= "<tr><td colspan='4' align='center'> </td></tr>\n";
  $menu.= "<tr><td colspan='4' align='center'>
           <a href='?what2do=editParams'>Regelungs Parameter</a></td></tr>\n";
  $menu.= "</table>\n";
  $menu.= "<input type='hidden' name='collOffset' value='".$GLOBALS['collOffset']."'>";
  $menu.= "<input type='hidden' name='collHysteresis' value='".$GLOBALS['collHysteresis']."'>";
  $menu.= "<input type='hidden' name='TtankSPsummer' value='".$GLOBALS['TtankSPsummer']."'>";
  $menu.= "<input type='hidden' name='TtankCritical' value='".$GLOBALS['TtankCritical']."'>";
  $menu.= "<input type='hidden' name='TtankOvenOn' value='".$GLOBALS['TtankOvenOn']."'>";
  $menu.= "<input type='hidden' name='TtankOvenOff' value='".$GLOBALS['TtankOvenOff']."'>";
  $menu.= "<input type='hidden' name='solarPumpDuration' value='".$GLOBALS['solarPumpDuration']."'>";
  $menu.= "<input type='hidden' name='debug' value='".$GLOBALS['debug']."'>";
  $menu.= "<input type='hidden' name='showRawValues' value='".$GLOBALS['showRawValues']."'>";
  $menu.= "<input type='hidden' name='adminpwd' value='".$GLOBALS['adminpwd']."'>";
  $menu.= "</form>\n";
  return $menu;
}

function HV_writeConfig(){
  if(isset($_POST['heatMode']))         {$GLOBALS['heatMode']         =$_POST['heatMode'];}
  if(isset($_POST['stateSolar']))       {$GLOBALS['stateSolar']       =$_POST['stateSolar'];}
  if(isset($_POST['stateOven']))        {$GLOBALS['stateOven']        =$_POST['stateOven'];}
  if(isset($_POST['stateServ']))        {$GLOBALS['stateServ']        =$_POST['stateServ'];}
  if(isset($_POST['collOffset']))       {$GLOBALS['collOffset']       =$_POST['collOffset'];}
  if(isset($_POST['collHysteresis']))   {$GLOBALS['collHysteresis']   =$_POST['collHysteresis'];}
  if(isset($_POST['TtankSPsummer']))    {$GLOBALS['TtankSPsummer']    =$_POST['TtankSPsummer'];}
  if(isset($_POST['TtankCritical']))    {$GLOBALS['TtankCritical']    =$_POST['TtankCritical'];}
  if(isset($_POST['TtankOvenOn']))      {$GLOBALS['TtankOvenOn']      =$_POST['TtankOvenOn'];}
  if(isset($_POST['TtankOvenOff']))     {$GLOBALS['TtankOvenOff']     =$_POST['TtankOvenOff'];}
  if(isset($_POST['solarPumpDuration'])){$GLOBALS['solarPumpDuration']=$_POST['solarPumpDuration'];}
  if(isset($_POST['debug']) AND $_POST['debug']=="TRUE"){
    $GLOBALS['debug']=TRUE;
  }else{
    $GLOBALS['debug']=FALSE;
  }
  if(isset($_POST['showRawValues']) AND $_POST['showRawValues']=="TRUE"){
    $GLOBALS['showRawValues'] =TRUE;
  }else{
    $GLOBALS['showRawValues'] =FALSE;
  }
  if(isset($_POST['adminpwd']))      {$GLOBALS['adminpwd']      =$_POST['adminpwd'];}

  /* write file at off seconds only
   this way it may be read at even seconds safely */
  $now=time();
  if($now/2.0 == floor($now/2)){time_sleep_until($now+1);}
  $config ="<startphp\n";
  #$config ="\<?php\n";
  $config.="\$heatMode                ='".$GLOBALS['heatMode']."';\n";
  $config.="\$stateSolar              ='".$GLOBALS['stateSolar']."';\n";
  $config.="\$stateOven               ='".$GLOBALS['stateOven']."';\n";
  $config.="\$stateServ               ='".$GLOBALS['stateServ']."';\n";
  $config.="\$collOffset              ='".$GLOBALS['collOffset']."';\n";
  $config.="\$collHysteresis          ='".$GLOBALS['collHysteresis']."';\n";
  $config.="\$TtankSPsummer           ='".$GLOBALS['TtankSPsummer']."';\n";
  $config.="\$TtankCritical           ='".$GLOBALS['TtankCritical']."';\n";
  $config.="\$TtankOvenOn             ='".$GLOBALS['TtankOvenOn']."';\n";
  $config.="\$TtankOvenOff            ='".$GLOBALS['TtankOvenOff']."';\n";
  $config.="\$solarPumpDuration       ='".$GLOBALS['solarPumpDuration']."';\n";
  if($GLOBALS['debug']){
    $config.="\$debug                 =TRUE;\n";
  }else{
    $config.="\$debug                 =FALSE;\n";
  }
  if($GLOBALS['showRawValues']){
    $config.="\$showRawValues         =TRUE;\n";
  }else{
    $config.="\$showRawValues         =FALSE;\n";
  }
  $config.="\$adminpwd                ='".$GLOBALS['adminpwd']."';\n"; 
  #$config.="?\>"; 
  $config.="endphp>";
  
  $pf = fopen("./HV_config.php","w");
  fputs($pf,$config);
  fclose($pf);
  exec("perl -pi -e 's/startphp/?php/s' HV_config.php");
  exec("perl -pi -e 's/endphp/?/g' HV_config.php");
  /*
  $cmd="cat ".$config." > HV_config.php";
  echo str_replace("<",">",$cmd)."<br>";
  exec ($cmd);
  */
}

function HV_editParameters(){
  $menu = "<form action='?what2do=writeConfig' method='POST'>\n";
  $menu.= "<input type='hidden' name='heatMode' value='".$GLOBALS['heatMode']."'>";
  $menu.= "<input type='hidden' name='stateSolar' value='".$GLOBALS['stateSolar']."'>";
  $menu.= "<input type='hidden' name='stateOven' value='".$GLOBALS['stateOven']."'>";
  $menu.= "<input type='hidden' name='stateServ' value='".$GLOBALS['stateServ']."'>";
  $menu.= "<table border='0'>\n";
  $menu.= "<tr><td>collOffset:</td><td><input type='text' name='collOffset' value='".$GLOBALS['collOffset']."' length='4'></td>
           <td>If Tcollector falls below TtankLow + collectorOffset the pump is shut off.</td></tr>";
  $menu.= "<tr><td>collHysteresis:</td><td><input type='text' name='collHysteresis' value='".$GLOBALS['collHysteresis']."' length='4'></td>
           <td>If Tcollector increases TtankLow + collectorOffset + collectorHysteresis the pump is switched on.</td></tr>";
  $menu.= "<tr><td>TtankSPsummer:</td><td><input type='text' name='TtankSPsummer' value='".$GLOBALS['TtankSPsummer']."' length='4'></td>
           <td>Temperature to achieve in summer evenings. If tank should be hotter, it will be cooled.</td></tr>";
  $menu.= "<tr><td>TtankCritical:</td><td><input type='text' name='TtankCritical' value='".$GLOBALS['TtankCritical']."' length='4'></td>
           <td>If Temperature of tank exceeds this value the pump is shut off.</td></tr>";
  $menu.= "<tr><td>TtankOvenOn:</td><td><input type='text' name='TtankOvenOn' value='".$GLOBALS['TtankOvenOn']."' length='4'></td>
           <td>Temperature of tank where the oven is switched on.</td></tr>";
  $menu.= "<tr><td>TtankOvenOff:</td><td><input type='text' name='TtankOvenOff' value='".$GLOBALS['TtankOvenOff']."' length='4'></td>
           <td>Temperature of tank where the oven is switched off.</td></tr>";
  $menu.= "<tr><td>solarPumpDuration:</td><td><input type='text' name='solarPumpDuration' value='".$GLOBALS['solarPumpDuration']."' length='4'></td>
           <td>Duration of solar pump activation <=100s. Offtime will be 100-duration</td></tr>";
  if($GLOBALS['debug']){$val1="TRUE";}else{$val1="FALSE";}
  $menu.= "<tr><td>debug:</td><td><input type='text' name='debug' value='".$val1."' length='5'></td>
           <td></td></tr>";
  if($GLOBALS['showRawValues']){$val2="TRUE";}else{$val2="FALSE";}
  $menu.= "<tr><td>showRawValues:</td><td><input type='text' name='showRawValues' value='".$val2."' length='5'></td>
           <td>Set this flag to get timeseries, each second - will become huge.</td></tr>";
  $menu.= "<tr><td>adminpwd:</td><td><input type='text' name='adminpwd' value='".$GLOBALS['adminpwd']."' length='10'></td>
           <td></td></tr>";

  $menu.= "<tr><td colspan='3' align='center'><input type='submit' name='' value='submit'></td></tr>\n";
  $menu.= "</table>\n";
  $menu.= "</form>\n";

  return $menu;


}

function HV_setParameters($secCounter){
  /* read file at even seconds only
   this way it may be written at odd seconds safely */
  $now=time();
  if($now/2.0 != floor($now/2)){time_sleep_until($now+1);}
 # if($secCounter/2.0 == floor($secCounter/2)){
    include("HV_config.php");
    $GLOBALS['heatMode']=$heatMode;
    $GLOBALS['stateSolar']=$stateSolar;
    $GLOBALS['stateOven']=$stateOven;
    $GLOBALS['stateServ']=$stateServ;
    $GLOBALS['collOffset']=$collOffset;
    $GLOBALS['collHysteresis']=$collHysteresis;
    $GLOBALS['TtankSPsummer']=$TtankSPsummer;
    $GLOBALS['TtankCritical']=$TtankCritical;
    $GLOBALS['TtankOvenOn']=$TtankOvenOn;
    $GLOBALS['TtankOvenOff']=$TtankOvenOff;
    $GLOBALS['solarPumpDuration']=$solarPumpDuration;
    $GLOBALS['debug']=$debug;
    $GLOBALS['showRawValues']=$showRawValues;
    $GLOBALS['adminpwd']=$adminpwd;
 # } #fi
}

function HV_readParameters(){
  include("HV_config.php");
  $GLOBALS['heatMode']=$heatMode;
  $GLOBALS['stateSolar']=$stateSolar;
  $GLOBALS['stateOven']=$stateOven;
  $GLOBALS['stateServ']=$stateServ;
  $GLOBALS['collOffset']=$collOffset;
  $GLOBALS['collHysteresis']=$collHysteresis;
  $GLOBALS['TtankSPsummer']=$TtankSPsummer;
  $GLOBALS['TtankCritical']=$TtankCritical;
  $GLOBALS['TtankOvenOn']=$TtankOvenOn;
  $GLOBALS['TtankOvenOff']=$TtankOvenOff;
  $GLOBALS['solarPumpDuration']=$solarPumpDuration;
  $GLOBALS['debug']=$debug;
  $GLOBALS['showRawValues']=$showRawValues;
  $GLOBALS['adminpwd']=$adminpwd;
}


?>
1HV_Admin_Login
2HV_colorMap
3HV_config
4HV_convertASCII
5HV_getSunPrediction
6HV_heatingControl
7HV_loop
8HV_readOperationState
9HV_readTemperatures
10HV_restart
11HV_serviceLog
12HV_setActuators
13HV_setParameters
14HV_showHouse
15HV_showLog
16HV_showRawValues
17HV_showWeatherForecast
18HV_thermos200
19HV_ventProg
20HV_writeLog
21index
22MoistAir
23readFilenames
24readNamedData
25tableInterpol

 

gnuplot

gnuplot is used to visualise the results - via script you can do infinite diagrams in 1 second.
Run 'test' in gnuplot to get an owerview of the available line- and symbolstyles.

Login
Valid HTML 4.01!