Click here to Skip to main content
15,885,676 members
Articles / Programming Languages / C# 4.0

Process Performance Determination in C#: Part 2

Rate me:
Please Sign up or sign in to vote.
5.00/5 (3 votes)
14 Jun 2012CPOL3 min read 17.1K   162   8  
The program presented here provides a simple way to obtain process performance through PPM.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProcessPerformance2
{
    /// <summary>
    /// Process Performance from PPM (Part per Million) Result class
    /// </summary>
    public class ProcessPerformanceFrPPMResult
    {
        /// <summary>
        /// Default constructor
        /// </summary>
        public ProcessPerformanceFrPPMResult() { }
        /// <summary>
        /// Defect Per Unit
        /// </summary>
        public double DPU;
        /// <summary>
        /// Part Per Million
        /// </summary>
        public double PPM;        
        /// <summary>
        /// Yield in Percent
        /// </summary>
        public double YieldInPercent;
    }

    /// <summary>
    /// Determine Process Performance from PPM
    /// </summary>
    public class ProcessPerformanceFrPPM
    {
        private int N = 0;
        private int D = 0;
        private double dpu = 0;
        private double ppm = 0;
        private double yieldInPercent = 0;
        
        /// <summary>
        /// ProcessPerformanceFrPPM Result
        /// </summary>
        public ProcessPerformanceFrPPMResult Result = new ProcessPerformanceFrPPMResult();

        #region Constructors
        /// <summary>
        /// Process performace from PPM constructor
        /// </summary>
        public ProcessPerformanceFrPPM() { } //default empty constructor

        #endregion //Constructors

        /// <summary>
        /// Write only property: total number of units
        /// </summary>
        public int NumOfUnitProcessed
        {
            set { N = value; }
        }

        /// <summary>
        /// Write only property: total number of defective parts
        /// </summary>
        public int NumOfDefectivePart
        {
            set { D = value; }
        }

        /// <summary>
        /// Calculate the Process Performance from PPM
        /// </summary>
        public void Analyze()
        {
            dpu = (double)D / N;
            ppm = (double)D / N * 1000000;
            yieldInPercent = (1 - ppm / 1000000) * 100;
            //Result
            Result.DPU = dpu;
            Result.PPM = ppm;
            Result.YieldInPercent = yieldInPercent;            
        }

    }//end class ProcessPerformanceFrPPM
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Foundasoft.com
Malaysia Malaysia
Consultant

Comments and Discussions