public void AddCount(int count) { Count += count; // Масса всех стержней WeightTotal = RoundHelper.Round2Digits(Weight * Count); Amount = WeightTotal; }
/// <summary> /// Перед вызовом /// </summary> public override void Calc() { // Масса ед Weight = RoundHelper.Round3Digits(WeightUnit); // Масса общая WeightTotal = RoundHelper.Round2Digits(Weight * Meters); Amount = WeightTotal; }
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; }
/// <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(); }
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(); }
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(); }
/// <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(); }
private double CalcMeters(double length) { // Кол стержней в распределении Count = CalcCountByStep(Width, Step) * Rows; return(RoundHelper.Round2Digits(ConvertMmToMLength(length) * Count)); }