Exemple #1
0
        public void CreateWaternetZonesExtremeChartDataCollection_ReturnsEmptyChartDataCollection()
        {
            // Call
            ChartDataCollection data = MacroStabilityInwardsChartDataFactory.CreateWaternetZonesExtremeChartDataCollection();

            // Assert
            CollectionAssert.IsEmpty(data.Collection);
            Assert.AreEqual("Zones extreem", data.Name);
        }
Exemple #2
0
        /// <summary>
        /// Creates a new instance of <see cref="MacroStabilityInwardsOutputChartControl"/>.
        /// </summary>
        /// <param name="data">The calculation to show the output for.</param>
        /// <param name="generalInput">General calculation parameters that are the same across all calculations.</param>
        /// <param name="getNormativeAssessmentLevelFunc"><see cref="Func{TResult}"/> for obtaining the normative assessment level.</param>
        /// <exception cref="ArgumentNullException">Thrown when any input parameter is <c>null</c>.</exception>
        public MacroStabilityInwardsOutputChartControl(MacroStabilityInwardsCalculationScenario data,
                                                       GeneralMacroStabilityInwardsInput generalInput,
                                                       Func <RoundedDouble> getNormativeAssessmentLevelFunc)
        {
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            if (generalInput == null)
            {
                throw new ArgumentNullException(nameof(generalInput));
            }

            if (getNormativeAssessmentLevelFunc == null)
            {
                throw new ArgumentNullException(nameof(getNormativeAssessmentLevelFunc));
            }

            this.data         = data;
            this.generalInput = generalInput;
            this.getNormativeAssessmentLevelFunc = getNormativeAssessmentLevelFunc;

            InitializeComponent();

            chartDataCollection            = new ChartDataCollection(RiskeerCommonFormsResources.CalculationOutput_DisplayName);
            soilProfileChartData           = RiskeerChartDataFactory.CreateSoilProfileChartData();
            surfaceLineChartData           = RiskeerChartDataFactory.CreateSurfaceLineChartData();
            surfaceLevelInsideChartData    = MacroStabilityInwardsChartDataFactory.CreateSurfaceLevelInsideChartData();
            ditchPolderSideChartData       = RiskeerChartDataFactory.CreateDitchPolderSideChartData();
            bottomDitchPolderSideChartData = RiskeerChartDataFactory.CreateBottomDitchPolderSideChartData();
            bottomDitchDikeSideChartData   = RiskeerChartDataFactory.CreateBottomDitchDikeSideChartData();
            ditchDikeSideChartData         = RiskeerChartDataFactory.CreateDitchDikeSideChartData();
            dikeToeAtPolderChartData       = RiskeerChartDataFactory.CreateDikeToeAtPolderChartData();
            shoulderTopInsideChartData     = MacroStabilityInwardsChartDataFactory.CreateShoulderTopInsideChartData();
            shoulderBaseInsideChartData    = MacroStabilityInwardsChartDataFactory.CreateShoulderBaseInsideChartData();
            dikeTopAtPolderChartData       = MacroStabilityInwardsChartDataFactory.CreateDikeTopAtPolderChartData();
            dikeToeAtRiverChartData        = RiskeerChartDataFactory.CreateDikeToeAtRiverChartData();
            dikeTopAtRiverChartData        = MacroStabilityInwardsChartDataFactory.CreateDikeTopAtRiverChartData();
            surfaceLevelOutsideChartData   = MacroStabilityInwardsChartDataFactory.CreateSurfaceLevelOutsideChartData();
            waternetZonesExtremeChartData  = MacroStabilityInwardsChartDataFactory.CreateWaternetZonesExtremeChartDataCollection();
            waternetZonesDailyChartData    = MacroStabilityInwardsChartDataFactory.CreateWaternetZonesDailyChartDataCollection();
            tangentLinesChartData          = MacroStabilityInwardsChartDataFactory.CreateTangentLinesChartData();
            leftGridChartData          = MacroStabilityInwardsChartDataFactory.CreateLeftGridChartData();
            rightGridChartData         = MacroStabilityInwardsChartDataFactory.CreateRightGridChartData();
            slipPlaneChartData         = MacroStabilityInwardsChartDataFactory.CreateSlipPlaneChartData();
            leftCircleRadiusChartData  = MacroStabilityInwardsChartDataFactory.CreateActiveCircleRadiusChartData();
            rightCircleRadiusChartData = MacroStabilityInwardsChartDataFactory.CreatePassiveCircleRadiusChartData();
            slicesChartData            = MacroStabilityInwardsSliceChartDataFactory.CreateSlicesChartData();

            sliceParametersChartDataCollection = MacroStabilityInwardsSliceChartDataFactory.CreateSliceParametersChartDataCollection();
            sliceCohesionChartData             = MacroStabilityInwardsSliceChartDataFactory.CreateCohesionChartData();
            sliceEffectiveStressChartData      = MacroStabilityInwardsSliceChartDataFactory.CreateEffectiveStressChartData();
            sliceTotalPorePressureChartData    = MacroStabilityInwardsSliceChartDataFactory.CreateTotalPorePressureChartData();
            sliceWeightChartData = MacroStabilityInwardsSliceChartDataFactory.CreateWeightChartData();
            slicePiezometricPorePressureChartData = MacroStabilityInwardsSliceChartDataFactory.CreatePiezometricPorePressureChartData();
            slicePorePressureChartData            = MacroStabilityInwardsSliceChartDataFactory.CreatePorePressureChartData();
            sliceVerticalPorePressureChartData    = MacroStabilityInwardsSliceChartDataFactory.CreateVerticalPorePressureChartData();
            sliceHorizontalPorePressureChartData  = MacroStabilityInwardsSliceChartDataFactory.CreateHorizontalPorePressureChartData();
            sliceOverConsolidationRatioChartData  = MacroStabilityInwardsSliceChartDataFactory.CreateOverConsolidationRatioChartData();
            slicePopChartData          = MacroStabilityInwardsSliceChartDataFactory.CreatePopChartData();
            sliceNormalStressChartData = MacroStabilityInwardsSliceChartDataFactory.CreateNormalStressChartData();
            sliceShearStressChartData  = MacroStabilityInwardsSliceChartDataFactory.CreateShearStressChartData();
            sliceLoadStressChartData   = MacroStabilityInwardsSliceChartDataFactory.CreateLoadStressChartData();

            chartDataCollection.Add(soilProfileChartData);
            chartDataCollection.Add(surfaceLineChartData);
            chartDataCollection.Add(surfaceLevelInsideChartData);
            chartDataCollection.Add(ditchPolderSideChartData);
            chartDataCollection.Add(bottomDitchPolderSideChartData);
            chartDataCollection.Add(bottomDitchDikeSideChartData);
            chartDataCollection.Add(ditchDikeSideChartData);
            chartDataCollection.Add(dikeToeAtPolderChartData);
            chartDataCollection.Add(shoulderTopInsideChartData);
            chartDataCollection.Add(shoulderBaseInsideChartData);
            chartDataCollection.Add(dikeTopAtPolderChartData);
            chartDataCollection.Add(dikeToeAtRiverChartData);
            chartDataCollection.Add(dikeTopAtRiverChartData);
            chartDataCollection.Add(surfaceLevelOutsideChartData);
            chartDataCollection.Add(waternetZonesExtremeChartData);
            chartDataCollection.Add(waternetZonesDailyChartData);
            chartDataCollection.Add(tangentLinesChartData);
            chartDataCollection.Add(leftGridChartData);
            chartDataCollection.Add(rightGridChartData);
            chartDataCollection.Add(slicesChartData);
            chartDataCollection.Add(slipPlaneChartData);
            chartDataCollection.Add(leftCircleRadiusChartData);
            chartDataCollection.Add(rightCircleRadiusChartData);

            chartDataCollection.Add(sliceParametersChartDataCollection);
            sliceParametersChartDataCollection.Add(sliceLoadStressChartData);
            sliceParametersChartDataCollection.Add(sliceShearStressChartData);
            sliceParametersChartDataCollection.Add(sliceNormalStressChartData);
            sliceParametersChartDataCollection.Add(slicePopChartData);
            sliceParametersChartDataCollection.Add(sliceOverConsolidationRatioChartData);
            sliceParametersChartDataCollection.Add(sliceHorizontalPorePressureChartData);
            sliceParametersChartDataCollection.Add(sliceVerticalPorePressureChartData);
            sliceParametersChartDataCollection.Add(slicePorePressureChartData);
            sliceParametersChartDataCollection.Add(slicePiezometricPorePressureChartData);
            sliceParametersChartDataCollection.Add(sliceWeightChartData);
            sliceParametersChartDataCollection.Add(sliceTotalPorePressureChartData);
            sliceParametersChartDataCollection.Add(sliceEffectiveStressChartData);
            sliceParametersChartDataCollection.Add(sliceCohesionChartData);

            soilLayerChartDataLookup = new List <ChartMultipleAreaData>();

            phreaticLineExtremeLookup = new Dictionary <MacroStabilityInwardsPhreaticLine, ChartLineData>();
            phreaticLineDailyLookup   = new Dictionary <MacroStabilityInwardsPhreaticLine, ChartLineData>();
            waternetLineExtremeLookup = new Dictionary <MacroStabilityInwardsWaternetLine, ChartMultipleAreaData>();
            waternetLineDailyLookup   = new Dictionary <MacroStabilityInwardsWaternetLine, ChartMultipleAreaData>();

            UpdateChartData();

            chartControl.Data = chartDataCollection;
        }
Exemple #3
0
        /// <summary>
        /// Creates a new instance of <see cref="MacroStabilityInwardsInputView"/>.
        /// </summary>
        /// <param name="data">The calculation to show the input for.</param>
        /// <param name="generalInput">General calculation parameters that are the same across all calculations.</param>
        /// <param name="assessmentSection">The assessment section the calculation belongs to.</param>
        /// <param name="getHydraulicBoundaryLocationCalculationFunc">The <see cref="Func{TResult}"/> for
        /// obtaining the hydraulic boundary location calculation.</param>
        /// <exception cref="ArgumentNullException">Thrown when any input parameter is <c>null</c>.</exception>
        public MacroStabilityInwardsInputView(MacroStabilityInwardsCalculationScenario data,
                                              GeneralMacroStabilityInwardsInput generalInput,
                                              IAssessmentSection assessmentSection,
                                              Func <HydraulicBoundaryLocationCalculation> getHydraulicBoundaryLocationCalculationFunc)
        {
            if (data == null)
            {
                throw new ArgumentNullException(nameof(data));
            }

            if (generalInput == null)
            {
                throw new ArgumentNullException(nameof(generalInput));
            }

            if (assessmentSection == null)
            {
                throw new ArgumentNullException(nameof(assessmentSection));
            }

            if (getHydraulicBoundaryLocationCalculationFunc == null)
            {
                throw new ArgumentNullException(nameof(getHydraulicBoundaryLocationCalculationFunc));
            }

            this.data         = data;
            this.generalInput = generalInput;
            this.getHydraulicBoundaryLocationCalculationFunc = getHydraulicBoundaryLocationCalculationFunc;

            InitializeComponent();

            calculationObserver = new Observer(UpdateChartTitle)
            {
                Observable = data
            };

            calculationInputObserver = new Observer(UpdateViewData)
            {
                Observable = data.InputParameters
            };

            hydraulicLocationCalculationObserver = new Observer(UpdateViewData)
            {
                Observable = getHydraulicBoundaryLocationCalculationFunc()
            };

            failureMechanismContributionObserver = new Observer(UpdateViewData)
            {
                Observable = assessmentSection.FailureMechanismContribution
            };

            chartDataCollection            = new ChartDataCollection(RiskeerCommonFormsResources.Calculation_Input);
            soilProfileChartData           = RiskeerChartDataFactory.CreateSoilProfileChartData();
            surfaceLineChartData           = RiskeerChartDataFactory.CreateSurfaceLineChartData();
            surfaceLevelInsideChartData    = MacroStabilityInwardsChartDataFactory.CreateSurfaceLevelInsideChartData();
            ditchPolderSideChartData       = RiskeerChartDataFactory.CreateDitchPolderSideChartData();
            bottomDitchPolderSideChartData = RiskeerChartDataFactory.CreateBottomDitchPolderSideChartData();
            bottomDitchDikeSideChartData   = RiskeerChartDataFactory.CreateBottomDitchDikeSideChartData();
            ditchDikeSideChartData         = RiskeerChartDataFactory.CreateDitchDikeSideChartData();
            dikeToeAtPolderChartData       = RiskeerChartDataFactory.CreateDikeToeAtPolderChartData();
            shoulderTopInsideChartData     = MacroStabilityInwardsChartDataFactory.CreateShoulderTopInsideChartData();
            shoulderBaseInsideChartData    = MacroStabilityInwardsChartDataFactory.CreateShoulderBaseInsideChartData();
            dikeTopAtPolderChartData       = MacroStabilityInwardsChartDataFactory.CreateDikeTopAtPolderChartData();
            dikeToeAtRiverChartData        = RiskeerChartDataFactory.CreateDikeToeAtRiverChartData();
            dikeTopAtRiverChartData        = MacroStabilityInwardsChartDataFactory.CreateDikeTopAtRiverChartData();
            surfaceLevelOutsideChartData   = MacroStabilityInwardsChartDataFactory.CreateSurfaceLevelOutsideChartData();
            tangentLinesData              = MacroStabilityInwardsChartDataFactory.CreateTangentLinesChartData();
            leftGridChartData             = MacroStabilityInwardsChartDataFactory.CreateLeftGridChartData();
            rightGridChartData            = MacroStabilityInwardsChartDataFactory.CreateRightGridChartData();
            waternetZonesExtremeChartData = MacroStabilityInwardsChartDataFactory.CreateWaternetZonesExtremeChartDataCollection();
            waternetZonesDailyChartData   = MacroStabilityInwardsChartDataFactory.CreateWaternetZonesDailyChartDataCollection();

            chartDataCollection.Add(soilProfileChartData);
            chartDataCollection.Add(surfaceLineChartData);
            chartDataCollection.Add(surfaceLevelInsideChartData);
            chartDataCollection.Add(ditchPolderSideChartData);
            chartDataCollection.Add(bottomDitchPolderSideChartData);
            chartDataCollection.Add(bottomDitchDikeSideChartData);
            chartDataCollection.Add(ditchDikeSideChartData);
            chartDataCollection.Add(dikeToeAtPolderChartData);
            chartDataCollection.Add(shoulderTopInsideChartData);
            chartDataCollection.Add(shoulderBaseInsideChartData);
            chartDataCollection.Add(dikeTopAtPolderChartData);
            chartDataCollection.Add(dikeToeAtRiverChartData);
            chartDataCollection.Add(dikeTopAtRiverChartData);
            chartDataCollection.Add(surfaceLevelOutsideChartData);
            chartDataCollection.Add(tangentLinesData);
            chartDataCollection.Add(leftGridChartData);
            chartDataCollection.Add(rightGridChartData);
            chartDataCollection.Add(waternetZonesExtremeChartData);
            chartDataCollection.Add(waternetZonesDailyChartData);

            soilLayerChartDataLookup = new List <ChartMultipleAreaData>();

            SetChartData();

            chartControl.Data = chartDataCollection;

            UpdateChartTitle();
            UpdateTableData();
        }