Ejemplo n.º 1
0
        protected override void SetPowerFeedback(DevicePowerStatus newPowerState)
        {
            if (newPowerState != PowerStatus && _busyTimer != null)
            {
                _busyTimer.Stop();
                _busyTimer.Dispose();
                _busyTimer = null;
            }

            if (Power && newPowerState == DevicePowerStatus.PowerCooling)
            {
                _busyTimer = new CTimer(specific => SetPowerFeedback(DevicePowerStatus.PowerOff),
                                        (long)_powerOffTime.TotalMilliseconds);
            }

            else if (!Power && newPowerState == DevicePowerStatus.PowerWarming)
            {
                _busyTimer = new CTimer(specific => SetPowerFeedback(DevicePowerStatus.PowerOn),
                                        (long)_powerOnTime.TotalMilliseconds);
            }

            else if (PowerStatus == DevicePowerStatus.PowerWarming && newPowerState == DevicePowerStatus.PowerOn)
            {
                SendInputCommand(_currentInput);
            }

            PowerStatus = newPowerState;
        }
Ejemplo n.º 2
0
        protected override void SetPowerFeedback(DevicePowerStatus newPowerState)
        {
            if (PowerStatus != DevicePowerStatus.PowerOff && newPowerState == DevicePowerStatus.PowerWarming)
            {
                return;
            }

            PowerStatus = newPowerState;
        }
Ejemplo n.º 3
0
        public virtual void OnPowerStatusChange(DevicePowerStatus newPowerStatus, DevicePowerStatus previousPowerStatus)
        {
#if DEBUG
            CrestronConsole.PrintLine("Display {0} OnPowerStatusChange(), newPowerStatus = {1}, previousPowerStatus = {2}",
                                      this.Name, newPowerStatus.ToString(), previousPowerStatus.ToString());
#endif
            if (PowerStatusChange != null)
            {
                PowerStatusChange(this, new DevicePowerStatusEventArgs(newPowerStatus, previousPowerStatus));
                FusionUpdate();
            }
        }
Ejemplo n.º 4
0
        protected override void SetPowerFeedback(DevicePowerStatus newPowerState)
        {
            PowerStatus = newPowerState;

            if (RequestedPower != Power && _powerActioned)
            {
                ActionPowerRequest(RequestedPower);
            }
            else if (_powerActioned && RequestedPower == Power)
            {
                _powerActioned = true;
            }
        }
Ejemplo n.º 5
0
        protected override void SetPowerFeedback(DevicePowerStatus newPowerState)
        {
            PowerStatus = newPowerState;

            if (_firstFeedback)
            {
                _firstFeedback = false;
                Power          = Power;
            }
            else if (RequestedPower != Power)
            {
                ActionPowerRequest(RequestedPower);
            }
        }
Ejemplo n.º 6
0
        protected override void SetPowerFeedback(DevicePowerStatus newPowerState)
        {
            PowerStatus = newPowerState;

            //if (!_firstConnect)
            //{
            //    _firstConnect = true;
            //    Power = Power;
            //    return;
            //}

            //if (PowerStatus == DevicePowerStatus.PowerOff || PowerStatus == DevicePowerStatus.PowerOn
            //    && Power != RequestedPower)
            //    ActionPowerRequest(RequestedPower);
        }
Ejemplo n.º 7
0
        protected override void SetPowerFeedback(DevicePowerStatus newPowerState)
        {
            PowerStatus = newPowerState;

            if (!_firstConnect)
            {
                _firstConnect = true;
                Power         = Power;
                return;
            }

            if (PowerStatus == DevicePowerStatus.PowerOff || PowerStatus == DevicePowerStatus.PowerOn &&
                Power != RequestedPower)
            {
                ActionPowerRequest(RequestedPower);
            }
        }
Ejemplo n.º 8
0
        protected override void SetPowerFeedback(DevicePowerStatus newPowerState)
        {
            PowerStatus = newPowerState;

            if (!_firstConnect)
            {
                _firstConnect = true;
                Power         = Power;
                return;
            }

            if ((PowerStatus == DevicePowerStatus.PowerOff || PowerStatus == DevicePowerStatus.PowerOn) && Power != RequestedPower)
            {
                Debug.WriteWarn(GetType().Name + " Power Not as Requested", "PowerStatus = {0}, RequestedPower = {1}, Power = {2}",
                                PowerStatus, RequestedPower, Power);
                ActionPowerRequest(RequestedPower);
            }
        }
Ejemplo n.º 9
0
        protected override void SetPowerFeedback(DevicePowerStatus newPowerState)
        {
            if (!_firstConnect)
            {
                PowerStatus   = newPowerState;
                _firstConnect = true;
                Power         = Power;
                return;
            }

            if (_powerBusyTimer != null && !_powerBusyTimer.Disposed)
            {
                _powerBusyTimer.Stop();
                _powerBusyTimer.Dispose();
            }

            if (PowerStatus == DevicePowerStatus.PowerOff && newPowerState == DevicePowerStatus.PowerOn)
            {
                PowerStatus     = DevicePowerStatus.PowerWarming;
                _powerBusyTimer = new CTimer(specific => SetPowerFeedback(DevicePowerStatus.PowerOn), 5000);
                return;
            }

            if (PowerStatus == DevicePowerStatus.PowerOn && newPowerState == DevicePowerStatus.PowerOff)
            {
                PowerStatus     = DevicePowerStatus.PowerCooling;
                _powerBusyTimer = new CTimer(specific => SetPowerFeedback(DevicePowerStatus.PowerOff), 8000);
                return;
            }

            PowerStatus = newPowerState;

            if (PowerStatus == DevicePowerStatus.PowerOff || PowerStatus == DevicePowerStatus.PowerOn &&
                Power != RequestedPower)
            {
                ActionPowerRequest(RequestedPower);
            }
        }
Ejemplo n.º 10
0
 protected override void SetPowerFeedback(DevicePowerStatus newPowerState)
 {
     PowerStatus = newPowerState;
 }
Ejemplo n.º 11
0
 public DevicePowerStatusEventArgs(DevicePowerStatus newPowerStatus, DevicePowerStatus previousPowerStatus)
 {
     NewPowerStatus      = newPowerStatus;
     PreviousPowerStatus = previousPowerStatus;
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Call this when receiving power status feedback from device.
 /// PowerStatus = newPowerState;
 /// </summary>
 /// <param name="newPowerState"></param>
 protected abstract void SetPowerFeedback(DevicePowerStatus newPowerState);