示例#1
0
 public ReadRange(int x, int y, RangeDirection direction)
 {
     X         = x;
     Y         = y;
     Range     = 11;
     Direction = direction;
 }
示例#2
0
 public ReadRange(int x, int y, int range, RangeDirection direction)
 {
     X         = x;
     Y         = y;
     Range     = range;
     Direction = direction;
 }
        public static string GenerateFloatingPointType(VHDL.type.RealType typeDeclaration)
        {
            string         typeName       = typeDeclaration.Identifier;
            double         rangeLeft      = ((typeDeclaration.Range as VHDL.Range).From as VHDL.literal.RealLiteral).RealValue;
            double         rangeRight     = ((typeDeclaration.Range as VHDL.Range).To as VHDL.literal.RealLiteral).RealValue;
            RangeDirection rangeRirection = ((typeDeclaration.Range as VHDL.Range).Direction == VHDL.Range.RangeDirection.TO) ? RangeDirection.To : RangeDirection.DownTo;

            return(GenerateFloatingPointType(typeName, rangeLeft, rangeRight, rangeRirection));
        }
        public static string GenerateFloatingPointSubType(VHDLCompilerInterface compiler, string typeName, RangeSubtypeIndication rangeSubtype)
        {
            string         baseType       = compiler.TypeDictionary[rangeSubtype.BaseType];
            double         rangeLeft      = ((rangeSubtype.Range as VHDL.Range).From as VHDL.literal.RealLiteral).RealValue;
            double         rangeRight     = ((rangeSubtype.Range as VHDL.Range).To as VHDL.literal.RealLiteral).RealValue;
            RangeDirection rangeRirection = ((rangeSubtype.Range as VHDL.Range).Direction == VHDL.Range.RangeDirection.TO) ? RangeDirection.To : RangeDirection.DownTo;

            return(GenerateFloatingPointSubType(compiler, typeName, baseType, rangeLeft, rangeRight, rangeRirection));
        }
        public static string GeneratePhysicalType(VHDLCompilerInterface compiler, VHDL.type.PhysicalType typeDeclaration)
        {
            Int64          rangeLeft  = ((typeDeclaration.Range as VHDL.Range).From as VHDL.literal.IntegerLiteral).IntegerValue;
            Int64          rangeRight = ((typeDeclaration.Range as VHDL.Range).To as VHDL.literal.IntegerLiteral).IntegerValue;
            RangeDirection direction  = ((typeDeclaration.Range as VHDL.Range).Direction == VHDL.Range.RangeDirection.TO) ? RangeDirection.To : RangeDirection.DownTo;

            List <PhysicalTypeBaseInfo> dict = FormPhysicalValueDictionary(typeDeclaration);

            PhysicalTypeTemplate template = new PhysicalTypeTemplate(typeDeclaration.Identifier, dict, rangeLeft, rangeRight, direction);
            string text = template.TransformText();

            return(text);
        }
示例#6
0
        public static string GenerateIntegerType(VHDLCompilerInterface compiler, VHDL.type.IntegerType typeDeclaration)
        {
            string         typeName       = typeDeclaration.Identifier;
            Int64          rangeLeft      = ((typeDeclaration.Range as VHDL.Range).From as VHDL.literal.IntegerLiteral).IntegerValue;
            Int64          rangeRight     = ((typeDeclaration.Range as VHDL.Range).To as VHDL.literal.IntegerLiteral).IntegerValue;
            RangeDirection rangeRirection = ((typeDeclaration.Range as VHDL.Range).Direction == VHDL.Range.RangeDirection.TO) ? RangeDirection.To : RangeDirection.DownTo;

            IntegerTypeTemplate template = new IntegerTypeTemplate(typeName, rangeLeft, rangeRight, rangeRirection);
            string text = template.TransformText();

            compiler.TypeRangeDictionary.AddItem(typeDeclaration, "IntegerRange", template.RangeLeft, template.RangeRight, template.Direction);

            return(text);
        }
        public static string GenerateIntegerSubType(VHDLCompilerInterface compiler, string typeName, RangeSubtypeIndication rangeSubtype)
        {
            string         baseType       = compiler.TypeDictionary[rangeSubtype.BaseType];
            Int64          rangeLeft      = ((rangeSubtype.Range as VHDL.Range).From as VHDL.literal.IntegerLiteral).IntegerValue;
            Int64          rangeRight     = ((rangeSubtype.Range as VHDL.Range).To as VHDL.literal.IntegerLiteral).IntegerValue;
            RangeDirection rangeRirection = ((rangeSubtype.Range as VHDL.Range).Direction == VHDL.Range.RangeDirection.TO) ? RangeDirection.To : RangeDirection.DownTo;

            IntegerSubTypeTemplate template = new IntegerSubTypeTemplate(typeName, baseType, rangeLeft, rangeRight, rangeRirection);
            string code = template.TransformText();

            //compiler.TypeRangeDictionary.AddItem(rangeSubtype, "IntegerRange", template.RangeLeft, template.RangeRight, template.Direction);

            return(code);
        }
示例#8
0
 public PhysicalTypeTemplate(string name, List <PhysicalTypeBaseInfo> dict, Int64 rangeLeft, Int64 rangeRight, RangeDirection rangeDirection)
     : this("Work", name, dict, rangeLeft, rangeRight, rangeDirection)
 {
 }
示例#9
0
 public FloatPointSubTypeTemplate(string name, string baseTypeName, Double rangeLeft, Double rangeRight, RangeDirection rangeDirection)
     : this("Work", name, baseTypeName, rangeLeft, rangeRight, rangeDirection)
 {
 }
示例#10
0
 public PhysicalTypeTemplate(string nameSpaceName, string name, List <PhysicalTypeBaseInfo> dict, Int64 rangeLeft, Int64 rangeRight, RangeDirection rangeDirection)
 {
     this.nameSpaceName = nameSpaceName;
     this.name          = name;
     this.dict          = dict;
     this.rangeLeft     = rangeLeft.ToString();
     this.rangeRight    = rangeRight.ToString();
     this.Direction     = string.Format("RangeDirection.{0}", rangeDirection.ToString());
 }
        public static string GenerateFloatingPointType(string typeName, double rangeLeft, double rangeRight, RangeDirection rangeRirection)
        {
            FloatPointTypeTemplate template = new FloatPointTypeTemplate(typeName, rangeLeft, rangeRight, rangeRirection);
            string text = template.TransformText();

            return(text);
        }
示例#12
0
 public FloatPointSubTypeTemplate(string nameSpaceName, string name, string baseTypeName, Double rangeLeft, Double rangeRight, RangeDirection rangeDirection)
 {
     this.nameSpaceName = nameSpaceName;
     this.name          = name;
     this.baseTypeName  = baseTypeName;
     this.rangeLeft     = rangeLeft.ToString();
     this.rangeRight    = rangeRight.ToString();
     this.Direction     = string.Format("RangeDirection.{0}", rangeDirection.ToString());
 }
示例#13
0
 public PhysicalRange(Int64 left, Int64 right, RangeDirection direction)
     : base(new VHDLPhysicalValue <T>(left), new VHDLPhysicalValue <T>(right), direction)
 {
 }
示例#14
0
 /// <summary>
 /// Creates a range with integer bounds.
 /// </summary>
 /// <param name="from">the from value</param>
 /// <param name="direction">the direction</param>
 /// <param name="to">the to value</param>
 public Range(int from, RangeDirection direction, int to)
     : this(new DecimalLiteral(from), direction, new DecimalLiteral(to))
 {
 }
示例#15
0
 /// <summary>
 /// Creates a range with integer bounds.
 /// </summary>
 /// <param name="from">the from value</param>
 /// <param name="direction">the direction</param>
 /// <param name="to">the to value</param>
 public Range(double from, RangeDirection direction, double to)
     : this(new RealLiteral(from), direction, new RealLiteral(to))
 {
 }
示例#16
0
 /// <summary>
 /// Create new instance
 /// </summary>
 /// <param name="Direction">Range direction</param>
 public RangeFinderCmd(RangeDirection Direction)
 {
     this.Direction = Direction;
 }
示例#17
0
 public FloatingPointRange(VHDLFloatingPointValue left, VHDLFloatingPointValue right, RangeDirection direction)
     : base(left, right, direction)
 {
 }
示例#18
0
 public ScalarRange(T left, T right, RangeDirection direction)
 {
     this.left      = left;
     this.right     = right;
     this.direction = direction;
 }
        public override void HandleInput(IOperatorInputMsg Input)
        {
            var keyConfig = _keyBinding.CurrentValue.RangeFinder;

            //farther
            if (ValidateKeyPress(Input, keyConfig.Farther))
            {
                if (Input.InputType == KeyInputType.KeyPress)
                {
                    if (_currDirection == RangeDirection.Farther)
                    {
                        _currDirection = RangeDirection.Stop;
                        _cmdDelegate.Stop();
                    }
                    else
                    {
                        _currDirection = RangeDirection.Farther;
                        _cmdDelegate.AimFarther();
                    }
                }
                else if (Input.InputType == KeyInputType.KeyDown)
                {
                    _currDirection = RangeDirection.Farther;
                    _cmdDelegate.AimFarther();
                }
                else
                {
                    if (_currDirection == RangeDirection.Farther)
                    {
                        _currDirection = RangeDirection.Stop;
                        _cmdDelegate.Stop();
                    }
                }

                Input.IsHandled = true;
            }
            //closer
            else if (ValidateKeyPress(Input, keyConfig.Closer))
            {
                if (Input.InputType == KeyInputType.KeyPress)
                {
                    if (_currDirection == RangeDirection.Closer)
                    {
                        _currDirection = RangeDirection.Stop;
                        _cmdDelegate.Stop();
                    }
                    else
                    {
                        _currDirection = RangeDirection.Closer;
                        _cmdDelegate.AimCloser();
                    }
                }
                else if (Input.InputType == KeyInputType.KeyDown)
                {
                    _currDirection = RangeDirection.Closer;
                    _cmdDelegate.AimCloser();
                }
                else
                {
                    if (_currDirection == RangeDirection.Closer)
                    {
                        _currDirection = RangeDirection.Stop;
                        _cmdDelegate.Stop();
                    }
                }

                Input.IsHandled = true;
            }
        }
        public static string GenerateFloatingPointSubType(VHDLCompilerInterface compiler, string typeName, string baseType, double rangeLeft, double rangeRight, RangeDirection rangeRirection)
        {
            FloatPointSubTypeTemplate template = new FloatPointSubTypeTemplate(typeName, baseType, rangeLeft, rangeRight, rangeRirection);
            string text = template.TransformText();

            return(text);
        }
示例#21
0
 public FloatingPointRange(double left, double right, RangeDirection direction)
     : base(new VHDLFloatingPointValue(left), new VHDLFloatingPointValue(right), direction)
 {
 }
示例#22
0
 public EnumRange(T left, T right, RangeDirection direction)
     : base(new VHDLEnumValue <T>(left), new VHDLEnumValue <T>(right), direction)
 {
 }
示例#23
0
 public IntegerRange(Int64 left, Int64 right, RangeDirection direction)
     : base(new VHDLIntegerValue(left), new VHDLIntegerValue(right), direction)
 {
 }
示例#24
0
 public DiscreteRange(T left, T right, RangeDirection direction)
     : base(left, right, direction)
 {
 }
示例#25
0
 public EnumRange(VHDLEnumValue <T> left, VHDLEnumValue <T> right, RangeDirection direction)
     : base(left, right, direction)
 {
 }
示例#26
0
 public IntegerRange(VHDLIntegerValue left, VHDLIntegerValue right, RangeDirection direction)
     : base(left, right, direction)
 {
 }
示例#27
0
 public EnumBaseTypeIterator(T left, T right, RangeDirection direction)
 {
     this.left      = left;
     this.right     = right;
     this.direction = direction;
 }
示例#28
0
 public PhysicalRange(VHDLPhysicalValue <T> left, VHDLPhysicalValue <T> right, RangeDirection direction)
     : base(left, right, direction)
 {
 }
示例#29
0
 public static IEnumerable <T> GetBaseValuesInRange(T left, T right, RangeDirection direction)
 {
     return(new EnumBaseTypeIterator <T>(left, right, direction));
 }
        private void RangeDirectionButtonClicked(object obj, RoutedEventArgs e)
        {
            if (obj == _rightRangeButton)
            {
                _rangeDirection = RangeDirection.ToRight;
            }
            else
            {
                _rangeDirection = RangeDirection.ToLeft;
            }

            _currentSelectingMark = _currentHoveringMark;
            _selectingMarkForDraw = new Mark(_currentSelectingMark);
            _currentHoveringMark = null;

            _view.ClearUIElement(typeof(Button));
            SetRedrawTimer();
        }
示例#31
0
 /// <summary>
 /// Creates a range.
 /// </summary>
 /// <param name="from">the from expression</param>
 /// <param name="direction">the direction</param>
 /// <param name="to">the to expression</param>
 public Range(Expression from, RangeDirection direction, Expression to)
 {
     this.from      = from;
     this.direction = direction;
     this.to        = to;
 }