Exemplo n.º 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);
            }
        }
Exemplo n.º 2
0
        void Communication_OnResultComplete()
        {
            try
            {
                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];

                LifetimeTest.AddResult(BelongsToSocketId, DUTPin, Voltage);
                int NextPin = LifetimeTest.GetNextPin();
                if (NextPin != 0)
                {
                    Communication.TestPin(NextPin);
                }
                else
                {
                    if (numericTestHour.pinValue() > 0)
                    {
                        if (this.Dispatcher.CheckAccess() == true)
                        {
                            //this.Invoke(new MethodInvoker(delegate
                            //{
                            //    CompareToLimits();
                            //}));
                            Dispatcher.BeginInvoke(new Action(delegate()
                            {
                                CompareToLimits();
                            }));
                        }
                        else
                        {
                            CompareToLimits();
                        }
                        listLifetimeInfo1.DisplaAll(true);
                    }
                    else
                    {
                        if (this.Dispatcher.CheckAccess() == true)
                        {
                            //this.Invoke(new MethodInvoker(delegate
                            //{
                            //    DisplayTime0Data();
                            //}));
                            Dispatcher.BeginInvoke(new Action(delegate()
                            {
                                DisplayTime0Data();
                            }));
                        }
                        else
                        {
                            DisplayTime0Data();
                        }
                    }

                    //if (MessageBox.Show("Would you like to save this data to the database?", "Test Complete", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                    //{
                    SaveDataToDatabase();
                    //}
                    //SafeLockUI(false);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Communication_OnResultComplete(): " + ex.ToString());
            }
        }