Пример #1
0
        public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
        {
            var joinMap = new StatusSignControllerJoinMap();

            var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);

            if (!string.IsNullOrEmpty(joinMapSerialized))
            {
                joinMap = JsonConvert.DeserializeObject <StatusSignControllerJoinMap>(joinMapSerialized);
            }

            joinMap.OffsetJoinNumbers(joinStart);

            Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));

            trilist.SetBoolSigAction(joinMap.RedControl, b => EnableControl(trilist, joinMap, this));
            trilist.SetBoolSigAction(joinMap.GreenControl, b => EnableControl(trilist, joinMap, this));
            trilist.SetBoolSigAction(joinMap.BlueControl, b => EnableControl(trilist, joinMap, this));

            trilist.SetUShortSigAction(joinMap.RedLed, u => SetColor(trilist, joinMap, this));
            trilist.SetUShortSigAction(joinMap.GreenLed, u => SetColor(trilist, joinMap, this));
            trilist.SetUShortSigAction(joinMap.BlueLed, u => SetColor(trilist, joinMap, this));

            trilist.StringInput[joinMap.Name].StringValue = Name;

            IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);
            RedLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RedControl]);
            BlueLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.BlueControl]);
            GreenLedEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.GreenControl]);

            RedLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.RedLed]);
            BlueLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.BlueLed]);
            GreenLedBrightnessFeedback.LinkInputSig(trilist.UShortInput[joinMap.GreenLed]);
        }
Пример #2
0
        public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
        {
            var joinMap = new C2nRthsControllerJoinMap(joinStart);

            var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);

            if (!string.IsNullOrEmpty(joinMapSerialized))
            {
                joinMap = JsonConvert.DeserializeObject <C2nRthsControllerJoinMap>(joinMapSerialized);
            }

            bridge.AddJoinMap(Key, joinMap);

            Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));


            trilist.SetBoolSigAction(joinMap.TemperatureFormat.JoinNumber, SetTemperatureFormat);



            IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
            TemperatureFeedback.LinkInputSig(trilist.UShortInput[joinMap.Temperature.JoinNumber]);
            HumidityFeedback.LinkInputSig(trilist.UShortInput[joinMap.Humidity.JoinNumber]);

            trilist.StringInput[joinMap.Name.JoinNumber].StringValue = Name;
        }
Пример #3
0
        public static void Run(SvPlayer player, string message)
        {
            var tpaUser = PlayerList[player.player.ID].TpaUser;

            if (tpaUser == null || !IsOnline.Run(tpaUser))
            {
                player.SendChatMessage($"<color={errorColor}>There are no TPA accepts. (User could've went offline.)</color>");
                return;
            }
            PlayerList[player.player.ID].TpaUser = null;
            player.SendChatMessage($"<color={errorColor}>You denied the TPA request of</color> <color={argColor}>{tpaUser.username}</color><color={errorColor}>.</color>");
            tpaUser.svPlayer.SendChatMessage($"<color={argColor}>{player.player.username}</color> <color={errorColor}>Denied your TPA request.</color>");
        }
Пример #4
0
        public static void Run(SvPlayer player, string message)
        {
            var tpaUser = PlayerList[player.player.ID].TpaUser;

            if (tpaUser == null || !IsOnline.Run(tpaUser))
            {
                player.SendChatMessage($"<color={errorColor}>There are no TPA accepts. (User could've went offline.)</color>");
                return;
            }
            tpaUser.svPlayer.ResetAndSavePosition(player.player.GetPosition(), player.player.GetRotation(), player.player.GetPlaceIndex());
            PlayerList[player.player.ID].TpaUser = null;
            player.SendChatMessage($"<color={infoColor}>You accepted the TPA request of</color> <color={argColor}>{tpaUser.username}</color><color={infoColor}>.</color>");
            tpaUser.svPlayer.SendChatMessage($"<color={argColor}>{player.player.username}</color> <color={infoColor}>Accepted your TPA request.</color>");
        }
Пример #5
0
        // This device has a different class for com ports which will make it hard to implement IComPorts....

        //#region IComPorts Members
        //public CrestronCollection<ComPort> ComPorts { get { return TxRxPair.ComPorts as CrestronCollection<ComPort>; } }
        //public int NumberOfComPorts { get { return 1; } }
        //#endregion
        public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
        {
            var joinMap = new HdMdxxxCEControllerJoinMap(joinStart);

            var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);

            if (!string.IsNullOrEmpty(joinMapSerialized))
            {
                joinMap = JsonConvert.DeserializeObject <HdMdxxxCEControllerJoinMap>(joinMapSerialized);
            }

            bridge.AddJoinMap(Key, joinMap);

            Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));

            IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline.JoinNumber]);
            RemoteEndDetectedFeedback.LinkInputSig(trilist.BooleanInput[joinMap.RemoteEndDetected.JoinNumber]);

            trilist.SetSigTrueAction(joinMap.AutoRouteOn.JoinNumber, AutoRouteOn);
            AutoRouteOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.AutoRouteOn.JoinNumber]);
            trilist.SetSigTrueAction(joinMap.AutoRouteOff.JoinNumber, AutoRouteOff);
            AutoRouteOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.AutoRouteOff.JoinNumber]);

            trilist.SetSigTrueAction(joinMap.PriorityRoutingOn.JoinNumber, PriorityRouteOn);
            PriorityRoutingOnFeedback.LinkInputSig(trilist.BooleanInput[joinMap.PriorityRoutingOn.JoinNumber]);
            trilist.SetSigTrueAction(joinMap.PriorityRoutingOff.JoinNumber, PriorityRouteOff);
            PriorityRoutingOnFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.PriorityRoutingOff.JoinNumber]);

            trilist.SetSigTrueAction(joinMap.InputOnScreenDisplayEnabled.JoinNumber, OnScreenDisplayEnable);
            InputOnScreenDisplayEnabledFeedback.LinkInputSig(trilist.BooleanInput[joinMap.InputOnScreenDisplayEnabled.JoinNumber]);
            trilist.SetSigTrueAction(joinMap.AutoRouteOff.JoinNumber, OnScreenDisplayDisable);
            InputOnScreenDisplayEnabledFeedback.LinkComplementInputSig(trilist.BooleanInput[joinMap.InputOnScreenDisplayDisabled.JoinNumber]);

            trilist.SetUShortSigAction(joinMap.VideoSource.JoinNumber, (i) => ExecuteSwitch(i, null, eRoutingSignalType.Video | eRoutingSignalType.Audio));
            VideoSourceFeedback.LinkInputSig(trilist.UShortInput[joinMap.VideoSource.JoinNumber]);

            trilist.UShortInput[joinMap.SourceCount.JoinNumber].UShortValue = (ushort)InputPorts.Count;

            foreach (var input in InputPorts)
            {
                var number     = Convert.ToUInt16(input.Selector);
                var numberJoin = (UInt16)(number - 1);
                SyncDetectedFeedbacks[number].LinkInputSig(trilist.BooleanInput[joinMap.SyncDetected.JoinNumber + numberJoin]);
                trilist.StringInput[joinMap.SourceNames.JoinNumber + numberJoin].StringValue = input.Key;
            }
        }
Пример #6
0
        public static void Run(SvPlayer player, string message)
        {
            var replyUser = PlayerList[player.player.ID].ReplyToUser;

            if (replyUser == null || !IsOnline.Run(replyUser))
            {
                player.SendChatMessage($"<color={errorColor}>There is nobody to respond to. (User could've went offline.)</color>");
                return;
            }
            string arg1 = GetArgument.Run(1, false, true, message);

            if (string.IsNullOrEmpty(arg1))
            {
                player.SendChatMessage(ArgRequired);
                return;
            }
            PlayerList[replyUser.ID].ReplyToUser = player.player;
            player.SendChatMessage($"<color={infoColor}>[PM]</color> <color={argColor}>{replyUser.username}</color> <color={warningColor}>></color> <color={infoColor}>{arg1}</color>");
            replyUser.svPlayer.SendChatMessage($"<color={infoColor}>[PM]</color> <color={argColor}>{player.player.username}</color> <color={warningColor}><</color> <color={infoColor}>{arg1}</color>");
        }
Пример #7
0
        public bool Equals(GroupMember input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     MemberType == input.MemberType ||
                     (MemberType != null && MemberType.Equals(input.MemberType))
                     ) &&
                 (
                     IsOnline == input.IsOnline ||
                     (IsOnline != null && IsOnline.Equals(input.IsOnline))
                 ) &&
                 (
                     LastOnlineStatusChange == input.LastOnlineStatusChange ||
                     (LastOnlineStatusChange.Equals(input.LastOnlineStatusChange))
                 ) &&
                 (
                     GroupId == input.GroupId ||
                     (GroupId.Equals(input.GroupId))
                 ) &&
                 (
                     DestinyUserInfo == input.DestinyUserInfo ||
                     (DestinyUserInfo != null && DestinyUserInfo.Equals(input.DestinyUserInfo))
                 ) &&
                 (
                     BungieNetUserInfo == input.BungieNetUserInfo ||
                     (BungieNetUserInfo != null && BungieNetUserInfo.Equals(input.BungieNetUserInfo))
                 ) &&
                 (
                     JoinDate == input.JoinDate ||
                     (JoinDate != null && JoinDate.Equals(input.JoinDate))
                 ));
        }
Пример #8
0
        public override void LinkToApi(BasicTriList trilist, uint joinStart, string joinMapKey, EiscApiAdvanced bridge)
        {
            var joinMap = new DmBladeChassisControllerJoinMap();

            var joinMapSerialized = JoinMapHelper.GetSerializedJoinMapForDevice(joinMapKey);

            if (!string.IsNullOrEmpty(joinMapSerialized))
            {
                joinMap = JsonConvert.DeserializeObject <DmBladeChassisControllerJoinMap>(joinMapSerialized);
            }


            joinMap.OffsetJoinNumbers(joinStart);

            Debug.Console(1, this, "Linking to Trilist '{0}'", trilist.ID.ToString("X"));

            IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.IsOnline]);

            // Link up outputs
            for (uint i = 1; i <= Chassis.NumberOfOutputs; i++)
            {
                var ioSlot = i;

                // Control
                trilist.SetUShortSigAction(joinMap.OutputVideo + ioSlot, o => ExecuteSwitch(o, ioSlot, eRoutingSignalType.Video));

                if (TxDictionary.ContainsKey(ioSlot))
                {
                    Debug.Console(2, "Creating Tx Feedbacks {0}", ioSlot);
                    var txKey         = TxDictionary[ioSlot];
                    var basicTxDevice = DeviceManager.GetDeviceForKey(txKey) as DmTxControllerBase;

                    var advancedTxDevice = basicTxDevice as DmTxControllerBase;

                    if (Chassis is DmMd128x128 || Chassis is DmMd64x64)
                    {
                        InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
                    }
                    else
                    {
                        if (advancedTxDevice != null)
                        {
                            advancedTxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
                            Debug.Console(2, "Linking Tx Online Feedback from Advanced Transmitter at input {0}", ioSlot);
                        }
                        else if (InputEndpointOnlineFeedbacks[ioSlot] != null)
                        {
                            Debug.Console(2, "Linking Tx Online Feedback from Input Card {0}", ioSlot);
                            InputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.InputEndpointOnline + ioSlot]);
                        }
                    }

                    if (basicTxDevice != null && advancedTxDevice == null)
                    {
                        trilist.BooleanInput[joinMap.TxAdvancedIsPresent + ioSlot].BoolValue = true;
                    }

                    if (advancedTxDevice != null)
                    {
                        advancedTxDevice.AnyVideoInput.VideoStatus.VideoSyncFeedback.LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);
                    }
                    else
                    {
                        Debug.Console(1, "Setting up actions and feedbacks on input card {0}", ioSlot);
                        VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);

                        var inputPort = InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
                        if (inputPort != null)
                        {
                            Debug.Console(1, "Port value for input card {0} is set", ioSlot);
                            var port = inputPort.Port;

                            if (port != null)
                            {
                                if (port is HdmiInputWithCEC)
                                {
                                    Debug.Console(1, "Port is HdmiInputWithCec");

                                    var hdmiInPortWCec = port as HdmiInputWithCEC;

                                    if (hdmiInPortWCec.HdcpSupportedLevel != eHdcpSupportedLevel.Unknown)
                                    {
                                        SetHdcpStateAction(true, hdmiInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist);
                                    }

                                    InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);

                                    if (InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
                                    {
                                        trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)InputCardHdcpCapabilityTypes[ioSlot];
                                    }
                                    else
                                    {
                                        trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1;
                                    }
                                }
                            }
                        }
                        else
                        {
                            inputPort = InputPorts[string.Format("inputCard{0}--dmIn", ioSlot)];

                            if (inputPort != null)
                            {
                                var port = inputPort.Port;

                                if (port is DMInputPortWithCec)
                                {
                                    Debug.Console(1, "Port is DMInputPortWithCec");

                                    var dmInPortWCec = port as DMInputPortWithCec;

                                    SetHdcpStateAction(PropertiesConfig.InputSlotSupportsHdcp2[ioSlot], dmInPortWCec, joinMap.HdcpSupportState + ioSlot, trilist);

                                    InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);

                                    if (InputCardHdcpCapabilityTypes.ContainsKey(ioSlot))
                                    {
                                        trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = (ushort)InputCardHdcpCapabilityTypes[ioSlot];
                                    }
                                    else
                                    {
                                        trilist.UShortInput[joinMap.HdcpSupportCapability + ioSlot].UShortValue = 1;
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    VideoInputSyncFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.VideoSyncStatus + ioSlot]);

                    var inputPort = InputPorts[string.Format("inputCard{0}--hdmiIn", ioSlot)];
                    if (inputPort != null)
                    {
                        var hdmiPort = inputPort.Port as EndpointHdmiInput;

                        if (hdmiPort != null)
                        {
                            SetHdcpStateAction(true, hdmiPort, joinMap.HdcpSupportState + ioSlot, trilist);
                            InputCardHdcpCapabilityFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.HdcpSupportState + ioSlot]);
                        }
                    }
                }
                if (RxDictionary.ContainsKey(ioSlot))
                {
                    Debug.Console(2, "Creating Rx Feedbacks {0}", ioSlot);
                    //var rxKey = RxDictionary[ioSlot];
                    //var rxDevice = DeviceManager.GetDeviceForKey(rxKey) as DmRmcControllerBase;
                    //var hdBaseTDevice = DeviceManager.GetDeviceForKey(rxKey) as DmHdBaseTControllerBase;
                    //if (hdBaseTDevice != null) {
                    OutputEndpointOnlineFeedbacks[ioSlot].LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
                    //}
                    //else if (rxDevice != null) {
                    //    rxDevice.IsOnline.LinkInputSig(trilist.BooleanInput[joinMap.OutputEndpointOnline + ioSlot]);
                    //}
                }

                // Feedback
                VideoOutputFeedbacks[ioSlot].LinkInputSig(trilist.UShortInput[joinMap.OutputVideo + ioSlot]);


                OutputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputNames + ioSlot]);
                InputNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.InputNames + ioSlot]);
                OutputVideoRouteNameFeedbacks[ioSlot].LinkInputSig(trilist.StringInput[joinMap.OutputCurrentVideoInputNames + ioSlot]);
            }
        }