public override double[] RapidErrorRate_AllCH(int syn = 0) { lock (syncRoot) { // byte bitRateSelect; double[] ErrRata = new double[4]; Bert25GNoPolarityClass.ClearECAllCH(pDevice); Thread.Sleep(1000); bool[] Flag_Lock = new bool[4]; string[] ArrayBer = new string[4]; string[] ArrayErrorCount = new string[4]; string StrBer, StrErrorCount; try { Bert25GNoPolarityClass.GetBER(edGatingTime, (byte)pDataRate, pDevice, out Flag_Lock, out ArrayBer, out ArrayErrorCount, out StrBer, out StrErrorCount); // Bert_25G_V2.GetBER() for (int i = 0; i < 4; i++) { try { double k = Convert.ToDouble(ArrayBer[i]); if (Flag_Lock[i] && k >= 0 && k <= 1) { ErrRata[i] = k; } else { ErrRata[i] = 1; } } catch { ErrRata[i] = 1; } } return(ErrRata); } catch (InnoExCeption error) { Log.SaveLogToTxt("ErrorCode=" + ExceptionDictionary.Code._Funtion_Fatal_0x05002 + "Reason=" + error.TargetSite.Name + "Fail"); throw error; } catch (Exception error) { Log.SaveLogToTxt("ErrorCode=" + ExceptionDictionary.Code._Funtion_Fatal_0x05002 + "Reason=" + error.TargetSite.Name + "Fail"); throw new InnoExCeption(ExceptionDictionary.Code._Funtion_Fatal_0x05002, error.StackTrace); // throw new InnoExCeption(ex); } } }
public override double[] RapidErrorCount_AllCH(int syn = 0, bool IsClear = false) { lock (syncRoot) { double[] ErrCount = new double[4] { 1E+9, 1E+9, 1E+9, 1E+9 }; try { if (IsClear) { Bert25GNoPolarityClass.ClearECAllCH(pDevice); } Thread.Sleep(1000); ulong[] ArrayErrorCount = new ulong[4]; Bert25GNoPolarityClass.GetErrorCount(pDevice, out ArrayErrorCount); ErrCount = Array.ConvertAll <ulong, double>(ArrayErrorCount, s => double.Parse(s.ToString())); return(ErrCount); } catch (InnoExCeption error) { Log.SaveLogToTxt("ErrorCode=" + ExceptionDictionary.Code._Funtion_Fatal_0x05002 + "Reason=" + error.TargetSite.Name + "Fail"); throw error; } catch (Exception error) { Log.SaveLogToTxt("ErrorCode=" + ExceptionDictionary.Code._Funtion_Fatal_0x05002 + "Reason=" + error.TargetSite.Name + "Fail"); throw new InnoExCeption(ExceptionDictionary.Code._Funtion_Fatal_0x05002, error.StackTrace); // throw new InnoExCeption(ex); } } }
public override bool AutoAlaign(bool becenter) { // Bert_25G_V2 lock (syncRoot) { try { Bert25GNoPolarityClass.ClearECAllCH(pDevice); return(true); } catch (InnoExCeption error) { Log.SaveLogToTxt("ErrorCode=" + ExceptionDictionary.Code._Funtion_Fatal_0x05002 + "Reason=" + error.TargetSite.Name + "Fail"); throw error; } catch (Exception error) { Log.SaveLogToTxt("ErrorCode=" + ExceptionDictionary.Code._Funtion_Fatal_0x05002 + "Reason=" + error.TargetSite.Name + "Fail"); throw new InnoExCeption(ExceptionDictionary.Code._Funtion_Fatal_0x05002, error.StackTrace); // throw new InnoExCeption(ex); } } }