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 = ""; } }
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")); }
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()); } }