예제 #1
0
        /// <summary>
        /// Creates a new instance of <see cref="GeneralResult{T}"/> for top level sub
        /// mechanism illustration points based on the information of <paramref name="hydraRingGeneralResult"/>.
        /// </summary>
        /// <param name="hydraRingGeneralResult">The <see cref="HydraRingGeneralResult"/> to base the
        /// <see cref="GeneralResult{T}"/> to create on.</param>
        /// <returns>The newly created <see cref="GeneralResult{T}"/>.</returns>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="hydraRingGeneralResult"/> is <c>null</c>.</exception>
        /// <exception cref="IllustrationPointConversionException">Thrown when the <paramref name="hydraRingGeneralResult"/>
        /// cannot be converted to a <see cref="GeneralResult{T}"/> with top level sub mechanism illustration points.</exception>
        public static GeneralResult <TopLevelSubMechanismIllustrationPoint> ConvertToGeneralResultTopLevelSubMechanismIllustrationPoint(
            HydraRingGeneralResult hydraRingGeneralResult)
        {
            if (hydraRingGeneralResult == null)
            {
                throw new ArgumentNullException(nameof(hydraRingGeneralResult));
            }

            WindDirection          governingWindDirection = WindDirectionConverter.Convert(hydraRingGeneralResult.GoverningWindDirection);
            IEnumerable <Stochast> stochasts = GetStochasts(hydraRingGeneralResult);
            IEnumerable <TopLevelSubMechanismIllustrationPoint> windDirectionClosingScenarioIllustrationPoints =
                GetTopLevelSubMechanismIllustrationPoints(hydraRingGeneralResult.IllustrationPoints);

            return(new GeneralResult <TopLevelSubMechanismIllustrationPoint>(governingWindDirection,
                                                                             stochasts,
                                                                             windDirectionClosingScenarioIllustrationPoints));
        }
예제 #2
0
        /// <summary>
        /// Creates a new instance of <see cref="TopLevelFaultTreeIllustrationPoint"/>
        /// based on the information of <paramref name="hydraRingWindDirectionClosingSituation"/>
        /// and <paramref name="hydraRingIllustrationPointTreeNode"/>.
        /// </summary>
        /// <param name="hydraRingWindDirectionClosingSituation">The <see cref="HydraRingWindDirectionClosingSituation"/>
        /// to base the <see cref="TopLevelFaultTreeIllustrationPoint"/> on.</param>
        /// <param name="hydraRingIllustrationPointTreeNode">The <see cref="HydraRingIllustrationPointTreeNode"/>
        /// to base the <see cref="TopLevelFaultTreeIllustrationPoint"/> on.</param>
        /// <returns>A <see cref="TopLevelFaultTreeIllustrationPoint"/>.</returns>
        /// <exception cref="ArgumentNullException">Thrown when any input parameter
        /// is <c>null</c>.</exception>
        /// <exception cref="ArgumentException">Thrown when <paramref name="hydraRingIllustrationPointTreeNode"/>
        /// has tree node elements which do not contain exactly 0 or 2 children.</exception>
        public static TopLevelFaultTreeIllustrationPoint Convert(HydraRingWindDirectionClosingSituation hydraRingWindDirectionClosingSituation,
                                                                 HydraRingIllustrationPointTreeNode hydraRingIllustrationPointTreeNode)
        {
            if (hydraRingWindDirectionClosingSituation == null)
            {
                throw new ArgumentNullException(nameof(hydraRingWindDirectionClosingSituation));
            }

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

            WindDirection windDirection = WindDirectionConverter.Convert(hydraRingWindDirectionClosingSituation.WindDirection);

            return(new TopLevelFaultTreeIllustrationPoint(windDirection,
                                                          hydraRingWindDirectionClosingSituation.ClosingSituation,
                                                          IllustrationPointNodeConverter.Convert(hydraRingIllustrationPointTreeNode)));
        }
예제 #3
0
        /// <summary>
        /// Creates a new instance of <see cref="TopLevelSubMechanismIllustrationPoint"/>
        /// based on the information of <paramref name="hydraRingWindDirectionClosingSituation"/>
        /// and <paramref name="hydraRingSubMechanismIllustrationPoint"/>.
        /// </summary>
        /// <param name="hydraRingWindDirectionClosingSituation">The <see cref="HydraRingWindDirectionClosingSituation"/>
        /// to base the <see cref="TopLevelSubMechanismIllustrationPoint"/> on.</param>
        /// <param name="hydraRingSubMechanismIllustrationPoint">The <see cref="HydraRingSubMechanismIllustrationPoint"/>
        /// to base the <see cref="TopLevelSubMechanismIllustrationPoint"/> on.</param>
        /// <returns>A <see cref="TopLevelSubMechanismIllustrationPoint"/>.</returns>
        /// <exception cref="ArgumentNullException">Thrown when any parameter is <c>null</c>.</exception>
        public static TopLevelSubMechanismIllustrationPoint Convert(HydraRingWindDirectionClosingSituation hydraRingWindDirectionClosingSituation,
                                                                    HydraRingSubMechanismIllustrationPoint hydraRingSubMechanismIllustrationPoint)
        {
            if (hydraRingWindDirectionClosingSituation == null)
            {
                throw new ArgumentNullException(nameof(hydraRingWindDirectionClosingSituation));
            }

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

            WindDirection windDirection = WindDirectionConverter.Convert(hydraRingWindDirectionClosingSituation.WindDirection);
            SubMechanismIllustrationPoint subMechanismIllustrationPoint =
                SubMechanismIllustrationPointConverter.Convert(hydraRingSubMechanismIllustrationPoint);

            return(new TopLevelSubMechanismIllustrationPoint(windDirection,
                                                             hydraRingWindDirectionClosingSituation.ClosingSituation,
                                                             subMechanismIllustrationPoint));
        }