public void StorageSource(List <string> list) { HGemConfigFormat SplitHGEMConfig4Data = new HGemConfigFormat(); try { foreach (string tmp in list) { string[] arraySplit = tmp.Split(','); string category = arraySplit[0].Trim(); int index = tmp.IndexOf('='); if (category.ToUpper().IndexOf(Standard.key4Vid) == 0) { string subTmp = tmp.Substring(index + 1).Replace("[", "").Replace("]", ""); outputPrototype data = SplitHGEMConfig4Data.outputVid(subTmp); vidDic.Add(data.ID, data); } else if (category.ToUpper().IndexOf(Standard.key4Event) == 0) { string subTmp = tmp.Substring(index + 1).Replace("[", "").Replace("]", ""); outputPrototype data = SplitHGEMConfig4Data.outputEvent(subTmp); eventDic.Add(data.ID, data); } else if (category.ToUpper().IndexOf(Standard.key4Link) == 0) { string subTmp = tmp.Substring(index + 1 + 1); outputPrototype data = SplitHGEMConfig4Data.outputReportLink(subTmp); linkDic.Add(data.ID, data); } else if (category.ToUpper().IndexOf(Standard.key4Report) == 0) { string subTmp = tmp.Substring(index + 1 + 1); outputPrototype data = SplitHGEMConfig4Data.outputReport(subTmp); reportDic.Add(data.ID, data); } else if (category.ToUpper().IndexOf(Standard.key4Setting) == 0) { string subTmp = tmp.Substring(index + 1).Replace("[", "").Replace("]", ""); SettingType data = SplitHGEMConfig4Data.outputSettings(subTmp); settingDic.Add("TYPE", data); } } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public outputPrototype outputReportLink(string content) { string[] arr = Regex.Split(content, "Reports="); string outputString = string.Empty; outputPrototype data = new outputPrototype(); string[] idArr = arr[0].Replace(",", "").Split('='); data.ID = idArr[1]; string[] valueArr = arr[1].Replace("[", "").Replace("]", "").Split(','); data.VALUE = combination4Output(valueArr, 0); //outputString+= string.Format(list[Standard.key4Report].ToString(), data.ID, data.NAME, data.VALUE); return(data); }
public List <string> getSECSData(outputPrototype data) { List <string> list = new List <string>(); char horizontalTab = '\t'; try { if (data != null) { int indexOfEnd = data.VALUE.IndexOf(';'); string[] values; if (indexOfEnd < 0) { values = data.VALUE.Split(','); } else { values = data.VALUE.Substring(0, indexOfEnd).Split(','); } foreach (string key in values) { outputPrototype vidInfo = getVIDInfo(key); if (vidInfo.TYPE.ToUpper().IndexOf("A") == 0) { list.Add(horizontalTab.ToString() + string.Format(columnString, "A", vidInfo.NAME.Length, vidInfo.NAME, vidInfo.NAME)); } else if (vidInfo.TYPE.ToUpper().IndexOf("L") == 0) { list.Add(horizontalTab.ToString() + columnList); } else { list.Add(horizontalTab.ToString() + string.Format(columnInt, vidInfo.TYPE, 1, 0, vidInfo.NAME)); } } } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(list); }
public outputPrototype outputReport(string content) { string[] arr = Regex.Split(content, "Vids="); outputPrototype data = new outputPrototype(); string[] idAndName = arr[0].Split(','); string[] idArr = idAndName[0].Split('='); data.ID = idArr[1]; string[] nameArr = idAndName[1].Split('='); data.NAME = nameArr[1]; string[] tmp = arr[1].Replace("[", "").Replace("]", "").Split(','); data.VALUE = combination4Output(tmp, 0); // outputString += string.Format(list[Standard.key4Link].ToString(), data.ID, data.VALUE); return(data); }
public outputPrototype outputEvent(string content) { string[] array = content.Split(','); string outputString = string.Empty; outputPrototype data = new outputPrototype(); string[] idArr = array[0].Split('='); data.ID = idArr[1]; string[] nameArr = array[1].Split('='); data.NAME = nameArr[1]; string[] valueArr = array[2].Split('='); data.VALUE = valueArr[1]; //outputString += string.Format(list[Standard.key4Event].ToString(), data.ID, data.NAME, data.VALUE); return(data); }
private Dictionary <string, string> getEventGrop() { Dictionary <string, string> list = new Dictionary <string, string>(); Dictionary <string, outputPrototype> .Enumerator source; try { source = objConvert.getEvent(); while (source.MoveNext()) { string key = source.Current.Key; outputPrototype data = source.Current.Value; list.Add(key, data.NAME); } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return(list); }