Files
PepApi.Core/PepLib.Core/Report.cs
AJ 7c5b4ded5f chore(PepLib.Core): remove unused using directives and clean up formatting
Remove unnecessary System, System.Collections.Generic, System.IO, and
System.Linq using directives that were flagged by IDE analyzers. Also
includes minor whitespace and code style normalization.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 07:52:17 -05:00

121 lines
2.7 KiB
C#

using PepLib.IO;
namespace PepLib
{
public partial class Report
{
public Report()
{
Drawings = new List<Report.Drawing>();
Plates = new List<Report.Plate>();
}
public List<Report.Drawing> Drawings { get; set; }
public List<Report.Plate> Plates { get; set; }
public string Name { get; set; }
public string Customer { get; set; }
public DateTime DateProgrammed { get; set; }
public string Material { get; set; }
public string ProgrammedBy { get; set; }
public string Machine { get; set; }
public string Comments { get; set; }
public string Remarks { get; set; }
public TimeSpan TotalCutTime { get; set; }
public double TotalGasUsed { get; set; }
public double TotalRapidDistance { get; set; }
public int TotalHeadRaises { get; set; }
public double CutFeedrate { get; set; }
public double RapidFeedrate { get; set; }
public TimeSpan PierceTime { get; set; }
public int PlateCount()
{
return Plates.Sum(plate => plate.Quantity);
}
public int ProgramCount()
{
return Plates.Count;
}
public double CutDistance()
{
return Drawings.Sum(dwg => dwg.CutDistance);
}
public double ScribeDistance()
{
return Drawings.Sum(dwg => dwg.ScribeDistance);
}
public double BevelDistance()
{
return Drawings.Sum(dwg => dwg.BevelDistance);
}
public int TotalPierceCount()
{
return Drawings.Sum(dwg => dwg.PierceCount);
}
public static Report Load(string nestFile)
{
var reader = new ReportReader();
reader.Read(nestFile);
return reader.Report;
}
public static Report Load(Stream stream)
{
var reader = new ReportReader();
reader.Read(stream);
return reader.Report;
}
public static bool TryLoad(string nestfile, out Report report)
{
try
{
report = Load(nestfile);
}
catch (Exception)
{
report = null;
return false;
}
return true;
}
public static bool TryLoad(Stream stream, out Report report)
{
try
{
report = Load(stream);
}
catch (Exception)
{
report = null;
return false;
}
return true;
}
}
}