コード例 #1
0
        public CheckLotAndMachineCompatibilityResult CheckLotAndMachineCompatibility(LotInfo lotInfo, MachineInfo machineInfo)
        {
            Stopwatch functionTimer = new Stopwatch();

            functionTimer.Start();
            int stepCount = 1;
            Dictionary <int, string> WarningMessage = new Dictionary <int, string>();

            //1.) machine must be set as high reliability if lot is auto motive
            if (lotInfo.IsAutomotive && !machineInfo.IsAutomotive)
            {
                functionTimer.Stop();
                SaveFunctionLog("CheckLotAndMachineCompatibility", functionTimer.ElapsedMilliseconds, DateTime.Now);
                return(new CheckLotAndMachineCompatibilityResult(11, WarningMessage, "www.google.com", stepCount));
            }
            stepCount += 1;
            //2.) check machine ...
            //  2.1) process step must be equal
            if (machineInfo.Job == null)
            {
                functionTimer.Stop();
                SaveFunctionLog("CheckLotAndMachineCompatibility", functionTimer.ElapsedMilliseconds, DateTime.Now);
                return(new CheckLotAndMachineCompatibilityResult(27, WarningMessage, "www.google.com", stepCount));
            }
            if (lotInfo.Job == null)
            {
                functionTimer.Stop();
                SaveFunctionLog("CheckLotAndMachineCompatibility", functionTimer.ElapsedMilliseconds, DateTime.Now);
                return(new CheckLotAndMachineCompatibilityResult(28, WarningMessage, "www.google.com", stepCount));
            }
            for (int i = 0; i < machineInfo.Job.Length; i++)
            {
                if (lotInfo.Job.Id == machineInfo.Job[i].Id)
                {
                    break;
                }
                if (i == machineInfo.Job.Length - 1)
                {
                    functionTimer.Stop();
                    SaveFunctionLog("CheckLotAndMachineCompatibility", functionTimer.ElapsedMilliseconds, DateTime.Now);
                    return(new CheckLotAndMachineCompatibilityResult(12, WarningMessage, "www.google.com", stepCount));
                }
            }
            //  2.2) machine type must equal to specific as the lot needed

            //3.) machine's material check
            //  3.1) material type check
            //  3.2) material life time check
            //  3.3) material usagable date check

            //4.) machine's jig check
            //  4.1) jig type check
            //  4.2) jig life time check

            //5.) machine's equipment check
            //  5.1) equipment type check
            //  5.2) equipment setting check
            //  5.3) equipment quantity check

            functionTimer.Stop();
            SaveFunctionLog("CheckLotAndMachineCompatibility", functionTimer.ElapsedMilliseconds, DateTime.Now);
            return(new CheckLotAndMachineCompatibilityResult(WarningMessage));
        }
コード例 #2
0
        public CheckLotConditionResult CheckLotCondition(LotInfo lotInfo)
        {
            Stopwatch functionTimer = new Stopwatch();

            functionTimer.Start();
            int stepCount = 1;
            Dictionary <int, string> WarningMessage = new Dictionary <int, string>();

            if (lotInfo == null)
            {
                functionTimer.Stop();
                SaveFunctionLog("CheckLotCondition", functionTimer.ElapsedMilliseconds, DateTime.Now);
                return(new CheckLotConditionResult(10, WarningMessage, "www.google.com", stepCount));
            }
            stepCount += 1;
            if (lotInfo.LotState == null)
            {
                functionTimer.Stop();
                SaveFunctionLog("CheckLotCondition", functionTimer.ElapsedMilliseconds, DateTime.Now);
                return(new CheckLotConditionResult(26, WarningMessage, "www.google.com", stepCount));
            }
            if (lotInfo.LotState.ProcessState == 1)
            {
                functionTimer.Stop();
                SaveFunctionLog("CheckLotCondition", functionTimer.ElapsedMilliseconds, DateTime.Now);
                return(new CheckLotConditionResult(13, WarningMessage, "www.google.com", stepCount));
            }
            if (lotInfo.LotState.ProcessState == 2)
            {
                functionTimer.Stop();
                SaveFunctionLog("CheckLotCondition", functionTimer.ElapsedMilliseconds, DateTime.Now);
                return(new CheckLotConditionResult(14, WarningMessage, "www.google.com", stepCount));
            }
            if (lotInfo.LotState.ProcessState == 3)
            {
                functionTimer.Stop();
                SaveFunctionLog("CheckLotCondition", functionTimer.ElapsedMilliseconds, DateTime.Now);
                return(new CheckLotConditionResult(15, WarningMessage, "www.google.com", stepCount));
            }
            stepCount += 1;
            if (lotInfo.LotState.QualityState == 1)
            {
                functionTimer.Stop();
                SaveFunctionLog("CheckLotCondition", functionTimer.ElapsedMilliseconds, DateTime.Now);
                return(new CheckLotConditionResult(16, WarningMessage, "www.google.com", stepCount));
            }
            if (lotInfo.LotState.QualityState == 2)
            {
                functionTimer.Stop();
                SaveFunctionLog("CheckLotCondition", functionTimer.ElapsedMilliseconds, DateTime.Now);
                return(new CheckLotConditionResult(17, WarningMessage, "www.google.com", stepCount));
            }
            if (lotInfo.LotState.QualityState == 3)
            {
                functionTimer.Stop();
                SaveFunctionLog("CheckLotCondition", functionTimer.ElapsedMilliseconds, DateTime.Now);
                return(new CheckLotConditionResult(18, WarningMessage, "www.google.com", stepCount));
            }
            functionTimer.Stop();
            SaveFunctionLog("CheckMachineCondition", functionTimer.ElapsedMilliseconds, DateTime.Now);
            return(new CheckLotConditionResult(WarningMessage));
        }