private bool TriggerOutputSelect(int Channel) // ok { lock (syncRoot) { try { ushort TempValue; Bert25GNoPolarityClass.TriggerOutputWrite(IN012525_Phycial_Add, (ushort)(Channel - 1), pDevice); Thread.Sleep(200); Bert25GNoPolarityClass.TriggerOutputRead(IN012525_Phycial_Add, pDevice, out TempValue); if ((Channel - 1) == (ushort)TempValue) { return(true); } return(false); } 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[] 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); } } }
private bool IniTialize_Bert() // OK { lock (syncRoot) { bool flag_REF32 = false; bool[] PPG32; bool[] ED32; bool[] flag_GT1724 = new bool[2]; bool[] flag_PPG_OK; bool[] flag_ED_OK; bool flag_PRBS_OK = false; String BertSN = ""; bool flagTotal = true; try { Bert25GNoPolarityClass.InitializeUpdateForAnritsuPRBSDefinition(1, (byte)pDataRate, pDevice, out flag_REF32, out flag_PPG_OK, out flag_ED_OK, out BertSN, out flag_PRBS_OK); if (!flag_REF32) { return(false); } for (int i = 0; i < flag_PPG_OK.Length; i++) { if (!flag_PPG_OK[i]) { Log.SaveLogToTxt("PPG Error"); return(false); } } for (int i = 0; i < flag_ED_OK.Length; i++) { if (!flag_ED_OK[i]) { Log.SaveLogToTxt("ED Error"); return(false); } } if (BertSN == null || BertSN == "") { Log.SaveLogToTxt("SN Error"); return(false); } if (!flag_PRBS_OK) { Log.SaveLogToTxt("PRBS Error"); return(false); } 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); } // return flagTotal; } }
public override bool ConfigureOTxPolarity(bool polarity) { lock (syncRoot) { ushort Swing, uPrbs; byte[] ReadInverted = new byte[4]; //polarity= 正, Anritsu为标准 自制BERT =Inverted=1 否则 BERT =NoInverted=0 //TxALLChannel=4,phycialAddress=0,PRBS31=4,Swing100=4, polarity try { byte Inverted = 0; if (polarity) { Inverted = 1; for (int i = 0; i < 4; i++) { ReadInverted[i] = 0; } } else { Inverted = 0; for (int i = 0; i < 4; i++) { ReadInverted[i] = 1; } } //polarity= 正, Anritsu为标准 自制BERT =Inverted=1 否则 BERT =NoInverted=0 //TxALLChannel=4,phycialAddress=0,PRBS31=4,Swing100=4, polarity Bert25GNoPolarityClass.PPGWrite(4, 0, 4, 4, Inverted, pDevice); for (byte i = 0; i < 4; i++) { // Bert25GNoPolarityClass.PPGWrite(4, 0, 4, 4, Inverted, pDevice); Thread.Sleep(100); Bert25GNoPolarityClass.PPGRead(0, i, pDevice, out Swing, out uPrbs, out ReadInverted[i]); } if (ReadInverted[0] == Inverted && ReadInverted[1] == Inverted && ReadInverted[2] == Inverted && ReadInverted[3] == Inverted) { return(true); } else { return(false); } } 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); } } }