Esempio n. 1
0
 private void DeviceOnPowerStatusChange(IPowerDevice device, DevicePowerStatusEventArgs args)
 {
     Feedback = args.NewPowerStatus == DevicePowerStatus.PowerWarming ||
                args.NewPowerStatus == DevicePowerStatus.PowerOn;
     BoolInputSigs[2].BoolValue = device.PowerStatus != DevicePowerStatus.PowerCooling &&
                                  device.PowerStatus != DevicePowerStatus.PowerWarming;
 }
Esempio n. 2
0
 private void FusionAssetOnPowerStatusChange(IPowerDevice device, DevicePowerStatusEventArgs args)
 {
     foreach (var asset in (from fusionAsset in _fusionAssets
                            where device == fusionAsset.Value
                            select Fusion.UserConfigurableAssetDetails[fusionAsset.Key].Asset).OfType <FusionStaticAsset>())
     {
         asset.PowerOn.InputSig.BoolValue = device.Power;
         return;
     }
 }
Esempio n. 3
0
        protected virtual void OnPowerStatusChange(IPowerDevice device, DevicePowerStatusEventArgs args)
        {
            var handler = PowerStatusChange;

            if (handler == null)
            {
                return;
            }
            try
            {
                handler(device, args);
            }
            catch (Exception e)
            {
                CloudLog.Exception(e);
            }
        }
Esempio n. 4
0
        protected virtual void DisplayDeviceOnPowerStatusChange(IPowerDevice device, DevicePowerStatusEventArgs args)
        {
            switch (args.NewPowerStatus)
            {
            case DevicePowerStatus.PowerWarming:
            case DevicePowerStatus.PowerOn:
                if (args.PreviousPowerStatus == DevicePowerStatus.PowerWarming)
                {
                    return;
                }
                if (HoistController != null)
                {
                    CloudLog.Info("{0} power now {1}, Lowering Hoist", Name, args.NewPowerStatus);
                    HoistController.Down();
                }
                if (ScreenController != null)
                {
                    CloudLog.Info("{0} power now {1}, Lowering Screen", Name, args.NewPowerStatus);
                    ScreenController.Down();
                }
                break;

            case DevicePowerStatus.PowerOff:
                if (ScreenController != null && args.PreviousPowerStatus == DevicePowerStatus.PowerOn)
                {
                    CloudLog.Info("{0} power now {1}, Raising Screen", Name, args.NewPowerStatus);
                    ScreenController.Up();
                }
                if (HoistController != null)
                {
                    CloudLog.Info("{0} power now {1}, Raising Hoist", Name, args.NewPowerStatus);
                    HoistController.Up();
                }
                break;

            case DevicePowerStatus.PowerCooling:
                if (ScreenController != null)
                {
                    CloudLog.Info("{0} power now {1}, Raising Screen", Name, args.NewPowerStatus);
                    ScreenController.Up();
                }
                break;
            }
        }
Esempio n. 5
0
 public uint AddItem(IPowerDevice device)
 {
     return(base.AddItem(device.Name, device, true));
 }