//============================== // Write Test Log //============================== public void OutputData() { //TestLog testlog = new TestLog(); //testlog.Write(dut, System.Windows.Forms.Application.StartupPath + @"\test results\"); XmlReport xmlReport = new XmlReport(); //Open XML Report if (!xmlReport.OpenReport(dut.SerailNumber, System.Windows.Forms.Application.StartupPath + @"\test results\", Manufacture.testStation)) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSingleData("Serial_Number", dut.SerailNumber)) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSingleData("Test_Station", Manufacture.testStation)) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSingleData("Error_Code", string.Format("{0:X} ", dut.ErrorCode))) { Log.error(xmlReport.LastError); } string time = System.DateTime.Now.ToString("u", DateTimeFormatInfo.InvariantInfo); if (!xmlReport.WriteSingleData("Test_Time", time)) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSingleData("Button", dut.LeftButtonStatus.ToString())) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSingleData("IDD_Value", dut.IDDValue.ToString())) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSingleData("Firmware_Revision", dut.FwRev.ToString())) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSerialData("Raw_Count_Averages", dut.RawCount)) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSerialData("Raw_Count_Noise", dut.Noise)) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSerialData("IDAC_Value", dut.IDAC)) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSerialData("Global_IDAC_Value", dut.Global_IDAC)) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSerialData("IDAC_Gain_Value", dut.IDACGain)) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSerialData("Local_IDAC_Value", dut.Local_IDAC)) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSerialData("Signal_Data", dut.Signal)) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSerialData("SNR_Data", dut.SNR)) { Log.error(xmlReport.LastError); } //Close XML Report if (!xmlReport.CloseReport()) { Log.error(xmlReport.LastError); } }
//****************************************// // Test Record // //****************************************// /// <summary> /// Write Test Log; /// Write test log of each DUT in seprated file; /// Single txt file with file name is the serial number; /// </summary> public void TestLog() { foreach (DUT dut in m_DUTArray) { //TestLog testlog = new TestLog(); //testlog.Write(dut, System.Windows.Forms.Application.StartupPath + @"\test results\"); XmlReport xmlReport = new XmlReport(); //xmlReport.writeReport(dut, System.Windows.Forms.Application.StartupPath + @"\test results\", "TPT"); //Open XML Report if (!xmlReport.OpenReport(dut.SerailNumber, System.Windows.Forms.Application.StartupPath + @"\test results\", "TPT")) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSingleData("Serial_Number", dut.SerailNumber)) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSingleData("Test_Station", "TPT")) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSingleData("Error_Code", string.Format("{0:X} ", dut.ErrorCode))) { Log.error(xmlReport.LastError); } string time = System.DateTime.Now.ToString("u", DateTimeFormatInfo.InvariantInfo); if (!xmlReport.WriteSingleData("Test_Time", time)) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSingleData("IDD_Value", dut.IDDValue.ToString())) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSingleData("Firmware_Revision", dut.FwRev.ToString())) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSerialData("Raw_Count_Averages", dut.RawCount)) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSerialData("Raw_Count_Noise", dut.Noise)) { Log.error(xmlReport.LastError); } if (!xmlReport.WriteSerialData("IDAC_Value", dut.IDAC)) { Log.error(xmlReport.LastError); } //if (!xmlReport.WriteSerialData("Signal_Data", dut.Signal)) //{ Log.error(xmlReport.LastError); } //if (!xmlReport.WriteSerialData("SNR_Data", dut.SNR)) //{ Log.error(xmlReport.LastError); } //Close XML Report if (!xmlReport.CloseReport()) { Log.error(xmlReport.LastError); } } }