Ejemplo n.º 1
0
        public override bool Initial(ChipControlByPN tableA, ChipDefaultValueByPN tableB, EEPROMDefaultValueByTestPlan tableC, DUTCoeffControlByPN tableD)
        {
            lock (syncRoot)
            {
                try
                {
                    this.dataTable_ChipControlByPN              = tableA;
                    this.dataTable_ChipDefaultValueByPN         = tableB;
                    this.dataTable_EEPROMDefaultValueByTestPlan = tableC;
                    this.dataTable_DUTCoeffControlByPN          = tableD;

                    //QSFP = new EEPROM(TestPlanParaByPN.DUT_USB_Port);
                    //USBIO = new IOPort("USB", TestPlanParaByPN.DUT_USB_Port.ToString());
                    //IOPort.IOConnect();
                    //USBIO = IOPort.GetIOPort();

                    string    filter    = "ItemName = " + "'" + "DEBUGINTERFACE" + "'";
                    DataRow[] foundRows = this.dataTable_DUTCoeffControlByPN.Select(filter);

                    if (foundRows.Length == 0)
                    {
                        Log.SaveLogToTxt("there is no DEBUGINTERFACE");
                    }
                    else if (foundRows.Length > 1)
                    {
                        Log.SaveLogToTxt("count of DEBUGINTERFACE is more than 1");
                    }
                    else
                    {
                        DebugInterface.EngPage      = Convert.ToByte(foundRows[0]["Page"]);
                        DebugInterface.StartAddress = Convert.ToInt32(foundRows[0]["StartAddress"]);
                    }
                    return(true);
                }
                catch (Exception ex)
                {
                    Log.SaveLogToTxt(ex.ToString());
                    return(false);
                }
            }
        }
Ejemplo n.º 2
0
        public bool ReadyForTest(out string dut_SN, out string dut_FW)
        {
            dut_SN = "";
            dut_FW = "";
            string TestStartTime = myDataIO.GetCurrTime().ToString("yyyy/MM/dd HH:mm:ss");

            try
            {
                supply      = null;
                tempControl = null;
                attennuator = null;
                foreach (string key in usedEquipments.Keys)
                {
                    if (key == "POWERSUPPLY")
                    {
                        supply = (PowerSupply)this.usedEquipments[key];
                    }

                    if (key == "THERMOCONTROLLER")
                    {
                        tempControl = (Thermocontroller)this.usedEquipments[key];
                    }

                    if (key == "ATTENNUATOR")
                    {
                        attennuator = (Attennuator)this.usedEquipments[key];
                    }
                }

                // 获得芯片control 地址信息
                Log.SaveLogToTxt("Try to get chip control address from server.");
                string          table      = "GlobalManufactureChipsetControl";
                string          expression = "select * from " + table + " where PID= " + GlobalParaByPN.ID + " order by ID";
                ChipControlByPN dataTable_ChipControlByPN = new ChipControlByPN(myDataIO.GetDataTable(expression, table));

                // 获得芯片初始化赋值信息
                Log.SaveLogToTxt("Try to get chip default value from server.");
                table      = "GlobalManufactureChipsetInitialize";
                expression = "select * from " + table + " where PID= " + GlobalParaByPN.ID + " order by ID";
                ChipDefaultValueByPN dataTable_ChipDefaultValueByPN = new ChipDefaultValueByPN(myDataIO.GetDataTable(expression, table));

                // 获得模块配置EEPROM初始化赋值信息
                Log.SaveLogToTxt("Try to get EEPROM default value from server.");
                table      = "TopoManufactureConfigInit";
                expression = "select * from " + table + " where PID= " + TestPlanParaByPN.ID + " order by ID";
                EEPROMDefaultValueByTestPlan dataTable_EEPROMDefaultValueByTestPlan = new EEPROMDefaultValueByTestPlan(myDataIO.GetDataTable(expression, table));

                // 获得模块系数表信息
                Log.SaveLogToTxt("Try to get module map from server.");
                table      = "GlobalManufactureCoefficients";
                expression = "select * from " + table + " where PID= " + GlobalParaByPN.MCoefsID + " order by ID";
                DUTCoeffControlByPN dataTable_DUTCoeffControlByPN = new DUTCoeffControlByPN(myDataIO.GetDataTable(expression, table));

                dut = myFactory.CreateDUT(GlobalParaByPN.Family);
                dut.Initial(dataTable_ChipControlByPN, dataTable_ChipDefaultValueByPN, dataTable_EEPROMDefaultValueByTestPlan, dataTable_DUTCoeffControlByPN);

                Log.SaveLogToTxt("Enable full function of module.");
                supply.OutPutSwitch(true);
                if (!dut.FullFunctionEnable())
                {
                    Log.SaveLogToTxt("Faield to enable full function of module.");
                    return(false);
                }

                //check SN
                for (int i = 0; i < 3; i++)
                {
                    dut_SN = dut.ReadSN();

                    if (Algorithm.CheckSerialNumberFormat(dut_SN))
                    {
                        Log.SaveLogToTxt("Read module' serial number is " + dut_SN);
                        break;
                    }

                    if (i == 2)
                    {
                        Log.SaveLogToTxt("Failed to read module' serial number.");
                        return(false);
                    }
                }

                //check FW
                for (int i = 0; i < 3; i++)
                {
                    dut_FW = dut.ReadFW();

                    if (dut_FW.Length != 4)
                    {
                        Log.SaveLogToTxt("Failed to read module's firmware.");
                        return(false);
                    }

                    if (dut_FW != "0000" && dut_FW != "FFFF")
                    {
                        if (TestPlanParaByPN.IsCheckFW)
                        {
                            if (dut_FW != TestPlanParaByPN.FwVersion)
                            {
                                Log.SaveLogToTxt("Module's firmware does not math.");
                                break;
                            }
                        }
                        break;
                    }
                }

                return(true);
            }
            catch
            {
                Log.SaveLogToTxt("Failed to prepare to test. Please check network.");
                return(false);
            }
        }
Ejemplo n.º 3
0
 public virtual bool Initial(ChipControlByPN tableA, ChipDefaultValueByPN tableB, EEPROMDefaultValueByTestPlan tableC, DUTCoeffControlByPN tableD)
 {
     return(true);
 }