-
Notifications
You must be signed in to change notification settings - Fork 0
/
battery-report.html
1207 lines (512 loc) · 23.2 KB
/
battery-report.html
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
<!DOCTYPE html>
<!-- saved from url=(0016)http://localhost -->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ms="urn:schemas-microsoft-com:xslt" xmlns:bat="http://schemas.microsoft.com/battery/2012" xmlns:js="http://microsoft.com/kernel"><head><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="ReportUtcOffset" content="+9:00"/><title>Battery report</title><style type="text/css">
body {
font-family: Segoe UI Light;
letter-spacing: 0.02em;
background-color: #181818;
color: #F0F0F0;
margin-left: 5.5em;
}
h1 {
color: #11D8E8;
font-size: 42pt;
}
h2 {
font-size: 15pt;
color: #11EEF4;
margin-top: 4em;
margin-bottom: 0em;
letter-spacing: 0.08em;
}
td {
padding-left: 0.3em;
padding-right: 0.3em;
}
.nobatts {
font-family: Segoe UI Semibold;
background: #272727;
color: #ACAC60;
font-size: 13pt;
padding-left:0.4em;
padding-right:0.4em;
padding-top:0.3em;
padding-bottom:0.3em;
}
.explanation {
color: #777777;
font-size: 12pt;
margin-bottom: 1em;
}
.explanation2 {
color: #777777;
font-size: 12pt;
margin-bottom: 0.1em;
}
table {
border-width: 0;
table-layout: fixed;
font-family: Segoe UI Light;
letter-spacing: 0.02em;
background-color: #181818;
color: #f0f0f0;
}
.even { background: #272727; }
.odd { background: #1E1E1E; }
.even.suspend { background: #1A1A28; }
.odd.suspend { background: #1A1A2C; }
thead {
font-family: Segoe UI Semibold;
font-size: 85%;
color: #BCBCBC;
}
text {
font-size: 12pt;
font-family: Segoe UI Light;
fill: #11EEF4;
}
.centered { text-align: center; }
.label {
font-family: Segoe UI Semibold;
font-size: 85%;
color: #BCBCBC;
}
.dc.even { background: #40182C; }
.dc.odd { background: #30141F; }
td.colBreak {
padding: 0;
width: 0.15em;
}
td.state { text-align: center; }
td.hms {
font-family: Segoe UI Symbol;
text-align: right;
padding-right: 3.4em;
}
td.dateTime { font-family: Segoe UI Symbol; }
td.nullValue { text-align: center; }
td.percent {
font-family: Segoe UI Symbol;
text-align: right;
padding-right: 2.5em;
}
col:first-child { width: 13em; }
col.col2 { width: 10.4em; }
col.percent { width: 7.5em; }
td.mw {
text-align: right;
padding-right: 2.5em;
}
td.acdc { text-align: center; }
span.date {
display: inline-block;
width: 5.5em;
}
span.time {
text-align: right;
width: 4.2em;
display: inline-block;
}
text { font-family: Segoe UI Symbol; }
.noncontigbreak {
height: 0.3em;
background-color: #1A1A28;
}
</style><script type="text/javascript">
// Formats a number using the current locale (to handle the 1000's separator).
// The result is rounded so no decimal point is shown.
function numberToLocaleString(value) {
var localeString = Math.round(parseFloat(value + '')).toLocaleString();
return localeString.substring(0, localeString.indexOf('.'));
}
function padLeft(number, length) {
var str = '' + number;
while (str.length < length) {
str = '0' + str;
}
return str;
}
// Returns the number of milliseconds between 2 date-times represented as strings.
function msBetween(startTime, endTime) {
return startTime > endTime
? msBetween(endTime, startTime)
: parseDateTime(endTime) - parseDateTime(startTime);
}
var dateFormat = /(\d{4})-(\d{2})-(\d{2})[T](\d{2}):(\d{2}):(\d{2})/
// Parses a date-time string and returns a Date (i.e. number of milliseconds)
function parseDateTime(value) {
if (!value) {
return 0;
}
var match = dateFormat.exec(value)
if (!match) {
return 0;
}
return Date.parse(match[1] + '/' + match[2] + '/' +
match[3] + ' ' + match[4] + ':' +
match[5] + ':' + match[6])
}
// Parses just the date portion of a date-time string and returns a Date
// (i.e. number of milliseconds)
function parseDate(value) {
if (!value) {
return 0;
}
var match = dateFormat.exec(value)
if (!match) {
return 0;
}
return Date.parse(match[1] + '/' + match[2] + '/' + match[3])
}
var durationFormat = /P((\d+)D)?T((\d+)H)?((\d+)M)?(\d+)S/
// Convert a string of the form P10DT1H15M40S to a count of milliseconds
function parseDurationToMs(value) {
var match = durationFormat.exec(value)
if (!match) {
return 0
}
var days = parseInt(match[2] || '0');
var hrs = parseInt(match[4] || '0');
var mins = parseInt(match[6] || '0');
var secs = parseInt(match[7] || '0');
return ((((((days * 24) + hrs) * 60) + mins) * 60) + secs) * 1000;
}
// Converts milliseconds to days
function msToDays(ms) {
return (ms / 1000 / 60 / 60 / 24);
}
function daysToMs(days) {
return (days * 24 * 60 * 60 * 1000);
}
// Formats a number of milliseconds as h:mm:ss
function formatDurationMs(value) {
var ms = parseInt(value);
var secs = ms / 1000;
var mins = secs / 60;
var hrs = Math.floor(mins / 60);
mins = Math.floor(mins % 60);
secs = Math.floor(secs % 60);
return hrs + ':' + padLeft(mins,2) + ':' + padLeft(secs,2);
}
// Converts a millisecond timestamp to a day and month string
// Note: dayOffset is forward from date.
function dateToDayAndMonth(ms, dayOffset) {
var adjustedDate = new Date(ms + (dayOffset * 24 * 60 * 60 * 1000));
return padLeft(adjustedDate.getMonth() + 1, 2) + "-" +
padLeft(adjustedDate.getDate(), 2);
}
// Takes a millisecond timestamp and returns a new millisecond timestamp
// rounded down to the current day.
function dateFloor(ms) {
var dt = new Date(ms);
return Date.parse(dt.getFullYear() + '/' + (dt.getMonth() + 1) + '/' + dt.getDate());
}
Timegraph = {
axisTop: 9.5,
axisRight: 24.5,
axisBottom: 25.5,
axisLeft: 25.5,
ticks: 10,
// Maximum number of 24 hour ticks for showing 12 and 6 hour ticks
ticks12Hour: 8,
ticks6Hour: 4,
// Shading
lineColor: "#B82830",
shadingColor: "#4d1d35",
precompute: function (graph) {
var canvas = graph.canvas;
var data = graph.data;
var min = 0;
var max = 0;
graph.height = canvas.height - Timegraph.axisTop - Timegraph.axisBottom;
graph.width = canvas.width - Timegraph.axisLeft - Timegraph.axisRight;
for (var i = 0; i < data.length; i++) {
data[i].t0 = parseDateTime(data[i].x0);
data[i].t1 = parseDateTime(data[i].x1);
if (i == 0) {
min = data[i].t0;
max = data[i].t1;
}
if (data[i].t0 < min) {
min = data[i].t0;
}
if (data[i].t1 > max) {
max = data[i].t1;
}
data[i].yy0 =
Timegraph.axisTop + graph.height - data[i].y0 * graph.height;
data[i].yy1 =
Timegraph.axisTop + graph.height - data[i].y1 * graph.height;
}
if (graph.startTime != null) {
graph.startMs = parseDateTime(graph.startTime);
} else {
graph.startMs = min;
}
graph.endMs = max;
graph.durationMs = max - min;
},
drawFrame: function (graph) {
var canvas = graph.canvas;
var context = graph.context;
graph.width =
canvas.width - Timegraph.axisRight - Timegraph.axisLeft;
graph.height =
canvas.height - Timegraph.axisTop - Timegraph.axisBottom;
context.beginPath();
context.moveTo(Timegraph.axisLeft, Timegraph.axisTop);
context.lineTo(Timegraph.axisLeft + graph.width,
Timegraph.axisTop);
context.lineTo(Timegraph.axisLeft + graph.width,
Timegraph.axisTop + graph.height);
context.lineTo(Timegraph.axisLeft,
Timegraph.axisTop + graph.height);
context.lineTo(Timegraph.axisLeft, Timegraph.axisTop);
context.strokeStyle = "#c0c0c0";
context.stroke();
},
drawRange: function (graph) {
var canvas = graph.canvas;
var context = graph.context;
context.font = "12pt Segoe UI";
context.fillStyle = "#00b0f0";
context.fillText("%", 0, Timegraph.axisTop + 5, Timegraph.axisLeft);
var tickSpacing = graph.height / 10;
var offset = Timegraph.axisTop + tickSpacing;
var tickValue = 90;
for (var i = 0; i < 9; i++) {
context.beginPath();
context.moveTo(Timegraph.axisLeft, offset);
context.lineTo(Timegraph.axisLeft + graph.width,
offset);
context.stroke();
context.fillText(tickValue.toString(),
0,
offset + 5,
Timegraph.axisLeft);
offset += tickSpacing;
tickValue -= 10;
}
},
drawDomain: function (graph, start, end) {
var canvas = graph.canvas;
var context = graph.context;
var data = graph.data;
var duration = end - start;
if ((end < start)) {
return;
}
var startDay = dateFloor(start);
var t0 = startDay;
var t1 = dateFloor(end);
var dayOffset = 0;
if (start > t0) {
t0 = t0 + daysToMs(1);
dayOffset++;
}
if (t0 >= t1) {
return;
}
var increment =
Math.max(Math.floor((t1 - t0) / daysToMs(Timegraph.ticks)), 1);
var incrementMs = daysToMs(increment);
var spacing = (incrementMs / duration) * graph.width;
var offset = (t0 - start) / duration;
var ticksCount = Math.floor((t1 - t0) / incrementMs);
for (offset = offset * graph.width + Timegraph.axisLeft;
offset < (graph.width + Timegraph.axisLeft);
offset += spacing) {
context.beginPath();
context.moveTo(offset, Timegraph.axisTop);
context.lineTo(offset, Timegraph.axisTop + graph.height);
context.stroke();
context.fillText(dateToDayAndMonth(startDay, dayOffset),
offset,
Timegraph.axisTop + graph.height + 15,
spacing);
dayOffset += increment;
}
},
plot: function (graph, start, end) {
var canvas = graph.canvas;
var context = graph.context
var data = graph.data;
if ((end < start)) {
return;
}
var duration = end - start;
Timegraph.drawDomain(graph, start, end);
context.fillStyle = Timegraph.shadingColor;
for (var i = 0; i < data.length - 1; i++) {
if ((data[i].t0 < start) || (data[i].t0 > end) ||
(data[i].t1 > end)) {
continue;
}
var x1 = (data[i].t0 - start) / duration;
x1 = x1 * graph.width + Timegraph.axisLeft;
var x2 = (data[i].t1 - start) / duration;
x2 = x2 * graph.width + Timegraph.axisLeft;
context.globalAlpha = 0.3;
context.fillRect(x1, Timegraph.axisTop, (x2 - x1), graph.height);
context.globalAlpha = 1;
context.beginPath();
context.strokeStyle = Timegraph.lineColor;
context.lineWidth = 1.5;
context.moveTo(x1, data[i].yy0);
context.lineTo(x2, data[i].yy1);
context.stroke();
}
},
draw: function (graph) {
var canvas = document.getElementById(graph.element);
if (canvas == null) {
return;
}
var context = canvas.getContext('2d');
if (context == null) {
return;
}
graph.width = 0;
graph.height = 0;
graph.context = context;
graph.canvas = canvas;
Timegraph.precompute(graph);
Timegraph.drawFrame(graph);
Timegraph.drawRange(graph);
Timegraph.plot(graph, graph.startMs, graph.endMs);
}
};
drainGraphData = [
];
function main() {
Timegraph.draw({
element: "drain-graph",
data: drainGraphData,
startTime: "2017-05-17T18:30:20",
endTime: "2017-05-20T18:30:21",
});
}
if (window.addEventListener != null) {
window.addEventListener("load", main, false);
} else if (window.attachEvent != null) {
window.attachEvent("onload", main);
}
</script></head><body><h1>
Battery report
</h1><table style="margin-bottom: 6em;"><col/><tr><td class="label">
COMPUTER NAME
</td><td>SYYSBIIR</td></tr><tr><td class="label">
SYSTEM PRODUCT NAME
</td><td>ASUSTeK COMPUTER INC. N551JB</td></tr><tr><td class="label">
BIOS
</td><td>N551JB.201 03/04/2015</td></tr><tr><td class="label">
OS BUILD
</td><td>15063.0.amd64fre.rs2_release.170317-1834</td></tr><tr><td class="label">
PLATFORM ROLE
</td><td>Mobile</td></tr><tr><td class="label">
CONNECTED STANDBY
</td><td>Not supported</td></tr><tr><td class="label">
REPORT TIME
</td><td class="dateTime"><span class="date">2017-05-20 </span><span class="time">18:30:21</span></td></tr></table><h2>
Installed batteries
</h2><div class="explanation">
Information about each currently installed battery
</div><table><colgroup><col style="width: 15em;"/><col style="width: 14em;"/></colgroup><thead><tr><td> </td><td>
BATTERY
1</td></tr></thead><tr><td><span class="label">NAME</span></td><td>ASUS Battery</td></tr><tr><td><span class="label">MANUFACTURER</span></td><td>ASUSTeK</td></tr><tr><td><span class="label">SERIAL NUMBER</span></td><td>
-
</td></tr><tr><td><span class="label">CHEMISTRY</span></td><td>LIon</td></tr><tr><td><span class="label">DESIGN CAPACITY</span></td><td> mWh
</td></tr><tr style="height:0.4em;"></tr><tr><td><span class="label">FULL CHARGE CAPACITY</span></td><td> mWh
</td></tr><tr><td><span class="label">CYCLE COUNT</span></td><td>
-
</td></tr></table><h2>Recent usage</h2><div class="explanation">
Power states over the last 3 days
</div><table><colgroup><col/><col class="col2"/><col style="width: 4.2em;"/><col class="percent"/><col style="width: 11em;"/></colgroup><thead><tr><td>
START TIME
</td><td class="centered">
STATE
</td><td class="centered">
SOURCE
</td><td colspan="2" class="centered">
CAPACITY REMAINING
</td></tr></thead><tr class="even 1"><td class="dateTime"><span class="date">2017-05-20 </span><span class="time">01:11:08</span></td><td class="state">
Active
</td><td class="acdc">
AC
</td><td class="nullValue">-</td><td class="nullValue">-</td></tr><tr class="odd suspend 2"><td class="dateTime"><span class="date"> </span><span class="time">01:11:08</span></td><td class="state">
Suspended
</td><td class="acdc"></td><td class="nullValue">-</td><td class="nullValue">-</td></tr><tr class="even 3"><td class="dateTime"><span class="date"> </span><span class="time">14:18:30</span></td><td class="state">
Active
</td><td class="acdc">
AC
</td><td class="nullValue">-</td><td class="nullValue">-</td></tr><tr class="odd 4"><td class="dateTime"><span class="date"> </span><span class="time">18:26:27</span></td><td class="state">
Battery changed
</td><td class="acdc">
AC
</td><td class="nullValue">-</td><td class="nullValue">-</td></tr><tr class="even 5"><td class="dateTime"><span class="date"> </span><span class="time">18:26:27</span></td><td class="state">
Active
</td><td class="acdc">
AC
</td><td class="nullValue">-</td><td class="nullValue">-</td></tr><tr class="odd 6"><td class="dateTime"><span class="date"> </span><span class="time">18:28:02</span></td><td class="state">
Battery changed
</td><td class="acdc">
AC
</td><td class="nullValue">-</td><td class="nullValue">-</td></tr><tr class="even 7"><td class="dateTime"><span class="date"> </span><span class="time">18:28:02</span></td><td class="state">
Active
</td><td class="acdc">
AC
</td><td class="nullValue">-</td><td class="nullValue">-</td></tr><tr class="odd 8"><td class="dateTime"><span class="date"> </span><span class="time">18:30:20</span></td><td class="state">
Report generated
</td><td class="acdc">
AC
</td><td class="nullValue">-</td><td class="nullValue">-</td></tr></table><h2>Battery usage</h2><div class="explanation">
Battery drains over the last 3 days
</div><canvas id="drain-graph" width="864" height="400"></canvas><table><colgroup><col/><col class="col2"/><col style="width: 10em;"/><col class="percent"/><col style="width: 11em;"/></colgroup><thead><tr><td>
START TIME
</td><td class="centered">
STATE
</td><td class="centered">
DURATION
</td><td class="centered" colspan="2">
ENERGY DRAINED
</td></tr></thead><tr class="even"><td class="nullValue">-</td><td class="nullValue">-</td><td class="nullValue">-</td><td class="nullValue">-</td><td class="nullValue">-</td></tr></table><h2>
Usage history
</h2><div class="explanation2">
History of system usage on AC and battery
</div><table><colgroup><col/><col class="col2"/><col style="width: 10em;"/><col style=""/><col style="width: 10em;"/><col style="width: 10em;"/><col style=""/></colgroup><thead><tr><td> </td><td colspan="2" class="centered">
BATTERY DURATION
</td><td class="colBreak"> </td><td colspan="3" class="centered">
AC DURATION
</td></tr><tr><td>
PERIOD
</td><td class="centered">
ACTIVE
</td><td class="centered">
CONNECTED STANDBY
</td><td class="colBreak"> </td><td class="centered">
ACTIVE
</td><td class="centered">
CONNECTED STANDBY
</td></tr></thead><tr class="even"><td class="nullValue">-</td><td class="nullValue">-</td><td class="nullValue">-</td><td class="colBreak"> </td><td class="nullValue">-</td><td class="nullValue">-</td></tr></table><h2>
Battery capacity history
</h2><div class="explanation">
Charge capacity history of the system's batteries
</div><table><colgroup><col/><col class="col2"/><col style="width: 10em;"/></colgroup><thead><tr><td><span>PERIOD</span></td><td class="centered">
FULL CHARGE CAPACITY
</td><td class="centered">
DESIGN CAPACITY
</td></tr></thead><tr class="even"><td class="nullValue">-</td><td class="nullValue">-</td><td class="nullValue">-</td></tr></table><h2>
Battery life estimates
</h2><div class="explanation2">
Battery life estimates based on observed drains
</div><table><colgroup><col/><col class="col2"/><col style="width: 10em;"/><col style=""/><col style="width: 10em;"/><col style="width: 10em;"/><col style="width: 10em;"/></colgroup><thead><tr class="rowHeader"><td> </td><td colspan="2" class="centered">
AT FULL CHARGE
</td><td class="colBreak"> </td><td colspan="2" class="centered">
AT DESIGN CAPACITY
</td></tr><tr class="rowHeader"><td>
PERIOD
</td><td class="centered"><span>ACTIVE</span></td><td class="centered"><span>CONNECTED STANDBY</span></td><td class="colBreak"> </td><td class="centered"><span>ACTIVE</span></td><td class="centered"><span>CONNECTED STANDBY</span></td></tr></thead><tr class="even"><td class="nullValue">-</td><td class="nullValue">-</td><td class="nullValue">-</td><td class="colBreak"> </td><td class="nullValue">-</td><td class="nullValue">-</td></tr></table><div class="explanation2" style="margin-top: 1em; margin-bottom: 0.4em;">
Current estimate of battery life based on all observed drains since OS install
</div><table><colgroup><col/><col class="col2"/><col style="width: 10em;"/><col style=""/><col style="width: 10em;"/><col style="width: 10em;"/><col style="width: 10em;"/></colgroup><tr class="even" style="vertical-align:top"><td>
Since OS install
</td><td class="nullValue">-</td><td class="nullValue">-</td><td class="colBreak"> </td><td class="nullValue">-</td><td class="nullValue">-</td></tr></table><br/><br/><br/></body></html>