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; }
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; } }
void display_PowerStatusChange(IDeviceWithPower device, DevicePowerStatusEventArgs args) { if (args.PreviousPowerStatus == DevicePowerStatus.PowerOff && ( args.NewPowerStatus == DevicePowerStatus.PowerOn || args.NewPowerStatus == DevicePowerStatus.PowerWarming)) { Down(); } else if (args.PreviousPowerStatus == DevicePowerStatus.PowerOn && ( args.NewPowerStatus == DevicePowerStatus.PowerOff || args.NewPowerStatus == DevicePowerStatus.PowerCooling)) { Up(); } }
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; } }