protected override bool StartTest() { logger.FlushLogBuffer(); logoStr = ""; if (AnalysisInputParameters(inputParameters) == false) { logger.FlushLogBuffer(); return(false); } if (selectedEquipList["DUT"] != null && selectedEquipList["POWERSUPPLY"] != null) { Powersupply tempps = (Powersupply)selectedEquipList["POWERSUPPLY"]; // open apc string apcstring = null; dut.APCStatus(out apcstring); if (apcstring == "OFF" || apcstring == "FF") { logoStr += logger.AdapterLogString(0, "Step2...Start Open apc"); dut.APCON(); logoStr += logger.AdapterLogString(0, "Power off"); tempps.Switch(false); Thread.Sleep(200); logoStr += logger.AdapterLogString(0, "Power on"); tempps.Switch(true); Thread.Sleep(200); bool isOpen = dut.APCStatus(out apcstring); if (apcstring == "ON") { logoStr += logger.AdapterLogString(1, "APC ON"); } else { logoStr += logger.AdapterLogString(3, "APC NOT ON"); } } // open apc logoStr += logger.AdapterLogString(0, "Step3..Read ICC"); icc = tempps.GetCurrent(); icc -= GlobalParameters.Iccoffset; logoStr += logger.AdapterLogString(1, "ICC=" + icc.ToString()); AnalysisOutputParameters(outputParameters); logger.FlushLogBuffer(); return(true); } else { logoStr += logger.AdapterLogString(4, "Equipments is not enough!"); logger.FlushLogBuffer(); return(false); } }
protected override bool StartTest() { logoStr = ""; try { if (tempps != null) { // open apc //CloseandOpenAPC(Convert.ToByte(APCMODE.IBAISandIMODON)); // open apc Log.SaveLogToTxt("Step3..Read ICC"); icc = tempps.GetCurrent() - Convert.ToDouble(GlobalParameters.StrEvbCurrent); if (icc == 0) { InnoExCeption ex = new InnoExCeption(ExceptionDictionary.Code._Funtion_Fatal_0x05002); //Log.SaveLogToTxt(ex.ID + ": " + ex.Message + "\r\n" + ex.StackTrace); throw ex; } Log.SaveLogToTxt("ICC=" + icc.ToString()); OutPutandFlushLog(); return(true); } else { InnoExCeption ex = new InnoExCeption(ExceptionDictionary.Code._Funtion_Fatal_0x05002); //Log.SaveLogToTxt(ex.ID + ": " + ex.Message + "\r\n" + ex.StackTrace); throw ex; } } catch (InnoExCeption ex)//from driver { //Log.SaveLogToTxt(ex.ID + ": " + ex.Message + "\r\n" + ex.StackTrace); exceptionList.Add(ex); OutPutandFlushLog(); return(false); } catch (Exception error)//from itself { //one way: deal this exception itself InnoExCeption ex = new InnoExCeption(ExceptionDictionary.Code._0xFFFFF, error.StackTrace); //Log.SaveLogToTxt(ex.ID + ": " + ex.Message + "\r\n" + ex.StackTrace); exceptionList.Add(ex); OutPutandFlushLog(); return(false); //the other way is: should throw exception, rather than the above three code. see below: //throw new InnoExCeption(ExceptionDictionary.Code._0xFFFFF, error.StackTrace); } }