private void buttonStart_Click(object sender, EventArgs e) { if (listLifetimeInfo1.CheckForDuplicateSerialNumber() == true) { //MessageBox.Show("Duplicate serial numbers detected, please fix.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Duplicate serial numbers detected, please fix.", "Error"); return; } if (textBatchName.Text.Trim().Length == 0) { //MessageBox.Show("Please enter a batch name.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("Duplicate serial numbers detected, please fix.", "Error"); return; } PinsToTest = listLifetimeInfo1.GetAllPinsToTest(); int PinTotal = PinsToTest.Count; //ClearLog(); treeReport.Items.Clear(); LifetimeTest = new TestPart(); LifetimeTest.TotalIterations = (int)numericIterations.pinValue(); LifetimeTest.PinsToTest = PinsToTest; // SafeLockUI(true); if (PinTotal > 0) { Communication.TestPin(LifetimeTest.GetNextPin()); } }
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); } }
private void buttonStart_Click(object sender, RoutedEventArgs e) { PinsToTest = listProductionInfo1.GetAllPinsToTest(); listProductionInfo1.ResetAll(); PinTotal = PinsToTest.Count; ClearLog(); ProductionTest = new TestPart(); ProductionTest.TotalIterations = (int)numericIterations.pinValue(); ProductionTest.PinsToTest = PinsToTest; if (PinTotal > 0) { SetDisplayStates(false); Communication.TestPin(ProductionTest.GetNextPin()); } /* Debuggin purposes * listProductionInfo1.DisplaAll(true); * listProductionInfo1.SetResult(0, false); */ }
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()); } }