From 4e4f9c4acfe79f4beb924f785ecf69173ad53c9d Mon Sep 17 00:00:00 2001 From: Dan <daniel2.lorych@live.uwe.ac.uk> Date: Mon, 2 May 2022 11:36:40 +0100 Subject: [PATCH] Update Solar panel to accept solar energy variable --- Helios/Source/ConfiguratorService.cs | 4 ++-- Helios/Source/SolarPanel.cs | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Helios/Source/ConfiguratorService.cs b/Helios/Source/ConfiguratorService.cs index ce47bfa..fa2d06a 100644 --- a/Helios/Source/ConfiguratorService.cs +++ b/Helios/Source/ConfiguratorService.cs @@ -35,8 +35,8 @@ namespace Helios.Source result.RoofAngle = roof.Elevation; result.PanelEfficiency = panel.Efficiency * 100; result.InstallationCost = panel.GetInstallationCost(roof.Area); - result.PowerGeneratedSummer = Math.Round(panel.GetPowerOutput(roof.Area, summerElevationAngle), 2); - result.PowerGeneratedWinter = Math.Round(panel.GetPowerOutput(roof.Area, winterElevationAngle), 2); + result.PowerGeneratedSummer = Math.Round(panel.GetPowerOutput(1000, roof.Area, summerElevationAngle), 2); + result.PowerGeneratedWinter = Math.Round(panel.GetPowerOutput(1000, roof.Area, winterElevationAngle), 2); result.GeneratesRequiredPower = GeneratesRequiredPower(input.PowerRequired, result.PowerGeneratedWinter); result.ExceedsMaximumPower = ExceedsPowerLimit(input.MaximumPower, result.PowerGeneratedWinter); result.WithinBudget = WithinBudget(input.Budget, result.InstallationCost); diff --git a/Helios/Source/SolarPanel.cs b/Helios/Source/SolarPanel.cs index e2a09a3..0e8e59d 100644 --- a/Helios/Source/SolarPanel.cs +++ b/Helios/Source/SolarPanel.cs @@ -31,11 +31,12 @@ namespace Helios.Source return installationCost; } - public double GetPowerOutput(double roofArea, int roofElevation) + + public double GetPowerOutput(int solarEnergy, double roofArea, int roofElevation) { double powerOutput; - powerOutput = Efficiency * 1000 * roofArea * Math.Sin(roofElevation); + powerOutput = Efficiency * solarEnergy * roofArea * Math.Sin(roofElevation); this.PowerOutput = powerOutput; -- GitLab