/// <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;
            }
        }
Пример #2
0
        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;
            }
        }
Пример #3
0
 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());
     }
 }
Пример #4
0
 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;
         }
     }
 }
Пример #5
0
        void FusionStateChange(FusionBase device, FusionStateEventArgs args)
        {
            switch (args.EventId)
            {
            case FusionEventIds.SystemPowerOnReceivedEventId:
                Trace("FusionStateChange() system power on event received.");
                break;

            case FusionEventIds.SystemPowerOffReceivedEventId:
                Trace("FusionStateChange() system power off event received.");
                break;

            default:
                Trace("FusionStateChange() unhandled event received: " + args.EventId);
                break;
            }
        }
Пример #6
0
        void FusionRoom_FusionStateChange(FusionBase device, FusionStateEventArgs args)
        {
            switch (args.EventId)
            {
            case FusionEventIds.SystemPowerOffReceivedEventId:
                if (this.FusionRoom.SystemPowerOff.OutputSig.BoolValue)
                {
                    this.Room.FusionSystemPowerRequest(false);
                }
                break;

            case FusionEventIds.SystemPowerOnReceivedEventId:
                if (this.FusionRoom.SystemPowerOn.OutputSig.BoolValue)
                {
                    this.Room.FusionSystemPowerRequest(true);
                }
                break;
            }
        }
Пример #7
0
        private void OnFusionStateChange(FusionBase device, FusionStateEventArgs args)
        {
            var fusion = device as FusionRoom;

            if (fusion == null)
            {
                return;
            }

            switch (args.EventId)
            {
            case FusionEventIds.SystemPowerOffReceivedEventId:
                if (fusion.SystemPowerOff.OutputSig.BoolValue)
                {
                    FusionRequestedPowerOff();
                }
                break;

            case FusionEventIds.SystemPowerOnReceivedEventId:
                if (fusion.SystemPowerOn.OutputSig.BoolValue)
                {
                    FusionRequestedPowerOn();
                }
                break;

            case FusionEventIds.DisplayPowerOffReceivedEventId:
                if (fusion.DisplayPowerOff.OutputSig.BoolValue)
                {
                    FusionRequestedDisplaysOff();
                }
                break;

            case FusionEventIds.DisplayPowerOnReceivedEventId:
                if (fusion.DisplayPowerOn.OutputSig.BoolValue)
                {
                    FusionRequestedDisplaysOn();
                }
                break;
            }
        }
Пример #8
0
        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;
                }
            }
        }
Пример #9
0
 void AssetStateChange(FusionBase device, FusionAssetStateEventArgs args)
 {
     Trace("AssetStateChange() event ID: " + args.EventId);
 }
        /// <summary>
        /// Method to handle attribute changes on the FusionRoom object. This will be called for the default attributes, and any custom ones added using the FusionRoom.AddSig() method.
        /// </summary>
        /// <param name="device">Reference to the FusionRoom object raising this event.</param>
        /// <param name="args">Information about the event being raised.</param>
        void myRoom_FusionStateChange(FusionBase device, FusionStateEventArgs args)
        {
            // determine what type of event is being raised
            switch (args.EventId)
            {
                #region custom sigs (attributes)
            case FusionEventIds.UserConfiguredStringSigChangeEventId:
                var incomingStringSig = (StringSigData)args.UserConfiguredSigDetail;

                switch (incomingStringSig.Number)
                {
                // there are no user string sigs in this program, but this is how you would trap them
                default:
                    break;
                }
                break;

            case FusionEventIds.UserConfiguredUShortSigChangeEventId:
                var incomingUshortSig = (UShortSigData)args.UserConfiguredSigDetail;

                switch (incomingUshortSig.Number)
                {
                case 1:
                    CrestronConsole.PrintLine("Received a new Ushort value from fusion: {0}", incomingUshortSig.OutputSig.UShortValue);
                    break;

                default:
                    break;
                }
                break;

            case FusionEventIds.UserConfiguredBoolSigChangeEventId:
                var incomingBoolSig = (BooleanSigData)args.UserConfiguredSigDetail;

                if (incomingBoolSig.OutputSig.BoolValue)
                {
                    // determine which user bool sig is raising this event
                    switch (incomingBoolSig.Number)
                    {
                    case 1:
                        CrestronConsole.PrintLine("Received bool sig change from fusion!");
                        break;

                    default:
                        break;
                    }
                }

                break;
                #endregion

                #region System Power Events
            case FusionEventIds.SystemPowerOffReceivedEventId:
                // you need to add the following line to all fusion digital / bool sigs
                // when you send a digital from fusion will pulse the property on the Fusion room object (FALSE > TRUE, then TRUE > FALSE)
                // omitting this line will cause this code to be called twice
                if (myRoom.SystemPowerOff.OutputSig.BoolValue)
                {
                    // do what ever needs to happen when the sig is set
                    SetSystemPower(false);
                }
                break;

            case FusionEventIds.SystemPowerOnReceivedEventId:
                // you need to add the following line to all fusion digital / bool sigs
                // when you send a digital from fusion will pulse the property on the Fusion room object (FALSE > TRUE, then TRUE > FALSE)
                // omitting this line will cause this code to be called twice
                if (myRoom.SystemPowerOn.OutputSig.BoolValue)
                {
                    // do what ever needs to happen when the sig is set
                    SetSystemPower(true);
                }
                break;
                #endregion

                #region Display Power Events
            case FusionEventIds.DisplayPowerOnReceivedEventId:
                // you need to add the following line to all fusion digital / bool sigs
                // when you send a digital from fusion will pulse the property on the Fusion room object (FALSE > TRUE, then TRUE > FALSE)
                // omitting this line will cause this code to be called twice
                if (myRoom.DisplayPowerOn.OutputSig.BoolValue)
                {
                    // do what ever needs to happen when the sig is set
                    SetDisplayPower(true);
                }
                break;

            case FusionEventIds.DisplayPowerOffReceivedEventId:
                // you need to add the following line to all fusion digital / bool sigs
                // when you send a digital from fusion will pulse the property on the Fusion room object (FALSE > TRUE, then TRUE > FALSE)
                // omitting this line will cause this code to be called twice
                if (myRoom.DisplayPowerOff.OutputSig.BoolValue)
                {
                    // do what ever needs to happen when the sig is set
                    SetDisplayPower(false);
                }
                break;
                #endregion

                #region other possible events to explore
            case FusionEventIds.AuthenticateFailedReceivedEventId:
            case FusionEventIds.AuthenticateSucceededReceivedEventId:
            case FusionEventIds.BroadcastMessageReceivedEventId:
            case FusionEventIds.BroadcastMessageTypeReceivedEventId:
            case FusionEventIds.GroupMembershipRequestReceivedEventId:
            case FusionEventIds.HelpMessageReceivedEventId:
            case FusionEventIds.TextMessageFromRoomReceivedEventId:
                #endregion
            default:
                break;
            }
        }