[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"
],
"pattern": "^-?\\d+(\\.\\d*)?$"
},
{
"name": "Battery Starting SOC",
"control": "textfield",
"required": false,
"conversion": "number",
"property": [
"startingSOC"
],
"pattern": "^-?\\d+(\\.\\d*)?$"
}
],
"model": {

View File

@ -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)
);
}

View File

@ -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 }