File tree 1 file changed +5
-4
lines changed
platform/features/timeline/src/capabilities
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,8 @@ define(
37
37
// Build graphs for this group of utilizations
38
38
function buildGraphs ( utilizations ) {
39
39
var utilizationMap = { } ,
40
- result = { } ;
40
+ result = { } ,
41
+ startingSOC ;
41
42
42
43
// Bucket utilizations by type
43
44
utilizations . forEach ( function ( u ) {
@@ -55,14 +56,14 @@ define(
55
56
if ( domainObject . getModel ( ) . type === 'timeline' &&
56
57
result . power &&
57
58
domainObject . getModel ( ) . capacity > 0 ) {
58
- domainObject . getModel ( ) . startingSOC =
59
- parseFloat ( domainObject . getModel ( ) . startingSOC ) || 100 ;
59
+ startingSOC = isNaN ( parseFloat ( domainObject . getModel ( ) . startingSOC ) ) ?
60
+ 100 : parseFloat ( domainObject . getModel ( ) . startingSOC ) ;
60
61
61
62
result . battery = new CumulativeGraph (
62
63
result . power ,
63
64
0 ,
64
65
domainObject . getModel ( ) . capacity , // Watts
65
- ( domainObject . getModel ( ) . startingSOC / 100 ) * domainObject . getModel ( ) . capacity ,
66
+ ( startingSOC / 100 ) * domainObject . getModel ( ) . capacity ,
66
67
1 / 3600000 // millis-to-hour (since units are watt-hours)
67
68
) ;
68
69
}
You can’t perform that action at this time.
0 commit comments