Skip to content

Commit

Permalink
Merge pull request #45 from ADAPT/develop
Browse files Browse the repository at this point in the history
Fix to DeviceElementUse delegate on OperationData
  • Loading branch information
strhea authored Apr 9, 2018
2 parents 38c5b7f + 7684231 commit dd4e6e4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ISOv4Plugin/Mappers/TimeLogMapper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
* ISO standards can be purchased through the ANSI webstore at https://webstore.ansi.org
*/

Expand Down Expand Up @@ -336,11 +336,10 @@ private IEnumerable<OperationData> ImportTimeLog(ISOTask loggedTask, ISOTimeLog
IEnumerable<DeviceElementUse> sections = sectionMapper.Map(time, isoRecords, operationData.Id.ReferenceId, loggedDeviceElementsByDevice[dvc]);

var workingDatas = sections != null ? sections.SelectMany(x => x.GetWorkingDatas()).ToList() : new List<WorkingData>();
var sectionsSimple = sectionMapper.ConvertToBaseTypes(sections.ToList());

operationData.GetSpatialRecords = () => spatialMapper.Map(isoRecords, workingDatas);
operationData.MaxDepth = sections.Count() > 0 ? sections.Select(s => s.Depth).Max() : 0;
operationData.GetDeviceElementUses = x => x == 0 ? sectionsSimple : new List<DeviceElementUse>();
operationData.GetDeviceElementUses = x => sectionMapper.ConvertToBaseTypes(sections.Where(s => s.Depth == x).ToList());
operationData.PrescriptionId = prescriptionID;
operationData.OperationType = GetOperationTypeFromLoggingDevices(time);
operationData.ProductId = GetProductIDForOperationData(loggedTask, dvc);
Expand Down

0 comments on commit dd4e6e4

Please sign in to comment.