Esempio n. 1
0
        public Int32 BarQuantity()
        {
            Geometry2D geometry2D = new Geometry2D();
            int        Quant      = 0;
            decimal    length     = geometry2D.GetDistance(this.StartPoint, this.EndPoint);
            decimal    mainLength = length - this.StartOffset - this.EndOffset;

            if (this.barSpacingSettings.AddBarsLeft)
            {
                Quant      += this.barSpacingSettings.AddBarsLeftQuant;
                mainLength -= this.barSpacingSettings.AddBarsLeftSpacing * this.barSpacingSettings.AddBarsLeftQuant;
            }
            if (this.barSpacingSettings.AddBarsRight)
            {
                Quant      += this.barSpacingSettings.AddBarsRightQuant;
                mainLength -= this.barSpacingSettings.AddBarsRightSpacing * this.barSpacingSettings.AddBarsRightQuant;
            }

            Quant += Convert.ToInt16(Math.Ceiling(mainLength / barSpacingSettings.MainSpacing));
            return(Quant);
        }
Esempio n. 2
0
        public decimal GetLength()
        {
            Geometry2D Geometry2D = new Geometry2D();

            return(Geometry2D.GetDistance(this.StartPoint, this.EndPoint));
        }