Exemplo n.º 1
0
        public AlgorithmFlowElement(
            FlowInterfaceControl control, 
            IFlowProcessingPipeline processingPipeline,
            StorageLayer l)
        {
            this.m_Control = control;
            this.m_FlowProcessingPipeline = processingPipeline;
            this.m_Layer = l;
            var attrs = l.Algorithm.GetType().GetCustomAttributes(typeof(FlowDesignerNameAttribute), true);
            this.Name = attrs.Length > 0 ? (attrs[0] as FlowDesignerNameAttribute).Name : l.Algorithm.ToString();
            this.ImageWidth = 128;
            this.ImageHeight = 192;
            this.ObjectPropertyUpdated();

            // Create input / output connectors.
            foreach (string s in this.m_Layer.Algorithm.InputNames)
                this.m_InputConnectors.Add(new AlgorithmFlowConnector(this, s, true, l));
            this.m_OutputConnectors.Add(new AlgorithmFlowConnector(this, "Output", false, l));

            /*this.m_CompiledViewToggleThread = new Thread(() =>
            {
                while (this.m_CompiledViewToggleThread.ThreadState != ThreadState.AbortRequested)
                {
                    Thread.Sleep(100);
                    if (this.m_RealBitmap == this.m_RuntimeBitmap)
                        this.m_RealBitmap = this.m_CompiledBitmap;
                    else
                        this.m_RealBitmap = this.m_RuntimeBitmap;
                    try
                    {
                        this.m_Control.Invoke(new Action(() =>
                        {
                            this.m_Control.Invalidate(this.InvalidatingRegion.Apply(this.m_Control.Zoom));
                        }));
                    }
                    catch
                    {
                        break;
                    }
                }
            });
            this.m_CompiledViewToggleThread.Start();*/
        }
 public void SetPipelineAndStart(IFlowProcessingPipeline pipeline)
 {
     this.m_ProcessingPipeline = pipeline;
     this.m_ProcessingThread.Start();
 }
Exemplo n.º 3
0
 public AlgorithmFlowElement(
     FlowInterfaceControl control, 
     IFlowProcessingPipeline processingPipeline,
     IAlgorithm algorithm)
     : this(control, processingPipeline, new StorageLayer { Algorithm = algorithm })
 {
 }
Exemplo n.º 4
0
 public void SetPipeline(IFlowProcessingPipeline processingPipeline)
 {
     this.m_FlowProcessingPipeline = processingPipeline;
 }