Пример #1
0
        public void RefreshData(CardCommService service)
        {
            var arrBasic = InstructionHelper.ExtractData(service.GetCardBasicInfo(), "B").Split('_');

            if (arrBasic.Length == 5)
            {
                Software_Version = arrBasic[3];
                Hardware_Version = arrBasic[4];
            }
            var data = service.GetCardDataInfo();

            if (data.Contains("NOCARD"))
            {
                return;
            }
            //Software_Version = InstructionHelper.ExtractDataFromSet(data, "SV");
            //Hardware_Version = InstructionHelper.ExtractDataFromSet(data, "HV");
            Serial_Number    = InstructionHelper.ExtractDataFromSet(data, "SN");
            Manufacture_Date = InstructionHelper.ExtractDataFromSet(data, "MD");
            if (SFPSet == null)
            {
                SFPSet = new List <SFPModule>();
                for (int i = 1; i <= 8; ++i)
                {
                    SFPModule sfp = new SFPModule
                    {
                        SlotPosition = i
                    };
                    SFPSet.Add(sfp);
                }
            }
            foreach (var sfp in SFPSet)
            {
                sfp.Status                   = int.Parse(InstructionHelper.ExtractDataFromSet(data, string.Format("M{0:D2}_{1}", sfp.SlotPosition, "MS")));
                sfp.Work_Mode                = int.Parse(InstructionHelper.ExtractDataFromSet(data, string.Format("M{0:D2}_{1}", sfp.SlotPosition, "M")));
                sfp.Tx_Power_Control         = int.Parse(InstructionHelper.ExtractDataFromSet(data, string.Format("M{0:D2}_{1}", sfp.SlotPosition, "PC")));
                sfp.Tx_Power                 = double.Parse(InstructionHelper.ExtractDataFromSet(data, string.Format("M{0:D2}_{1}", sfp.SlotPosition, "TXP")));
                sfp.Rx_Power                 = double.Parse(InstructionHelper.ExtractDataFromSet(data, string.Format("M{0:D2}_{1}", sfp.SlotPosition, "RXP")));
                sfp.Module_Wave              = double.Parse(InstructionHelper.ExtractDataFromSet(data, string.Format("M{0:D2}_{1}", sfp.SlotPosition, "W")));
                sfp.Transmission_Distance    = double.Parse(InstructionHelper.ExtractDataFromSet(data, string.Format("M{0:D2}_{1}", sfp.SlotPosition, "TD")));
                sfp.Transmission_Rate        = double.Parse(InstructionHelper.ExtractDataFromSet(data, string.Format("M{0:D2}_{1}", sfp.SlotPosition, "R")));
                sfp.Module_Temperature       = double.Parse(InstructionHelper.ExtractDataFromSet(data, string.Format("M{0:D2}_{1}", sfp.SlotPosition, "T")));
                sfp.Tx_Power_State           = int.Parse(InstructionHelper.ExtractDataFromSet(data, string.Format("M{0:D2}_{1}", sfp.SlotPosition, "TXPA")));
                sfp.Rx_Power_State           = int.Parse(InstructionHelper.ExtractDataFromSet(data, string.Format("M{0:D2}_{1}", sfp.SlotPosition, "RXPA")));
                sfp.Module_Temperature_State = int.Parse(InstructionHelper.ExtractDataFromSet(data, string.Format("M{0:D2}_{1}", sfp.SlotPosition, "TA")));
                sfp.Type  = "SFP+";
                sfp.Alarm = "";
            }
        }
Пример #2
0
        public void RefreshStatus(NMUCommService service)
        {
            Type       = InstructionHelper.ExtractData(service.GetDeviceModel(), "DTP");
            CardStatus = InstructionHelper.ExtractData(service.GetBusinessCardStatus(), "CS");
            MACAddr    = InstructionHelper.ExtractData(service.GetMACAddress(), "MAC");
            if (Type.Length > 0)
            {
                Unit = Convert.ToInt32(Type.Substring(Type.Length - 1));
            }
            var arrStatus = CardStatus.Split('_');

            Slots = new List <Slot>();
            if (arrStatus.Length > 2)
            {
                if (Slots == null)
                {
                    Slots = new List <Slot>();
                }
                else
                {
                    Slots.Clear();
                }
                SlotCount = Convert.ToInt32(arrStatus[0]);
                int index = 2;
                int slot  = 1;
                foreach (var c in arrStatus[1])
                {
                    var card     = "NOCARD";
                    var cardCode = arrStatus[index++];
                    if (cardCode == "0101" || cardCode == "0102" || cardCode == "0103")
                    {
                        card = "OLP";
                    }
                    else if (cardCode == "0301")
                    {
                        card = "EDFA";
                    }
                    else if (cardCode == "0701")
                    {
                        card = "OEO";
                    }
                    Slots.Add(new Slot {
                        SlotNumber = slot++, IsInsert = c == '1', CardType = card
                    });
                }
            }
        }
Пример #3
0
        public void RefreshData(CardCommService service)
        {
            var arrBasic = InstructionHelper.ExtractData(service.GetCardBasicInfo(), "B").Split('_');

            if (arrBasic.Length == 5)
            {
                Software_Version = arrBasic[3];
                Hardware_Version = arrBasic[4];
            }
            var data = service.GetCardDataInfo();

            if (data.Contains("NOCARD"))
            {
                return;
            }
            Work_Mode                      = int.Parse(InstructionHelper.ExtractDataFromSet(data, "M"));
            PUMP_Switch                    = double.Parse(InstructionHelper.ExtractDataFromSet(data, "PSW"));
            Input_Power                    = double.Parse(InstructionHelper.ExtractDataFromSet(data, "PWI"));
            Output_Power                   = double.Parse(InstructionHelper.ExtractDataFromSet(data, "PWO"));
            Input_Power_Limit              = double.Parse(InstructionHelper.ExtractDataFromSet(data, "PIA"));
            Output_Power_Limit             = double.Parse(InstructionHelper.ExtractDataFromSet(data, "POA"));
            Modlue_Temperature_Upper_Limit = double.Parse(InstructionHelper.ExtractDataFromSet(data, "MTU"));
            Modlue_Temperature_Lower_Limit = double.Parse(InstructionHelper.ExtractDataFromSet(data, "MTD"));
            PUMP_Temperature_Upper_Limit   = double.Parse(InstructionHelper.ExtractDataFromSet(data, "PTU"));
            PUMP_Temperature_Lower_Limit   = double.Parse(InstructionHelper.ExtractDataFromSet(data, "PTD"));
            Input_Power_State              = int.Parse(InstructionHelper.ExtractDataFromSet(data, "PIN"));
            Output_Power_State             = int.Parse(InstructionHelper.ExtractDataFromSet(data, "POU"));
            Modlue_Temperature_State       = int.Parse(InstructionHelper.ExtractDataFromSet(data, "MT"));
            PUMP_Temperature_State         = int.Parse(InstructionHelper.ExtractDataFromSet(data, "PT"));
            PUMP_Electric_Current_State    = int.Parse(InstructionHelper.ExtractDataFromSet(data, "PI"));
            //Output_Power_Set = double.Parse(InstructionHelper.ExtractDataFromSet(data, ""));
            Modlue_Temperature = double.Parse(InstructionHelper.ExtractDataFromSet(data, "MTV"));
            Modlue_Voltage     = double.Parse(InstructionHelper.ExtractDataFromSet(data, "MPV"));
            PUMP_Power         = double.Parse(InstructionHelper.ExtractDataFromSet(data, "PPV"));
            PUMP_Temperature   = double.Parse(InstructionHelper.ExtractDataFromSet(data, "PTV"));
            //PUMP_Electric_Current = double.Parse(InstructionHelper.ExtractDataFromSet(data, ""));
            TEC_Electric_Current = double.Parse(InstructionHelper.ExtractDataFromSet(data, "TEC"));
            //Software_Version = InstructionHelper.ExtractDataFromSet(data, "SV");
            //Hardware_Version = InstructionHelper.ExtractDataFromSet(data, "HV");
            Serial_Number    = InstructionHelper.ExtractDataFromSet(data, "SN");
            Manufacture_Date = InstructionHelper.ExtractDataFromSet(data, "MD");
            Device_Type      = InstructionHelper.ExtractDataFromSet(data, "DT");
            Current_Gain     = double.Parse(InstructionHelper.ExtractDataFromSet(data, "CPGV"));
            //Set_Gain = double.Parse(InstructionHelper.ExtractDataFromSet(data, "PGV"));
        }
Пример #4
0
        public void RefreshStatus(NMUCommService service)
        {
            //单一数据处理
            IP_Address  = InstructionHelper.ExtractData(service.GetIPAddress(), "IP");
            Gateway     = InstructionHelper.ExtractData(service.GetGateway(), "GW");
            Subnet_Mask = InstructionHelper.ExtractData(service.GetNetMask(), "MSK");
            //FAN_Status = Convert.ToInt32(InstructionHelper.ExtractData(service.GetFanWorkingStatus(), "FNS"));
            int fan_state = 0;

            int.TryParse(InstructionHelper.ExtractData(service.GetFanWorkingStatus(), "FNS"), out fan_state);
            FAN_Status         = fan_state;
            Software_Version   = InstructionHelper.ExtractData(service.GetDeviceSoftwareVersion(), "SV");
            Hardware_Version   = InstructionHelper.ExtractData(service.GetDeviceHardwareVersion(), "HV");
            Serial_Number      = InstructionHelper.ExtractData(service.GetDeviceProductionSerialNumber(), "SN");
            Manufacturing_Date = InstructionHelper.ExtractData(service.GetDeviceFactoryDate(), "MD");
            //多重数据处理
            var powerStatus = InstructionHelper.ExtractData(service.GetPowerWorkingStatus(), "PWR");

            if (powerStatus.Length == 2)
            {
                Power_1_Status = Convert.ToInt32(powerStatus.Substring(0, 1));
                Power_2_Status = Convert.ToInt32(powerStatus.Substring(1, 1));
            }
        }
Пример #5
0
        public void RefreshData(CardCommService service)
        {
            var basicInfo = InstructionHelper.ExtractData(service.GetCardBasicInfo(), "B");
            var arrInfo   = basicInfo.Split('_');

            if (arrInfo.Length == 5)
            {
                switch (arrInfo[2])
                {
                case "0101":
                    Card_Type = "OLP1:1";
                    break;

                case "0102":
                    Card_Type = "OLP1+1";
                    break;
                }
                Software_Version = arrInfo[3];
                Hardware_Version = arrInfo[4];
            }
            var data = service.GetCardDataInfo();

            if (data.Contains("NOCARD"))
            {
                return;
            }
            Work_Mode       = int.Parse(InstructionHelper.ExtractDataFromSet(data, "M"));
            Current_Channel = int.Parse(InstructionHelper.ExtractDataFromSet(data, "S"));
            R1_Input_Power  = double.Parse(InstructionHelper.ExtractDataFromSet(data, "R1_P"));
            R2_Input_Power  = double.Parse(InstructionHelper.ExtractDataFromSet(data, "R2_P"));
            TX_Input_Power  = double.Parse(InstructionHelper.ExtractDataFromSet(data, "TX_P"));
            //Software_Version = InstructionHelper.ExtractDataFromSet(data, "SV");
            //Hardware_Version = InstructionHelper.ExtractDataFromSet(data, "HV");
            Serial_Number             = InstructionHelper.ExtractDataFromSet(data, "SN");
            Manufacture_Date          = InstructionHelper.ExtractDataFromSet(data, "MD");
            R1_Wave                   = int.Parse(InstructionHelper.ExtractDataFromSet(data, "R1_W"));
            R2_Wave                   = int.Parse(InstructionHelper.ExtractDataFromSet(data, "R2_W"));
            Tx_Wave                   = int.Parse(InstructionHelper.ExtractDataFromSet(data, "TX_W"));
            R1_Switching_Power        = double.Parse(InstructionHelper.ExtractDataFromSet(data, "R1_SP"));
            R2_Switching_Power        = double.Parse(InstructionHelper.ExtractDataFromSet(data, "R2_SP"));
            R1_Alarm_Power            = double.Parse(InstructionHelper.ExtractDataFromSet(data, "R1_AP"));
            R2_Alarm_Power            = double.Parse(InstructionHelper.ExtractDataFromSet(data, "R2_AP"));
            TX_Alarm_Power            = double.Parse(InstructionHelper.ExtractDataFromSet(data, "TX_AP"));
            Back_Mode                 = int.Parse(InstructionHelper.ExtractDataFromSet(data, "ACC"));
            Auto_Back_Delay           = int.Parse(InstructionHelper.ExtractDataFromSet(data, "Q"));
            Switch_Delay              = int.Parse(InstructionHelper.ExtractDataFromSet(data, "Y"));
            Manual_Switch_Channel     = int.Parse(InstructionHelper.ExtractDataFromSet(data, "S"));
            Manual_Back_to_Auto_Delay = int.Parse(InstructionHelper.ExtractDataFromSet(data, "R"));
            Power_Off_Keep_Work_Mode  = int.Parse(InstructionHelper.ExtractDataFromSet(data, "WMH"));

            //
            string almState = InstructionHelper.ExtractDataFromSet(data, "ALM");

            if (almState.Length == 5)
            {
                ALM_State = Convert.ToInt32(almState[0].ToString());
                R1_State  = Convert.ToInt32(almState[1].ToString());
                R2_State  = Convert.ToInt32(almState[2].ToString());
                TX_State  = Convert.ToInt32(almState[3].ToString());
                LS_State  = Convert.ToInt32(almState[4].ToString());
            }
        }