From e22ea4b7b6c0404fb66b79c4d40149d9bef3341e Mon Sep 17 00:00:00 2001 From: Mathew Date: Tue, 23 Aug 2022 14:23:32 -0500 Subject: [PATCH 1/4] fixed the Y label for Power plot and load demand, made plots in kVA instead od VA --- .../MeasurementChartContainer.tsx | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/client/src/app/simulation/measurement-chart/MeasurementChartContainer.tsx b/client/src/app/simulation/measurement-chart/MeasurementChartContainer.tsx index dd2653c1..59793bb8 100644 --- a/client/src/app/simulation/measurement-chart/MeasurementChartContainer.tsx +++ b/client/src/app/simulation/measurement-chart/MeasurementChartContainer.tsx @@ -235,15 +235,17 @@ export class MeasurementChartContainer extends Component { private _deriveYAxisLabel(plotModel: PlotModel) { switch (plotModel.measurementType) { case MeasurementType.POWER: - if (plotModel.useMagnitude) - return 'W'; - else - return 'Degrees'; + if (plotModel.useMagnitude) { +return 'kVA'; +} else { +return 'Degrees'; +} case MeasurementType.VOLTAGE: - if (plotModel.useMagnitude) - return 'V'; - else - return 'Degrees'; + if (plotModel.useMagnitude) { +return 'V'; +} else { +return 'Degrees'; +} case MeasurementType.TAP: return ''; default: @@ -342,7 +344,7 @@ export class MeasurementChartContainer extends Component { const loadDemandPlotModel = this._plotModels[1]; const loadDemandRenderableChartModel = this._createDefaultRenderableChartModel(loadDemandPlotModel); - loadDemandRenderableChartModel.yAxisLabel = 'KVA'; + loadDemandRenderableChartModel.yAxisLabel = 'kVA'; loadDemandRenderableChartModel.timeSeries = [ this._addValueToTimeSeries(this._findOrCreateTimeSeries(loadDemandPlotModel, loadDemandPlotModel.components[0]), energyConsumerP / 1000), this._addValueToTimeSeries(this._findOrCreateTimeSeries(loadDemandPlotModel, loadDemandPlotModel.components[1]), energyConsumerQ / 1000), @@ -405,8 +407,13 @@ export class MeasurementChartContainer extends Component { if (measurement !== undefined) { switch (plotModel.measurementType) { case MeasurementType.VOLTAGE: - case MeasurementType.POWER: return measurement[plotModel.useMagnitude ? 'magnitude' : 'angle']; + case MeasurementType.POWER: + if (plotModel.useMagnitude) { +return measurement['magnitude'] / 1000; +} else { +return measurement['angle']; +} case MeasurementType.TAP: return measurement.value; } From 68f0096504e0a2459691cb762492bfdc2bd9f2ba Mon Sep 17 00:00:00 2001 From: Mathew Date: Tue, 23 Aug 2022 14:36:27 -0500 Subject: [PATCH 2/4] formatted --- .../MeasurementChartContainer.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/client/src/app/simulation/measurement-chart/MeasurementChartContainer.tsx b/client/src/app/simulation/measurement-chart/MeasurementChartContainer.tsx index 59793bb8..80fe252c 100644 --- a/client/src/app/simulation/measurement-chart/MeasurementChartContainer.tsx +++ b/client/src/app/simulation/measurement-chart/MeasurementChartContainer.tsx @@ -236,16 +236,16 @@ export class MeasurementChartContainer extends Component { switch (plotModel.measurementType) { case MeasurementType.POWER: if (plotModel.useMagnitude) { -return 'kVA'; -} else { -return 'Degrees'; -} + return 'kVA'; + } else { + return 'Degrees'; + } case MeasurementType.VOLTAGE: if (plotModel.useMagnitude) { -return 'V'; -} else { -return 'Degrees'; -} + return 'V'; + } else { + return 'Degrees'; + } case MeasurementType.TAP: return ''; default: From e4fc72faa73f0fddddeabfac8b14adb934c19ea5 Mon Sep 17 00:00:00 2001 From: Mathew Date: Tue, 23 Aug 2022 14:38:51 -0500 Subject: [PATCH 3/4] formatted --- .../measurement-chart/MeasurementChartContainer.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/src/app/simulation/measurement-chart/MeasurementChartContainer.tsx b/client/src/app/simulation/measurement-chart/MeasurementChartContainer.tsx index 80fe252c..0623d402 100644 --- a/client/src/app/simulation/measurement-chart/MeasurementChartContainer.tsx +++ b/client/src/app/simulation/measurement-chart/MeasurementChartContainer.tsx @@ -410,10 +410,10 @@ export class MeasurementChartContainer extends Component { return measurement[plotModel.useMagnitude ? 'magnitude' : 'angle']; case MeasurementType.POWER: if (plotModel.useMagnitude) { -return measurement['magnitude'] / 1000; -} else { -return measurement['angle']; -} + return measurement['magnitude'] / 1000; + } else { + return measurement['angle']; + } case MeasurementType.TAP: return measurement.value; } From 5ac21b29849c55077b776dd221e893d4f758fa1d Mon Sep 17 00:00:00 2001 From: Mathew Date: Wed, 24 Aug 2022 12:02:35 -0500 Subject: [PATCH 4/4] fixed the Y axis label for load demand plot --- .../measurement-chart/MeasurementChartContainer.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/app/simulation/measurement-chart/MeasurementChartContainer.tsx b/client/src/app/simulation/measurement-chart/MeasurementChartContainer.tsx index 0623d402..a125f0b5 100644 --- a/client/src/app/simulation/measurement-chart/MeasurementChartContainer.tsx +++ b/client/src/app/simulation/measurement-chart/MeasurementChartContainer.tsx @@ -80,7 +80,7 @@ export class MeasurementChartContainer extends Component { finalChartModels.push(renderableChartModel); } if (finalChartModels[1].yAxisLabel === '') { - finalChartModels[1].yAxisLabel = 'KVA'; + finalChartModels[1].yAxisLabel = 'kVA'; } this.setState({ renderableChartModels: finalChartModels @@ -212,7 +212,7 @@ export class MeasurementChartContainer extends Component { // If Load Demand chart has no Y-axis label // we want to set it now if (renderableChartModels[1].yAxisLabel === '') { - renderableChartModels[1].yAxisLabel = 'KVA'; + renderableChartModels[1].yAxisLabel = 'kVA'; } this.setState({ renderableChartModels