/// <summary>
        /// This method finalizes and converts the outputString to a floating point value
        /// </summary>
        private void FinalizeOutput()
        {
            OutputValue = float.Parse(OutputString);

            OutputValue = (float)Math.Round(OutputValue, 1);
            if (OutputValue < 0.1f)
            {
                OutputValue = 0.1f;
            }
            ActiveLabel.Text = OutputValue.ToString();
            ClearNumericKeyBoard();
            NumericKeyboardPanel.Visible = false;
            ActiveLabel.BackColor        = Color.White;
            ActiveLabel = null;
        }
Пример #2
0
        internal override void Build()
        {
            if (_TimeStamp.Count != _OutputValue.Count)
            {
                throw new SimulinkModelGeneratorException("TimeStamps count needs to be the same as OutputValues count.");
            }

            model.System.Block.Add(new Block()
            {
                BlockType  = "Reference",
                BlockName  = GenerateUniqueName("Repeating\\nSequence"),
                Parameters = new List <Parameter>()
                {
                    new Parameter()
                    {
                        Name = "Position", Text = base._Position
                    },
                    new Parameter()
                    {
                        Name = "BlockMirror", Text = base._BlockMirror
                    },
                    new Parameter()
                    {
                        Name = "Ports", Text = "[0 1]"
                    },
                    new Parameter()
                    {
                        Name = "LibraryVersion", Text = "1.391"
                    },
                    new Parameter()
                    {
                        Name = "SourceType", Text = "Repeating table"
                    },
                    new Parameter()
                    {
                        Name = "SourceBlock", Text = "simulink/Sources/Repeating\\nSequence"
                    },
                    new Parameter()
                    {
                        Name = "rep_seq_t", Text = _TimeStamp.ToString()
                    },
                    new Parameter()
                    {
                        Name = "rep_seq_y", Text = _OutputValue.ToString()
                    }
                }
            });
        }
Пример #3
0
            //-------------------------------------------------------------------------------------------------------------------------------------------------

            public string GetOutputString()
            {
                return(OutputValue.ToString());
            }