TotalCycleTime

This commit is contained in:
AJ
2018-05-31 12:54:44 -04:00
parent 5226fdb44e
commit a42f09bbfb

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace CincyLib.Laser
{
@@ -28,10 +29,12 @@ namespace CincyLib.Laser
if (splitIndex == -1)
continue;
curRecord = new Record();
log.Records.Add(curRecord);
var dateString = line.Remove(splitIndex - 1);
if (dateString.Contains("..."))
continue;
curRecord = new Record();
curRecord.Date = DateTime.Parse(dateString);
var programString = line.Substring(splitIndex + 8);
@@ -64,6 +67,8 @@ namespace CincyLib.Laser
curRecord.CutRecords.Add(cutRecord);
}
}
log.Records.Add(curRecord);
}
return log;
@@ -108,6 +113,11 @@ namespace CincyLib.Laser
public string ProgramFile { get; set; }
public List<string> LibraryFiles { get; set; }
public List<CutRecord> CutRecords { get; set; }
public TimeSpan TotalCycleTime
{
get { return TimeSpan.FromTicks(CutRecords.Sum(r => r.CycleTime.Ticks)); }
}
}
public class CutRecord