예제 #1
0
파일: Bar.cs 프로젝트: 15831944/KR_MN_Acad
 public void AddCount(int count)
 {
     Count += count;
     // Масса всех стержней
     WeightTotal = RoundHelper.Round2Digits(Weight * Count);
     Amount      = WeightTotal;
 }
예제 #2
0
 /// <summary>
 /// Перед вызовом
 /// </summary>
 public override void Calc()
 {
     // Масса ед
     Weight = RoundHelper.Round3Digits(WeightUnit);
     // Масса общая
     WeightTotal = RoundHelper.Round2Digits(Weight * Meters);
     Amount      = WeightTotal;
 }
예제 #3
0
파일: Bar.cs 프로젝트: 15831944/KR_MN_Acad
 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;
 }
예제 #4
0
파일: Bar.cs 프로젝트: 15831944/KR_MN_Acad
        /// <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();
        }
예제 #5
0
파일: Tube.cs 프로젝트: 15831944/KR_MN_Acad
        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();
        }
예제 #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();
        }
예제 #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();
 }
예제 #8
0
 private double CalcMeters(double length)
 {
     // Кол стержней в распределении
     Count = CalcCountByStep(Width, Step) * Rows;
     return(RoundHelper.Round2Digits(ConvertMmToMLength(length) * Count));
 }