예제 #1
0
        /// <summary>
        /// Creates a new instance of <see cref="ProbabilisticPipingCalculationActivity"/>.
        /// </summary>
        /// <param name="calculation">The <see cref="ProbabilisticPipingCalculation"/> to perform.</param>
        /// <param name="failureMechanism">The failure mechanism the calculation belongs to.</param>
        /// <param name="assessmentSection">The assessment section the calculation belongs to.</param>
        /// <exception cref="ArgumentNullException">Thrown when any parameter is <c>null</c>.</exception>
        public ProbabilisticPipingCalculationActivity(ProbabilisticPipingCalculation calculation,
                                                      PipingFailureMechanism failureMechanism,
                                                      IAssessmentSection assessmentSection)
            : base(calculation)
        {
            if (failureMechanism == null)
            {
                throw new ArgumentNullException(nameof(failureMechanism));
            }

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

            this.calculation       = calculation;
            this.failureMechanism  = failureMechanism;
            this.assessmentSection = assessmentSection;

            Description = string.Format(RiskeerCommonServiceResources.Perform_calculation_with_name_0_, calculation.Name);

            service = new ProbabilisticPipingCalculationService();
            service.OnProgressChanged += UpdateProgressText;
        }
예제 #2
0
 protected override bool Validate()
 {
     return(ProbabilisticPipingCalculationService.Validate(calculation, failureMechanism, assessmentSection));
 }