Commit a59f298b authored by Alan Mitchell's avatar Alan Mitchell
Browse files

Partial Progress on plot_sensor Routine

Also implemented a Test button for arbitrary testing.
parent cece7548
......@@ -2,6 +2,25 @@
# global namespace pollution.
window.AN = {}
test = ->
window.AN.plot_sensor(2, 190)
# Causes a particular chart type and sensor to be selected.
window.AN.plot_sensor = (chart_id, sensor_id) ->
# save the current recalc setting, because we need to disable auto
# recalc because we are changing multiple input values
#old_recalc_setting = _auto_recalc
#_auto_recalc = false
$("#select_chart").val chart_id
process_chart_change()
if $("#select_sensor").attr("multiple") == "multiple"
$("#select_sensor").multiselect('uncheckAll')
$('#select_sensor option[value="#{sensor_id}"]').attr "selected", true
else
$("#select_sensor").val sensor_id
#_auto_recalc = old_recalc_setting
# update_results()
# controls whether results are updated automatically or manually by
# a direct call to 'update_results'
_auto_recalc = true
......@@ -146,5 +165,7 @@ $ ->
'select_sensor_y', 'averaging_time_xy', 'divide_date', 'time_period']
$("##{ctrl}").change inputs_changed for ctrl in ctrls
$("#test").click test
# Process the currently selected chart
process_chart_change()
// Generated by CoffeeScript 1.6.3
(function() {
var REFRESH_MS, inputs_changed, process_chart_change, set_visibility, update_bldg_list, update_chart_sensor_lists, update_results, _auto_recalc, _refresh_timer;
var REFRESH_MS, inputs_changed, process_chart_change, set_visibility, test, update_bldg_list, update_chart_sensor_lists, update_results, _auto_recalc, _refresh_timer;
window.AN = {};
test = function() {
return window.AN.plot_sensor(2, 190);
};
window.AN.plot_sensor = function(chart_id, sensor_id) {
$("#select_chart").val(chart_id);
process_chart_change();
if ($("#select_sensor").attr("multiple") === "multiple") {
$("#select_sensor").multiselect('uncheckAll');
return $('#select_sensor option[value="#{sensor_id}"]').attr("selected", true);
} else {
return $("#select_sensor").val(sensor_id);
}
};
_auto_recalc = true;
inputs_changed = function() {
......@@ -151,6 +166,7 @@
ctrl = ctrls[_i];
$("#" + ctrl).change(inputs_changed);
}
$("#test").click(test);
return process_chart_change();
});
......
......@@ -121,5 +121,7 @@
<button id="download_many">Download Excel Spreadsheet</button>
</p>
<div id="results"></div>
<div id="results">
<button id="test">Test It</button>
</div>
{% endblock %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment