Compare commits

..
4 Commits
5 changed files with 13 additions and 11 deletions

No files matched your search

+5 -3
View File
@@ -179,7 +179,7 @@ namespace Elwig.Helpers.Billing {
} else {
throw new InvalidOperationException();
}
var ctrd = obj["ctrd"] ?? obj["geb"];
var ctrd = obj["contracted"] ?? obj["geb"];
if (ctrd is JsonObject) {
c2 = GetCurveData(ctrd.AsObject(), cMode);
} else if (ctrd?.AsValue().TryGetValue(out decimal v) == true) {
@@ -287,9 +287,11 @@ namespace Elwig.Helpers.Billing {
curve["data"] = GraphToJson(entry.DataGraph, entry.Mode.ToString().ToLower());
if (entry.ContractedFlatBonus != null) {
curve["ctrd"] = (decimal)entry.ContractedFlatBonus;
curve["contracted"] = (decimal)entry.ContractedFlatBonus;
curve.Remove("geb");
} else if (entry.ContractedGraph != null) {
curve["ctrd"] = GraphToJson(entry.ContractedGraph, entry.Mode.ToString().ToLower());
curve["contracted"] = GraphToJson(entry.ContractedGraph, entry.Mode.ToString().ToLower());
curve.Remove("geb");
}
return curve;
@@ -92,13 +92,13 @@
{"$ref": "#/definitions/curve_data"}
]
},
"ctrd": {
"geb": {
"anyOf": [
{"type": "number"},
{"$ref": "#/definitions/curve_data"}
]
},
"geb": {
"contracted": {
"anyOf": [
{"type": "number"},
{"$ref": "#/definitions/curve_data"}
+2 -2
View File
@@ -35,11 +35,11 @@ namespace Elwig.Windows {
private static readonly LegendItem
UnContractedLegend = new() {
LabelText = "Ungebunden", LineWidth = 1, LineColor = ColorUnContracted,
LabelText = "UnContracted", LineWidth = 1, LineColor = ColorUnContracted,
MarkerStyle = new(MarkerShape.FilledCircle, 5, ColorUnContracted)
},
ContractedLegend = new() {
LabelText = "Gebunden", LineWidth = 1, LineColor = ColorContracted,
LabelText = "Contracted", LineWidth = 1, LineColor = ColorContracted,
MarkerStyle = new(MarkerShape.FilledCircle, 5, ColorContracted)
},
LdwLegend = new() {
@@ -298,7 +298,7 @@ namespace Tests.UnitTests.HelperTests {
"73oe": 0.5,
"17kmw": 0.6
},
"ctrd": 0.1
"contracted": 0.1
}, {
"id": 2,
"mode": "kmw",
@@ -306,7 +306,7 @@ namespace Tests.UnitTests.HelperTests {
"15kmw": 0.6,
"17kmw": 0.7
},
"ctrd": {
"contracted": {
"73oe": 0.65,
"17kmw": 0.80
}
+2 -2
View File
@@ -56,12 +56,12 @@ namespace Tests.UnitTests.HelperTests {
"id": 1,
"mode": "oe",
"data": {"15kmw": 0.54},
"ctrd": 0.1
"contracted": 0.1
}, {
"id": 2,
"mode": "oe",
"data": {"15kmw": 0.61},
"ctrd": 0.1
"contracted": 0.1
}]
}
""";