-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
57 lines (54 loc) · 1.94 KB
/
index.html
File metadata and controls
57 lines (54 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<head>
<title>Energy Monitor</title>
</head>
<body onload=init()>
<canvas id=gaugeCanvas width=200 height=200>No canvas in your browser...</canvas>
</body>
<script>
function init()
{
// Initialzing gauge
tempGauge = new steelseries.Radial('gaugeCanvas', {
gaugeType: steelseries.GaugeType.TYPE4,
minValue:0,
maxValue:5000,
size: 200,
frameDesign: steelseries.FrameDesign.Steel,
knobStyle: steelseries.KnobStyle.SILVER,
pointerType: steelseries.PointerType.TYPE6,
lcdDecimals: 1,
section: null,
area: null,
titleString: 'Power',
unitString: 'W',
thresholdVisible: false,
lcdVisible: true
});
// Start the gauge update
setInterval(function(){
var site = "https://api.xively.com/v2/feeds/1116617964.json?&key=alheO4BHm8CpDDQIaoE4tKt28r4GTHPo76HqDMfcnPteo7WK&&datastreams=118";
//alert('going for ' + site);
$.ajax({
type: 'GET',
url: site,
dataType: 'json',
cache: false,
data: {},
processData: true,
async: false, // you have to have this so the data will arrive before display
success: function(data_archive) {
//alert("the url returned success");
//alert("got back " + data_archive.datastreams[0].current_value);
tempGauge.setValueAnimated(eval(data_archive.datastreams[0].current_value));
},
error: function(a){
//alert("here I am in the error routine");
}
});
//alert('after the get');
}, 10000);
}
</script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type=text/javascript src=https://dl.dropboxusercontent.com/u/2986612/tween-min.js></script>
<script type=text/javascript src=https://dl.dropboxusercontent.com/u/2986612/steelseries-min.js></script>