[Timeline] Add battery starting state-of-charge

Issue #1185
This commit is contained in:
David Hudson 2016-09-18 22:52:41 +09:00
parent 156ba832f2
commit d913798d5b
3 changed files with 12 additions and 1 deletions

View File

@ -182,6 +182,16 @@ define([
"capacity" "capacity"
], ],
"pattern": "^-?\\d+(\\.\\d*)?$" "pattern": "^-?\\d+(\\.\\d*)?$"
},
{
"name": "Battery Starting SOC",
"control": "textfield",
"required": false,
"conversion": "number",
"property": [
"startingSOC"
],
"pattern": "^-?\\d+(\\.\\d*)?$"
} }
], ],
"model": { "model": {

View File

@ -60,7 +60,7 @@ define(
result.power, result.power,
0, 0,
domainObject.getModel().capacity, // Watts domainObject.getModel().capacity, // Watts
domainObject.getModel().capacity, domainObject.getModel().startingSOC,
1 / 3600000 // millis-to-hour (since units are watt-hours) 1 / 3600000 // millis-to-hour (since units are watt-hours)
); );
} }

View File

@ -101,6 +101,7 @@ define(
it("provides a battery graph for timelines with capacity", function () { it("provides a battery graph for timelines with capacity", function () {
var mockCallback = jasmine.createSpy('callback'); var mockCallback = jasmine.createSpy('callback');
testModel.capacity = 1000; testModel.capacity = 1000;
testModel.startingSOC = 1000;
testModel.type = "timeline"; testModel.type = "timeline";
mockDomainObject.useCapability.andReturn(asPromise([ mockDomainObject.useCapability.andReturn(asPromise([
{ key: "power", start: 0, end: 15 } { key: "power", start: 0, end: 15 }