示例#1
0
        void Communication_OnResultComplete()
        {
            Double VoltageRef = Properties.Settings.Default.VoltageReference;
            int    TestedPin  = Communication.PinID1 + Communication.PinID2;
            Double Voltage    = Math.Round((Communication.PinValue * VoltageRef) / 1023.0, 3);

            int BelongsToSocketId = GCItoDeviceIndex[TestedPin];
            int DUTPin            = GCItoDUTMap[TestedPin];
            //LimitEntity LimitsForPin = DUTPintoLimit[DUTPin];

            bool PinResult = false;

            ProductionTest.AddResult(BelongsToSocketId, DUTPin, Voltage);
            int NextPin = ProductionTest.GetNextPin();

            if (NextPin != 0)
            {
                UpdateCurrentIteration(true);
                Communication.TestPin(NextPin);
            }
            else
            {
                foreach (int Socket in ProductionTest.TestResults.Keys)
                {
                    int ProductionTestID = GCIDB.GetNextProductionTestID();
                    foreach (int TestedDUTPin in ProductionTest.TestResults[Socket].Keys)
                    {
                        LimitEntity LimitsForPin = DUTPintoLimit[TestedDUTPin];

                        double AverageVoltage = ProductionTest.TestResults[Socket][TestedDUTPin].GetVoltageAverage();
                        double StdDev         = ProductionTest.TestResults[Socket][TestedDUTPin].GetStandardDeviation();

                        if (AverageVoltage < LimitsForPin.LCL || AverageVoltage > LimitsForPin.UCL)
                        {
                            PinResult = false;
                            listProductionInfo1.SetResult(Socket, false);
                            AddLog("Socket " + Socket + " DUT Pin [" + TestedDUTPin + "] Average Voltage: " + AverageVoltage + " FAILED");
                        }
                        else
                        {
                            PinResult = true;
                            AddLog("Socket " + Socket + " DUT Pin [" + TestedDUTPin + "] Average Voltage: " + AverageVoltage + " PASSED");
                        }

                        for (int j = 0; j < ProductionTest.TestResults[Socket][TestedDUTPin].VoltageReadings.Count; j++)
                        {
                            double MeasuredVoltage = ProductionTest.TestResults[Socket][TestedDUTPin].VoltageReadings[j];
                            Dispatcher.BeginInvoke(new Action(delegate()
                            {
                                GCIDB.AddProductionTestData(textBatchName.Text, ProductionTestID, LoadedPartID, LoadedProductionLimitID, TestedDUTPin, (j - 1), MeasuredVoltage, AverageVoltage, StdDev, PinResult, DateTime.Now);
                            }));
                        }
                    }
                }
                SetDisplayStates(true);
                UpdateCurrentIteration(false);
                listProductionInfo1.DisplaAll(true);
                //  MessageBox.Show("Test Complete", "Part Finished", MessageBoxButton.OK, MessageBox.Information);
            }
        }