Пример #1
0
        // private LVEnum_1 pDevice;

        public override bool Initialize(TestModeEquipmentParameters[] Inno_25GBert_EDStruct)
        {
            lock (syncRoot)
            {
                int i = 0;

                try
                {
                    if (Algorithm.FindFileName(Inno_25GBert_EDStruct, "Addr", out i))
                    {
                        Addr = Convert.ToByte(Inno_25GBert_EDStruct[i].DefaultValue);

                        switch (Addr)
                        {
                        case 0:
                            pDevice = LVEnum_1.Device_0;
                            break;

                        case 1:
                            pDevice = LVEnum_1.Device_1;
                            break;

                        case 2:
                            pDevice = LVEnum_1.Device_2;
                            break;

                        case 3:
                            pDevice = LVEnum_1.Device_3;
                            break;

                        default:
                            pDevice = LVEnum_1.Device_1;
                            break;
                        }
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no Addr");
                        return(false);
                    }

                    if (Algorithm.FindFileName(Inno_25GBert_EDStruct, "IOTYPE", out i))
                    {
                        IOType = Inno_25GBert_EDStruct[i].DefaultValue;
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no IOTYPE");
                        return(false);
                    }



                    if (Algorithm.FindFileName(Inno_25GBert_EDStruct, "EDGATINGTIME", out i))
                    {
                        edGatingTime = Convert.ToInt16(Inno_25GBert_EDStruct[i].DefaultValue);
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no EDGATINGTIME");
                        return(false);
                    }

                    //if (Algorithm.FindFileName(Inno_25GBert_EDStruct, "RESET", out i))
                    //{
                    //    Reset = Convert.ToBoolean(Inno_25GBert_EDStruct[i].DefaultValue);
                    //}
                    //else
                    //{
                    //    Log.SaveLogToTxt("there is no RESET");
                    //    return false;
                    //}

                    if (Algorithm.FindFileName(Inno_25GBert_EDStruct, "NAME", out i))
                    {
                        Name = Inno_25GBert_EDStruct[i].DefaultValue;
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no NAME");
                        return(false);
                    }

                    if (Algorithm.FindFileName(Inno_25GBert_EDStruct, "EDPattern", out i))
                    {
                        EDPattern = (PrbsType)Convert.ToByte(Inno_25GBert_EDStruct[i].DefaultValue);
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no EDPattern");
                        return(false);
                    }

                    totalChannels = 4;

                    //if (Algorithm.FindFileName(Inno_25GBert_EDStruct, "EDInvert", out i))
                    //{
                    //    EDInvert = (ED_Inverted)Convert.ToByte(Inno_25GBert_EDStruct[i].DefaultValue);
                    //}
                    //else
                    //{
                    //    Log.SaveLogToTxt("there is no EDInvert");
                    //    return false;
                    //}

                    //  DeviceIndex = Convert.ToByte(Addr);

                    if (Algorithm.FindFileName(Inno_25GBert_EDStruct, "TriggerOutputList".ToUpper(), out i))
                    {
                        TriggerOutputList = Inno_25GBert_EDStruct[i].DefaultValue.Split(',');
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no TriggerOutputList");
                        return(false);
                    }

                    //if (Algorithm.FindFileName(Inno_25GBert_EDStruct, "deviceIndex", out i))
                    //{
                    //    DeviceIndex = Convert.ToByte(Inno_25GBert_EDStruct[i].DefaultValue);
                    //}
                    //else
                    //{
                    //    Log.SaveLogToTxt("there is no deviceIndex");
                    //    return false;
                    //}

                    //if (Algorithm.FindFileName(Inno_25GBert_EDStruct, "FCK", out i))
                    //{
                    //    FCK = (IOPort.CFKType)Convert.ToByte(Inno_25GBert_EDStruct[i].DefaultValue);
                    //}
                    //else
                    //{
                    //    Log.SaveLogToTxt("there is no FCK");
                    //    return false;
                    //}

                    if (!Connect())
                    {
                        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);
                }
            }
        }
Пример #2
0
        public override bool Initialize(TestModeEquipmentParameters[] inPara)
        {
            lock (syncRoot)
            {
                int i = 0;
                try
                {
                    if (Algorithm.FindFileName(inPara, "Addr", out i))
                    {
                        Addr = Convert.ToByte(inPara[i].DefaultValue);
                        switch (Addr)
                        {
                        case 0:
                            device = LVEnum_1.Device_0;
                            break;

                        case 1:
                            device = LVEnum_1.Device_1;
                            break;

                        case 2:
                            device = LVEnum_1.Device_2;
                            break;

                        case 3:
                            device = LVEnum_1.Device_3;
                            break;

                        default:
                            device = LVEnum_1.Device_1;
                            break;
                        }
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no Addr");
                        return(false);
                    }

                    if (Algorithm.FindFileName(inPara, "IOTYPE", out i))
                    {
                        IOType = inPara[i].DefaultValue;
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no IOTYPE");
                        return(false);
                    }

                    if (Algorithm.FindFileName(inPara, "RESET", out i))
                    {
                        Reset = Convert.ToBoolean(inPara[i].DefaultValue);
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no RESET");
                        return(false);
                    }

                    if (Algorithm.FindFileName(inPara, "NAME", out i))
                    {
                        Name = inPara[i].DefaultValue;
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no NAME");
                        return(false);
                    }

                    if (Algorithm.FindFileName(inPara, "DATARATE", out i))
                    {
                        dataRate = inPara[i].DefaultValue;
                        switch (dataRate)
                        {
                        case "10.3125":
                            rate = DataRate.Rate103125;
                            break;

                        case "14":
                            rate = DataRate.Rate14;
                            break;

                        default:
                            break;
                        }
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no DATARATE");
                        return(false);
                    }

                    if (Algorithm.FindFileName(inPara, "TotalChannel".ToUpper(), out i))
                    {
                        totalChannels = Convert.ToByte(inPara[i].DefaultValue);
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no TotalChannel");
                        return(false);
                    }

                    if (Algorithm.FindFileName(inPara, "PPGInvert".ToUpper(), out i))
                    {
                        invent = (PG_Inverted)Convert.ToByte(inPara[i].DefaultValue);
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no PPGInvert");
                        return(false);
                    }

                    if (Algorithm.FindFileName(inPara, "PPGPattern".ToUpper(), out i))
                    {
                        txPRBS = (TxPRBS)Convert.ToByte(inPara[i].DefaultValue);
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no PPGPattern");
                        return(false);
                    }

                    if (!Connect())
                    {
                        return(false);
                    }
                }
                catch (InnoExCeption error)
                {
                    Log.SaveLogToTxt("ErrorCode=" + error.ID + "Reason=" + error.TargetSite.Name + "Fail");
                    throw error;
                }

                catch (Exception error)
                {
                    Log.SaveLogToTxt("ErrorCode=" + ExceptionDictionary.Code._Los_parameter_0x05102 + "Reason=" + error.TargetSite.Name + "Fail");
                    throw new InnoExCeption(ExceptionDictionary.Code._Funtion_Fatal_0x05002, error.StackTrace);
                    // throw new InnoExCeption(ex);
                }

                return(true);
            }
        }
Пример #3
0
        public override bool Initialize(TestModeEquipmentParameters[] Inno_25GBert_PPGStruct)
        {
            lock (syncRoot)
            {
                int i = 0;
                try
                {
                    if (Algorithm.FindFileName(Inno_25GBert_PPGStruct, "Addr", out i))
                    {
                        Addr = Convert.ToByte(Inno_25GBert_PPGStruct[i].DefaultValue);
                        switch (Addr)
                        {
                        case 0:
                            pDevice = LVEnum_1.Device_0;
                            break;

                        case 1:
                            pDevice = LVEnum_1.Device_1;
                            break;

                        case 2:
                            pDevice = LVEnum_1.Device_2;
                            break;

                        case 3:
                            pDevice = LVEnum_1.Device_3;
                            break;

                        default:
                            pDevice = LVEnum_1.Device_1;
                            break;
                        }
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no Addr");
                        return(false);
                    }

                    if (Algorithm.FindFileName(Inno_25GBert_PPGStruct, "ED_Version", out i))
                    {
                        byte Ed_Value = Convert.ToByte(Inno_25GBert_PPGStruct[i].DefaultValue);
                        switch (Ed_Value)
                        {
                        case 0:
                            pED_Version = ED_Version.R1;
                            break;

                        case 1:
                            pED_Version = ED_Version.R2;
                            break;

                        default:
                            pED_Version = ED_Version.R2;
                            break;
                        }
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no Addr");
                        return(false);
                    }


                    if (Algorithm.FindFileName(Inno_25GBert_PPGStruct, "TriggerOutputList".ToUpper(), out i))
                    {
                        TriggerOutputList = Inno_25GBert_PPGStruct[i].DefaultValue.Split(',');
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no TriggerOutputList");
                        return(false);
                    }

                    if (Algorithm.FindFileName(Inno_25GBert_PPGStruct, "IOTYPE", out i))
                    {
                        IOType = Inno_25GBert_PPGStruct[i].DefaultValue;
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no IOTYPE");
                        return(false);
                    }

                    if (Algorithm.FindFileName(Inno_25GBert_PPGStruct, "RESET", out i))
                    {
                        Reset = Convert.ToBoolean(Inno_25GBert_PPGStruct[i].DefaultValue);
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no RESET");
                        return(false);
                    }

                    if (Algorithm.FindFileName(Inno_25GBert_PPGStruct, "NAME", out i))
                    {
                        Name = Inno_25GBert_PPGStruct[i].DefaultValue;
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no NAME");
                        return(false);
                    }

                    if (Algorithm.FindFileName(Inno_25GBert_PPGStruct, "DATARATE", out i))
                    {
                        dataRate = Inno_25GBert_PPGStruct[i].DefaultValue;
                        // pDataRate = (DataRate)Convert.ToDouble(dataRate);
                        switch (dataRate)
                        {
                        case "25.78":
                            pDataRate = DataRate.Rate25;
                            break;

                        case "28":
                            pDataRate = DataRate.Rate28;
                            break;

                        default:
                            break;
                        }
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no DATARATE");
                        return(false);
                    }

                    if (Algorithm.FindFileName(Inno_25GBert_PPGStruct, "PPGInvert".ToUpper(), out i))
                    {
                        PPGInvert = (PG_Inverted)Convert.ToByte(Inno_25GBert_PPGStruct[i].DefaultValue);
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no PPGInvert");
                        return(false);
                    }

                    if (Algorithm.FindFileName(Inno_25GBert_PPGStruct, "PPGPattern".ToUpper(), out i))
                    {
                        pTxPrbsType = (TxPrbsType)Convert.ToByte(Inno_25GBert_PPGStruct[i].DefaultValue);
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no PPGPattern");
                        return(false);
                    }

                    if (Algorithm.FindFileName(Inno_25GBert_PPGStruct, "SWING", out i))
                    {
                        pSwing = (TX_Set_Swing)Convert.ToByte(Inno_25GBert_PPGStruct[i].DefaultValue);
                    }
                    else
                    {
                        Log.SaveLogToTxt("there is no SWING");
                        return(false);
                    }

                    if (!Connect())
                    {
                        return(false);
                    }
                }
                catch (InnoExCeption error)
                {
                    Log.SaveLogToTxt("ErrorCode=" + error.ID + "Reason=" + error.TargetSite.Name + "Fail");
                    throw error;
                }

                catch (Exception error)
                {
                    Log.SaveLogToTxt("ErrorCode=" + ExceptionDictionary.Code._Los_parameter_0x05102 + "Reason=" + error.TargetSite.Name + "Fail");
                    throw new InnoExCeption(ExceptionDictionary.Code._Funtion_Fatal_0x05002, error.StackTrace);
                    // throw new InnoExCeption(ex);
                }
                return(true);
            }
        }
Пример #4
0
        public override bool Initialize(TestModeEquipmentParameters[] inPara)
        {
            lock (syncRoot)
            {
                int i = 0;

                if (Algorithm.FindFileName(inPara, "Addr", out i))
                {
                    Addr = Convert.ToByte(inPara[i].DefaultValue);

                    switch (Addr)
                    {
                    case 0:
                        device = LVEnum_1.Device_0;
                        break;

                    case 1:
                        device = LVEnum_1.Device_1;
                        break;

                    case 2:
                        device = LVEnum_1.Device_2;
                        break;

                    case 3:
                        device = LVEnum_1.Device_3;
                        break;

                    default:
                        device = LVEnum_1.Device_1;
                        break;
                    }
                }
                else
                {
                    Log.SaveLogToTxt("there is no Addr");
                    return(false);
                }

                if (Algorithm.FindFileName(inPara, "IOTYPE", out i))
                {
                    IOType = inPara[i].DefaultValue;
                }
                else
                {
                    Log.SaveLogToTxt("there is no IOTYPE");
                    return(false);
                }

                if (Algorithm.FindFileName(inPara, "EDGATINGTIME", out i))
                {
                    edGatingTime = Convert.ToInt16(inPara[i].DefaultValue);
                }
                else
                {
                    Log.SaveLogToTxt("there is no EDGATINGTIME");
                    return(false);
                }

                if (Algorithm.FindFileName(inPara, "RESET", out i))
                {
                    Reset = Convert.ToBoolean(inPara[i].DefaultValue);
                }
                else
                {
                    Log.SaveLogToTxt("there is no RESET");
                    return(false);
                }

                if (Algorithm.FindFileName(inPara, "TriggerOutputList".ToUpper(), out i))
                {
                    outChannel = inPara[i].DefaultValue.Split(',');
                }
                else
                {
                    Log.SaveLogToTxt("there is no TriggerOutputList");
                    return(false);
                }

                if (Algorithm.FindFileName(inPara, "NAME", out i))
                {
                    Name = inPara[i].DefaultValue;
                }
                else
                {
                    Log.SaveLogToTxt("there is no NAME");
                    return(false);
                }

                if (Algorithm.FindFileName(inPara, "EDPattern", out i))
                {
                    rxPRBS = (RxPRBS)Convert.ToByte(inPara[i].DefaultValue);
                }
                else
                {
                    Log.SaveLogToTxt("there is no EDPattern");
                    return(false);
                }

                if (Algorithm.FindFileName(inPara, "DATARATE", out i))
                {
                    string dataRate = inPara[i].DefaultValue;
                    switch (dataRate)
                    {
                    case "10.3125":
                        rate = DataRate.Rate103125;
                        break;

                    case "14":
                        rate = DataRate.Rate14;
                        break;

                    default:
                        break;
                    }
                }
                else
                {
                    Log.SaveLogToTxt("there is no DATARATE");
                    return(false);
                }

                if (Algorithm.FindFileName(inPara, "EDInvert", out i))
                {
                    invent = (ED_Inverted)Convert.ToByte(inPara[i].DefaultValue);
                }
                else
                {
                    Log.SaveLogToTxt("there is no EDInvert");
                    return(false);
                }

                if (Algorithm.FindFileName(inPara, "TotalChannel".ToUpper(), out i))
                {
                    totalChannels = Convert.ToByte(inPara[i].DefaultValue);
                }
                else
                {
                    Log.SaveLogToTxt("there is no TotalChannel");
                    return(false);
                }

                if (!Connect())
                {
                    return(false);
                }

                return(true);
            }
        }