Author: zecas
Date: Sun Jan 25 17:56:20 2015
New Revision: 113

URL: http://svn.gna.org/viewcvs/zzzt?rev=113&view=rev
Log:
new daily js graph with maximum and average - crontab echoes value is an arg is 
given

Modified:
    trunk/i18n/en.php
    trunk/i18n/fr.php
    trunk/i18n/pt.php
    trunk/i18n/switch.php
    trunk/model/sm3000s.php
    trunk/standalone_crontab/crontab_monitor.script
    trunk/stats/daily.php
    trunk/stats/index.php
    trunk/stats/monthly.php
    trunk/stats/yearly.php

Modified: trunk/i18n/en.php
URL: 
http://svn.gna.org/viewcvs/zzzt/trunk/i18n/en.php?rev=113&r1=112&r2=113&view=diff
==============================================================================
--- trunk/i18n/en.php   (original)
+++ trunk/i18n/en.php   Sun Jan 25 17:56:20 2015
@@ -48,7 +48,8 @@
 define("FW_ERROR","Possible error in firmware");
 define("BY_MONTH","Production by Month");
 define("LAST_MEASURES","Last Measures");
-define("AVG_20_MN","Average for last 20 minutes : ");
+define("AVG","Average");
+define("D20_MN"," for last 20 minutes : ");
 
 define("CONFIGURE","Configure");
 define("PASSWORD","Configuration Password");

Modified: trunk/i18n/fr.php
URL: 
http://svn.gna.org/viewcvs/zzzt/trunk/i18n/fr.php?rev=113&r1=112&r2=113&view=diff
==============================================================================
--- trunk/i18n/fr.php   (original)
+++ trunk/i18n/fr.php   Sun Jan 25 17:56:20 2015
@@ -48,7 +48,8 @@
 define("FW_ERROR","Erreur possible du micrologiciel");
 define("BY_MONTH","Production par Mois");
 define("LAST_MEASURES","Dernières mesures");
-define("AVG_20_MN","Moyenne des 20 dernières minutes : ");
+define("AVG","Moyenne");
+define("D20_MN"," des 20 dernières minutes : ");
 
 define("CONFIGURE","Configurer");
 define("PASSWORD","Mot de Passe de Configuration");

Modified: trunk/i18n/pt.php
URL: 
http://svn.gna.org/viewcvs/zzzt/trunk/i18n/pt.php?rev=113&r1=112&r2=113&view=diff
==============================================================================
--- trunk/i18n/pt.php   (original)
+++ trunk/i18n/pt.php   Sun Jan 25 17:56:20 2015
@@ -48,7 +48,8 @@
 define("FW_ERROR","Erro possível no micro-controlador");
 define("BY_MONTH","Produção por Mês");
 define("LAST_MEASURES","Últimas medidas");
-define("AVG_20_MN","Média dos últimos 20 minutos : ");
+define("AVG","Média");
+define("D20_MN"," dos últimos 20 minutos : ");
 
 define("CONFIGURE","Configurar");
 define("PASSWORD","Senha de Configuração");

Modified: trunk/i18n/switch.php
URL: 
http://svn.gna.org/viewcvs/zzzt/trunk/i18n/switch.php?rev=113&r1=112&r2=113&view=diff
==============================================================================
--- trunk/i18n/switch.php       (original)
+++ trunk/i18n/switch.php       Sun Jan 25 17:56:20 2015
@@ -16,7 +16,7 @@
     along with Zzzt! .  If not, see <http://www.gnu.org/licenses/>.
 */
 
-define("VERSION","1.9");
+define("VERSION","1.10");
 
 ini_set('display_errors','1');
 

Modified: trunk/model/sm3000s.php
URL: 
http://svn.gna.org/viewcvs/zzzt/trunk/model/sm3000s.php?rev=113&r1=112&r2=113&view=diff
==============================================================================
--- trunk/model/sm3000s.php     (original)
+++ trunk/model/sm3000s.php     Sun Jan 25 17:56:20 2015
@@ -30,8 +30,8 @@
     "PAC" => array("coef"=>.5, "unit"=>"W"),
     "TKK" => array("coef"=>1, "unit"=>"°C"),
     "PDC" => array("coef"=>.5, "unit"=>"W"),
+    "KDY" => array("coef"=>.1, "unit"=>"kWh"),
     "KLD" => array("coef"=>.1, "unit"=>"kWh"),
-    "KDY" => array("coef"=>.1, "unit"=>"kWh"),
     "KLM" => array("coef"=>1, "unit"=>"kWh"),
     "KLY" => array("coef"=>1, "unit"=>"kWh")
 );

Modified: trunk/standalone_crontab/crontab_monitor.script
URL: 
http://svn.gna.org/viewcvs/zzzt/trunk/standalone_crontab/crontab_monitor.script?rev=113&r1=112&r2=113&view=diff
==============================================================================
--- trunk/standalone_crontab/crontab_monitor.script     (original)
+++ trunk/standalone_crontab/crontab_monitor.script     Sun Jan 25 17:56:20 2015
@@ -37,12 +37,16 @@
 if($inverter->connected){
   $url=$inverter->config['db_url'];
   $url.="?alea=$alea&monitor_date=".$inverter->status['timestamp'];
+  $info='';
   $zero=0;
+
   foreach($inverter->crontab_monitor as $k => $v) {
+    $info.=' '.$inverter->status[$k].$v['unit'];
     $zero += $inverter->status[$k];
     $url.="&$k=".$inverter->status[$k];
   }
   if ($zero > 0) file($url);//some firmware answer 0 for all values around 
wake up time
+  if ( isset($argv[1]) ) echo $info; //echo information to the terminal if 
wanted
   return true;
 }
 else return false;

Modified: trunk/stats/daily.php
URL: 
http://svn.gna.org/viewcvs/zzzt/trunk/stats/daily.php?rev=113&r1=112&r2=113&view=diff
==============================================================================
--- trunk/stats/daily.php       (original)
+++ trunk/stats/daily.php       Sun Jan 25 17:56:20 2015
@@ -1,4 +1,21 @@
 <?php
+/*    This file is part of Zzzt!.
+    Copyright (C) 2009  Antonio Ho, José Jorge
+
+    Zzzt! is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    Zzzt! is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Zzzt! .  If not, see <http://www.gnu.org/licenses/>.
+*/
+
   require '../inverter/class_inverter.php';
   session_start();// after the needed classes
   $inverter=new inverter();
@@ -29,7 +46,18 @@
   <a href=monthly.php><?php echo BY_MONTH;?></a>
   <a href=yearly.php><?php echo KYR;?></a>
   <a href=index.php><?php echo DAY_PROD;?></a>
-
+<?php
+  $ret=$db->query('SELECT last, time, kld, kdy FROM `zzzt_kld_errors` LIMIT 0 
, 30');
+  if ($ret!=false && $db->num_rows() > 0) {
+    echo "<table bgcolor='red' border=1>
+          <tr><th colspan=4>".FW_ERROR."</th></tr>
+          
<tr><th>".DDY."</th><th>".THR."</th><th>".KDY."</th><th>KLD</th></tr>";
+    while ($row = $db->fetch())
+      echo 
"<tr><td>{$row['last']}</td><td>{$row['time']}</td><td>{$row['kdy']}</td><td>{$row['kld']}</td></tr>";
+    echo '</table>';
+  }
+?>
+  
   <script type="text/javascript">
     document.write("<div id=\"holder\"></div>");
      
@@ -44,30 +72,41 @@
       }
 
       foreach ($jour as $j ) {
-         $sql="SELECT MAX(production)
+         $sql="SELECT MAX(production) AS max, ROUND( AVG(production), 1) AS moy
                      FROM zzzt_daily
                WHERE DAY(date) = DAY('$j')
                AND MONTH(date) = MONTH('$j')";
          $db->query($sql);
-         list($record[])=$db->fetch();
+         $row=$db->fetch();
+         $record[]=$row['max'];
+         $moyenne[]=$row['moy'];
       }
     ?>
 
-    new Morris.Area({element: 'holder', lineColors: ['#<?php echo 
$db->rnd_color();?>','#<?php echo $db->rnd_color();?>'], 
-      hoverCallback: function (index, options, content) {
-       var row = options.data[index];
-       return '<a href=index.php?day=' + row.j + "><?php echo DAY_PROD;?></a>" 
+ content ;
-      },
-      fillOpacity: 0.5, postUnits: 'kWh', behaveLikeLine: true, smooth: false, 
hideHover: 'auto',  data: [
-      <?php
-       for($i=0;$i<sizeof($values);$i++) {
-         echo "{ j: '".$jour[$i]."'";
-         echo ", 'r': ".$values[$i];
-         echo ", 't': ".$record[$i];
-         if($i<sizeof($values)-1) echo " },\n"; else echo " }\n";
-       }
-      ?>
-      ], xkey: 'j', ykeys: ['r','t'], labels: ['<?php echo PAC;?>','<?php echo 
'Record';?>'] });
+    new Morris.Area({element: 'holder',
+                    lineColors: ['#<?php echo $db->rnd_color();?>',
+                                 '#<?php echo $db->rnd_color();?>',
+                                 '#<?php echo $db->rnd_color();?>'], 
+                     hoverCallback: function (index, options, content) {
+                                         var row = options.data[index];
+                                         return '<a href=index.php?day=' + 
row.j + "><?php echo DAY_PROD;?></a>" + content ;
+                                       },
+                     fillOpacity: 0.5,
+                     postUnits: 'kWh',
+                     behaveLikeLine: true,
+                     smooth: false,
+                     hideHover: 'auto',
+                     data: [
+                       <?php
+                         for($i=0;$i<sizeof($values);$i++) {
+                           echo "{ j: '".$jour[$i]."'";
+                           echo ", 'r': ".$values[$i];
+                           echo ", 'm': ".$moyenne[$i];
+                           echo ", 't': ".$record[$i];
+                           if($i<sizeof($values)-1) echo " },\n"; else echo " 
}\n";
+                         }
+                       ?>
+                       ], xkey: 'j', ykeys: ['r', 'm', 't'], labels: ['<?php 
echo PAC;?>', '<?php echo AVG;?>', 'Record'] });
   
   </script>
   <noscript><img src=image_year.php?width=800&amp;height=500></noscript>

Modified: trunk/stats/index.php
URL: 
http://svn.gna.org/viewcvs/zzzt/trunk/stats/index.php?rev=113&r1=112&r2=113&view=diff
==============================================================================
--- trunk/stats/index.php       (original)
+++ trunk/stats/index.php       Sun Jan 25 17:56:20 2015
@@ -123,7 +123,7 @@
        AND MONTH(date) = MONTH('{$_GET['day']}')
        ORDER BY year DESC";
   $db->query($sql);
-  $ap=utf8_encode(strftime("%e %B %G", strtotime($_GET['day'])))."
+  $ap=strftime("%e %B %G", strtotime($_GET['day']))."
 ";
   while ($row = $db->fetch()) $ap.=DYR." {$row['year']} : {$row['production']} 
kWh
 ";
@@ -134,7 +134,7 @@
   if ($kdy20 != NULL) {
     $db->query("SELECT kdy FROM `zzzt` ORDER BY monitor_date DESC LIMIT 0,1");
     list($kdynow)= $db->fetch();
-    $ap.=AVG_20_MN. ($kdynow-$kdy20)*3000 ." W";
+    $ap.=AVG.D20_MN. ($kdynow-$kdy20)*3000 ." W";
   }
 
   echo "<a title='$ap'>".LAST_MEASURES."</a>";

Modified: trunk/stats/monthly.php
URL: 
http://svn.gna.org/viewcvs/zzzt/trunk/stats/monthly.php?rev=113&r1=112&r2=113&view=diff
==============================================================================
--- trunk/stats/monthly.php     (original)
+++ trunk/stats/monthly.php     Sun Jan 25 17:56:20 2015
@@ -1,4 +1,20 @@
 <?php
+/*    This file is part of Zzzt!.
+    Copyright (C) 2009-2014  Antonio Ho, José Jorge
+
+    Zzzt! is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    Zzzt! is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Zzzt! .  If not, see <http://www.gnu.org/licenses/>.
+*/
   require '../inverter/class_inverter.php';
   session_start();// after the needed classes
   $inverter=new inverter();
@@ -48,6 +64,7 @@
        $db->query($sql);
        $row = $db->fetch();
        if(!in_array($row['year'],$year)) $year[]=$row['year'];
+       $enCoursDuMois=round($row['production']);
        $moyenne_quotidienne_du_mois=round($row['production']/(date('j')-1),1);
        
$values[$row['year']][$row['month']]=round($row['production']*(date('t')/(date('j')-1)));
       }
@@ -70,7 +87,7 @@
 
   </script>
   <noscript><br><img 
src=image_by_month.php?width=1000&amp;height=600></noscript>
-  <div id='moyenne'><?php echo strftime( '%B %Y', mktime(0,0,0,date('n'),1) 
).' : '.$moyenne_quotidienne_du_mois.'kWh/'.DDY; ?></div>
+  <div id='moyenne'><?php echo strftime( '%B %Y', mktime(0,0,0,date('n'),1) 
)." : $enCoursDuMois kWh soit $moyenne_quotidienne_du_mois /".DDY; ?></div>
 
 </body>
 </html>

Modified: trunk/stats/yearly.php
URL: 
http://svn.gna.org/viewcvs/zzzt/trunk/stats/yearly.php?rev=113&r1=112&r2=113&view=diff
==============================================================================
--- trunk/stats/yearly.php      (original)
+++ trunk/stats/yearly.php      Sun Jan 25 17:56:20 2015
@@ -1,4 +1,20 @@
 <?php
+/*    This file is part of Zzzt!.
+    Copyright (C) 2009-2014  Antonio Ho, José Jorge
+
+    Zzzt! is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    Zzzt! is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with Zzzt! .  If not, see <http://www.gnu.org/licenses/>.
+*/
   require '../inverter/class_inverter.php';
   session_start();// after the needed classes
   $inverter=new inverter();


_______________________________________________
Zzzt-commits mailing list
Zzzt-commits@gna.org
https://mail.gna.org/listinfo/zzzt-commits

Reply via email to