Esempio n. 1
0
 private void CheckWaterChangeTime(object state)
 {
     if (TimerController.IsTimeReadyToRun(_waterChangeTime, _waterChangeInterval))
     {
         WaterChange();
     }
 }
 /// <summary>
 /// Constructs a new <see cref="BasePinController"/> object by initialzing the timer controller
 /// </summary>
 public BasePinController(IEnumerable <DateTime?> feedingTimes, int pinches)
 {
     TimerController              = new TimerController(feedingTimes);
     TimerController.PumpOff     += _timerController_PumpOff;
     TimerController.PumpOn      += _timerController_PumpOn;
     TimerController.FeederStart += _timerController_FeederStart;
     IsFillActive  = false;
     IsDrainActive = false;
     Pinches       = pinches;
 }
        /// <summary>
        /// Initicates the drain sequence. Will start the associated timer and set the GPIO pins.
        /// to turn on the correct valves.
        /// </summary>
        public void Drain()
        {
            IsDrainActive = true;

            OpenValve(_outPin_Open, _outPin_Close);

            OpenValve(_wastePin_Open, _wastePin_Close);

            CloseValve(_inPin_Open, _inPin_Close);

            CloseValve(_fillSaltPin_Open, _fillSaltPin_Close);

            TimerController.SetPumpOnDelay();
        }
        /// <summary>
        /// Starts the Fill fresh water
        /// </summary>
        public void FillFreshWater()
        {
            IsFillActive = true;

            OpenValve(_inPin_Open, _inPin_Close);

            OpenValve(_fillFreshPin_Open, _fillFreshPin_Close);

            CloseValve(_outPin_Open, _outPin_Close);

            CloseValve(_wastePin_Open, _wastePin_Close);

            TimerController.SetPumpOnDelay();
        }
 public void Stop()
 {
     TurnValvesOff();
     TimerController.SetPumpOffDelay();
 }
Esempio n. 6
0
 /// <summary>
 /// GUI click event for draining.  Will start the associated timer and set the selected GPIO pins LOW
 /// to turn on the correct valves.
 /// </summary>
 public void Drain()
 {
     IsDrainActive = true;
     Console.WriteLine($"----------------{DateTime.Now}: DRAIN ON");
     TimerController.SetPumpOnDelay();
 }
Esempio n. 7
0
 /// <summary>
 /// Starts the Fill fresh water
 /// </summary>
 public void FillFreshWater()
 {
     IsFillActive = true;
     Console.WriteLine($"----------------{DateTime.Now}: FILL FRESH ON");
     TimerController.SetPumpOnDelay();
 }