Created
May 1, 2012 22:16
-
-
Save anonymous/2571887 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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