public ISOGuidanceShift ExportGuidanceShift(GuidanceShift adaptGuidanceShift)
        {
            ISOGuidanceShift gst = new ISOGuidanceShift();

            //Group ID
            gst.GuidanceGroupIdRef = TaskDataMapper.InstanceIDMap.GetISOID(adaptGuidanceShift.GuidanceGroupId);

            //Pattern ID
            gst.GuidancePatternIdRef = TaskDataMapper.InstanceIDMap.GetISOID(adaptGuidanceShift.GuidancePatterId);

            //Shifts
            gst.GuidanceEastShift  = adaptGuidanceShift.EastShift.AsConvertedInt("mm");
            gst.GuidanceNorthShift = adaptGuidanceShift.NorthShift.AsConvertedInt("mm");
            gst.PropagationOffset  = adaptGuidanceShift.PropagationOffset.AsConvertedInt("mm");

            //Allocation Stamp
            if (adaptGuidanceShift.TimeScopeIds.Any())
            {
                TimeScope scope = DataModel.Catalog.TimeScopes.FirstOrDefault(t => t.Id.ReferenceId == adaptGuidanceShift.TimeScopeIds.First()); //Mapping first timescope only
                if (scope != null)
                {
                    gst.AllocationStamp = AllocationStampMapper.ExportAllocationStamp(scope);
                }
            }

            return(gst);
        }
Exemple #2
0
        private List <ISOProductAllocation> GetProductAllocationsForSummary(Summary summary)
        {
            List <ISOProductAllocation> productAllocations = null;

            if (summary.OperationSummaries != null && summary.OperationSummaries.Any())
            {
                productAllocations = new List <ISOProductAllocation>();
                foreach (OperationSummary operationSummary in summary.OperationSummaries)
                {
                    foreach (StampedMeteredValues values in operationSummary.Data)
                    {
                        ISOProductAllocation pan = new ISOProductAllocation();
                        pan.AllocationStamp = AllocationStampMapper.ExportAllocationStamp(values.Stamp);
                        pan.ProductIdRef    = TaskDataMapper.InstanceIDMap.GetISOID(operationSummary.ProductId);
                        productAllocations.Add(pan);
                    }
                }
            }
            return(productAllocations);
        }