private void FusionOnFusionAssetStateChange(FusionBase device, FusionAssetStateEventArgs args) { if (!_fusionAssets.ContainsKey(args.UserConfigurableAssetDetailIndex)) { return; } var staticAsset = Fusion.UserConfigurableAssetDetails[args.UserConfigurableAssetDetailIndex].Asset as FusionStaticAsset; var asset = _fusionAssets[args.UserConfigurableAssetDetailIndex]; var powerDevice = asset as IPowerDevice; if (powerDevice == null || staticAsset == null) { return; } switch (args.EventId) { case FusionAssetEventId.StaticAssetPowerOnReceivedEventId: if (staticAsset.PowerOn.OutputSig.BoolValue) { powerDevice.Power = true; } break; case FusionAssetEventId.StaticAssetPowerOffReceivedEventId: if (staticAsset.PowerOff.OutputSig.BoolValue) { powerDevice.Power = false; } break; } }
/// <summary> /// Method to handle asset changes from fusion ( /// </summary> /// <param name="device"></param> /// <param name="args"></param> void myRoom_FusionAssetStateChange(FusionBase device, FusionAssetStateEventArgs args) { // determine which asset is raising this event switch (args.UserConfigurableAssetDetailIndex) { case 3: // the FusionLightingLoad // determine what event is being raised switch (args.EventId) { case FusionAssetEventId.LoadOffReceivedEventId: if (myLightingLoad.LoadOff.OutputSig.BoolValue) { SetLights(false); } break; case FusionAssetEventId.LoadOnReceivedEventId: if (myLightingLoad.LoadOn.OutputSig.BoolValue) { SetLights(true); } break; default: break; } break; default: break; } }
void FusionRoom_FusionAssetStateChange(FusionBase device, FusionAssetStateEventArgs args) { if (args.UserConfigurableAssetDetailIndex == this.FusionAsset.ParamAssetNumber) { CrestronConsole.PrintLine("{0}.FusionRoom_FusionAssetStateChange", this.GetType()); CrestronConsole.PrintLine(" args.EventId = {0}", args.EventId); CrestronConsole.PrintLine(" args.UserConfiguredSigDetail = {0}", args.UserConfiguredSigDetail.GetType()); } }
void FusionRoom_FusionAssetStateChange(FusionBase device, FusionAssetStateEventArgs args) { if (args.UserConfigurableAssetDetailIndex == this.FusionAsset.ParamAssetNumber) { switch (args.EventId) { case FusionAssetEventId.StaticAssetAssetBoolAssetSigEventReceivedEventId: Crestron.SimplSharpPro.Fusion.BooleanSigDataFixedName sig = (Crestron.SimplSharpPro.Fusion.BooleanSigDataFixedName)args.UserConfiguredSigDetail; if (sig.Number == 1 && sig.OutputSig.BoolValue) { this.Reboot(); } break; } } }
void FusionRoom_FusionAssetStateChange(FusionBase device, FusionAssetStateEventArgs args) { if (args.UserConfigurableAssetDetailIndex == this.FusionAsset.ParamAssetNumber) { switch (args.EventId) { case FusionAssetEventId.StaticAssetPowerOnReceivedEventId: if (((Crestron.SimplSharpPro.Fusion.BooleanSigDataFixedName)args.UserConfiguredSigDetail).OutputSig.BoolValue) { this.Power = true; } break; case FusionAssetEventId.StaticAssetPowerOffReceivedEventId: if (((Crestron.SimplSharpPro.Fusion.BooleanSigDataFixedName)args.UserConfiguredSigDetail).OutputSig.BoolValue) { this.Power = false; } break; } } }
void AssetStateChange(FusionBase device, FusionAssetStateEventArgs args) { Trace("AssetStateChange() event ID: " + args.EventId); }