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);
 }
 public BlockSetupPlotForm(string title, ref BlockBase block)
     : base(title, ref block)
 {
     InitializeComponent();
     OnBeforeInitializing += BeforeInitializing;
     OnAfterInitializing += AfterInitializing;
     OnFieldValueChanged += FieldValueChanged;
     BeforeInitializing();
     AfterInitializing();
 }
Beispiel #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;
        }
 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();
 }
        /// <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);
        }
Beispiel #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);
        }
Beispiel #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)
 {
 }
Beispiel #8
0
        /// <summary>
        /// Constructor
        /// </summary>
        public InvertBlock()
        {
            BlockBase root = this;

            CreateNodes(ref root);
        }
 /// <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)
     });
 }
Beispiel #10
0
        /// <summary>
        /// Constructor
        /// </summary>
        public IFFTBlock()
        {
            BlockBase root = this;

            CreateNodes(ref root);
        }
Beispiel #11
0
 /// <summary>
 /// Constructor
 /// </summary>
 public BlockInputSignalBridge(BlockBase root) : base(root)
 {
 }
Beispiel #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);
 }
        /// <summary>
        /// Constructor
        /// </summary>
        public AbsoluteValueBlock()
        {
            BlockBase root = this;

            CreateNodes(ref root);
        }
 /// <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);
 }
Beispiel #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);
        }
Beispiel #18
0
 public BlockPlot(ref BlockBase block)
 {
     InitializeComponent();
     ApplicationUtils.ConfigureGraph(GraphControl, block.Name);
     Block = block;
 }
Beispiel #19
0
 /// <summary>
 /// Creates the input and output nodes
 /// </summary>
 /// <param name="root"></param>
 protected abstract void CreateNodes(ref BlockBase root);
Beispiel #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);
        }
Beispiel #21
0
        /// <summary>
        /// Constructor
        /// </summary>
        public RelationalOperatorBlock()
        {
            BlockBase root = this;

            CreateNodes(ref root);
        }
Beispiel #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;
 }
 public DiagramFormOutput(ref BlockBase block)
 {
     InitializeComponent();
     ApplicationUtils.ConfigureGraph(GraphControl, block.Name);
     Block = block;
 }
        /// <summary>
        /// Constructor
        /// </summary>
        public LogicOperationBlock()
        {
            BlockBase root = this;

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

            CreateNodes(ref root);
        }
Beispiel #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);
 }
Beispiel #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));
 }
Beispiel #31
0
 protected override List <BlockInputNode> GetNodeList(BlockBase root)
 {
     return(root.InputNodes);
 }
Beispiel #32
0
        /// <summary>
        /// Constructor
        /// </summary>
        public ShiftBlock()
        {
            BlockBase root = this;

            CreateNodes(ref root);
        }
 /// <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);
 }
 /// <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>();
 }