Ejemplo n.º 1
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);
                }
            }
        }