Ejemplo n.º 1
0
        /// <summary>
        /// Intial logic to set up instance
        /// </summary>
        void Init()
        {
            // Will gather to the specified delimiter
            PortGather = new CommunicationGather(Communication, '\x03');
            PortGather.LineReceived += this.Port_LineReceived;

            // Constuct the CommunicationMonitor
            CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, "\x02QPW\x03\x02QMI\x03"); // Query Power

            // Define the input ports
            InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, new Action(InputHdmi1), this));
            InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, new Action(InputHdmi2), this));
            InputPorts.Add(new RoutingInputPort(RoutingPortNames.DviIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Dvi, new Action(InputDvi1), this));
            InputPorts.Add(new RoutingInputPort(RoutingPortNames.VgaIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Vga, new Action(InputVga), this));

            // Define the feedback Funcs
            VolumeLevelFeedback = new IntFeedback(() => { return(_VolumeLevel); });
            MuteFeedback        = new BoolFeedback(() => _IsMuted);
            InputNumberFeedback = new IntFeedback(() => { Debug.Console(2, this, "CHange Input number {0}", InputNumber); return(InputNumber); });

            // Set the warmup time
            WarmupTime = 17000;
        }
Ejemplo n.º 2
0
        void Init()
        {
            PortGather = new CommunicationGather(Communication, '\x0d');
            PortGather.LineReceived += this.Port_LineReceived;
            CommunicationMonitor     = new GenericCommunicationMonitor(this, Communication, 30000, 120000, 300000, "\x02QPW\x03");         // Query Power

            InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, new Action(InputHdmi1), this));
            InputPorts.Add(new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, new Action(InputHdmi2), this));

            InputPorts.Add(new RoutingInputPort(RoutingPortNames.DviIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Dvi, new Action(InputDvi1), this));
            InputPorts.Add(new RoutingInputPort(RoutingPortNames.CompositeIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Composite, new Action(InputVideo1), this));
            InputPorts.Add(new RoutingInputPort(RoutingPortNames.VgaIn, eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Vga, new Action(InputVga), this));


            VolumeLevelFeedback = new IntFeedback(() => { return(_VolumeLevel); });
            MuteFeedback        = new BoolFeedback(() => _IsMuted);

            //    new BoolCueActionPair(CommonBoolCue.Menu, b => { if(b) Send(MenuIrCmd); }),
            //    new BoolCueActionPair(CommonBoolCue.Up, b => { if(b) Send(UpIrCmd); }),
            //    new BoolCueActionPair(CommonBoolCue.Down, b => { if(b) Send(DownIrCmd); }),
            //    new BoolCueActionPair(CommonBoolCue.Left, b => { if(b) Send(LeftIrCmd); }),
            //    new BoolCueActionPair(CommonBoolCue.Right, b => { if(b) Send(RightIrCmd); }),
            //    new BoolCueActionPair(CommonBoolCue.Select, b => { if(b) Send(SelectIrCmd); }),
            //    new BoolCueActionPair(CommonBoolCue.Exit, b => { if(b) Send(ExitIrCmd); }),
            //};
        }
Ejemplo n.º 3
0
        public void AddInputPortToNode(string name, Type type)
        {
            var conn = new Port(name, this, PortTypes.Input, type);

            InputPortPanel.Children.Add(conn);
            conn.DataChanged += conn_DataChanged;
            InputPorts.Add(conn);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Adds InputPort
        /// </summary>
        void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType)
        {
            var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);

            Debug.Console(2, this, "Adding input port '{0}'", portKey);
            var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);

            InputPorts.Add(inputPort);
        }
Ejemplo n.º 5
0
        public void AddInputPortToNode(string name, Type type, bool multipleConnectionsAllowed = false)
        {
            var port = new Port(name, this, PortTypes.Input, type)
            {
                MultipleConnectionsAllowed = multipleConnectionsAllowed
            };

            InputPortPanel.Children.Add(port);
            port.DataChanged += port_DataChanged;
            InputPorts.Add(port);
        }
Ejemplo n.º 6
0
        private new void AddInputPort(Port portReference, Func <string> requestCode, bool alsoAddToHierarchy = true)
        {
            var inputPort = new InputPort(this, portReference, requestCode);

            InputPorts.Add(inputPort);
            InputPortDictionary.Add(portReference, inputPort);
            if (alsoAddToHierarchy)
            {
                inputContainer.Add(portReference);
            }
        }
Ejemplo n.º 7
0
        public NodeInputPort CreateInputPort(float weight = 1f)
        {
            NodeInputPort port = new NodeInputPort {
                Node = this, Index = InputPorts.Count, Weight = weight
            };

            Playable.SetInputCount(Playable.GetInputCount() + 1);
            Playable.SetInputWeight(port.Index, weight);

            InputPorts.Add(port);

            return(port);
        }
Ejemplo n.º 8
0
        public Blendspace1DNodeInputPort CreateInputPort(float threshold)
        {
            Blendspace1DNodeInputPort port = new Blendspace1DNodeInputPort  {
                Node = this, Index = InputPorts.Count, Threshold = threshold
            };

            Playable.SetInputCount(Playable.GetInputCount() + 1);

            InputPorts.Add(port);

            RecalculateWeights();

            return(port);
        }
Ejemplo n.º 9
0
        /// <summary>
        ///
        /// </summary>
        public MockVC(DeviceConfig config)
            : base(config)
        {
            PropertiesConfig = JsonConvert.DeserializeObject <VideoCodec.MockVcPropertiesConfig>(config.Properties.ToString());

            CodecInfo = new MockCodecInfo();

            // Get favoritesw
            if (PropertiesConfig.Favorites != null)
            {
                CallFavorites           = new CodecCallFavorites();
                CallFavorites.Favorites = PropertiesConfig.Favorites;
            }

            DirectoryBrowseHistory = new List <CodecDirectory>();

            // Debug helpers
            MuteFeedback.OutputChange            += (o, a) => Debug.Console(1, this, "Mute={0}", _IsMuted);
            PrivacyModeIsOnFeedback.OutputChange += (o, a) => Debug.Console(1, this, "Privacy={0}", _PrivacyModeIsOn);
            SharingSourceFeedback.OutputChange   += (o, a) => Debug.Console(1, this, "SharingSource={0}", _SharingSource);
            VolumeLevelFeedback.OutputChange     += (o, a) => Debug.Console(1, this, "Volume={0}", _VolumeLevel);

            CurrentDirectoryResultIsNotDirectoryRoot = new BoolFeedback(() => DirectoryBrowseHistory.Count > 0);

            CurrentDirectoryResultIsNotDirectoryRoot.FireUpdate();

            CodecOsdIn = new RoutingInputPort(RoutingPortNames.CodecOsd, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, 0, this);
            InputPorts.Add(CodecOsdIn);
            HdmiIn1 = new RoutingInputPort(RoutingPortNames.HdmiIn1, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, 1, this);
            InputPorts.Add(HdmiIn1);
            HdmiIn2 = new RoutingInputPort(RoutingPortNames.HdmiIn2, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, 2, this);
            InputPorts.Add(HdmiIn2);
            HdmiOut = new RoutingOutputPort(RoutingPortNames.HdmiOut, eRoutingSignalType.Audio | eRoutingSignalType.Video, eRoutingPortConnectionType.Hdmi, null, this);
            OutputPorts.Add(HdmiOut);

            CallHistory = new CodecCallHistory();
            for (int i = 0; i < 10; i++)
            {
                var call = new CodecCallHistory.CallHistoryEntry();
                call.Name   = "Call " + i;
                call.Number = i + "@call.com";
                CallHistory.RecentCalls.Add(call);
            }
            // eventually fire history event here

            SetupCameras();

            SetIsReady();
        }
Ejemplo n.º 10
0
        public AirMediaController(string key, string name, AmX00 device, DeviceConfig dc, AirMediaPropertiesConfig props)
            : base(key, name, device)
        {
            AirMedia = device;

            DeviceConfig = dc;

            PropertiesConfig = props;

            InputPorts.Add(new RoutingInputPort(DmPortName.Osd, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.None, new Action(SelectPinPointUxLandingPage), this));

            InputPorts.Add(new RoutingInputPort(DmPortName.AirMediaIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Streaming, new Action(SelectAirMedia), this));

            InputPorts.Add(new RoutingInputPort(DmPortName.HdmiIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.Hdmi, new Action(SelectHdmiIn), this));

            InputPorts.Add(new RoutingInputPort(DmPortName.AirBoardIn, eRoutingSignalType.Video,
                                                eRoutingPortConnectionType.None, new Action(SelectAirboardIn), this));

            if (AirMedia is Am300)
            {
                InputPorts.Add(new RoutingInputPort(DmPortName.DmIn, eRoutingSignalType.Audio | eRoutingSignalType.Video,
                                                    eRoutingPortConnectionType.DmCat, new Action(SelectDmIn), this));
            }

            AirMedia.AirMedia.AirMediaChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(AirMedia_AirMediaChange);

            IsInSessionFeedback            = new BoolFeedback(new Func <bool>(() => AirMedia.AirMedia.StatusFeedback.UShortValue == 0));
            ErrorFeedback                  = new IntFeedback(new Func <int>(() => AirMedia.AirMedia.ErrorFeedback.UShortValue));
            NumberOfUsersConnectedFeedback = new IntFeedback(new Func <int>(() => AirMedia.AirMedia.NumberOfUsersConnectedFeedback.UShortValue));
            LoginCodeFeedback              = new IntFeedback(new Func <int>(() => AirMedia.AirMedia.LoginCodeFeedback.UShortValue));
            ConnectionAddressFeedback      = new StringFeedback(new Func <string>(() => AirMedia.AirMedia.ConnectionAddressFeedback.StringValue));
            HostnameFeedback               = new StringFeedback(new Func <string>(() => AirMedia.AirMedia.HostNameFeedback.StringValue));

            // TODO: Figure out if we can actually get the TSID/Serial
            SerialNumberFeedback = new StringFeedback(new Func <string>(() => "unknown"));

            AirMedia.DisplayControl.DisplayControlChange += new Crestron.SimplSharpPro.DeviceSupport.GenericEventHandler(DisplayControl_DisplayControlChange);

            VideoOutFeedback = new IntFeedback(new Func <int>(() => Convert.ToInt16(AirMedia.DisplayControl.VideoOutFeedback)));
            AutomaticInputRoutingEnabledFeedback = new BoolFeedback(new Func <bool>(() => AirMedia.DisplayControl.EnableAutomaticRoutingFeedback.BoolValue));

            AirMedia.HdmiIn.StreamChange += new Crestron.SimplSharpPro.DeviceSupport.StreamEventHandler(HdmiIn_StreamChange);

            HdmiVideoSyncDetectedFeedback = new BoolFeedback(new Func <bool>(() => AirMedia.HdmiIn.SyncDetectedFeedback.BoolValue));
        }
Ejemplo n.º 11
0
        private void Initialize(TesiraSwitcherControlBlockConfig config)
        {
            Type = "";
            //DeviceManager.AddDevice(this);

            Debug.Console(2, this, "Adding SourceSelector '{0}'", Key);

            IsSubscribed = false;

            Label = config.Label;
            if (config.Type != null)
            {
                Type = config.Type;
            }

            Enabled = config.Enabled;

            if (config.SwitcherInputs != null)
            {
                foreach (
                    var input in
                    from input in config.SwitcherInputs
                    let inputPort = input.Value
                                    let inputPortKey = input.Key
                                                       select input)
                {
                    InputPorts.Add(new RoutingInputPort(input.Value.Label, eRoutingSignalType.Audio,
                                                        eRoutingPortConnectionType.BackplaneOnly, input.Key, this));
                }
            }
            if (config.SwitcherOutputs == null)
            {
                return;
            }
            foreach (
                var output in
                from output in config.SwitcherOutputs
                let outputPort = output.Value
                                 let outputPortKey = output.Key
                                                     select output)
            {
                OutputPorts.Add(new RoutingOutputPort(output.Value.Label, eRoutingSignalType.Audio,
                                                      eRoutingPortConnectionType.BackplaneOnly, output.Key, this));
            }
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Adds InputPort and sets Port as ICec object
        /// </summary>
        void AddInputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, ICec cecPort)
        {
            var portKey = string.Format("inputCard{0}--{1}", cardNum, portName);

            Debug.Console(2, this, "Adding input port '{0}'", portKey);
            var inputPort = new RoutingInputPort(portKey, sigType, portType, cardNum, this);

            if (inputPort != null)
            {
                if (cecPort != null)
                {
                    inputPort.Port = cecPort;
                }

                InputPorts.Add(inputPort);
            }
            else
            {
                Debug.Console(2, this, "inputPort is null");
            }
        }
Ejemplo n.º 13
0
        public override void Init()
        {
            base.Init();
            Label        = "Text Obj";
            NodePosition = new SVector2(960, 540);

            InputPorts.Add(new PortBase()
            {
                Text = "Properties",
                type = typeof(Object.Am_Text).ToString()
            }.Init());

            OutputPorts.Add(new PortBase()
            {
                Text = "Out",
                type = typeof(Object.Am_Text).ToString()
            }.Init());

            ShowedPropertiesList.Add("Text");
            ShowedPropertiesList.Add("Fill_Color");
        }
Ejemplo n.º 14
0
 void AddRoutingInputPort(RoutingInputPort port, byte fbMatch)
 {
     port.FeedbackMatchObject = fbMatch;
     InputPorts.Add(port);
 }
Ejemplo n.º 15
0
        /// <summary>
        /// CCDDisplay Plugin device constructor for ISerialComport transport
        /// </summary>
        /// <param name="key"></param>
        /// <param name="name"></param>
        /// <param name="config"></param>
        /// <param name="display">Loaded and initialized instance of CCD Display driver instance</param>
        public RVCDisplayDevice(string key, string name, RVCDisplayConfig config, RoomViewConnectedDisplay display)
            : base(key, name)
        {
            Debug.Console(0, this, "Constructing new {0} instance", name);

            _config  = config;
            _display = display;

            StatusFeedback = new IntFeedback(() => (int)CommunicationMonitor.Status);
            Feedbacks.Add(StatusFeedback);

            VolumeLevelFeedback = new IntFeedback(() => { return((int)_display.VolumeFeedback.UShortValue); });
            MuteFeedback        = new BoolFeedback(() => _display.MuteOnFeedback.BoolValue);
            Feedbacks.Add(VolumeLevelFeedback);
            Feedbacks.Add(MuteFeedback);

            CommunicationMonitor = new CrestronGenericBaseCommunicationMonitor(this, _display, 12000, 30000);

            for (uint i = 1; i <= _display.SourceSelectFeedbackSigs.Count; i++)
            {
                string sourceName = "input" + i.ToString();
                /// CompactFramework fix for inline Actions and using iterator variables
                uint             sourceIndex = i;
                RoutingInputPort inputPort   = new RoutingInputPort(sourceName, eRoutingSignalType.AudioVideo, eRoutingPortConnectionType.Hdmi, new Action(() => _display.SourceSelectSigs[sourceIndex].BoolValue = true), this)
                {
                    FeedbackMatchObject = sourceIndex
                };
                _display.SourceSelectSigs[sourceIndex].UserObject = inputPort;
                InputPorts.Add(inputPort);
            }

            CrestronConsole.AddNewConsoleCommand((s) =>
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("Driver Information:");
                sb.AppendFormat("\tDevice ID:        {0}\r\n", _display.DeviceIdStringFeedback.StringValue);
                sb.AppendFormat("\tFirmware:         {0}\r\n", _display.FirmwareVersionFeedback.StringValue);
                sb.AppendFormat("\tName:             {0}\r\n", _display.ProjectorNameFeedback.StringValue);
                sb.AppendFormat("\tDescription:      {0}\r\n", _display.Description);
                sb.AppendFormat("\tStatus:           {0}\r\n", _display.StatusMessageFeedback.StringValue);
                sb.AppendFormat("\tLamp:             {0}\r\n", _display.LampHoursFeedback.UShortValue);
                sb.AppendFormat("\tLamp (text):      {0}\r\n", _display.LampHoursTextFeedback.StringValue);

                CrestronConsole.ConsoleCommandResponse("{0}", sb.ToString());
            },
                                                 Key + "INFO", "Print Driver Info", ConsoleAccessLevelEnum.AccessOperator);

            CrestronConsole.AddNewConsoleCommand((s) =>
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("State:");
                sb.AppendFormat("\tName:             {0}\r\n", _display.Name);
                sb.AppendFormat("\tID:               {0}\r\n", _display.ID);
                sb.AppendFormat("\tOnline:           {0}\r\n", _display.IsOnline?"Online":"Offline");
                sb.AppendFormat("\tPower:            {0}\r\n", _display.PowerOnFeedback.BoolValue?"ON":"OFF");
                sb.AppendFormat("\tCooling:          {0}\r\n", _display.CoolingDownFeedback.BoolValue ? "ON" : "OFF");
                sb.AppendFormat("\tWarming:          {0}\r\n", _display.WarmingUpFeedback.BoolValue ? "ON" : "OFF");
                sb.AppendFormat("\tMute:             {0}\r\n", _display.MuteOnFeedback.BoolValue ? "ON" : "OFF");
                sb.AppendFormat("\tVolume:           {0}\r\n", _display.VolumeFeedback.UShortValue);
                sb.AppendFormat("\tLamp:             {0}\r\n", _display.LampHoursFeedback.UShortValue);

                CrestronConsole.ConsoleCommandResponse("{0}", sb.ToString());
            },
                                                 Key + "STATE", "Print display state", ConsoleAccessLevelEnum.AccessOperator);

            CrestronConsole.AddNewConsoleCommand((s) =>
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendFormat("Current Input:  {0}\r\n", _display.CurrentSourceFeedback.StringValue);
                sb.AppendFormat("Inputs:\r\n");
                for (uint i = 1; i <= _display.SourceSelectFeedbackSigs.Count; i++)
                {
                    string sourceName = _display.SourceNameTextFeedbackSigs[i].StringValue;
                    if (String.IsNullOrEmpty(sourceName) || String.IsNullOrEmpty(sourceName.Trim()))
                    {
                        break;
                    }
                    sb.AppendFormat("\t{0}: {1}\r\n", sourceName, _display.SourceSelectFeedbackSigs[i].BoolValue ? "ON" : "");
                }

                CrestronConsole.ConsoleCommandResponse(sb.ToString());
            },
                                                 Key + "INPUTS", "Display Driver Inputs", ConsoleAccessLevelEnum.AccessOperator);

            CrestronConsole.AddNewConsoleCommand((s) =>
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendFormat("Input Ports:\r\n");
                foreach (var inputPort in InputPorts)
                {
                    //uint sourceSelectIndex = _display.SourceSelectSigs.FirstOrDefault<BoolInputSig>(sig => sig.UserObject == inputPort).Number;
                    uint sourceSelectIndex = 0;
                    for (uint i = 1; i <= _display.SourceSelectSigs.Count; i++)
                    {
                        if (_display.SourceSelectSigs[i].UserObject == inputPort)
                        {
                            sourceSelectIndex = i;
                            break;
                        }
                    }
                    sb.AppendFormat("\t{0}: {1}\r\n", inputPort.Key, _display.SourceNameTextFeedbackSigs[sourceSelectIndex].StringValue);
                }

                CrestronConsole.ConsoleCommandResponse(sb.ToString());
            },
                                                 Key + "ROUTINGPORTS", "Display Driver Routing Ports", ConsoleAccessLevelEnum.AccessOperator);
        }