public ReadRange(int x, int y, RangeDirection direction) { X = x; Y = y; Range = 11; Direction = direction; }
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); }
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); }
public PhysicalTypeTemplate(string name, List <PhysicalTypeBaseInfo> dict, Int64 rangeLeft, Int64 rangeRight, RangeDirection rangeDirection) : this("Work", name, dict, rangeLeft, rangeRight, rangeDirection) { }
public FloatPointSubTypeTemplate(string name, string baseTypeName, Double rangeLeft, Double rangeRight, RangeDirection rangeDirection) : this("Work", name, baseTypeName, rangeLeft, rangeRight, rangeDirection) { }
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); }
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()); }
public PhysicalRange(Int64 left, Int64 right, RangeDirection direction) : base(new VHDLPhysicalValue <T>(left), new VHDLPhysicalValue <T>(right), direction) { }
/// <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)) { }
/// <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)) { }
/// <summary> /// Create new instance /// </summary> /// <param name="Direction">Range direction</param> public RangeFinderCmd(RangeDirection Direction) { this.Direction = Direction; }
public FloatingPointRange(VHDLFloatingPointValue left, VHDLFloatingPointValue right, RangeDirection direction) : base(left, right, direction) { }
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); }
public FloatingPointRange(double left, double right, RangeDirection direction) : base(new VHDLFloatingPointValue(left), new VHDLFloatingPointValue(right), direction) { }
public EnumRange(T left, T right, RangeDirection direction) : base(new VHDLEnumValue <T>(left), new VHDLEnumValue <T>(right), direction) { }
public IntegerRange(Int64 left, Int64 right, RangeDirection direction) : base(new VHDLIntegerValue(left), new VHDLIntegerValue(right), direction) { }
public DiscreteRange(T left, T right, RangeDirection direction) : base(left, right, direction) { }
public EnumRange(VHDLEnumValue <T> left, VHDLEnumValue <T> right, RangeDirection direction) : base(left, right, direction) { }
public IntegerRange(VHDLIntegerValue left, VHDLIntegerValue right, RangeDirection direction) : base(left, right, direction) { }
public EnumBaseTypeIterator(T left, T right, RangeDirection direction) { this.left = left; this.right = right; this.direction = direction; }
public PhysicalRange(VHDLPhysicalValue <T> left, VHDLPhysicalValue <T> right, RangeDirection direction) : base(left, right, direction) { }
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(); }
/// <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; }