示例#1
0
        /// <summary>
        /// Adds OutputPort
        /// </summary>
        void AddOutputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector)
        {
            var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);

            Debug.Console(2, this, "Adding output port '{0}'", portKey);
            OutputPorts.Add(new RoutingOutputPort(portKey, sigType, portType, selector, this));
        }
示例#2
0
        public void AddChildPort(bool incrementPortCount = true)
        {
            CodeGraph.Instance.InvalidateSaveButton();
            var outputPort = base.InstantiatePort(Orientation.Horizontal, Direction.Output, Port.Capacity.Single, typeof(float));

            outputPort.name      = $"EventPort {EventPorts.Count + 1}";
            outputPort.portName  = $"child {EventPorts.Count + 1}";
            outputPort.portColor = new Color(1, 1, 1, 0.2f);

            // AddOutputPort(outputPort, () => "");
            var outputPortObj = new OutputPort(this, outputPort, () => "");

            OutputPorts.Add(outputPortObj);
            EventPorts.Add(outputPortObj);
            OutputPortDictionary.Add(outputPort, outputPortObj);
            outputPort.contentContainer.Add(new Button(() => { RemovePort(outputPortObj); })
            {
                text = "X"
            });
            outputContainer.Add(outputPort);

            if (incrementPortCount)
            {
                PortCount++;
            }
            Refresh();
        }
示例#3
0
        public void AddOutputPortToNode(string name, Type type)
        {
            var conn = new Port(name, this, PortTypes.Output, type);

            OutputPortPanel.Children.Add(conn);

            OutputPorts.Add(conn);
        }
示例#4
0
        public void AddOutputPortToNode(string name, Type type)
        {
            var conn = new Port(name, this, PortTypes.Output, type)
            {
                MultipleConnectionsAllowed = true
            };

            OutputPortPanel.Children.Add(conn);

            OutputPorts.Add(conn);
        }
示例#5
0
        private new void AddOutputPort(Port portReference, Func <string> getCode, bool alsoAddToHierarchy = true)
        {
            var outputPort = new OutputPort(this, portReference, getCode);

            OutputPorts.Add(outputPort);
            OutputPortDictionary.Add(portReference, outputPort);
            if (alsoAddToHierarchy)
            {
                outputContainer.Add(portReference);
            }
        }
示例#6
0
 public override void Init()
 {
     base.Init();
     Label        = "Start Node";
     NodePosition = new SVector2(960, 540);
     OutputPorts.Add(new PortBase()
     {
         Text = "Start",
         type = typeof(Object.Am_Text).ToString()
     }.Init());
 }
示例#7
0
        /// <summary>
        /// Adds OutputPort and sets Port as ICec object
        /// </summary>
        void AddOutputPortWithDebug(uint cardNum, string portName, eRoutingSignalType sigType, eRoutingPortConnectionType portType, object selector, ICec cecPort)
        {
            var portKey = string.Format("outputCard{0}--{1}", cardNum, portName);

            Debug.Console(2, this, "Adding output port '{0}'", portKey);
            var outputPort = new RoutingOutputPort(portKey, sigType, portType, selector, this);

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

            OutputPorts.Add(outputPort);
        }
示例#8
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();
        }
示例#9
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));
            }
        }
示例#10
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");
        }
示例#11
0
        public CameraVisca(string key, string name, IBasicCommunication comm, CameraPropertiesConfig props) :
            base(key, name)
        {
            Presets = props.Presets;

            OutputPorts.Add(new RoutingOutputPort("videoOut", eRoutingSignalType.Video, eRoutingPortConnectionType.None, null, this, true));

            // Default to all capabilties
            Capabilities = eCameraCapabilities.Pan | eCameraCapabilities.Tilt | eCameraCapabilities.Zoom | eCameraCapabilities.Focus;

            Communication = comm;
            var socket = comm as ISocketStatus;

            if (socket != null)
            {
                // This instance uses IP control
                socket.ConnectionChange += new EventHandler <GenericSocketStatusChageEventArgs>(socket_ConnectionChange);
            }
            else
            {
                // This instance uses RS-232 control
            }
            PortGather = new CommunicationGather(Communication, "\xFF");


            Communication.BytesReceived += new EventHandler <GenericCommMethodReceiveBytesArgs>(Communication_BytesReceived);
            PowerIsOnFeedback            = new BoolFeedback(() => { return(PowerIsOn); });

            if (props.CommunicationMonitorProperties != null)
            {
                CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, props.CommunicationMonitorProperties);
            }
            else
            {
                CommunicationMonitor = new GenericCommunicationMonitor(this, Communication, 20000, 120000, 300000, "\x81\x09\x04\x00\xFF");
            }
            DeviceManager.AddDevice(CommunicationMonitor);
        }