public override bool setVapdAndSlope(bosainfo _bosainfo, testinginfo _testinfo, FVA3150 FVA, variables VAR)
        {
            try {
                FVA.Write("INP:WAVE 1490 NM");
                Thread.Sleep(Delay_suyhao);

                _testinfo.SYSTEMLOG += "STEP 1: SET APD voltage & Slope\r\n";
                _testinfo.VAPDRESULT = Parameters.testStatus.Wait.ToString();

                base.Read();
                base.WriteLine("echo set_flash_register 0x" + VAR.APD_00 + VAR.APD_40 + " 0x30 >/proc/pon_phy/debug");
                Thread.Sleep(Delay_modem);
                _testinfo.SYSTEMLOG += string.Format("{0}\r\n", base.Read());

                base.WriteLine("echo set_flash_register 0x" + VAR.APD_80 + VAR.APD_C0 + " 0x34 >/proc/pon_phy/debug");
                Thread.Sleep(Delay_modem);
                _testinfo.SYSTEMLOG += string.Format("{0}\r\n", base.Read());

                VAR.Slope_Up   = Convert.ToInt32((Convert.ToDouble(VAR.Slope_Up) * 100)).ToString("X");
                VAR.Slope_Down = Convert.ToInt32((Convert.ToDouble(VAR.Slope_Down) * 100)).ToString("X");

                base.WriteLine("echo set_flash_register_APD 0x00" + VAR.Slope_Up + " 0x00" + VAR.Slope_Down + " 0x" + (Convert.ToInt32((VAR.Vbr - 3) * 100)).ToString("X") + " >/proc/pon_phy/debug");
                Thread.Sleep(Delay_modem);
                _testinfo.SYSTEMLOG += string.Format("{0}\r\n", base.Read());

                string APD_DAC = "";
                if (VAR.Vbr - 3 >= 30.2 && VAR.Vbr - 3 <= 37.6)
                {
                    APD_DAC = Convert.ToInt32((Math.Round((((VAR.Vbr - 3) - 30.2) / (37.6 - 30.2)) * 64))).ToString("X");
                }
                else if (VAR.Vbr - 3 >= 37.6 && VAR.Vbr - 3 <= 44.9)
                {
                    APD_DAC = Convert.ToInt32((Math.Round((((VAR.Vbr - 3) - 37.6) / (44.9 - 37.6)) * 64) + 64)).ToString("X");
                }
                if (VAR.Vbr - 3 >= 44.9 && VAR.Vbr - 3 <= 50.9)
                {
                    APD_DAC = Convert.ToInt32((Math.Round((((VAR.Vbr - 3) - 44.9) / (50.9 - 44.9)) * 64) + 128)).ToString("X");
                }
                base.WriteLine("echo APD_DAC 0x" + APD_DAC + " >/proc/pon_phy/debug");
                Thread.Sleep(Delay_modem);
                base.WriteLine("echo DDMI_check_8472 >/proc/pon_phy/debug");
                Thread.Sleep(Delay_modem);
                base.WriteLine("echo apd_ctrl >/proc/pon_phy/debug");
                Thread.Sleep(Delay_modem);
                _testinfo.SYSTEMLOG += string.Format("{0}\r\n", base.Read());

                _testinfo.SYSTEMLOG += string.Format("{0}\r\n", "Set APD & Slope: PASS");
                _testinfo.VAPDRESULT = Parameters.testStatus.PASS.ToString();
                return(true);
            }
            catch (Exception ex) {
                _testinfo.VAPDRESULT = Parameters.testStatus.FAIL.ToString();
                _testinfo.SYSTEMLOG += ex.ToString() + "\r\n";
                return(false);
            }
        }
 public override bool calibDDMI(bosainfo _bosainfo, testinginfo _testinfo, FVA3150 FVA, variables VAR)
 {
     try {
         string str = "";
         Thread.Sleep(Delay_modem);
         _testinfo.SYSTEMLOG      += "STEP 3: RX DDMI Calibration\r\n";
         _testinfo.CALIBDDMIRESULT = Parameters.testStatus.Wait.ToString();
         _testinfo.SYSTEMLOG      += "- Thiết lập suy hao để ONT nhận mức Power: -30dBm\r\n";
         VAR.Att = -30 - (Convert.ToDouble(VAR.OLT_Power));
         FVA.Write("ATT " + VAR.Att.ToString() + " DB");
         Thread.Sleep(Delay_suyhao);
         base.WriteLine("echo set_flash_register_DDMI_RxPower 0x0064 0x58 >/proc/pon_phy/debug");
         Thread.Sleep(Delay_modem * 4);
         str = base.Read();
         _testinfo.SYSTEMLOG += str + "\r\n";
         _testinfo.SYSTEMLOG += "- Thiết lập suy hao để ONT nhận mức Power: -20dBm\r\n";
         VAR.Att              = -20 - (Convert.ToDouble(VAR.OLT_Power));
         FVA.Write("ATT " + VAR.Att.ToString() + " DB");
         Thread.Sleep(Delay_suyhao);
         base.WriteLine("echo set_flash_register_DDMI_RxPower 0x03e8 0x54 >/proc/pon_phy/debug");
         Thread.Sleep(Delay_modem * 4);
         str = base.Read();
         _testinfo.SYSTEMLOG += str + "\r\n";
         _testinfo.SYSTEMLOG += "- Thiết lập suy hao để ONT nhận mức Power: -10dBm\r\n";
         VAR.Att              = -10 - (Convert.ToDouble(VAR.OLT_Power));
         FVA.Write("ATT " + VAR.Att.ToString() + " DB");
         Thread.Sleep(Delay_suyhao);
         base.WriteLine("echo set_flash_register_DDMI_RxPower 0x2710 0x50 >/proc/pon_phy/debug");
         Thread.Sleep(Delay_modem * 4);
         str = base.Read();
         _testinfo.SYSTEMLOG      += str + "\r\n";
         _testinfo.CALIBDDMIRESULT = Parameters.testStatus.PASS.ToString();
         _testinfo.SYSTEMLOG      += "DDMI Calibration thành công.\r\n";
         return(true);
     }
     catch (Exception ex) {
         _testinfo.CALIBDDMIRESULT = Parameters.testStatus.FAIL.ToString();
         _testinfo.SYSTEMLOG      += ex.ToString() + "\r\n";
         return(false);
     }
 }
        static bool _loadBosaReport()
        {
            if (globalData.initSetting.BOSAREPORTFILE.Trim().Length == 0)
            {
                return(false);
            }
            //Thread t = new Thread(new ThreadStart(() => {
            //Load data from excel to dataGrid
            DataTable dt = new DataTable();

            dt = BosaReport.readData();

            //Import data from dataGrid to Sql Server (using Sql Bulk)
            int counter = 0;

            globalData.listBosaInfo = new List <bosainfo>();
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string _bosaSN = "", _Ith = "", _Vbr = "";
                _bosaSN = dt.Rows[i].ItemArray[0].ToString().Trim();
                if (_bosaSN.Length > 0 && bosa_SerialNumber_Is_Correct(_bosaSN) == true)
                {
                    _Ith = dt.Rows[i].ItemArray[1].ToString().Trim();
                    _Vbr = dt.Rows[i].ItemArray[5].ToString().Trim();

                    bosainfo _bs = new bosainfo()
                    {
                        BosaSN = _bosaSN, Ith = _Ith, Vbr = _Vbr
                    };
                    globalData.listBosaInfo.Add(_bs);
                    counter++;
                }
            }
            //}));
            //t.IsBackground = true;
            //t.Start();
            return(true);
        }
        //OK
        public override bool calibDDMI(bosainfo _bosainfo, testinginfo _testinfo, FVA3150 FVA, variables VAR)
        {
            double ADC_RX_Point1 = 0;
            double ADC_RX_Point2 = 0;
            double ADC_RX_Point3 = 0;

            double RX_Power1 = 0.5;
            double RX_Power2 = 1;
            double RX_Power3 = 100;

            string Slope_P2 = "";
            string Slope_P1 = "";
            string Offset   = "";

            string value                 = "";
            string value_register        = "";
            bool   Calibration_RX_Result = false;
            string Power_DDMI            = "";

            string attenuation_level_1 = (-33 - double.Parse(VAR.OLT_Power)).ToString();
            string attenuation_level_2 = (-30 - double.Parse(VAR.OLT_Power)).ToString();
            string attenuation_level_3 = (-10 - double.Parse(VAR.OLT_Power)).ToString();

            _testinfo.CALIBDDMIRESULT = Parameters.testStatus.Wait.ToString();

            value = base.Read();
            try {
                for (int i = 0; i < 3; i++)
                {
                    _testinfo.SYSTEMLOG += "Đã thiết lập xong máy suy hao.\r\n";
                    _testinfo.SYSTEMLOG += "OLT phát công suất = -33dBm ~ 0.5uW\r\n";
                    // Thiết lập suy hao mức 1 cho máy điều chỉnh suy hao
                    FVA.set_attenuation_level(attenuation_level_1);
                    _testinfo.SYSTEMLOG += string.Format("Đang thiết lập mức suy hao = {0}\r\n", attenuation_level_1);
                    Thread.Sleep(3000);
                    // Đọc giá trị thanh ghi ADC RX Power:F0-F1
                    // Đổi Hexa -> Decimal, lưu vào biến ADC_RX_Point1
                    //ADC_RX_Point1 = double.Parse(Read_ADC_value_RX("F0"));
                    //MessageBox.Show("Đọc ADC_RX 1");

                    base.Read();
                    base.WriteLine("laser msg --get F0 2");
                    Thread.Sleep(100);
                    value = base.Read();
                    _testinfo.SYSTEMLOG += value + "\r\n";
                    for (int j = 0; j < value.Split('\n').Length; j++)
                    {
                        if (value.Split('\n')[j].Contains("I2C"))
                        {
                            value_register       = value.Split('\n')[j].Split(':')[1].Trim();
                            ADC_RX_Point1        = Convert.ToDouble(HexToDec(value_register).ToString());
                            _testinfo.SYSTEMLOG += "ADC_RX_Point1 = " + ADC_RX_Point1 + "\r\n";
                        }
                    }
                    _testinfo.SYSTEMLOG += "OLT phát công suất = -30dBm ~ 1uW\r\n";
                    // Thiết lập suy hao mức 2 cho máy điều chỉnh suy hao
                    FVA.set_attenuation_level(attenuation_level_2);
                    _testinfo.SYSTEMLOG += "Đang thiết lập mức suy hao = " + attenuation_level_2 + "\r\n";
                    Thread.Sleep(3000);
                    // Đọc giá trị thanh ghi ADC RX Power:F0-F1
                    // Đổi Hexa -> Decimal, lưu vào biến ADC_RX_Point2
                    //ADC_RX_Point2 = double.Parse(Read_ADC_value_RX("F0"));
                    //MessageBox.Show("Đọc ADC_RX 2");
                    base.Read();
                    base.WriteLine("laser msg --get F0 2");
                    Thread.Sleep(100);
                    value = base.Read();
                    _testinfo.SYSTEMLOG += value + "\r\n";
                    for (int j = 0; j < value.Split('\n').Length; j++)
                    {
                        if (value.Split('\n')[j].Contains("I2C"))
                        {
                            value_register       = value.Split('\n')[j].Split(':')[1].Trim();
                            ADC_RX_Point2        = Convert.ToDouble(HexToDec(value_register).ToString());
                            _testinfo.SYSTEMLOG += "ADC_RX_Point2 = " + ADC_RX_Point2 + "\r\n";
                        }
                    }

                    _testinfo.SYSTEMLOG += "OLT phát công suất = -10dBm ~ 100uW\r\n";
                    // Thiết lập suy hao mức 3 cho máy điều chỉnh suy hao
                    FVA.set_attenuation_level(attenuation_level_3);
                    _testinfo.SYSTEMLOG += "Đang thiết lập mức suy hao = " + attenuation_level_3 + "\r\n";
                    Thread.Sleep(3000);
                    // Đọc giá trị thanh ghi ADC RX Power:F0-F1
                    // Đổi Hexa -> Decimal, lưu vào biến ADC_RX_Point3
                    //ADC_RX_Point3 = double.Parse(Read_ADC_value_RX("F0"));
                    //MessageBox.Show("Đọc ADC_RX 3");

                    base.Read();
                    base.WriteLine("laser msg --get F0 2");
                    Thread.Sleep(100);
                    value = base.Read();
                    _testinfo.SYSTEMLOG += value + "\r\n";
                    for (int j = 0; j < value.Split('\n').Length; j++)
                    {
                        if (value.Split('\n')[j].Contains("I2C"))
                        {
                            value_register       = value.Split('\n')[j].Split(':')[1].Trim();
                            ADC_RX_Point3        = Convert.ToDouble(HexToDec(value_register).ToString());
                            _testinfo.SYSTEMLOG += "ADC_RX_Point3 = " + ADC_RX_Point3 + "\r\n";
                        }
                    }

                    //Tính Slope-P2; Slope-P1; Offset
                    Slope_P2             = Calculate_Slope_Offset_Polynomial(2, ADC_RX_Point1, ADC_RX_Point2, ADC_RX_Point3, RX_Power1, RX_Power2, RX_Power3);
                    _testinfo.SYSTEMLOG += "Slope_2 DEC =" + Slope_P2 + "\r\n";
                    Slope_P2             = Convert_SlopeP2_RxToHex(float.Parse(Slope_P2));

                    Slope_P1             = Calculate_Slope_Offset_Polynomial(1, ADC_RX_Point1, ADC_RX_Point2, ADC_RX_Point3, RX_Power1, RX_Power2, RX_Power3);
                    _testinfo.SYSTEMLOG += "Slope_1 DEC =" + Slope_P1 + "\r\n";
                    Slope_P1             = Convert_SlopeP1_RxToHex(float.Parse(Slope_P1));

                    Offset = Calculate_Slope_Offset_Polynomial(0, ADC_RX_Point1, ADC_RX_Point2, ADC_RX_Point3, RX_Power1, RX_Power2, RX_Power3);
                    _testinfo.SYSTEMLOG += "Offset DEC =" + Offset + "\r\n";
                    Offset = Convert_Offset_RxToHex(float.Parse(Offset));
                    _testinfo.SYSTEMLOG += "--\r\n";
                    _testinfo.SYSTEMLOG += "Slope_2 =" + Slope_P2 + "\r\n";
                    _testinfo.SYSTEMLOG += "Slope_1 =" + Slope_P1 + "\r\n";
                    _testinfo.SYSTEMLOG += "Offset =" + Offset + "\r\n";

                    if (Slope_P2 != "NONE" && Slope_P1 != "NONE" && Offset != "NONE")
                    {
                        // Code Write Slope, Offset đến GN25L98
                        _testinfo.SYSTEMLOG += "Thực hiện Write Slope & Offset to EEPROM\r\n";
                        //MessageBox.Show(Slope_P2.Substring(0, 2));
                        Write_To_Register_COM("e2", Slope_P2.Substring(0, 2));
                        Thread.Sleep(delay);
                        //MessageBox.Show(Slope_P2.Substring(2, 2));
                        Write_To_Register_COM("e3", Slope_P2.Substring(2, 2));
                        Thread.Sleep(delay);
                        //MessageBox.Show(Offset.Substring(0, 2));
                        Write_To_Register_COM("e4", Slope_P1.Substring(0, 2));
                        Thread.Sleep(delay);
                        //MessageBox.Show(Offset.Substring(2, 2));
                        Write_To_Register_COM("e5", Slope_P1.Substring(2, 2));
                        Thread.Sleep(delay);
                        //MessageBox.Show(Slope_P2.Substring(0, 2));
                        Write_To_Register_COM("e6", Offset.Substring(0, 2));
                        Thread.Sleep(delay);
                        //MessageBox.Show(Offset.Substring(2, 2));
                        Write_To_Register_COM("e7", Offset.Substring(2, 2));
                        Thread.Sleep(delay);
                        base.Read();
                        base.WriteLine("laser power --rxread");
                        Thread.Sleep(100);
                        Power_DDMI           = base.Read().Split('=')[2].Trim().Substring(0, 5);
                        _testinfo.SYSTEMLOG += "Power_DDMI = " + Power_DDMI + "\r\n";
                        if (Convert.ToDouble(Power_DDMI) > -11 && Convert.ToDouble(Power_DDMI) < -9)
                        {
                            _testinfo.SYSTEMLOG      += "[OK] Hoàn thành Calibration RX Power.\r\n";
                            Calibration_RX_Result     = true;
                            _testinfo.CALIBDDMIRESULT = Parameters.testStatus.PASS.ToString();
                        }
                        else
                        {
                            _testinfo.SYSTEMLOG      += "[FAIL] Lỗi Calibration RX Power.\r\n";
                            Calibration_RX_Result     = false;
                            _testinfo.CALIBDDMIRESULT = Parameters.testStatus.FAIL.ToString();
                        }
                        break;
                    }
                    else
                    {
                        continue;
                    }
                }
            }
            catch (Exception ex) {
                _testinfo.SYSTEMLOG += ex.ToString() + "\r\n";
                _testinfo.SYSTEMLOG += "[ERROR] Lỗi trong quá trình RX Calibration.\r\n";
                //MessageBox.Show(Ex.ToString());
                Calibration_RX_Result     = false;
                _testinfo.CALIBDDMIRESULT = Parameters.testStatus.FAIL.ToString();
            }
            return(Calibration_RX_Result);
        }
        public override bool writeFlash(bosainfo _bosainfo, testinginfo _testinfo)
        {
            string tempStr = "";
            bool   result  = false;

            _testinfo.SYSTEMLOG       += "STEP 7: Save data into Flash\r\n";
            _testinfo.WRITEFLASHRESULT = Parameters.testStatus.Wait.ToString();

            try {
                bool _isOK = false;
                _isOK = base.WriteLineAndWaitComplete("echo set_flash_register 0x07050701 0x94 >/proc/pon_phy/debug", ref tempStr);
                _testinfo.SYSTEMLOG += tempStr + "\r\n";
                if (_isOK == false)
                {
                    goto NG;
                }

                _isOK = base.WriteLineAndWaitComplete("echo save_flash_matrix >/proc/pon_phy/debug", ref tempStr);
                _testinfo.SYSTEMLOG += tempStr + "\r\n";
                if (_isOK == false)
                {
                    goto NG;
                }

                _isOK = base.WriteLineAndWaitComplete("mtd writeflash /tmp/7570_bob.conf 160 656896 reservearea", ref tempStr); //dual band
                _testinfo.SYSTEMLOG += tempStr + "\r\n";
                if (_isOK == false)
                {
                    goto NG;
                }

                int _count = 0;
REPEAT:
                _count++;
                base.WriteLineAndWaitComplete("echo flash_dump >/proc/pon_phy/debug", ref tempStr);
                _testinfo.SYSTEMLOG += tempStr + "\r\n";
                if (tempStr.Contains("0x07050701") == false)
                {
                    if (_count < 3)
                    {
                        goto REPEAT;
                    }
                    result = false;
                }
                else
                {
                    result = true;
                }

                _testinfo.SYSTEMLOG += "Hoàn thành quá trình Calibration.\r\n";
                if (result == false)
                {
                    goto NG;
                }
                goto OK;
            }
            catch (Exception ex) {
                _testinfo.SYSTEMLOG += ex.ToString() + "\r\n";
                goto NG;
            }

OK:
            _testinfo.SYSTEMLOG       += "Write flash thành công.\r\n";
            _testinfo.WRITEFLASHRESULT = Parameters.testStatus.PASS.ToString();
            return(true);

NG:
            _testinfo.SYSTEMLOG       += string.Format("Write flash thất bại. {0}\r\n", _testinfo.ERRORCODE);
            _testinfo.WRITEFLASHRESULT = Parameters.testStatus.FAIL.ToString();
            return(false);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="_flag">True = -37, -31 // -35, -30</param>
        /// <param name="_bosainfo"></param>
        /// <param name="_testinfo"></param>
        /// <param name="FVA"></param>
        /// <param name="VAR"></param>
        /// <returns></returns>
        public override bool checkLOS(bool _flag, bosainfo _bosainfo, testinginfo _testinfo, FVA3150 FVA, variables VAR)
        {
            try {
                string str = "";
                bool   ret1 = false, ret2 = false;
                double value1 = _flag == true ? -37 : -35, value2 = _flag == true ? -31 : -30;
                _testinfo.SYSTEMLOG     += "STEP 6: LOS Check\r\n";
                _testinfo.CHECKLOSRESULT = Parameters.testStatus.Wait.ToString();
                _testinfo.SYSTEMLOG     += string.Format("- LOS Check: Thiết lập suy hao để ONT nhận mức Power: {0}dBm\r\n", value1);

                VAR.Att = value1 - (Convert.ToDouble(VAR.OLT_Power));
                FVA.Write("ATT " + VAR.Att.ToString() + " DB");
                Thread.Sleep(Delay_suyhao);
                base.WriteLine("echo DDMI_check_8472 >/proc/pon_phy/debug");
                Thread.Sleep(Delay_modem);
                base.WriteLine("echo show_BoB_information >/proc/pon_phy/debug");
                Thread.Sleep(Delay_modem);
                str = base.Read();
                _testinfo.SYSTEMLOG += str + "\r\n";
                for (int n = 0; n < str.Split('\n').Length; n++)
                {
                    if (str.Split('\n')[n].Contains("LOS ="))
                    {
                        str = str.Split('\n')[n].Split('=')[1];
                        if (str.Contains("1"))
                        {
                            _testinfo.SYSTEMLOG += string.Format("Check LOS ở {0}dBm: PASS\r\n", value1);
                            ret1 = true;
                            break;
                        }
                        else
                        {
                            _testinfo.SYSTEMLOG += string.Format("Check LOS ở {0}dBm: FAIL\r\n", value1);
                            ret1 = false;
                            break;
                        }
                    }
                }

                if (ret1 == true)
                {
                    _testinfo.SYSTEMLOG += string.Format("- LOS Check: Thiết lập suy hao để ONT nhận mức Power: {0}dBm\r\n", value2);
                    VAR.Att              = value2 - (Convert.ToDouble(VAR.OLT_Power));
                    FVA.Write("ATT " + VAR.Att.ToString() + " DB");
                    Thread.Sleep(Delay_suyhao);
                    base.WriteLine("echo DDMI_check_8472 >/proc/pon_phy/debug");
                    Thread.Sleep(Delay_modem);
                    base.WriteLine("echo show_BoB_information >/proc/pon_phy/debug");
                    Thread.Sleep(Delay_modem);
                    str = base.Read();
                    _testinfo.SYSTEMLOG += str + "\r\n";
                    for (int n = 0; n < str.Split('\n').Length; n++)
                    {
                        if (str.Split('\n')[n].Contains("LOS ="))
                        {
                            str = str.Split('\n')[n].Split('=')[1];

                            if (str.Contains("0"))
                            {
                                _testinfo.SYSTEMLOG += string.Format("Check LOS ở {0}dBm: PASS", value2);
                                ret2 = true;
                                break;
                            }
                            else
                            {
                                _testinfo.SYSTEMLOG += string.Format("Check LOS ở {0}dBm: FAIL", value2);
                                ret2 = false;
                                break;
                            }
                        }
                    }
                }
                _testinfo.CHECKLOSRESULT = ret1 && ret2 == true?Parameters.testStatus.PASS.ToString() : Parameters.testStatus.FAIL.ToString();

                return(ret1 && ret2);
            }
            catch (Exception ex) {
                _testinfo.CHECKLOSRESULT = Parameters.testStatus.FAIL.ToString();
                _testinfo.SYSTEMLOG     += ex.ToString() + "\r\n";
                return(false);
            }
        }
예제 #7
0
 public abstract bool overloadSensitivity(bosainfo _bosainfo, testinginfo _testinfo, FVA3150 FVA, variables VAR);
 //No used
 public override bool setVapdAndSlope(bosainfo _bosainfo, testinginfo _testinfo, FVA3150 FVA, variables VAR)
 {
     throw new NotImplementedException();
 }
 //No used
 public override bool curveDDMI(bosainfo _bosainfo, testinginfo _testinfo, FVA3150 FVA, variables VAR)
 {
     throw new NotImplementedException();
 }
        public override bool overloadSensitivity(bosainfo _bosainfo, testinginfo _testinfo, FVA3150 FVA, variables VAR)
        {
            try {
                string str = "";
                bool   ret1 = false, ret2 = false;
                //------------------------------------------------------------------------------------------//
                _testinfo.SYSTEMLOG     += "STEP 2: RX Power Overload test & Sensivity test\r\n";
                _testinfo.OVERLOADRESULT = Parameters.testStatus.PASS.ToString();
                _testinfo.SYSTEMLOG     += "- Thiết lập suy hao để ONT nhận mức Power: -8dBm\r\n";
                VAR.Att = -8 - (Convert.ToDouble(VAR.OLT_Power));
                FVA.Write("ATT " + VAR.Att.ToString() + " DB");
                Thread.Sleep(Delay_suyhao);

                for (int j = 0; j < 2; j++)
                {
                    base.WriteLine("echo GPON_BER 6 >/proc/pon_phy/debug");
                    Thread.Sleep(Delay_modem * 3);
                    str = base.Read();
                    _testinfo.SYSTEMLOG += str + "\r\n";

                    for (int n = 0; n < str.Split('\n').Length; n++)
                    {
                        if (str.Contains("Pattern Aligned"))
                        {
                            Thread.Sleep(Delay_modem * 3);
                            base.WriteLine("echo err_cnt >/proc/pon_phy/debug");
                            Thread.Sleep(Delay_modem * 2);
                            str = base.Read();
                            _testinfo.SYSTEMLOG += str + "\r\n";

                            for (int m = 0; m < str.Split('\n').Length; m++)
                            {
                                if (str.Contains("0x0"))
                                {
                                    ret1 = true;
                                    _testinfo.SYSTEMLOG += "Test Overload -8dBm: PASS\r\n";
                                    break;
                                }
                                else
                                {
                                    ret1 = false;
                                    _testinfo.SYSTEMLOG += "Test Overload -8dBm: FAIL\r\n";
                                    break;
                                }
                            }
                            break;
                        }
                    }
                    if (ret1 == true)
                    {
                        break;
                    }
                }
                if (ret1 == false)
                {
                    goto END;
                }

                //------------------------------------------------------------------------------------------//
                _testinfo.SYSTEMLOG += "- Thiết lập suy hao để ONT nhận mức Power: -28dBm\r\n";
                VAR.Att              = -28 - (Convert.ToDouble(VAR.OLT_Power));
                FVA.Write("ATT " + VAR.Att.ToString() + " DB");
                Thread.Sleep(Delay_suyhao);

                for (int j = 0; j < 2; j++)
                {
                    base.WriteLine("echo GPON_BER 6 >/proc/pon_phy/debug");
                    Thread.Sleep(Delay_modem * 3);
                    str = base.Read();
                    _testinfo.SYSTEMLOG += str + "\r\n";

                    for (int n = 0; n < str.Split('\n').Length; n++)
                    {
                        if (str.Contains("Pattern Aligned"))
                        {
                            Thread.Sleep(Delay_modem * 3);
                            base.WriteLine("echo err_cnt >/proc/pon_phy/debug");
                            Thread.Sleep(Delay_modem * 2);
                            str = base.Read();
                            _testinfo.SYSTEMLOG += str + "\r\n";

                            for (int m = 0; m < str.Split('\n').Length; m++)
                            {
                                if (str.Contains("0x0"))
                                {
                                    ret2 = true;
                                    _testinfo.SYSTEMLOG += "Test Sensitivity -28dBm: PASS\r\n";
                                    break;
                                }
                                else
                                {
                                    ret2 = false;
                                    _testinfo.SYSTEMLOG += "Test Sensitivity -28dBm: FAIL\r\n";
                                    break;
                                }
                            }
                            break;
                        }

                        else
                        {
                            ret2 = false;
                            _testinfo.SYSTEMLOG += "Test Sensitivity -28dBm FAIL. Kết quả Log không chứa Pattern Aligned\r\n";
                            break;
                        }
                    }
                    if (ret2 == true)
                    {
                        break;
                    }
                    else
                    {
                        continue;
                    }
                }
                goto END;
                //------------------------------------------------------------------------------------------//
END:
                _testinfo.OVERLOADRESULT = ret1 && ret2 == true?Parameters.testStatus.PASS.ToString() : Parameters.testStatus.FAIL.ToString();

                return(ret1 && ret2);
            }
            catch (Exception ex) {
                _testinfo.OVERLOADRESULT = Parameters.testStatus.FAIL.ToString();
                _testinfo.SYSTEMLOG     += ex.ToString() + "\r\n";
                return(false);
            }
        }
예제 #11
0
 public abstract bool writeFlash(bosainfo _bosainfo, testinginfo _testinfo);
예제 #12
0
 public abstract bool checkLOS(bool _flag, bosainfo _bosainfo, testinginfo _testinfo, FVA3150 FVA, variables VAR);
예제 #13
0
 public abstract bool calibLOS(bosainfo _bosainfo, testinginfo _testinfo, FVA3150 FVA, variables VAR, ref bool _flag);
예제 #14
0
 public abstract bool curveDDMI(bosainfo _bosainfo, testinginfo _testinfo, FVA3150 FVA, variables VAR);
        //OK
        public override bool calibLOS(bosainfo _bosainfo, testinginfo _testinfo, FVA3150 FVA, variables VAR, ref bool _flag)
        {
            string result1_LOS       = "";
            string Reg_value_LOS     = "";
            string Reg_value_bin_LOS = "";
            string LOS_bit           = "";
            string LOS_Level         = "";
            //string LOS_Level_Hex = "";
            string LOS_SLEEP_CTRL          = "";
            bool   Tuning_LOS_Level_Result = false;
            bool   Check_LOS_Result        = false;
            bool   Check_SD_Result         = false;
            string attenuation_level       = (-36 - double.Parse(VAR.OLT_Power)).ToString();

            _testinfo.CALIBLOSRESULT = Parameters.testStatus.Wait.ToString();
            _testinfo.SYSTEMLOG     += "Đã thiết lập xong máy suy hao.\r\n";

            FVA.set_attenuation_level(attenuation_level);
            _testinfo.SYSTEMLOG += "Đang thiết lập mức suy hao = " + attenuation_level + "\r\n";
            Thread.Sleep(2000);
            //ONT.Read();
            //base.WriteLine("laser msg --set bc 1 1c");
            base.WriteLine("laser msg --set bc 1 15"); //06.07.2018 đổi từ 1c sang 15 => nhầm code
            Thread.Sleep(100);
            base.WriteLine("laser msg --set 6e 1 44");
            Thread.Sleep(100);
            base.WriteLine("laser msg --set 6e 1 04");
            Thread.Sleep(100);

            base.Read();
            base.WriteLine("laser msg --get bc 1");
            Thread.Sleep(100);
            result1_LOS = base.Read();

            _testinfo.SYSTEMLOG += "result1_LOS: " + result1_LOS + "\r\n";
            //Hien_Thi.Hienthi.SetText(rtb, result1_LOS);

            for (int i = 0; i < result1_LOS.Split('\n').Length; i++)
            {
                if (result1_LOS.Split('\n')[i].Contains("I2C"))
                {
                    Reg_value_LOS     = result1_LOS.Split('\n')[i].Split(':')[1].Trim();
                    Reg_value_bin_LOS = hex2bin(Reg_value_LOS);
                }
            }
            LOS_SLEEP_CTRL = Reg_value_bin_LOS.Substring(0, 1);
            LOS_Level      = Reg_value_bin_LOS.Substring(1, 7);
            //Hien_Thi.Hienthi.SetText(rtb, "LOS_Level_bin = " + LOS_Level);
            base.Read();
            base.WriteLine("laser msg --get 6e 1");
            Thread.Sleep(100);
            result1_LOS = base.Read();
            //Hien_Thi.Hienthi.SetText(rtb, result1_LOS);

            for (int i = 0; i < result1_LOS.Split('\n').Length; i++)
            {
                if (result1_LOS.Split('\n')[i].Contains("I2C"))
                {
                    Reg_value_LOS     = result1_LOS.Split('\n')[i].Split(':')[1].Trim();
                    Reg_value_bin_LOS = hex2bin(Reg_value_LOS);
                }
            }
            LOS_bit = Reg_value_bin_LOS.Substring(6, 1);
            //Hien_Thi.Hienthi.SetText(rtb, "LOS_bit = " + LOS_bit);

            if (LOS_bit == "1")
            {
                for (int m = 0; m < 78; m++)
                {
                    _testinfo.SYSTEMLOG += "...\r\n";
                    _testinfo.SYSTEMLOG += "Điều chỉnh giảm LOS Level\r\n";
                    LOS_Level            = (Convert.ToInt32((LOS_Level), 2) - Convert.ToInt32("1", 2)).ToString("X");
                    _testinfo.SYSTEMLOG += "LOS_Level_new = " + LOS_Level + "\r\n";
                    base.WriteLine("laser msg --set bc 1 " + LOS_Level);
                    Thread.Sleep(100);
                    base.Read();
                    base.WriteLine("laser msg --get bc 1");
                    Thread.Sleep(100);
                    result1_LOS = base.Read();
                    //Hien_Thi.Hienthi.SetText(rtb, result1_LOS);

                    for (int i = 0; i < result1_LOS.Split('\n').Length; i++)
                    {
                        if (result1_LOS.Split('\n')[i].Contains("I2C"))
                        {
                            Reg_value_LOS     = result1_LOS.Split('\n')[i].Split(':')[1].Trim();
                            Reg_value_bin_LOS = hex2bin(Reg_value_LOS);
                        }
                    }
                    LOS_SLEEP_CTRL = Reg_value_bin_LOS.Substring(0, 1);
                    LOS_Level      = Reg_value_bin_LOS.Substring(1, 7);
                    //Hien_Thi.Hienthi.SetText(rtb, "LOS_Level_bin = " + LOS_Level);

                    base.Read();
                    base.WriteLine("laser msg --get 6e 1");
                    Thread.Sleep(100);
                    result1_LOS = base.Read();
                    //Hien_Thi.Hienthi.SetText(rtb, result1_LOS);

                    for (int i = 0; i < result1_LOS.Split('\n').Length; i++)
                    {
                        if (result1_LOS.Split('\n')[i].Contains("I2C"))
                        {
                            Reg_value_LOS     = result1_LOS.Split('\n')[i].Split(':')[1].Trim();
                            Reg_value_bin_LOS = hex2bin(Reg_value_LOS);
                        }
                    }
                    LOS_bit              = Reg_value_bin_LOS.Substring(6, 1);
                    _testinfo.SYSTEMLOG += "LOS_bit = " + LOS_bit + "\r\n";

                    if (LOS_bit == "0")
                    {
                        _testinfo.SYSTEMLOG += "Phát hiện SD. Tiếp tục điều chỉnh tăng LOS Level\r\n";
                        for (int n = 0; n < 58; n++)
                        {
                            _testinfo.SYSTEMLOG += "...\r\n";
                            _testinfo.SYSTEMLOG += "Tiếp tục điều chỉnh tăng LOS Level\r\n";
                            LOS_Level            = (Convert.ToInt32((LOS_Level), 2) + Convert.ToInt32("1", 2)).ToString("X");
                            _testinfo.SYSTEMLOG += "LOS_Level_new = " + LOS_Level + "\r\n";
                            base.WriteLine("laser msg --set bc 1 " + LOS_Level);
                            Thread.Sleep(100);

                            base.Read();
                            base.WriteLine("laser msg --get bc 1");
                            Thread.Sleep(100);
                            result1_LOS = base.Read();
                            //Hien_Thi.Hienthi.SetText(rtb, result1_LOS);

                            for (int i = 0; i < result1_LOS.Split('\n').Length; i++)
                            {
                                if (result1_LOS.Split('\n')[i].Contains("I2C"))
                                {
                                    Reg_value_LOS     = result1_LOS.Split('\n')[i].Split(':')[1].Trim();
                                    Reg_value_bin_LOS = hex2bin(Reg_value_LOS);
                                }
                            }
                            LOS_SLEEP_CTRL = Reg_value_bin_LOS.Substring(0, 1);
                            LOS_Level      = Reg_value_bin_LOS.Substring(1, 7);
                            //Hien_Thi.Hienthi.SetText(rtb, "LOS_Level_bin = " + LOS_Level);

                            base.Read();
                            base.WriteLine("laser msg --get 6e 1");
                            Thread.Sleep(100);
                            result1_LOS = base.Read();
                            //Hien_Thi.Hienthi.SetText(rtb, result1_LOS);

                            for (int i = 0; i < result1_LOS.Split('\n').Length; i++)
                            {
                                if (result1_LOS.Split('\n')[i].Contains("I2C"))
                                {
                                    Reg_value_LOS     = result1_LOS.Split('\n')[i].Split(':')[1].Trim();
                                    Reg_value_bin_LOS = hex2bin(Reg_value_LOS);
                                }
                            }
                            LOS_bit              = Reg_value_bin_LOS.Substring(6, 1);
                            _testinfo.SYSTEMLOG += "LOS_bit = " + LOS_bit + "\r\n";

                            if (LOS_bit == "1")
                            {
                                _testinfo.SYSTEMLOG    += "[OK] Hoàn thành Tuning LOS Level.\r\n";
                                Tuning_LOS_Level_Result = true;
                                break;
                            }
                        }
                        break;
                    }
                }
            }
            else if (LOS_bit == "0")
            {
                for (int m = 0; m < 78; m++)
                {
                    _testinfo.SYSTEMLOG += "...\r\n";
                    _testinfo.SYSTEMLOG += "Điều chỉnh tăng LOS Level\r\n";
                    LOS_Level            = (Convert.ToInt32((LOS_Level), 2) + Convert.ToInt32("1", 2)).ToString("X");
                    _testinfo.SYSTEMLOG += "LOS_Level_new = " + LOS_Level + "\r\n";
                    base.WriteLine("laser msg --set bc 1 " + LOS_Level);
                    Thread.Sleep(100);

                    base.Read();
                    base.WriteLine("laser msg --get bc 1");
                    Thread.Sleep(100);
                    result1_LOS = base.Read();
                    //Hien_Thi.Hienthi.SetText(rtb, result1_LOS);

                    for (int i = 0; i < result1_LOS.Split('\n').Length; i++)
                    {
                        if (result1_LOS.Split('\n')[i].Contains("I2C"))
                        {
                            Reg_value_LOS     = result1_LOS.Split('\n')[i].Split(':')[1].Trim();
                            Reg_value_bin_LOS = hex2bin(Reg_value_LOS);
                        }
                    }
                    LOS_SLEEP_CTRL = Reg_value_bin_LOS.Substring(0, 1);
                    LOS_Level      = Reg_value_bin_LOS.Substring(1, 7);
                    //Hien_Thi.Hienthi.SetText(rtb, "LOS_Level_bin = " + LOS_Level);

                    base.Read();
                    base.WriteLine("laser msg --get 6e 1");
                    Thread.Sleep(100);
                    result1_LOS = base.Read();
                    //Hien_Thi.Hienthi.SetText(rtb, result1_LOS);

                    for (int i = 0; i < result1_LOS.Split('\n').Length; i++)
                    {
                        if (result1_LOS.Split('\n')[i].Contains("I2C"))
                        {
                            Reg_value_LOS     = result1_LOS.Split('\n')[i].Split(':')[1].Trim();
                            Reg_value_bin_LOS = hex2bin(Reg_value_LOS);
                        }
                    }
                    LOS_bit              = Reg_value_bin_LOS.Substring(6, 1);
                    _testinfo.SYSTEMLOG += "LOS_bit = " + LOS_bit + "\r\n";

                    if (LOS_bit == "1")
                    {
                        _testinfo.SYSTEMLOG    += "[OK] Hoàn thành Tuning LOS Level.\r\n";
                        Tuning_LOS_Level_Result = true;
                        break;
                    }
                }
            }


            _testinfo.SYSTEMLOG += string.Format("- Check LOS: -36dBm\r\n");
            FVA.set_attenuation_level((-36 - double.Parse(VAR.OLT_Power)).ToString());
            Thread.Sleep(1000);
            base.Read();
            base.WriteLine("laser msg --get 6e 1");
            Thread.Sleep(100);
            result1_LOS = base.Read();
            for (int i = 0; i < result1_LOS.Split('\n').Length; i++)
            {
                if (result1_LOS.Split('\n')[i].Contains("I2C"))
                {
                    Reg_value_LOS     = result1_LOS.Split('\n')[i].Split(':')[1].Trim();
                    Reg_value_bin_LOS = hex2bin(Reg_value_LOS);
                }
            }
            LOS_bit              = Reg_value_bin_LOS.Substring(6, 1);
            _testinfo.SYSTEMLOG += "LOS_bit = " + LOS_bit + "\r\n";

            if (LOS_bit == "1")
            {
                _testinfo.SYSTEMLOG += "Check LOS: PASS\r\n";
                Check_LOS_Result     = true;
            }

            _testinfo.SYSTEMLOG += "- Check LOS: -33dBm\r\n";
            FVA.set_attenuation_level((-33 - double.Parse(VAR.OLT_Power)).ToString());
            Thread.Sleep(1000);
            base.Read();
            base.WriteLine("laser msg --get 6e 1");
            Thread.Sleep(100);
            result1_LOS = base.Read();
            for (int i = 0; i < result1_LOS.Split('\n').Length; i++)
            {
                if (result1_LOS.Split('\n')[i].Contains("I2C"))
                {
                    Reg_value_LOS     = result1_LOS.Split('\n')[i].Split(':')[1].Trim();
                    Reg_value_bin_LOS = hex2bin(Reg_value_LOS);
                }
            }
            LOS_bit              = Reg_value_bin_LOS.Substring(6, 1);
            _testinfo.SYSTEMLOG += "LOS_bit = " + LOS_bit + "\r\n";

            if (LOS_bit == "0")
            {
                _testinfo.SYSTEMLOG += "Check SD: PASS\r\n";
                Check_SD_Result      = true;
            }

            bool ret = Tuning_LOS_Level_Result && Check_LOS_Result && Check_SD_Result;

            _testinfo.CALIBLOSRESULT = ret == true?Parameters.testStatus.PASS.ToString() : Parameters.testStatus.FAIL.ToString();

            return(ret);
        }
 //No used
 public override bool checkLOS(bool _flag, bosainfo _bosainfo, testinginfo _testinfo, FVA3150 FVA, variables VAR)
 {
     throw new NotImplementedException();
 }
        public override bool curveDDMI(bosainfo _bosainfo, testinginfo _testinfo, FVA3150 FVA, variables VAR)
        {
            try {
                //----------------------------------BƯỚC 4: RX DDMI curve check ------------------------------------
                string str = "";
                bool   ret1 = false, ret2 = false;
                _testinfo.SYSTEMLOG      += "STEP 4: RX DDMI curve check\r\n";
                _testinfo.CURVEDDMIRESULT = Parameters.testStatus.Wait.ToString();
                _testinfo.SYSTEMLOG      += "- Thiết lập suy hao để ONT nhận mức Power: -15dBm\r\n";
                VAR.Att = -15 - (Convert.ToDouble(VAR.OLT_Power));
                FVA.Write("ATT " + VAR.Att.ToString() + " DB");
                Thread.Sleep(Delay_suyhao);
                for (int i = 0; i < 2; i++)
                {
                    base.WriteLine("echo DDMI_check_8472 >/proc/pon_phy/debug");
                    Thread.Sleep(Delay_modem);
                    str = base.Read();
                    _testinfo.SYSTEMLOG += str + "\r\n";
                    for (int n = 0; n < str.Split('\n').Length; n++)
                    {
                        if (str.Split('\n')[n].Contains("Rx Power"))
                        {
                            str = str.Split('\n')[n].Split('=')[1];
                            double RX_DDMI_Temp = Convert.ToDouble(str);
                            RX_DDMI_Temp         = (Math.Log10(RX_DDMI_Temp / 10000)) * 10;
                            _testinfo.SYSTEMLOG += "RX DDMI = " + RX_DDMI_Temp + "\r\n";
                            if (RX_DDMI_Temp > -16.5 && RX_DDMI_Temp < -13.5)
                            {
                                _testinfo.SYSTEMLOG += "Check DDMI -15dBm: PASS\r\n";
                                ret1 = true;
                                break;
                            }
                            else
                            {
                                _testinfo.SYSTEMLOG += "Check DDMI -15dBm: FAIL\r\n";
                                ret1 = false;
                                break;
                            }
                        }
                        else if ((n == str.Split('\n').Length - 1) && !str.Split('\n')[n].Contains("Rx Power"))
                        {
                            _testinfo.SYSTEMLOG += "Check DDMI -15dBm: FAIL\r\n";
                            ret1 = false;
                            break;
                        }
                    }
                    if (ret1 == true)
                    {
                        break;
                    }
                }

                _testinfo.SYSTEMLOG += "- Thiết lập suy hao để ONT nhận mức Power: -25dBm\r\n";
                VAR.Att              = -25 - (Convert.ToDouble(VAR.OLT_Power));
                FVA.Write("ATT " + VAR.Att.ToString() + " DB");
                Thread.Sleep(Delay_suyhao);
                for (int i = 0; i < 2; i++)
                {
                    base.WriteLine("echo DDMI_check_8472 >/proc/pon_phy/debug");
                    Thread.Sleep(Delay_modem);
                    str = base.Read();
                    _testinfo.SYSTEMLOG += str + "\r\n";
                    for (int n = 0; n < str.Split('\n').Length; n++)
                    {
                        if (str.Split('\n')[n].Contains("Rx Power"))
                        {
                            str = str.Split('\n')[n].Split('=')[1];
                            double RX_DDMI_Temp = Convert.ToDouble(str);
                            RX_DDMI_Temp         = (Math.Log10(RX_DDMI_Temp / 10000)) * 10;
                            _testinfo.SYSTEMLOG += "RX DDMI = " + RX_DDMI_Temp + "\r\n";
                            if (RX_DDMI_Temp > -26.5 && RX_DDMI_Temp < -23.5)
                            {
                                _testinfo.SYSTEMLOG += "Check DDMI -25dBm: PASS\r\n";
                                ret2 = true;
                                break;
                            }
                            else
                            {
                                _testinfo.SYSTEMLOG += "Check DDMI -25dBm: FAIL\r\n";
                                ret2 = false;
                                break;
                            }
                        }
                        else if ((n == str.Split('\n').Length - 1) && !str.Split('\n')[n].Contains("Rx Power"))
                        {
                            _testinfo.SYSTEMLOG += "Check DDMI -25dBm: FAIL\r\n";
                            ret2 = false;
                            break;
                        }
                    }
                    if (ret2 == true)
                    {
                        break;
                    }
                }

                _testinfo.CURVEDDMIRESULT = ret1 && ret2 == true?Parameters.testStatus.PASS.ToString() : Parameters.testStatus.FAIL.ToString();

                return(ret1 && ret2);
            }
            catch (Exception ex) {
                _testinfo.CURVEDDMIRESULT = Parameters.testStatus.FAIL.ToString();
                _testinfo.SYSTEMLOG      += ex.ToString() + "\r\n";
                return(false);
            }
        }
 //No used
 public override bool overloadSensitivity(bosainfo _bosainfo, testinginfo _testinfo, FVA3150 FVA, variables VAR)
 {
     throw new NotImplementedException();
 }
 public override bool calibLOS(bosainfo _bosainfo, testinginfo _testinfo, FVA3150 FVA, variables VAR, ref bool _flag)
 {
     try {
         string str = "";
         _testinfo.SYSTEMLOG     += "STEP 5: LOS Calibration\r\n";
         _testinfo.CALIBLOSRESULT = Parameters.testStatus.Wait.ToString();
         base.WriteLine("echo apd_ctrl >/proc/pon_phy/debug");
         Thread.Sleep(Delay_modem);
         base.WriteLine("echo LOS_calibration 7F 00 >/proc/pon_phy/debug");
         Thread.Sleep(Delay_modem);
         str = base.Read();
         _testinfo.SYSTEMLOG += str + "\r\n";
         _testinfo.SYSTEMLOG += "- Thiết lập suy hao để ONT nhận mức Power: -34dBm\r\n";
         VAR.Att              = -34 - (Convert.ToDouble(VAR.OLT_Power));
         FVA.Write("ATT " + VAR.Att.ToString() + " DB");
         Thread.Sleep(Delay_suyhao);
         base.WriteLine("echo cal_LOS >/proc/pon_phy/debug");
         Thread.Sleep(Delay_modem * 4);
         str = base.Read();
         _testinfo.SYSTEMLOG += str + "\r\n";
         _testinfo.SYSTEMLOG += "- Thiết lập suy hao để ONT nhận mức Power: -30dBm\r\n";
         VAR.Att              = -30 - (Convert.ToDouble(VAR.OLT_Power));
         FVA.Write("ATT " + VAR.Att.ToString() + " DB");
         Thread.Sleep(Delay_suyhao);
         base.WriteLine("echo cal_SD >/proc/pon_phy/debug");
         Thread.Sleep(Delay_modem * 4);
         str = base.Read();
         _testinfo.SYSTEMLOG += str + "\r\n";
         base.WriteLine("echo set_flash_register_LOS >/proc/pon_phy/debug");
         Thread.Sleep(Delay_modem * 2);
         str = base.Read();
         if (str.Contains("0x7e"))
         {
             _testinfo.SYSTEMLOG += str + "\r\n";
             _testinfo.SYSTEMLOG += "- Thiết lập suy hao để ONT nhận mức Power: -36dBm\r\n";
             VAR.Att              = -36 - (Convert.ToDouble(VAR.OLT_Power));
             FVA.Write("ATT " + VAR.Att.ToString() + " DB");
             Thread.Sleep(Delay_suyhao);
             base.WriteLine("echo cal_LOS >/proc/pon_phy/debug");
             Thread.Sleep(Delay_modem * 4);
             str = base.Read();
             _testinfo.SYSTEMLOG += str + "\r\n";
             _testinfo.SYSTEMLOG += "- Thiết lập suy hao để ONT nhận mức Power: -32dBm\r\n";
             VAR.Att              = -32 - (Convert.ToDouble(VAR.OLT_Power));
             FVA.Write("ATT " + VAR.Att.ToString() + " DB");
             Thread.Sleep(Delay_suyhao);
             base.WriteLine("echo cal_SD >/proc/pon_phy/debug");
             Thread.Sleep(Delay_modem * 4);
             str = base.Read();
             _testinfo.SYSTEMLOG += str + "\r\n";
             base.WriteLine("echo set_flash_register_LOS >/proc/pon_phy/debug");
             Thread.Sleep(Delay_modem * 2);
             str = base.Read();
             if (str.Contains("0x7e"))
             {
                 _testinfo.SYSTEMLOG     += str + "\r\n";
                 _testinfo.SYSTEMLOG     += "[FAIL] Board gặp trạng thái 7E\r\n";
                 _testinfo.CALIBLOSRESULT = Parameters.testStatus.FAIL.ToString();
             }
             else
             {
                 _testinfo.SYSTEMLOG     += str + "\r\n";
                 _testinfo.SYSTEMLOG     += "[OK] Thực hiện xong LOS Calibration\r\n";
                 _testinfo.CALIBLOSRESULT = Parameters.testStatus.PASS.ToString();
             }
             _flag = true;
         }
         else
         {
             _testinfo.CALIBLOSRESULT = Parameters.testStatus.PASS.ToString();
             _flag = false;
         }
         return(_testinfo.CALIBLOSRESULT == Parameters.testStatus.PASS.ToString());
     }
     catch (Exception ex) {
         _testinfo.CALIBLOSRESULT = Parameters.testStatus.FAIL.ToString();
         _testinfo.SYSTEMLOG     += ex.ToString() + "\r\n";
         return(false);
     }
 }
 //No used
 public override bool writeFlash(bosainfo _bosainfo, testinginfo _testinfo)
 {
     throw new NotImplementedException();
 }
예제 #21
0
 public abstract bool setVapdAndSlope(bosainfo _bosainfo, testinginfo _testinfo, FVA3150 FVA, variables VAR);