//private void tabControlMain_SelectedIndexChanged(object sender, EventArgs e) //{ // if (tabControlMain.SelectedIndex != 2) // { // labelDeviceSettingStatus.Text = ""; // } //} private void textBoxSNA_TextChanged(object sender, EventArgs e) { if (textBoxSNA.Text.Length == SERIAL_NUMBER_LENGTH) { string serialNumber = textBoxSNA.Text; //Go to Produciton Mode First. if (toolStripMenuItemEMode.Checked) { toolStripMenuItemEMode.CheckState = CheckState.Unchecked; toolStripMenuItemPMode.CheckState = CheckState.Checked; } //Check test parameter setting DeviceConfig.partType = serialNumber.Substring(0, PARTNUMBER_LENGTH); //DeviceConfig.filePath = Application.StartupPath + "\\Production.ini"; if (!DeviceConfig.Read()) { MessageBox.Show("Cannot find " + DeviceConfig.partType.ToString() + " in Production.ini", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Set_TextBox(textBoxMPNA, ""); Set_TextBox(textBoxSNA, ""); return; } //Check test hardware if (!testHardwareReady) { MessageBox.Show("Hardware is not ready, check hardware config", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Set_TextBox(textBoxMPNA, ""); Set_TextBox(textBoxSNA, ""); //SettingLoad(); return; } if (!testWellARunning) { testWellARunning = true; Set_StatusBox(textBoxWellAStatus, "", Color.White); Set_TextBox(textBoxMPNA, DeviceConfig.partType); Set_TextBox(textBoxSNA, serialNumber.Substring(PARTNUMBER_LENGTH + 1, (SERIAL_NUMBER_LENGTH - PARTNUMBER_LENGTH - 1))); //SettingLoad(); testWellA = new TestWell(agilentDevice, mpqDevice, serialNumber); Thread testThread1 = new Thread(testProcess); testThread1.Start(testWellA); } else { MessageBox.Show("Current Well is in testing...", "Error:", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
//****************************************// // User Interface // //****************************************// private void Show_Test_Result(TestWell tW, bool testFinished) { //testWellARunning = !testFinished; int i = 0; foreach (TextBox tb in dutTextBoxWellA) { int errorCode = tW.DUTArray[i].ErrorCode; SetDUTTextBox(tb, errorCode, testFinished); i++; } }
private void exitTPT() { try { RegistryKey saveKey = Registry.LocalMachine.CreateSubKey(@"software\Cypress\TrackpadTest"); saveKey.SetValue("Total Tested", totalTestedNumber.ToString()); saveKey.SetValue("Total Failed", totalFailedNumber.ToString()); saveKey.SetValue("Yield Rate", yieldRate.ToString()); saveKey.SetValue("Test ID", testID); saveKey.SetValue("Test Station", testStation); saveKey.SetValue("Test Site", testSite); agilentDevice = null; mpqDevice = null; testWellA = null; GC.Collect(0); System.Threading.Thread.Sleep(100); } catch (Exception ex) { Log.error(ex.Message); } }
//****************************************// // Main Test Process // //****************************************// /// <summary> /// The test sequences for trackpad /// </summary> /// <param name="ob"></param>The testwell class private void testProcess(object ob) { TestWell testWell = (TestWell)ob; testWell.Initialize(); if (!testWell.TPTFixtureEnableStatus()) // check if this TPT is enabled or bad********************* { MessageBox.Show("This TPT is not enabled or a bad one, please contact your test engineer", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error); testWellARunning = false; testWell.PneumaticOff(); return; } //if (!testWell.WellIDCheck(textBoxMPNA.Text)) // check if it is the right fixture********************* //{ // MessageBox.Show("This is not the right fixture to test the board", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Error); // testWellARunning = false; // testWell.PneumaticOff(); // return; //} if (testWell.ReadMicroSwitch()) { Show_Test_Result(testWell, false); //clear test result Thread.Sleep(300); SetListBoxStatus("Well Closed"); testWell.PneumaticOn(); Thread.Sleep(2000); testWell.CheckTrackpadInSlot(); // check if there is trackpad in each of eight slots ******************************* if ((DeviceConfig.Items.trackpad_ShopFloor == DeviceConfig.TPCONFIG.TP_TEST_ONLINE) && testWell.PortEnalbes != 0) { SetListBoxStatus("***********Check Permission*************"); if (TestWell.OperatorID == "") { FormOperatorID formOperatorID = new FormOperatorID(); formOperatorID.ShowDialog(); TestWell.OperatorID = formOperatorID.OperatorID; } if (!testWell.CheckTestPermission()) { Set_StatusBox(textBoxWellAStatus, "Fail to connect SFCS", Color.Red); testWellARunning = false; testWell.PneumaticOff(); return; } Show_Test_Result(testWell, false); } if (testWell.PortEnalbes != 0) { SetListBoxStatus("*************IDD Testing***************"); testWell.IDDTest(false); Show_Test_Result(testWell, false); } if (testWell.PortEnalbes != 0) { SetListBoxStatus("*********Programming Prod Code*********"); testWell.ProgrammingIC(1); Show_Test_Result(testWell, false); } if (testWell.PortEnalbes != 0) { SetListBoxStatus("**********Enter Test Mode************"); testWell.EnterIntoTestMode(); } if (testWell.PortEnalbes != 0) { SetListBoxStatus("**********Fimware Rev Check************"); testWell.I2CFWRevCheck(); Show_Test_Result(testWell, false); } if (testWell.PortEnalbes != 0) { SetListBoxStatus("**********Switch Button Test************"); testWell.I2CSwitchTest(); Show_Test_Result(testWell, false); } if (testWell.PortEnalbes != 0) { SetListBoxStatus("*************IDD Testing***************"); testWell.IDDTest(true); Show_Test_Result(testWell, false); } if (testWell.PortEnalbes != 0) { SetListBoxStatus("**********Row Count Testing**********"); testWell.I2CRowCountTest(); Show_Test_Result(testWell, false); } if (testWell.PortEnalbes != 0) { SetListBoxStatus("*************IDAC Testing**************"); testWell.I2CIDACTest(); Show_Test_Result(testWell, false); } //if (testWell.PortEnalbes != 0) //{ // SetListBoxStatus("*********Programming Prod Code*********"); // testWell.ProgrammingIC(1); // Show_Test_Result(testWell, false); //} if (testWell.PortEnalbes != 0) { SetListBoxStatus("**********Exit Test Mode************"); testWell.ExitTestMode(); } if ((DeviceConfig.Items.trackpad_ShopFloor == DeviceConfig.TPCONFIG.TP_TEST_ONLINE)) { SetListBoxStatus("*********Upload Test Results***********"); if (!testWell.UploadTestRecord()) { Set_StatusBox(textBoxWellAStatus, "Fail to connect SFCS", Color.Red); testWellARunning = false; testWell.PneumaticOff(); return; } } Show_Test_Result(testWell, true); testWell.TestLog(); //cacalute pass/fail count double currentTested = 0; double currentFailed = 0; foreach (DUT dut in testWell.DUTArray) { if (dut.ErrorCode != 0) { currentFailed++; } currentTested++; } totalTestedNumber += currentTested; totalFailedNumber += currentFailed; yieldRate = (totalTestedNumber - totalFailedNumber) / totalTestedNumber; SetManufacturingSummary(); //release fixture lock. testWell.PneumaticOff(); //set status box if (currentFailed != 0) { Set_StatusBox(textBoxWellAStatus, "Total Failed:" + currentFailed.ToString(), Color.Red); } else { Set_StatusBox(textBoxWellAStatus, "PASS", Color.Green); } testWellARunning = false; Set_TextBox(textBoxSNA, ""); //clear serial number of wellA, get focused. } }
//private void tabControlMain_SelectedIndexChanged(object sender, EventArgs e) //{ // if (tabControlMain.SelectedIndex != 2) // { // labelDeviceSettingStatus.Text = ""; // } //} private void textBoxSNA_TextChanged(object sender, EventArgs e) { if (textBoxSNA.Text.Length == SERIAL_NUMBER_LENGTH) { string serialNumber = textBoxSNA.Text; string partType = serialNumber.Substring(0, PARTNUMBER_LENGTH); string identifier = serialNumber.Substring(PARTNUMBER_LENGTH, (SERIAL_NUMBER_LENGTH - PARTNUMBER_LENGTH)); serialNumber = partType + identifier; //check if serial number is valid if (!validateSerialNumber(serialNumber)) { MessageBox.Show("invalid serial number", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Set_TextBox(textBoxMPNA, ""); Set_TextBox(textBoxSNA, ""); return; } Set_TextBox(textBoxMPNA, partType); Set_TextBox(textBoxSNA, identifier); //Go to Produciton Mode. if (toolStripMenuItemEMode.Checked) { toolStripMenuItemEMode.CheckState = CheckState.Unchecked; toolStripMenuItemPMode.CheckState = CheckState.Checked; } //Check test hardware if (!testHardwareReady) { MessageBox.Show("Hardware is not ready, check hardware config", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); Set_TextBox(textBoxMPNA, ""); Set_TextBox(textBoxSNA, ""); return; } if (!testWellARunning) { try { if (lastPartType != partType) { FormTrackpadConfig formTPConfig = new FormTrackpadConfig(); tpConfig = formTPConfig.read(partType); } lastPartType = partType; } catch (Exception ex) { MessageBox.Show(ex.Message, "Error: ", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show("No such config file in the folder", "Error: ", MessageBoxButtons.OK, MessageBoxIcon.Error); Log.error(ex.Message); return; } testWellARunning = true; Set_StatusBox(textBoxWellAStatus, "", Color.White); testWellA = new TestWell(agilentDevice, mpqDevice, serialNumber, tpConfig); Thread testThread1 = new Thread(testProcess); testThread1.Start(testWellA); } else { MessageBox.Show("Current Well is in testing...", "Error:", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
//****************************************// // Main Test Process // //****************************************// /// <summary> /// The test sequences for trackpad /// </summary> /// <param name="ob"></param>The testwell class private void testProcess(object ob) { TestWell testWell = (TestWell)ob; testWell.Initialize(); if (true) //testWell.ReadMicroSwitch()) //16 { Show_Test_Result(testWell, false); //clear test result Thread.Sleep(DelayTime.MICRO_SWITCH_ON); SetListBoxStatus("Well Closed"); //testWell.PneumaticOn(); Thread.Sleep(DelayTime.PNEUMATIC_ON); //testWell.CheckTrackpadInSlot(); // check if there is trackpad in each of eight slots ******************************* if (testSite == "CM 1") { SetListBoxStatus("***********Check Permission*************"); if (!testWell.CheckTestPermission(testID)) { Set_StatusBox(textBoxWellAStatus, "Fail to connect SFCS", Color.Red); testWellARunning = false; testWell.PneumaticOff(); return; } Show_Test_Result(testWell, false); } if (testWell.PortEnables != 0 && testWell.PortEnables2 != 0) { SetListBoxStatus("*************IDD Testing***************"); testWell.IDDTest(false); Show_Test_Result(testWell, false); } if (testWell.PortEnables != 0 && testWell.PortEnables2 != 0) { SetListBoxStatus("*********Programming Prod Code*********"); testWell.ProgrammingIC(1); Show_Test_Result(testWell, false); } if (testWell.PortEnables != 0 && testWell.PortEnables2 != 0) { SetListBoxStatus("*************IDD Testing***************"); testWell.IDDTest(true); Show_Test_Result(testWell, false); } if (testWell.PortEnables != 0 && testWell.PortEnables2 != 0) { SetListBoxStatus("**********Enter Test Mode************"); testWell.EnterIntoTestMode(); } if (testWell.PortEnables != 0 && testWell.PortEnables2 != 0 && tpConfig.TPT.ReadFW) { SetListBoxStatus("**********Fimware Rev Check************"); testWell.I2CFWRevCheck(); Show_Test_Result(testWell, false); } if (testWell.PortEnables != 0 && testWell.PortEnables2 != 0 && tpConfig.TPT.ReadRawCount) { SetListBoxStatus("**********Row Count Testing**********"); testWell.I2CRowCountTest(); Show_Test_Result(testWell, false); } if (testWell.PortEnables != 0 && testWell.PortEnables2 != 0 && tpConfig.TPT.ReadIDAC) { SetListBoxStatus("*************IDAC Testing**************"); testWell.I2CIDACTest(); Show_Test_Result(testWell, false); } //if (testWell.PortEnables1 != 0) //{ // SetListBoxStatus("*********Programming Prod Code*********"); // testWell.ProgrammingIC(1); // Show_Test_Result(testWell, false); //} SetListBoxStatus("**********Exit Test Mode************"); testWell.ExitTestMode(); if (testSite == "CM 1") { SetListBoxStatus("*********Upload Test Results***********"); if (!testWell.UploadTestRecord(testID)) { Set_StatusBox(textBoxWellAStatus, "Fail to connect SFCS", Color.Red); testWellARunning = false; testWell.PneumaticOff(); return; } } testWell.TestLog(); Show_Test_Result(testWell, true); //cacalute pass/fail count double currentTested = 0; double currentFailed = 0; foreach (DUT dut in testWell.DUTArray) { if (dut.ErrorCode != 0) { currentFailed++; } currentTested++; } totalTestedNumber += currentTested; totalFailedNumber += currentFailed; yieldRate = (totalTestedNumber - totalFailedNumber) / totalTestedNumber; SetManufacturingSummary(); //release fixture lock. testWell.PneumaticOff(); //set status box if (currentFailed != 0) { Set_StatusBox(textBoxWellAStatus, "Total Failed:" + currentFailed.ToString(), Color.Red); } else { Set_StatusBox(textBoxWellAStatus, "PASS", Color.Green); } testWellARunning = false; Set_TextBox(textBoxSNA, ""); //clear serial number of wellA, get focused. } }