public void copy(ThresholdFlg src) { this.type = src.type; this.flg = src.flg; }
public void copy(DevThreshold src) { this.ThresholdsFlg = new System.Collections.Generic.List <ThresholdFlg>(); for (int i = 0; i < src.ThresholdsFlg.Count; i++) { ThresholdFlg src2 = src.ThresholdsFlg[i]; ThresholdFlg item = default(ThresholdFlg); item.copy(src2); this.ThresholdsFlg.Add(item); } this.UIEditFlg = new System.Collections.Generic.List <ThresholdFlg>(); for (int j = 0; j < src.UIEditFlg.Count; j++) { ThresholdFlg src2 = src.UIEditFlg[j]; ThresholdFlg item = default(ThresholdFlg); item.copy(src2); this.UIEditFlg.Add(item); } this.currentThresholds = new System.Collections.Generic.List <stru_CommRange>(); for (int k = 0; k < src.currentThresholds.Count; k++) { stru_CommRange src3 = src.currentThresholds[k]; stru_CommRange item2 = default(stru_CommRange); item2.copy(src3); this.currentThresholds.Add(item2); } this.voltageThresholds = new System.Collections.Generic.List <stru_CommRange>(); for (int l = 0; l < src.voltageThresholds.Count; l++) { stru_CommRange src3 = src.voltageThresholds[l]; stru_CommRange item2 = default(stru_CommRange); item2.copy(src3); this.voltageThresholds.Add(item2); } this.powerThresholds = new System.Collections.Generic.List <stru_CommRange>(); for (int m = 0; m < src.powerThresholds.Count; m++) { stru_CommRange src3 = src.powerThresholds[m]; stru_CommRange item2 = default(stru_CommRange); item2.copy(src3); this.powerThresholds.Add(item2); } this.powerDissThresholds = new System.Collections.Generic.List <stru_CommRange>(); for (int n = 0; n < src.powerDissThresholds.Count; n++) { stru_CommRange src3 = src.powerDissThresholds[n]; stru_CommRange item2 = default(stru_CommRange); item2.copy(src3); this.powerDissThresholds.Add(item2); } this.tempThresholds = new System.Collections.Generic.List <stru_CommRange>(); for (int num = 0; num < src.tempThresholds.Count; num++) { stru_CommRange src3 = src.tempThresholds[num]; stru_CommRange item2 = default(stru_CommRange); item2.copy(src3); this.tempThresholds.Add(item2); } this.HumiThresholds = new System.Collections.Generic.List <stru_CommRange>(); for (int num2 = 0; num2 < src.HumiThresholds.Count; num2++) { stru_CommRange src3 = src.HumiThresholds[num2]; stru_CommRange item2 = default(stru_CommRange); item2.copy(src3); this.HumiThresholds.Add(item2); } this.PressThresholds = new System.Collections.Generic.List <stru_CommRange>(); for (int num3 = 0; num3 < src.PressThresholds.Count; num3++) { stru_CommRange src3 = src.PressThresholds[num3]; stru_CommRange item2 = default(stru_CommRange); item2.copy(src3); this.PressThresholds.Add(item2); } this.commonThresholds = default(DevCommonThreshold); this.commonThresholds.copy(src.commonThresholds); }
private void getThresholds(ref DevModelConfig devinfo, XmlTextReader reader) { devinfo.devThresholds.ThresholdsFlg = new System.Collections.Generic.List <ThresholdFlg>(); devinfo.devThresholds.UIEditFlg = new System.Collections.Generic.List <ThresholdFlg>(); devinfo.devThresholds.currentThresholds = new System.Collections.Generic.List <stru_CommRange>(); devinfo.devThresholds.voltageThresholds = new System.Collections.Generic.List <stru_CommRange>(); devinfo.devThresholds.powerThresholds = new System.Collections.Generic.List <stru_CommRange>(); devinfo.devThresholds.powerDissThresholds = new System.Collections.Generic.List <stru_CommRange>(); devinfo.devThresholds.tempThresholds = new System.Collections.Generic.List <stru_CommRange>(); devinfo.devThresholds.HumiThresholds = new System.Collections.Generic.List <stru_CommRange>(); devinfo.devThresholds.PressThresholds = new System.Collections.Generic.List <stru_CommRange>(); while (reader.Read()) { XmlNodeType nodeType = reader.NodeType; if (nodeType != XmlNodeType.Element) { if (nodeType == XmlNodeType.EndElement) { if (reader.Name.Equals("threshold")) { return; } } } else { if (reader.Name.Equals("readVflag")) { ThresholdFlg item = default(ThresholdFlg); item.type = reader.GetAttribute("type"); item.flg = System.Convert.ToInt32(reader.GetAttribute("flag"), 16); devinfo.devThresholds.ThresholdsFlg.Add(item); } else { if (reader.Name.Equals("UIeditflag")) { ThresholdFlg item2 = default(ThresholdFlg); item2.type = reader.GetAttribute("type"); item2.flg = System.Convert.ToInt32(reader.GetAttribute("flag"), 16); devinfo.devThresholds.UIEditFlg.Add(item2); } else { if (reader.Name.Equals("current")) { stru_CommRange item3 = default(stru_CommRange); item3.type = reader.GetAttribute("type"); item3.id = reader.GetAttribute("id"); item3.range = reader.GetAttribute("range"); devinfo.devThresholds.currentThresholds.Add(item3); } else { if (reader.Name.Equals("voltage")) { stru_CommRange item4 = default(stru_CommRange); item4.type = reader.GetAttribute("type"); item4.id = reader.GetAttribute("id"); item4.range = reader.GetAttribute("range"); devinfo.devThresholds.voltageThresholds.Add(item4); } else { if (reader.Name.Equals("power")) { stru_CommRange item5 = default(stru_CommRange); item5.type = reader.GetAttribute("type"); item5.id = reader.GetAttribute("id"); item5.range = reader.GetAttribute("range"); devinfo.devThresholds.powerThresholds.Add(item5); } else { if (reader.Name.Equals("powerDissipation")) { stru_CommRange item6 = default(stru_CommRange); item6.type = reader.GetAttribute("type"); item6.id = reader.GetAttribute("id"); item6.range = reader.GetAttribute("range"); devinfo.devThresholds.powerDissThresholds.Add(item6); } else { if (reader.Name.Equals("temperature")) { stru_CommRange item7 = default(stru_CommRange); item7.type = reader.GetAttribute("type"); item7.id = reader.GetAttribute("id"); item7.range = reader.GetAttribute("range"); devinfo.devThresholds.tempThresholds.Add(item7); } else { if (reader.Name.Equals("humidity")) { stru_CommRange item8 = default(stru_CommRange); item8.type = reader.GetAttribute("type"); item8.id = reader.GetAttribute("id"); item8.range = reader.GetAttribute("range"); devinfo.devThresholds.HumiThresholds.Add(item8); } else { if (reader.Name.Equals("pressure")) { stru_CommRange item9 = default(stru_CommRange); item9.type = reader.GetAttribute("type"); item9.id = reader.GetAttribute("id"); item9.range = reader.GetAttribute("range"); devinfo.devThresholds.PressThresholds.Add(item9); } } } } } } } } } } } }