예제 #1
0
        public void RefreshControllerOutputStatus()
        {
            treeview.BeginUpdate();
            foreach (TreeNode node in treeview.Nodes)
            {
                if (node.Tag is IControllerDevice controller)
                {
                    foreach (TreeNode channelNode in node.Nodes)
                    {
                        if (channelNode.Tag is int i)
                        {
                            IDataFlowComponentReference source = controller.Outputs[i].Source;

                            if (source == null)
                            {
                                channelNode.ImageKey = channelNode.SelectedImageKey = "WhiteBall";
                            }
                            else if (source.Component == null || source.OutputIndex < 0)
                            {
                                channelNode.ImageKey = channelNode.SelectedImageKey = "GreyBall";
                            }
                            else
                            {
                                channelNode.ImageKey = channelNode.SelectedImageKey = "GreenBall";
                            }
                        }
                    }
                }
            }

            treeview.EndUpdate();
        }
예제 #2
0
        private bool _CheckComponentSourceForCircularDependency(IDataFlowComponent component,
                                                                IDataFlowComponentReference source)
        {
            if (source == null)
            {
                return(false);
            }

            return(_CheckComponentSourceForCircularDependency(component, source.Component));
        }
예제 #3
0
        private void _SetComponentSource(IDataFlowComponent component, IDataFlowComponentReference source)
        {
            if (Equals(source, component.Source))
            {
                return;
            }

            component.Source = source;

            OnComponentSourceChanged(component);
        }
예제 #4
0
        public bool SetComponentSource(IDataFlowComponent component, IDataFlowComponentReference source)
        {
            if (component == null)
            {
                throw new ArgumentNullException("component");
            }

            if (_CheckComponentSourceForCircularDependency(component, source))
            {
                return(false);
            }

            _RemoveComponentSource(component);
            _SetComponentSource(component, source);
            return(true);
        }
 private void _LookupAndConnectShapeToSource(FilterSetupShapeBase shape)
 {
     if (shape.DataFlowComponent != null && shape.DataFlowComponent.Source != null)
     {
         IDataFlowComponentReference source = shape.DataFlowComponent.Source;
         if (!_dataFlowComponentToShapes.ContainsKey(source.Component))
         {
             VixenSystem.Logging.Error("CreateConnectionsFromExistingLinks: can't find shape for source " + source.Component + source.OutputIndex);
             return;
         }
         List <FilterSetupShapeBase> sourceShapes = _dataFlowComponentToShapes[source.Component];
         // TODO: deal with multiple instances of the source data flow component: eg. a element existing as
         // multiple shapes (currently, we'll assume it's the first shape in the list)
         ConnectShapes(sourceShapes.First(), source.OutputIndex, shape);
     }
 }
예제 #6
0
        private void AddControllerToTree(TreeNodeCollection collection, IControllerDevice controller)
        {
            TreeNode controllerNode = new TreeNode();

            controllerNode.Name = controller.Id.ToString();
            controllerNode.Text = controller.Name;
            controllerNode.Tag  = controller;

            if (controller.IsRunning)
            {
                controllerNode.ImageKey = controllerNode.SelectedImageKey = "Group";
            }
            else
            {
                controllerNode.ImageKey = controllerNode.SelectedImageKey = "RedBall";
            }

            collection.Add(controllerNode);

            for (int i = 0; i < controller.OutputCount; i++)
            {
                TreeNode channelNode = new TreeNode();
                channelNode.Name = controller.Outputs[i].Name;
                channelNode.Text = controller.Outputs[i].Name;
                channelNode.Tag  = i;

                IDataFlowComponentReference source = controller.Outputs[i].Source;

                if (source == null)
                {
                    channelNode.ImageKey = channelNode.SelectedImageKey = "WhiteBall";
                }
                else if (source.Component == null || source.OutputIndex < 0)
                {
                    channelNode.ImageKey = channelNode.SelectedImageKey = "GreyBall";
                }
                else
                {
                    channelNode.ImageKey = channelNode.SelectedImageKey = "GreenBall";
                }

                controllerNode.Nodes.Add(channelNode);
            }
        }
예제 #7
0
        private void _SetComponentSource(IDataFlowComponent component, IDataFlowComponentReference source)
        {
            if (Equals(source, component.Source))
            {
                return;
            }

            component.Source = source;

            if (source != null)
            {
                // add the reverse reference (if we're not clearing it) -- track a data component's destinations, to make it easier to find later.
                if (!_componentDestinations.ContainsKey(source.Component))
                {
                    _componentDestinations[source.Component] = new List <IDataFlowComponent>();
                }
                _componentDestinations[source.Component].Add(component);
            }

            OnComponentSourceChanged(component);
        }
예제 #8
0
 public bool CheckComponentSourceForCircularDependency(IDataFlowComponent component, IDataFlowComponentReference source)
 {
     return(_CheckComponentSourceForCircularDependency(component, source));
 }
 public override void CopyFrom(Shape source)
 {
     base.CopyFrom(source);
     if (source is DataFlowConnectionLine) {
         DataFlowConnectionLine src = (DataFlowConnectionLine) source;
         SourceDataFlowComponentReference = src.SourceDataFlowComponentReference;
         DestinationDataComponent = src.DestinationDataComponent;
     }
 }