Exemplo n.º 1
0
 public void AddCount(int count)
 {
     Count += count;
     // Масса всех стержней
     WeightTotal = RoundHelper.Round2Digits(Weight * Count);
     Amount      = WeightTotal;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Перед вызовом
 /// </summary>
 public override void Calc()
 {
     // Масса ед
     Weight = RoundHelper.Round3Digits(WeightUnit);
     // Масса общая
     WeightTotal = RoundHelper.Round2Digits(Weight * Meters);
     Amount      = WeightTotal;
 }
Exemplo n.º 3
0
 public virtual void Calc()
 {
     // Кол стержней
     if (Width != 0 && Step != 0)
     {
         Count = CalcCountByStep(Width, Step) * Rows;
     }
     // Масса ед. кг.
     Weight = RoundHelper.Round3Digits(WeightUnit * ConvertMmToMLength(Length));
     // Масса всех стержней
     WeightTotal = RoundHelper.Round2Digits(Weight * Count);
     Amount      = WeightTotal;
 }
Exemplo n.º 4
0
        /// <summary>
        /// Суммирование элементов и запись результата в SpecRow
        /// </summary>
        public virtual void SumAndSetRow(SpecGroupRow row, List <ISpecElement> elems)
        {
            // Обозначения, Наименования, Кол, Массы ед, примечания
            row.Mark        = Mark;
            row.Designation = Gost.Number;
            row.Name        = GetName();

            int    countTotal  = 0;
            double weightTotal = 0;

            foreach (var item in elems)
            {
                var bar = item as Bar;
                countTotal += bar.Count;
                //weightTotal += bar.WeightTotal;
            }
            weightTotal = RoundHelper.Round2Digits(Weight * countTotal);

            row.Count       = countTotal.ToString();
            row.Weight      = Weight.ToString("0.000");
            row.Description = weightTotal.ToString();
        }
Exemplo n.º 5
0
        public void SumAndSetRow(SpecGroupRow row, List <ISpecElement> elems)
        {
            // Обозначения, Наименования, Кол, Массы ед, примечания
            row.Designation = Gost.Number;
            row.Name        = $"Труба {Name}, L={Length}";
            //row.Mark = Mark;
            row.Mark = "";
            Mark     = "";
            var tubes = elems.OfType <Tube>();

            foreach (var item in tubes)
            {
                item.Mark = "";
            }

            int    countTotal  = elems.Count;
            double weightTotal = RoundHelper.Round2Digits(Weight * countTotal);

            row.Count       = countTotal.ToString();
            row.Weight      = Weight.ToString("0.000");
            row.Description = weightTotal.ToString();
        }
Exemplo n.º 6
0
        public override void SumAndSetRow(SpecGroupRow specGroupRow, List <ISpecElement> elems)
        {
            // Обозначения, Наименования, Кол, Массы ед, примечания
            specGroupRow.Mark        = Mark;
            specGroupRow.Designation = Gost.Number;
            specGroupRow.Name        = GetName();

            double metersTotal = 0;
            double weightTotal = 0;

            foreach (var item in elems)
            {
                var bar = item as BarRunning;
                metersTotal += bar.Meters;
                //weightTotal += bar.WeightTotal;
            }
            metersTotal = RoundHelper.RoundWhole(metersTotal);
            weightTotal = RoundHelper.Round2Digits(metersTotal * Weight);

            specGroupRow.Count       = metersTotal.ToString();
            specGroupRow.Weight      = Weight.ToString("0.000");
            specGroupRow.Description = weightTotal.ToString();
        }
Exemplo n.º 7
0
 /// <summary>
 /// Погонные стержни по длине (м.)
 /// </summary>
 public BarRunning(int diam, double meters, string pos, ISpecBlock block, string friendlyName)
     : base(diam, 0, 1, pos, block, friendlyName)
 {
     Meters = RoundHelper.Round2Digits(meters);
     Key    = GetKey();
 }
Exemplo n.º 8
0
 private double CalcMeters(double length)
 {
     // Кол стержней в распределении
     Count = CalcCountByStep(Width, Step) * Rows;
     return(RoundHelper.Round2Digits(ConvertMmToMLength(length) * Count));
 }