Skip to content

Instantly share code, notes, and snippets.

Created May 1, 2012 22:16
Show Gist options
  • Save anonymous/2571887 to your computer and use it in GitHub Desktop.
Save anonymous/2571887 to your computer and use it in GitHub Desktop.
query = "apply nansum(axis=1) < paste < window(first, field='minute', increment=15) < units to data in (" + starttime + ", " + endtime + ") streamlimit 10000 where Metadata/Extra/System = 'electric' and ((Properties/UnitofMeasure = 'kW' or Properties/UnitofMeasure = 'Watts') or Properties/UnitofMeasure = 'W') and Metadata/Location/Building like 'Etcheverry Hall%' and not Metadata/Extra/Operator like 'sum%' and not Path like '%demand'";
$.ajax({
async: true,
type: 'POST',
url: '/ARDgetData/api/query?',
data: querystring,
success: function(response) {
console.log(response);
}
});
sum = []
for( roomIndex in data ){
for( readingIndex in l[roomIndex].Readings ){
sum[readingIndex] = ( sum[readingIndex] || 0 ) + parseInt(data[roomIndex].Readings[readingIndex]);
}
}
for( roomIndex in data ){
for( i = 0; i < 1000; i++ ){
sum[i] = ( sum[i] || 0 ) + parseInt(data[roomIndex].Readings[i]);
}
}
for ( i = 0; i < 1000; i++ ) {
for( roomIndex in data ) {
sum[i] = ( sum[i] || 0 ) + parseInt(data[roomIndex].Readings[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment