Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
energy
bmon
Commits
a59f298b
Commit
a59f298b
authored
Dec 15, 2014
by
Alan Mitchell
Browse files
Partial Progress on plot_sensor Routine
Also implemented a Test button for arbitrary testing.
parent
cece7548
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
2 deletions
+41
-2
bmsapp/static/bmsapp/scripts/bmsapp2-1.0.coffee
bmsapp/static/bmsapp/scripts/bmsapp2-1.0.coffee
+21
-0
bmsapp/static/bmsapp/scripts/bmsapp2-1.0.js
bmsapp/static/bmsapp/scripts/bmsapp2-1.0.js
+17
-1
bmsapp/templates/bmsapp/reports.html
bmsapp/templates/bmsapp/reports.html
+3
-1
No files found.
bmsapp/static/bmsapp/scripts/bmsapp2-1.0.coffee
View file @
a59f298b
...
...
@@ -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
()
bmsapp/static/bmsapp/scripts/bmsapp2-1.0.js
View file @
a59f298b
// 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
();
});
...
...
bmsapp/templates/bmsapp/reports.html
View file @
a59f298b
...
...
@@ -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 %}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment