Ejemplo n.º 1
0
        private bool IniTialize_Bert() // 150513
        {
            lock (syncRoot)
            {
                try
                {
                    bool   flag_H1023  = false;
                    bool[] flag_N1025  = new bool[2];
                    bool[] flag_GT1724 = new bool[2];
                    Bert_25G_V1.Initialize(Convert.ToByte(pDataRate.GetHashCode()), pDevice, out flag_H1023, out flag_N1025, out flag_GT1724);

                    if (flag_H1023 && flag_GT1724[0] && flag_GT1724[1])
                    {
                        //  MessageBox.Show("PPG ok");
                        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);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Channel">Dut Channel</param>
        /// <returns></returns>
        private bool TriggerOutputSelect(int Channel) // 150511
        {
            lock (syncRoot)
            {
                try
                {
                    int TempValue = Convert.ToInt16(Channel - 1);
                    Bert_25G_V1.TriggerOutputWrite((ushort)TempValue, pDevice);

                    ushort TriggerIndex;

                    Bert_25G_V1.TriggerOutputRead(pDevice, out TriggerIndex);

                    if (TriggerIndex == (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);
                }
            }
        }
Ejemplo n.º 3
0
        public override double[] RapidErrorRate_AllCH(int syn = 0)
        {
            lock (syncRoot)
            {
                try
                {
                    // byte bitRateSelect;
                    double[] ErrRata = new double[4];
                    Bert_25G_V1.ClearECAllCH(pDevice);
                    Thread.Sleep(1000);
                    bool[]   Flag_Lock = new bool[4];
                    string[] ArrayBer = new string[4];
                    string[] ArrayErrorCount = new string[4];
                    string   StrBer, StrErrorCount;
                    Bert_25G_V1.GetBER(edGatingTime, (byte)pDataRate, pDevice, out Flag_Lock, out ArrayBer, out ArrayErrorCount, out StrBer, out StrErrorCount);

                    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);
                }
            }
        }
Ejemplo n.º 4
0
        private bool ConfigureChannel(int syn = 1)
        {
            lock (syncRoot)
            {
                try
                {
                    if (syn == 0)
                    {
                        Bert_25G_V1.PPGWrite((ushort)pTx_Channel, (ushort)pTxPrbsType, (ushort)pSwing, (byte)PPGInvert, pDevice);
                    }
                    else
                    {
                        for (int i = 0; i < 3; i++)
                        {
                            Bert_25G_V1.PPGWrite((ushort)pTx_Channel, (ushort)pTxPrbsType, (ushort)pSwing, (byte)PPGInvert, pDevice);
                            Thread.Sleep(1000);
                            ushort Swingindex, PRBSIndex;
                            byte   PPGInvertIndex;
                            Bert_25G_V1.PPGRead((ushort)pTx_Channel, pDevice, out Swingindex, out PRBSIndex, out PPGInvertIndex);
                            if (Swingindex == (ushort)pSwing && (byte)PPGInvert == PPGInvertIndex && (ushort)pTxPrbsType == PRBSIndex)
                            {
                                return(true);
                            }
                        }
                        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);
                }
            }
        }
Ejemplo n.º 5
0
        public override bool AutoAlaign(bool becenter)
        {
            lock (syncRoot)
            {
                try
                {
                    Bert_25G_V1.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);
                }
            }
        }
Ejemplo n.º 6
0
        public bool ConfigureAllChannel()
        {// 第一个参数4 表示RXAllChannel,第二个参数 1=RxEnable 写死在程序中
            lock (syncRoot)
            {
                try
                {
                    Bert_25G_V1.EDWrite(4, 1, (byte)EDPattern, (byte)EDInvert, 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);
                }
            }
        }