Example #1
0
        private void UpdateFanSpeedAnimation(FanSpeed speed)
        {
            ((Storyboard)Resources["Storyboard"]).Stop();
            switch (speed)
            {
            case FanSpeed.Low:
                _rotateAnimation.Duration       = new Duration(TimeSpan.FromSeconds(1));
                _rotateAnimation.RepeatBehavior = RepeatBehavior.Forever;
                break;

            case FanSpeed.Medium:
                _rotateAnimation.Duration       = new Duration(TimeSpan.FromSeconds(.1));
                _rotateAnimation.RepeatBehavior = RepeatBehavior.Forever;
                break;

            case FanSpeed.High:
                _rotateAnimation.Duration       = new Duration(TimeSpan.FromSeconds(.01));
                _rotateAnimation.RepeatBehavior = RepeatBehavior.Forever;
                break;
            }

            if (Value)
            {
                ((Storyboard)Resources["Storyboard"]).Begin();
            }
        }
Example #2
0
        private void AdjustFanSpeed()
        {
            switch (_fanSpeed)
            {
            case FanSpeed.Low:
                _fanSpeed = FanSpeed.Medium;
                Console.WriteLine("Setting fan speed to medium");
                break;

            case FanSpeed.Medium:
                _fanSpeed = FanSpeed.High;
                Console.WriteLine("Setting fan speed to high");
                break;

            case FanSpeed.High:
                _fanSpeed = FanSpeed.Max;
                Console.WriteLine("Setting fan speed to max");
                break;

            default:
                _fanSpeed = FanSpeed.Low;
                Console.WriteLine("Setting fan speed to low");
                break;
            }
        }
Example #3
0
 public void Revert()
 {
     if (_oldSpeed == FanSpeed.Off)
     {
         TurnACOff();
     }
     else
     {
         Console.WriteLine("Setting fan speed to previous");
         _fanSpeed = _oldSpeed;
     }
 }
Example #4
0
 public void TurnACOff()
 {
     if (_on)
     {
         Console.WriteLine("Turning AC off");
         _on       = false;
         _fanSpeed = FanSpeed.Off;
     }
     else
     {
         Console.WriteLine("AC already off");
     }
 }
Example #5
0
 public GPUAnalysis Analyze()
 {
     return(new GPUAnalysis()
     {
         BusLoad = BusLoad.IsSensorThresholded(),
         CoreClock = CoreClock.IsSensorThresholded(),
         CoreLoad = CoreLoad.IsSensorThresholded(),
         CoreTemperature = CoreTemperature.IsSensorThresholded(),
         FanSpeed = FanSpeed.IsSensorThresholded(),
         FrameBufferLoad = FrameBufferLoad.IsSensorThresholded(),
         ShaderClock = ShaderClock.IsSensorThresholded(),
         VideoEngineLoad = VideoEngineLoad.IsSensorThresholded()
     });
 }
Example #6
0
 public void TurnACOn()
 {
     if (_on)
     {
         _oldSpeed = _fanSpeed;
         AdjustFanSpeed();
     }
     else
     {
         _on       = true;
         _fanSpeed = FanSpeed.Low;
         Console.WriteLine("Turning AC on");
     }
 }
Example #7
0
 public void SpeedUp()
 {
     if (IsOn)
     {
         switch (fanSpeed)
         {
             case FanSpeed.Slow:
                 fanSpeed = FanSpeed.Medium;
                 break;
             case FanSpeed.Medium:
                 fanSpeed = FanSpeed.Fast;
                 break;
         }
     }
 }
Example #8
0
        public static void ChangeFanSpeed(long lRequestId, FanSpeed speed)
        {
            AirConditionerCommand command = new AirConditionerCommand();

            Logging.WriteDebugLog("AirConditioner.ChangeFanSpeed() [0x{0}] Changing Fan Speed: {1}", lRequestId.ToString("X8"), Enum.GetName(typeof(FanSpeed), speed));

            lock (_oLockCommand)
            {
                command.amOn         = _airConditionerCommand.amOn;
                command.tempTarget   = _airConditionerCommand.tempTarget;
                command.fanSpeed     = (int)speed;
                command.mode         = _airConditionerCommand.mode;
                command.enabledZones = _airConditionerCommand.enabledZones;
            }

            MQTT.SendMessage("actron/aircon/fanmode", Enum.GetName(typeof(FanSpeed), speed).ToLower());

            PostCommand(lRequestId, "System", command);
        }
Example #9
0
 public void SetSpeed(FanSpeed fanSpeed)
 {
     Console.WriteLine("Fan - Fan speed: " + fanSpeed);
 }
 public CeilingFan(string location)
 {
     _location = location;
     _fanSpeed = FanSpeed.Off;
 }
 public void Off()
 {
     _fanSpeed = FanSpeed.Off;
     Console.WriteLine($"{_location} ceiling fan is off");
 }
 public void Low()
 {
     _fanSpeed = FanSpeed.Low;
     Console.WriteLine($"{_location} ceiling fan is on low");
 }
 public void Hight()
 {
     _speed = FanSpeed.High;
 }
Example #14
0
 public void Medium()
 {
     Console.WriteLine($"Ceiling fan in {_roomName} set to medium");
     _speed = FanSpeed.Medium;
 }
Example #15
0
 public void Off()
 {
     Console.WriteLine($"Ceiling fan in {_roomName} fan off");
     _speed = FanSpeed.Off;
 }
Example #16
0
 public void Execute()
 {
     _prevSpeed = _ceilingFan.GetSpeed();
     _ceilingFan.Hight();
 }
Example #17
0
 public async Task SetFanSpeed(FanSpeed speed)
 {
     await SendCommand(Commands.AC_FUN_WINDLEVEL, speed.ToString());
 }
Example #18
0
 public void SetSpeed(FanSpeed fanSpeed)
 {
     _Clevo.RunMethod(_SetMethodName, (uint)fanSpeed);
 }
 public void Off()
 {
     _speed = FanSpeed.Off;
 }
 public void Low()
 {
     _speed = FanSpeed.Low;
 }
 public void Medium()
 {
     _speed = FanSpeed.Medium;
 }
 public void SetSpeed(FanSpeed fanSpeed)
 {
     Console.WriteLine("Fan - Fan speed: " + fanSpeed);
 }
Example #23
0
 public void High()
 {
     Console.WriteLine($"Ceiling fan in {_roomName} set to high");
     _speed = FanSpeed.High;
 }
 public void High()
 {
     _fanSpeed = FanSpeed.High;
     Console.WriteLine($"{_location} ceiling fan is on high");
 }
Example #25
0
 public void Low()
 {
     Console.WriteLine($"Ceiling fan in {_roomName} set to low");
     _speed = FanSpeed.Low;
 }
 public void Medium()
 {
     _fanSpeed = FanSpeed.Medium;
     Console.WriteLine($"{_location} ceiling fan is on medium");
 }
Example #27
0
 public Conditioner(int temperature, FanSpeed fanSpeed)
     : base(10, 30, temperature)
 {
     this.fanSpeed = fanSpeed;
 }
 public CeilingFan(string roomName)
 {
     _roomName = roomName;
     _speed    = FanSpeed.Off;
 }
 public void Execute()
 {
     _previousSpeed = _ceilingFan.GetSpeed();
     _ceilingFan.Off();
 }
Example #30
0
 public CeilingFan(string roomName)
 {
     _roomName  = roomName;
     _speed     = FanSpeed.Off;
     SpeedStack = new Stack <FanSpeed>();
 }