diff --git a/SafeExamBrowser.SystemComponents/PowerSupply/PowerSupply.cs b/SafeExamBrowser.SystemComponents/PowerSupply/PowerSupply.cs index 3f3264bc..57858866 100644 --- a/SafeExamBrowser.SystemComponents/PowerSupply/PowerSupply.cs +++ b/SafeExamBrowser.SystemComponents/PowerSupply/PowerSupply.cs @@ -22,10 +22,10 @@ namespace SafeExamBrowser.SystemComponents.PowerSupply private readonly ILogger logger; private readonly PowerSupplySettings settings; - private DateTime lastStatusLog; - private Timer timer; private double critical; private double low; + private DateTime lastStatusLog; + private Timer timer; public event StatusChangedEventHandler StatusChanged; @@ -53,6 +53,8 @@ namespace SafeExamBrowser.SystemComponents.PowerSupply lastStatusLog = DateTime.Now; } + logger.Warn($"Raw Charge: {charge}, Low Threshold: {low}, Critical Threshold: {critical}, Status: {status.BatteryChargeStatus}"); + return status; } @@ -60,9 +62,13 @@ namespace SafeExamBrowser.SystemComponents.PowerSupply { const int TWO_SECONDS = 2000; + logger.Warn($"Pre-Sanitized Low Threshold: {settings.ChargeThresholdLow}, Pre-Sanitized Critical Threshold: {settings.ChargeThresholdCritical}"); + critical = SanitizeThreshold(settings.ChargeThresholdCritical); low = SanitizeThreshold(settings.ChargeThresholdLow); + logger.Warn($"Sanitized Low Threshold: {low}, Sanitized Critical Threshold: {critical}"); + timer = new Timer(TWO_SECONDS); timer.Elapsed += Timer_Elapsed; timer.AutoReset = true;