hide_div("loading", false);
}
} else {
- loading_counter--;
+ if (loading_counter > 0) {
+ loading_counter--;
+ }
if (loading_counter == 0) {
hide_div("loading", true);
}
if (CSV_Cache[filename].pending) {
/* its pending load by someone else. Add ourselves to the notify
queue so we are told when it is done */
+ writeDebug("waiting on: " + filename);
CSV_Cache[filename].queue.push({filename:filename, callback:callback});
return;
}
/* its ready in the cache - return it via a delayed callback */
- var d = { filename: CSV_Cache[filename].filename,
- labels: CSV_Cache[filename].labels.slice(0),
- data: CSV_Cache[filename].data.slice(0) };
- queue_call(callback, d);
+ if (CSV_Cache[filename].data == null) {
+ var d = { filename: CSV_Cache[filename].filename,
+ labels: null,
+ data: null };
+ hide_div("nodata", false);
+ queue_call(callback, d);
+ } else {
+ var d = { filename: CSV_Cache[filename].filename,
+ labels: CSV_Cache[filename].labels.slice(0),
+ data: CSV_Cache[filename].data.slice(0) };
+ hide_div("nodata", true);
+ queue_call(callback, d);
+ }
return;
}
if (caller.r.readyState == 4) {
if (caller.r.status == 200) {
load_CSV_callback(caller);
+ hide_div("nodata", true);
+ writeDebug("got file: " + caller.filename);
} else {
/* the load failed */
+ writeDebug("missed file: " + caller.filename);
+ hide_div("nodata", false);
queue_call(caller.callback, { filename: filename, data: null, labels: null });
while (CSV_Cache[caller.filename].queue.length > 0) {
var qe = CSV_Cache[caller.filename].queue.shift();
}
CSV_Cache[caller.filename].pending = false;
CSV_Cache[caller.filename].queue = null;
+ CSV_Cache[caller.filename].data = null;
+ CSV_Cache[caller.filename].labels = null;
}
}
}
var labels = new Array();
if (d.data == null) {
+ writeDebug("null data in process_one_csv");
queue_call(caller.callback, d);
return;
}
defaultAttrs = {
width: 700,
height: 350,
- rollPeriod: 5,
+ rollPeriod: 1,
strokeWidth: 1,
showRoller: true
}
if (d[0] == undefined) {
writeDebug("unable to load file");
- /* hide_div("nodata", false); */
loading(false);
return;
}
*/
function show_graphs() {
- hide_div("nodata", true);
-
graph_sum_csv_files("Total AC Power (W)",
days_csv_files(),
"Pac",
<![endif]-->
+<p>Tips:
+<ul>
+<li>You can zoom a time range by dragging the mouse over the range you
+ are interested in.</li>
+<li>Double click to see the whole data set again.</li>
+<li>You can change the rolling average value using the selection box
+ in the bottom left corner of each graph.
+<li>Use the green +/- icons to hide or show a particular graph
+</ul>
+</p>
+
+
<form id="dateForm" method="get" onsubmit="return false;" action="">
<fieldset>
- <p><input type="text" class="w8em format-d-m-y highlight-days-67
+ <p>Select Date: <input type="text" class="w8em format-d-m-y highlight-days-67
range-high-today range-low-2010-10-09" name="pvdate" id="pvdate" value="" maxlength="10" /></p>
</fieldset>
</form>