diff --git a/platform/features/timeline/bundle.js b/platform/features/timeline/bundle.js index 12effc50a3..145a496f08 100644 --- a/platform/features/timeline/bundle.js +++ b/platform/features/timeline/bundle.js @@ -182,6 +182,16 @@ define([ "capacity" ], "pattern": "^-?\\d+(\\.\\d*)?$" + }, + { + "name": "Battery Starting SOC", + "control": "textfield", + "required": false, + "conversion": "number", + "property": [ + "startingSOC" + ], + "pattern": "^-?\\d+(\\.\\d*)?$" } ], "model": { diff --git a/platform/features/timeline/src/capabilities/GraphCapability.js b/platform/features/timeline/src/capabilities/GraphCapability.js index d9810005a3..c4e5166f0e 100644 --- a/platform/features/timeline/src/capabilities/GraphCapability.js +++ b/platform/features/timeline/src/capabilities/GraphCapability.js @@ -60,7 +60,7 @@ define( result.power, 0, domainObject.getModel().capacity, // Watts - domainObject.getModel().capacity, + domainObject.getModel().startingSOC, 1 / 3600000 // millis-to-hour (since units are watt-hours) ); } diff --git a/platform/features/timeline/test/capabilities/GraphCapabilitySpec.js b/platform/features/timeline/test/capabilities/GraphCapabilitySpec.js index 71a6de2ade..e36724dbcb 100644 --- a/platform/features/timeline/test/capabilities/GraphCapabilitySpec.js +++ b/platform/features/timeline/test/capabilities/GraphCapabilitySpec.js @@ -101,6 +101,7 @@ define( it("provides a battery graph for timelines with capacity", function () { var mockCallback = jasmine.createSpy('callback'); testModel.capacity = 1000; + testModel.startingSOC = 1000; testModel.type = "timeline"; mockDomainObject.useCapability.andReturn(asPromise([ { key: "power", start: 0, end: 15 }