diff --git a/typescript/frontend-marios2/src/content/dashboards/Log/graph.util.tsx b/typescript/frontend-marios2/src/content/dashboards/Log/graph.util.tsx index 810920d9e..854e71408 100644 --- a/typescript/frontend-marios2/src/content/dashboards/Log/graph.util.tsx +++ b/typescript/frontend-marios2/src/content/dashboards/Log/graph.util.tsx @@ -32,6 +32,7 @@ export type ConfigurationValues = { minimumSoC: string | number; gridSetPoint: number; forceCalibrationCharge: number; + calibrationChargeDate: Date | null; }; export interface Battery { @@ -158,6 +159,7 @@ export type TopologyValues = { DcDcNum: I_BoxDataValue[]; calibrationChargeForced: I_BoxDataValue[]; mode: I_BoxDataValue[]; + calibrationChargeDate: I_BoxDataValue[]; batteryView: Battery[]; }; @@ -293,7 +295,8 @@ export const topologyPaths: TopologyPaths = { maximumDischargePower: ['/Config/MaxBatteryDischargingCurrent'], DcDcNum: ['/DcDc/SystemControl/NumberOfConnectedSlaves'], calibrationChargeForced: ['/Config/ForceCalibrationCharge'], - mode: ['/EssControl/Mode'] + mode: ['/EssControl/Mode'], + calibrationChargeDate: ['/EssControl/Date'] }; export const extractValues = ( @@ -307,19 +310,19 @@ export const extractValues = ( if (topologyKey === 'batteryView') { extractedValues[topologyKey] = []; - const numOfBatteries = timeSeriesData.value[ + const battery_ids_from_csv = timeSeriesData.value[ '/Config/Devices/BatteryNodes' ].value .toString() - .split(',').length; + .split(','); - let battery_id = 1; + let battery_index = 0; let pathIndex = 0; while (pathIndex < paths.length) { let battery = {}; let existingKeys = 0; - battery[BatteryKeys[0]] = battery_id; + battery[BatteryKeys[0]] = battery_ids_from_csv[battery_index]; for (let i = 1; i < BatteryKeys.length; i++) { const path = paths[pathIndex]; if (timeSeriesData.value.hasOwnProperty(path)) { @@ -337,7 +340,7 @@ export const extractValues = ( } pathIndex++; } - battery_id++; + battery_index++; if (existingKeys > 0) { extractedValues[topologyKey].push(battery as Battery); }