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(); }
private bool _CheckComponentSourceForCircularDependency(IDataFlowComponent component, IDataFlowComponentReference source) { if (source == null) { return(false); } return(_CheckComponentSourceForCircularDependency(component, source.Component)); }
private void _SetComponentSource(IDataFlowComponent component, IDataFlowComponentReference source) { if (Equals(source, component.Source)) { return; } component.Source = source; OnComponentSourceChanged(component); }
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); } }
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); } }
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); }
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; } }