/// <summary> /// Performs functional initialization of ComputeVolumes state that is dependent on the initial state /// set via the constructor /// </summary> private void InitialiseVolumesCalculator(VolumesCalculator computeVolumes) { // Set up the volumes calc parameters VolumesUtilities.SetProdReportSelectionType(VolumeType, out var fromSelectionType, out var toSelectionType); computeVolumes.FromSelectionType = fromSelectionType; computeVolumes.ToSelectionType = toSelectionType; computeVolumes.UseEarliestData = BaseFilter.AttributeFilter.ReturnEarliestFilteredCellPass; computeVolumes.RefOriginal = BaseDesign == null || BaseDesign.DesignID == Guid.Empty ? null : siteModel.Designs.Locate(BaseDesign.DesignID); computeVolumes.RefDesign = TopDesign == null || TopDesign.DesignID == Guid.Empty ? null : siteModel.Designs.Locate(TopDesign.DesignID); if (computeVolumes.FromSelectionType == ProdReportSelectionType.Surface) { computeVolumes.ActiveDesign = computeVolumes.RefOriginal != null ? new DesignWrapper(BaseDesign, computeVolumes.RefOriginal) : null; } else { computeVolumes.ActiveDesign = computeVolumes.ToSelectionType == ProdReportSelectionType.Surface && computeVolumes.RefDesign != null ? new DesignWrapper(TopDesign, computeVolumes.RefDesign) : null; } // Assign the active design into the aggregator for use Aggregator.ActiveDesign = computeVolumes.ActiveDesign; }
public void TestProdReportSelectionType(VolumeComputationType volumeType, ProdReportSelectionType expectedFromSelectionType, ProdReportSelectionType expectedToSelectionType) { VolumesUtilities.SetProdReportSelectionType(volumeType, out var fromSelectionType, out var toSelectionType); fromSelectionType.Should().Be(expectedFromSelectionType); toSelectionType.Should().Be(expectedToSelectionType); }
/// <summary> /// Performs functional initialization of ComputeVolumes state that is dependent on the initial state /// set via the constructor /// </summary> /// <param name="computeVolumes"></param> private void InitialiseVolumesCalculator(ProgressiveVolumesCalculator computeVolumes) { // Set up the volumes calc parameters VolumesUtilities.SetProdReportSelectionType(VolumeType, out var fromSelectionType, out var toSelectionType); computeVolumes.FromSelectionType = fromSelectionType; computeVolumes.ToSelectionType = toSelectionType; computeVolumes.RefOriginal = _baseDesign == null || _baseDesign.DesignID == Guid.Empty ? null : _siteModel.Designs.Locate(_baseDesign.DesignID); computeVolumes.RefDesign = _topDesign == null || _topDesign.DesignID == Guid.Empty ? null : _siteModel.Designs.Locate(_topDesign.DesignID); if (computeVolumes.FromSelectionType == ProdReportSelectionType.Surface) { computeVolumes.ActiveDesign = computeVolumes.RefOriginal != null ? new DesignWrapper(_baseDesign, computeVolumes.RefOriginal) : null; } else { computeVolumes.ActiveDesign = computeVolumes.ToSelectionType == ProdReportSelectionType.Surface && computeVolumes.RefDesign != null ? new DesignWrapper(_topDesign, computeVolumes.RefDesign) : null; } // Assign the active design into the aggregator for use Aggregator.ActiveDesign = computeVolumes.ActiveDesign; }