예제 #1
0
 public static DiagramBlock CreateDiagramBlock(BlockBase block, bool useNextPosition)
 {
     var className = block.GetAssemblyClassName();
     var imageName = "img" + className + "Mini";
     var image = GetResourceImage(imageName, 30, 20);
     var label = GetResourceString(block.Name);
     var shortname = typeof(BlockOutputNode).GetProperty("ShortName");
     return new DiagramBlock(image, label, block, block.InputNodes.ToArray<object>(), block.OutputNodes.ToArray<object>(), shortname, true, useNextPosition);
 }
예제 #2
0
 public BlockSetupPlotForm(string title, ref BlockBase block)
     : base(title, ref block)
 {
     InitializeComponent();
     OnBeforeInitializing += BeforeInitializing;
     OnAfterInitializing += AfterInitializing;
     OnFieldValueChanged += FieldValueChanged;
     BeforeInitializing();
     AfterInitializing();
 }
예제 #3
0
        /// <summary>
        /// Constructor
        /// </summary>
        public RampFunctionBlock()
        {
            BlockBase root = this;

            CreateNodes(ref root);

            Amplitude        = 1;
            Offset           = 0;
            Start            = RampStart = 0;
            Finish           = RampFinish = 1;
            SamplingRate     = 32768;
            IgnoreLastSample = false;
            ReturnToZero     = true;
        }
예제 #4
0
 public BlockSetupBaseForm(string title, ref BlockBase block)
 {
     InitializeComponent();
     FormCaption.Text = title;
     if (OnBeforeInitializing != null)
         OnBeforeInitializing();
     TempBlock = block.CloneWithLinks();
     TempBlock.Cascade = false;
     PropertyGrid.SelectedObject = TempBlock;
     PropertyGrid.Refresh();
     HasParameters = TempBlock.HasParameters();
     Block = block;
     if (OnAfterInitializing != null)
         OnAfterInitializing();
 }
예제 #5
0
        /// <summary>
        /// Constructor
        /// </summary>
        public GenerateSignalBlock()
        {
            BlockBase root = this;

            CreateNodes(ref root);

            TemplateNameList = new List <string>();
            TemplateNameList.AddRange(Utils.GetTypes("WaveletStudio.SignalGeneration").Select(it => it.Name).ToArray());
            Amplitude        = 1;
            Frequency        = 60;
            Phase            = 0;
            Offset           = 0;
            Start            = 0;
            Finish           = 1;
            SamplingRate     = 32768;
            IgnoreLastSample = false;
            TemplateName     = TemplateNameList.ElementAt(0);
        }
예제 #6
0
        /// <summary>
        /// Connects to another block
        /// </summary>
        /// <param name="block"></param>
        public void ConnectTo(BlockBase block)
        {
            if (OutputNodes.Count == 0 || block.InputNodes.Count == 0)
            {
                return;
            }

            var outputNode = OutputNodes.FirstOrDefault(it => it.ConnectingNode == null);
            var inputNode  = block.InputNodes.FirstOrDefault(it => it.ConnectingNode == null);

            if (outputNode == null)
            {
                outputNode = OutputNodes[0];
            }
            if (inputNode == null)
            {
                inputNode = block.InputNodes[0];
            }

            outputNode.ConnectTo(inputNode);
        }
예제 #7
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="root">The block object thar contains this node</param>
 /// <param name="name">Name of the input</param>
 /// <param name="shortName">Short name</param>
 public BlockInputNode(ref BlockBase root, string name, string shortName) : base(ref root, name, shortName)
 {
 }
예제 #8
0
        /// <summary>
        /// Constructor
        /// </summary>
        public InvertBlock()
        {
            BlockBase root = this;

            CreateNodes(ref root);
        }
예제 #9
0
 /// <summary>
 /// Create a single output node in a block
 /// </summary>
 internal static List <BlockOutputNode> CreateSingleOutput(ref BlockBase root)
 {
     return(new List <BlockOutputNode> {
         new BlockOutputNode(ref root, Resources.Output, Resources.Out)
     });
 }
예제 #10
0
        /// <summary>
        /// Constructor
        /// </summary>
        public IFFTBlock()
        {
            BlockBase root = this;

            CreateNodes(ref root);
        }
예제 #11
0
 /// <summary>
 /// Constructor
 /// </summary>
 public BlockInputSignalBridge(BlockBase root) : base(root)
 {
 }
예제 #12
0
 /// <summary>
 /// Creates the input and output nodes
 /// </summary>
 /// <param name="root"></param>
 protected override sealed void CreateNodes(ref BlockBase root)
 {
     root.InputNodes = BlockInputNode.CreateSingleInputSignal(ref root);
     root.OutputNodes = BlockOutputNode.CreateSingleOutput(ref root);
 }
예제 #13
0
        /// <summary>
        /// Constructor
        /// </summary>
        public AbsoluteValueBlock()
        {
            BlockBase root = this;

            CreateNodes(ref root);
        }
예제 #14
0
 /// <summary>
 /// Creates the input and output nodes
 /// </summary>
 /// <param name="root"></param>
 protected override sealed void CreateNodes(ref BlockBase root)
 {
     root.InputNodes  = BlockInputNode.CreateDoubledInput(ref root);
     root.OutputNodes = BlockOutputNode.CreateSingleOutput(ref root);
 }
예제 #15
0
 /// <summary>
 /// Creates the input and output nodes
 /// </summary>
 /// <param name="root"></param>
 protected abstract void CreateNodes(ref BlockBase root);
        /// <summary>
        /// Constructor
        /// </summary>
        public NormalDistributionBlock()
        {
            BlockBase root = this;

            CreateNodes(ref root);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public SampleBasedOperationBlock()
        {
            BlockBase root = this;

            CreateNodes(ref root);
        }
예제 #18
0
 public BlockPlot(ref BlockBase block)
 {
     InitializeComponent();
     ApplicationUtils.ConfigureGraph(GraphControl, block.Name);
     Block = block;
 }
예제 #19
0
 /// <summary>
 /// Creates the input and output nodes
 /// </summary>
 /// <param name="root"></param>
 protected abstract void CreateNodes(ref BlockBase root);
예제 #20
0
        /// <summary>
        /// Connects to another block
        /// </summary>
        /// <param name="block"></param>
        public void ConnectTo(BlockBase block)
        {
            if(OutputNodes.Count == 0 || block.InputNodes.Count == 0)
                return;

            var outputNode = OutputNodes.FirstOrDefault(it => it.ConnectingNode == null);
            var inputNode = block.InputNodes.FirstOrDefault(it => it.ConnectingNode == null);
            if (outputNode == null)
                outputNode = OutputNodes[0];
            if (inputNode == null)
                inputNode = block.InputNodes[0];

            outputNode.ConnectTo(inputNode);
        }
예제 #21
0
        /// <summary>
        /// Constructor
        /// </summary>
        public RelationalOperatorBlock()
        {
            BlockBase root = this;

            CreateNodes(ref root);
        }
예제 #22
0
 /// <summary>
 /// Create a single input node in a block
 /// </summary>
 internal static List <BlockInputNode> CreateSingleInputSignal(ref BlockBase root)
 {
     return(new List <BlockInputNode> {
         new BlockInputNode(ref root, Resources.Signal, Resources.In)
     });
 }
 /// <summary>
 /// Return the node list
 /// </summary>
 protected abstract List <T> GetNodeList(BlockBase root);
 /// <summary>
 /// Constructor
 /// </summary>
 protected BlockInOutSignalBridgeBase(BlockBase root)
 {
     _root = root;
 }
예제 #25
0
 public DiagramFormOutput(ref BlockBase block)
 {
     InitializeComponent();
     ApplicationUtils.ConfigureGraph(GraphControl, block.Name);
     Block = block;
 }
예제 #26
0
        /// <summary>
        /// Constructor
        /// </summary>
        public LogicOperationBlock()
        {
            BlockBase root = this;

            CreateNodes(ref root);
        }
예제 #27
0
        /// <summary>
        /// Constructor
        /// </summary>
        public ScalarOperationBlock()
        {
            BlockBase root = this;

            CreateNodes(ref root);
        }
예제 #28
0
 /// <summary>
 /// Creates the input and output nodes
 /// </summary>
 /// <param name="root"></param>
 protected override sealed void CreateNodes(ref BlockBase root)
 {
     root.InputNodes = new List<BlockInputNode>
                           {
                               new BlockInputNode(ref root, Resources.Input + "1", Resources.In + "1"),
                               new BlockInputNode(ref root, Resources.Input + "2", Resources.In + "2"),
                               new BlockInputNode(ref root, Resources.Input + "3", Resources.In + "3")
                           };
     root.OutputNodes = BlockOutputNode.CreateSingleOutput(ref root);
 }
예제 #29
0
 /// <summary>
 /// Creates the input and output nodes
 /// </summary>
 /// <param name="root"></param>
 protected override sealed void CreateNodes(ref BlockBase root)
 {
     root.InputNodes = BlockInputNode.CreateSingleInput(ref root);
     root.OutputNodes = new List<BlockOutputNode>();
     for (var i = 1; i <= _outputCount; i++)
     {
         root.OutputNodes.Add(new BlockOutputNode(ref root, Resources.Output + " " + i, Resources.Out + i));
     }
 }
 /// <summary>
 /// Creates the input and output nodes
 /// </summary>
 /// <param name="root"></param>
 protected override sealed void CreateNodes(ref BlockBase root)
 {
     root.InputNodes = new List<BlockInputNode>();
     root.OutputNodes = new List<BlockOutputNode>();
     root.InputNodes.Add(new BlockInputNode(ref root, Resources.Signal, Resources.In));
     root.OutputNodes.Add(new BlockOutputNode(ref root, Resources.Output, Resources.Out));
 }
예제 #31
0
 protected override List <BlockInputNode> GetNodeList(BlockBase root)
 {
     return(root.InputNodes);
 }
예제 #32
0
        /// <summary>
        /// Constructor
        /// </summary>
        public ShiftBlock()
        {
            BlockBase root = this;

            CreateNodes(ref root);
        }
예제 #33
0
 /// <summary>
 /// Creates the input and output nodes
 /// </summary>
 /// <param name="root"></param>
 protected override sealed void CreateNodes(ref BlockBase root)
 {
     root.OutputNodes = BlockOutputNode.CreateSingleOutputSignal(ref root);
 }
예제 #34
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="root">The block object thar contains this node</param>
 /// <param name="name">Name of the output</param>
 /// <param name="shortName">Short name</param>
 public BlockOutputNode(ref BlockBase root, string name, string shortName) : base(ref root, name, shortName)
 {
     Object = new List <Signal>();
 }