private void CheckWaterChangeLevel(object state) { if (_aquaI2CController.WaterHeight < _aquaI2CController.Delta10Height && _isChangeDrainDone == false) { _isChangeDrainDone = true; _aquaPinController.Stop(); Console.WriteLine("Water Changed: Auto Stop Fired"); Console.WriteLine($"Water Changed: {_aquaI2CController.WaterHeight}"); Console.WriteLine($"Water Changed: {_aquaI2CController.Delta10Height}"); } else if (_aquaPinController.IsPumpActive == false && _aquaPinController.IsFillActive == false && _aquaPinController.IsDrainActive == false) { _aquaPinController.FillSaltWater(); Console.WriteLine("Water Changed: Auto fill Fired"); Console.WriteLine($"Water Changed: {_aquaI2CController.WaterHeight}"); Console.WriteLine($"Water Changed: {_aquaI2CController.Delta10Height}"); } else if (_aquaI2CController.WaterHeight >= _aquaI2CController.TopWaterHeight && _aquaPinController.IsFillActive) { _aquaPinController.Stop(); Console.WriteLine("Water Changed: WaterChange Off"); _waterChangeTimer.Change(Timeout.Infinite, Timeout.Infinite); _waterLevelTimer.Change(TimeSpan.Zero, _waterLevelCheckInterval); _isChangeDrainDone = false; } }
public IActionResult Stop() { _aquaPinController.Stop(); return(Ok()); }