public _Dictionary <string, string> PICSFormatMnemonicsChangeSupport(Dictionary <string, object> dataPICS) { _Dictionary <string, string> PICSSupportFormattedA = new _Dictionary <string, string>(); foreach (KeyValuePair <string, object> tempPICS in dataPICS) { string patt = @"(12)\#(.+)"; Match mc = Regex.Match(tempPICS.Key, patt); if (mc.Success) { _List <string> abc = (_List <string>)tempPICS.Value; if (abc[1] != "") { if (abc[0] == "Y") { PICSSupportFormattedA.Add(abc[1], "True"); } else { PICSSupportFormattedA.Add(abc[1], "False"); } } } } return(PICSSupportFormattedA); }
public void Load() { _Files files = new _Files(); files.ExtName = _Files.用户规则库扩展名; files.DirName = string.Format("{0}库文件\\系统库", this.Parent.Parent.Global.AppFolder.FullName); files.FileName = "用户规则库"; CResult result = new CResult(false); try { FileInfo info = new FileInfo(files.FullName); if (info.Exists) {//文件存在的时候读取 this.m_DataSource = (CFiles.Deserialize(files.FullName) as _UserRules).m_DataSource; } result.Success = true; } catch (Exception ex) { result.Success = false; result.ErrorInformation = ex.Message; } }
public static _List <string> getValIntiligent(string k, _Dictionary <string, string> dic) { _List <string> retkeyval = new _List <string>(); bool notfound = true; string containkey = "0"; string retkey = k; string retval = ""; if (dic.ContainsKey(k)) { notfound = false; retval = dic[k]; containkey = "1"; } if (notfound) { // _v1 Match m1 = Regex.Match(k, @"(.+)\s*\(v(\d)\)", RegexOptions.IgnoreCase); if (m1.Success) { string newkey = m1.Groups[1].ToString().Trim() + "-" + m1.Groups[2].ToString(); if (dic.ContainsKey(newkey) && notfound) { notfound = false; retval = dic[newkey]; retkey = newkey; containkey = "2"; } //lgstr.deb("matched " + k + ":" + newkey+": "+notfound.ToString()); newkey = m1.Groups[1].ToString().Trim(); if (dic.ContainsKey(newkey) && notfound) { notfound = false; retval = dic[newkey]; retkey = newkey; containkey = "3"; } //lgstr.deb("matched " + k + ":" + newkey + ": " + notfound.ToString()); } } if (notfound) { //FDDIV Match m1 = Regex.Match(k, @"[FT]DD\s*(\w+)", RegexOptions.IgnoreCase); string newkey = m1.Groups[1].ToString().Trim(); if (dic.ContainsKey(newkey)) { notfound = false; retval = dic[newkey]; retkey = newkey; containkey = "4"; } } retkeyval.Add(containkey); retkeyval.Add(retkey); retkeyval.Add(retval); retkeyval.Add(k); return(retkeyval); }
/// <summary> /// 导入 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e) { this.openFileDialog1.Title = "导入报表格式"; this.openFileDialog1.Filter = "报表格式(*.RF)|*.RF"; this.openFileDialog1.RestoreDirectory = true; this.openFileDialog1.FileName = "报表格式"; if (this.openFileDialog1.ShowDialog() == DialogResult.OK) { string path = ""; path += System.IO.Path.GetDirectoryName(this.openFileDialog1.FileName) + "\\"; //得到路径 path += System.IO.Path.GetFileName(this.openFileDialog1.FileName); //得到文件名 object m_object = this.BinaryDeserialize(path); if (m_object != null) { ArrayList m_ArrayList = m_object as ArrayList; if (m_ArrayList != null) { _List m_List = new _List(); m_List.AddRange(m_ArrayList.ToArray()); this.m_Report.ReportStencil = m_List; this.Init(); } } } }
public _List <string> carrierNo3(_List <string> inputBand) { _List <string> carrierNo3Output = new _List <string>(); string patt1 = @"^\d+A-\d+A-\d+A$"; string patt2 = @"^\d+A-\d+B$"; string patt3 = @"^\d+B-\d+A$"; string patt4 = @"^\d+A-\d+C$"; string patt5 = @"^\d+C-\d+A$"; string patt6 = @"^\d+D$"; foreach (string temp in inputBand) { var mc1 = Regex.Match(temp, patt1).ToString(); var mc2 = Regex.Match(temp, patt2).ToString(); var mc3 = Regex.Match(temp, patt3).ToString(); var mc4 = Regex.Match(temp, patt4).ToString(); var mc5 = Regex.Match(temp, patt5).ToString(); var mc6 = Regex.Match(temp, patt6).ToString(); if ((mc1 != "") || (mc2 != "") || (mc3 != "") || (mc4 != "") || (mc5 != "") || (mc6 != "")) { carrierNo3Output.Add(temp); } } return(carrierNo3Output); }
public _List <string> getlist(DataRow row, List <int> indexlist) { _List <String> outstringlist = new _List <string>(); foreach (int ind in indexlist) { outstringlist.Add(row[ind].ToString()); } //string outstring = String.Join("\t", outstringlist); return(outstringlist); }
private static _List <string> getListSupportedBand(_List <string> bandlist) { _List <string> supportedBandList = new _List <string>(); foreach (string b in bandlist) { bool sup = StringProcess.bandSupportHelper(b, picsSupBandList); if (sup) { supportedBandList.Add(b); } } return(supportedBandList); }
public _List <string> DLOnlyBand(_List <string> inputBand) { string patternDLOnlyBand = @"29|32|67"; _List <string> DLOnlyBandOutput = new _List <string>(); foreach (string temp in inputBand) { var mcBand = Regex.Match(temp, patternDLOnlyBand).ToString(); if (mcBand != "") { DLOnlyBandOutput.Add(temp); } } return(DLOnlyBandOutput); }
public _List <string> getlist(DataRow row, List <int> indexlist, List <string> extracol) { _List <String> outstringlist = new _List <string>(); foreach (int ind in indexlist) { outstringlist.Add(row[ind].ToString().Replace("\n", "")); } foreach (string extr in extracol) { outstringlist.Add(extr); } //string outstring = String.Join("\t", outstringlist); return(outstringlist); }
private decimal GetZZJ() { IEnumerable <_ObjMetaanalysis> o = null; _List list = this.CurrentBusiness.Current.Reveal.Get(ERevealType.汇总分析); // if (list.Count < 1) return 0.0m; switch (this.CurrentBusiness.Current.ObjectType) { case EObjectType.Default: break; case EObjectType.PROJECT: o = from n in list.Cast <_ObjMetaanalysis>() where n.GetType() == typeof(_ProMetaanalysis) select n; break; case EObjectType.Engineering: o = from n in list.Cast <_ObjMetaanalysis>() where n.GetType() == typeof(_EngMetaanalysis) select n; break; case EObjectType.UnitProject: DataTable dt = (this.CurrentBusiness.Current as _UnitProject).Property.Metaanalysis.Source; DataRow[] rows = dt.Select(""); if (rows.Length > 0) { return(ToolKit.ParseDecimal(rows[0][""])); } else { return(0.0m); } default: break; } if (o.Count() > 0) { return(o.First().ZZJ); } else { return(0.0m); } }
public _Dictionary <string, object> readwholepics() { XmlNodeList allp = xmlDoc.GetElementsByTagName("mappingspec"); _List <int> app_mnem_col = new _List <int>(); foreach (XmlNode pl in allp) { string specnoRaw = pl.ChildNodes[0].InnerText.Trim(); string specno = ""; //specno = "3GPP TS " + specno; // This is because the sheetName has "3GPP TS " as the prefix. if (specnoRaw == "102 230-1") { specno = "ETSI TS " + specnoRaw; } else if (specnoRaw == "tty") { specno = "PTCRB Bearer Agnostic TTY Test"; } else if (specnoRaw == "PTCRB AT Command Test Spec. cov") { specno = "PTCRB AT Command Test Spec# cov"; } else if (specnoRaw == "37.901") { specno = "3GPP TR " + specnoRaw; } else { specno = "3GPP TS " + specnoRaw; } string id = pl.ChildNodes[1].InnerText.Trim(); app_mnem_col.Add(Int16.Parse(pl.ChildNodes[3].InnerText.Trim())); app_mnem_col.Add(Int16.Parse(pl.ChildNodes[2].InnerText.Trim())); lgstr.deb("spec from config: " + specno + " \n\t\t" + app_mnem_col.ToString()); try { // this function will run over the whole pics file and update PICSoutput getValue(specno, id, app_mnem_col); } catch (Exception ex) { lgstr.err("sheet missing in pics: " + specno); } app_mnem_col.Clear(); } return(PICSoutput); }
public static void combinedCond(_Dictionary <string, string> c_logic_map, _Dictionary <string, string> pics_support) { _List <string> cval = new _List <string>(); foreach (KeyValuePair <string, string> temp in c_logic_map) { cval.Add(temp.Key); } foreach (string C in cval) { lgstr.inf("Key Find: " + C + " Val: " + c_logic_map[C]); string evlstr = condCompl(C, c_logic_map, pics_support); lgstr.inf("Key Eval: " + C + " Val: " + evlstr); //lgstr.inf(c_logic_map.ToString()); } }
public _List <string> carrierNo2(_List <string> inputBand) { _List <string> carrierNo2Output = new _List <string>(); string patt1 = @"^\d+A-\d+A$"; string patt2 = @"^\d+[B-C]$"; foreach (string temp in inputBand) { var mc1 = Regex.Match(temp, patt1).ToString(); var mc2 = Regex.Match(temp, patt2).ToString(); if ((mc1 != "") || (mc2 != "")) { carrierNo2Output.Add(temp); } } return(carrierNo2Output); }
public string specIDForBandFun() { string specIdForBand = ""; string specno = ""; XmlNodeList allp = xmlDoc.GetElementsByTagName("mappingspec"); _List <int> mappingInfo = new _List <int>(); foreach (XmlNode pl in allp) { specno = pl.ChildNodes[0].InnerText.Trim(); if (specno == "36.521-2") { specIdForBand = pl.ChildNodes[1].InnerText.Trim(); } } return(specIdForBand); }
// idxcol must be greater or equal 2 and first one is key always //idxcol = [support column , mnemonic col] // PICSoutput has both support and pnemonic public void getValue(string sheetName, string id, _List <int> idxCol) { lg.inf("current PICS Sheet: " + sheetName); bool insidegroup = false; string firstval = ""; ExcelDataSheetTemp = GetExcelData(sheetName); foreach (DataRow dr in ExcelDataSheetTemp.Rows) { _List <string> rowinfo = new _List <string>(); firstval = dr[1].ToString().Trim(); // Considering 2nd column will be used as Item. Hard coding. foreach (int idx in idxCol) { string val; if (idx == -1) { val = ""; } else { val = dr[idx - 1].ToString().Trim().Replace("\n", "").Replace("\r", ""); } if (firstval.ToLower() == "item") { insidegroup = true; } else if (insidegroup && firstval.Trim() == "") { insidegroup = false; } if (insidegroup) { rowinfo.Add(val); } } if (insidegroup && firstval.ToLower() != "item" && firstval != "") { PICSoutput.Add(id + "#" + firstval, rowinfo); string[] def = rowinfo.ToArray(); } } }
public _Dictionary <string, string> PICSFormatChangeSupport(Dictionary <string, object> dataPICS) { // datapics 0 element is support and 1 for pnemonic. _Dictionary <string, string> PICSSupportFormatted = new _Dictionary <string, string>(); foreach (KeyValuePair <string, object> tempPICS in dataPICS) { _List <string> abc = (_List <string>)tempPICS.Value; //string[] def = abc.ToArray(); if (abc[0].ToLower().Trim() == "y") { PICSSupportFormatted.Add(tempPICS.Key, "True"); } else { PICSSupportFormatted.Add(tempPICS.Key, "False"); } } return(PICSSupportFormatted); }
public void getbandicesupport(string icebandsupportall) { dbobj.tablename = "testbandconfig"; DataTable dt = dbobj.getdatatble(); band_vs_icesupport.Clear(); foreach (DataRow row in dt.Rows) { string ba = row["band2"].ToString(); //string icesupport = bandSupportHelper(ba, icebandsupportall) ?"S":"NS"; _List <string> icebandalllst = new _List <string>(icebandsupportall.Split(' ').ToList()); string icesupport = StringProcess.bandSupportHelper(ba, icebandalllst) ? "S" : "NS"; if (!band_vs_icesupport.ContainsKey(ba)) { band_vs_icesupport.Add(ba, icesupport); } } lg.deb("band vs customer band support: \n\t\t\t" + band_vs_icesupport.ToString()); //Debug.Print(band_vs_icesupport.ToString()); // return band_vs_icesupport; }
public static bool bandSupportHelper(string inputBand, _List <string> PICSBandSupportList) { if ((inputBand.ToUpper() == "BI") || (inputBand.ToUpper() == "NI") || (inputBand.ToUpper() == "BA")) { return(true); } //start code here string outputBandHOA1 = ""; string outputBandHOA2 = ""; string outputBandHOB1 = ""; string outputBandHOB2 = ""; string outputBandHOB3 = ""; string outputBandHOB4 = ""; string outputBandHO1 = ""; string outputBandHO2 = ""; string outputBandHO1_3 = ""; string outputBandHO2_3 = ""; string outputBandHO3_3 = ""; bool finaloutputBand = false; string pattEG = @"^[EG]\d+$"; string pattU = @"^[U]\d+$"; Match mcEG = Regex.Match(inputBand, pattEG); Match mcU = Regex.Match(inputBand, pattU); if (mcEG.Success) { inputBand = inputBand.TrimStart('E').TrimStart('G').TrimStart('0'); } else if (mcU.Success) { inputBand = inputBand.TrimStart('U').TrimStart('0'); inputBand = BandProcess.getwbandinroman(inputBand); } string pattSC = @"^(\d|[IVX])+$"; Match mcSC = Regex.Match(inputBand, pattSC); //string pattSCU = @"^[IVX]+$"; //Match mcSCU = Regex.Match(inputBand, pattSCU); string outputBand = inputBand.Trim(); if (mcSC.Success) { if (PICSBandSupportList.Contains(outputBand)) { finaloutputBand = true; } } else { // Basic CA band matching: string pattBasicCA = @"CA_(.+)"; var mcBasicCA = Regex.Match(inputBand, pattBasicCA); string pattULCA = @"CA_(.+)\+(.+)"; var mcULCA = Regex.Match(inputBand, pattULCA); string pattHOA = @"[SD]B_(.+)\-(.+)"; var mcHOA = Regex.Match(inputBand, pattHOA); string pattHOB = @"(.+)\-(.+)\-(.+)\-(.+)"; var mcHOB = Regex.Match(inputBand, pattHOB); string pattHOC = @"FDD(.+)(\D+)"; var mcHOC = Regex.Match(inputBand, pattHOC); string pattHO = @"([EUCG])?(\w+)?\-([EUCG])?(\w+)?"; var mcHO = Regex.Match(inputBand, pattHO); string pattHO_3 = @"([EUCG])?(\w+)?\-([EUCG])?(\w+)?\-([EUCG])?(\w+)?"; var mcHO_3 = Regex.Match(inputBand, pattHO_3); // if (mcBasicCA.Success) { outputBand = mcBasicCA.Groups[1].ToString(); } else if (mcHO_3.Success) { string outputBandHO1_3Temp = mcHO_3.Groups[2].ToString(); outputBandHO1_3 = outputBandHO1_3Temp.TrimStart('0'); string outputBandHO2_3Temp = mcHO_3.Groups[4].ToString(); outputBandHO2_3 = outputBandHO2_3Temp.TrimStart('0'); string outputBandHO3_3Temp = mcHO_3.Groups[6].ToString(); outputBandHO3_3 = outputBandHO3_3Temp.TrimStart('0'); } else if (mcHO.Success) { string outputBandHO1Temp = mcHO.Groups[2].ToString(); outputBandHO1 = outputBandHO1Temp.TrimStart('0'); string outputBandHO2Temp = mcHO.Groups[4].ToString(); outputBandHO2 = outputBandHO2Temp.TrimStart('0'); } // else if (mcULCA.Success) { outputBand = "ULCA_" + mcULCA.Groups[1].ToString(); } else if (mcHOA.Success) { outputBandHOA1 = mcHOA.Groups[1].ToString(); outputBandHOA2 = mcHOA.Groups[2].ToString(); } else if (mcHOB.Success) { outputBandHOB1 = mcHOB.Groups[1].ToString(); outputBandHOB2 = mcHOB.Groups[2].ToString(); outputBandHOB3 = mcHOB.Groups[3].ToString(); outputBandHOB4 = mcHOB.Groups[4].ToString(); } else if (mcHOC.Success) { outputBand = mcHOC.Groups[1].ToString(); } // Band Checking and Producing Boolean Decision: //lgstr.cri("List of Bands from Function:"); //lgstr.cri(PICSBandSupportList.ToString()); if (PICSBandSupportList.Contains(outputBand)) { finaloutputBand = true; } else if (PICSBandSupportList.Contains(outputBandHOA1) && PICSBandSupportList.Contains(outputBandHOA2)) { finaloutputBand = true; } else if (PICSBandSupportList.Contains(outputBandHOB1) && PICSBandSupportList.Contains(outputBandHOB2) && PICSBandSupportList.Contains(outputBandHOB3) && PICSBandSupportList.Contains(outputBandHOB4)) { finaloutputBand = true; } else if (PICSBandSupportList.Contains(outputBandHO1) && PICSBandSupportList.Contains(outputBandHO2)) { finaloutputBand = true; } else if (PICSBandSupportList.Contains(outputBandHO1_3) && PICSBandSupportList.Contains(outputBandHO2_3) && PICSBandSupportList.Contains(outputBandHO3_3)) { finaloutputBand = true; } else { // //lgstr.err("{bandSupportHelper-stringprocess} Band Not Match: " + inputBand); if (!mismatchedbandbandsupporthelper.Contains(inputBand)) { mismatchedbandbandsupporthelper.Add(inputBand); } } } //lgstr.cri("Input band: " + inputBand + ", Output band: " + outputBand + ", Result: " + finaloutputBand); return(finaloutputBand); }
private void uploadDatabase() { EnableButton(false); int testcatcount = 0; //string PICSFileName = "XMM7480_PICS_V1.4.xlsx"; _List <string> fileSpecDataList = new _List <string>(); // File name prefix: Example: 34.121-1_CVL.csv, 34.121-1_TVA_RF.csv, etc. fileSpecDataList.Add("34.123-1"); //fileindex 0 fileSpecDataList.Add("36.523-1"); //fileindex 1 fileSpecDataList.Add("36.521-1"); //fileindex 2 fileSpecDataList.Add("36.521-3"); //fileindex 3 fileSpecDataList.Add("34.121-1"); //fileindex 4 fileSpecDataList.Add("51.010-2"); //fileindex 5 // Chad's specs: fileSpecDataList.Add("31.121-1"); //fileindex 6 fileSpecDataList.Add("31.124-1"); //fileindex 7 fileSpecDataList.Add("34.229-1"); //fileindex 8 fileSpecDataList.Add("51.010-4"); //fileindex 9 used in new code fileSpecDataList.Add("102 230-1"); //fileindex 10 fileSpecDataList.Add("37.571-1"); //fileindex 11 fileSpecDataList.Add("37.571-2"); //fileindex 12 fileSpecDataList.Add("34.171"); //fileindex 13 fileSpecDataList.Add("37.901"); //fileindex 14 fileSpecDataList.Add("tty"); //fileindex 15 fileSpecDataList.Add("at-command"); //fileindex 16 fileSpecDataList.Add("34.122"); //fileindex 17 string[] onever = allver.Split(','); Debug.Print("Database Name: "); Debug.Print(dbobj.DatabaseName); foreach (string ver in onever) { gcfver = ver.Trim(); foreach (string testcat in tc_cat_selected) { testcatcount++; SetLabelstat2(string.Format("{0} {1} {2} [{3}/{4}]", picsver, gcfver, testcat, testcatcount, (tc_cat_selected.Count * onever.Count()))); dbnameprefix = testcat.ToString().ToLower(); GenericParser.filereset.Clear(); if (!dbobj.getconnectionstat()) { dbobj.DatabaseName = dbnameprefix + "testplandb"; dbobj.connectToDatabase(); } else { dbobj.DatabaseName = dbnameprefix + "testplandb"; dbobj.changedb(); } if (dbobj.getconnectionstat()) { apendlog("Connected to : " + dbnameprefix + "testplandb"); versiontable = getfulltable("gcfptcrbver", "ver_gcf_ptcrb_op"); } else { MessageBox.Show("no db connection"); } _List <string> specTRLFiles = new _List <string>(); //_List<string> specTVAFiles = new _List<string>(); //_List<string> specCVLFiles = new _List<string>(); lg.inf("Select :(database) " + dbnameprefix); lg.inf("all spec files" + fileSpecDataList.ToString()); switch (dbnameprefix) { case "rf": List <int> rffiles = new List <int>() { 2, 4, 5 }; foreach (int psf in rffiles) { if ((psf == 4) || (psf == 5)) { specTRLFiles.Add(fileSpecDataList[psf] + "_TRL_RF.txt"); } else { specTRLFiles.Add(fileSpecDataList[psf] + "_TRL.txt"); } } //specTVAFiles.Add(fileSpecDataList[2] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[2] + "_CVL.csv"); // //specTVAFiles.Add(fileSpecDataList[4] + "_TVA_RF.csv"); //specCVLFiles.Add(fileSpecDataList[4] + "_CVL.csv"); // //specTVAFiles.Add(fileSpecDataList[5] + "_TVA_RF.csv"); //specCVLFiles.Add(fileSpecDataList[5] + "_CVL.csv"); break; case "rrm": List <int> rrmfiles = new List <int>() { 3, 4, 17 }; foreach (int psf in rrmfiles) { if (psf == 4) { specTRLFiles.Add(fileSpecDataList[psf] + "_TRL_RRM.txt"); // only 2 has no RF in file } else { specTRLFiles.Add(fileSpecDataList[psf] + "_TRL.txt"); } } //specTVAFiles.Add(fileSpecDataList[3] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[3] + "_CVL.csv"); // //specTVAFiles.Add(fileSpecDataList[4] + "_TVA_RRM.csv"); //specCVLFiles.Add(fileSpecDataList[4] + "_CVL.csv"); // //specTVAFiles.Add(fileSpecDataList[17] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[17] + "_CVL.csv"); break; case "ctps": List <int> psfiles = new List <int>() { 0, 1, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; //List<int> psfiles = new List<int>() { 7}; foreach (int psf in psfiles) { if (psf == 5) { specTRLFiles.Add(fileSpecDataList[psf] + "_TRL_CTPS.txt"); } else { specTRLFiles.Add(fileSpecDataList[psf] + "_TRL.txt"); } } //specTVAFiles.Add(fileSpecDataList[1] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[1] + "_CVL.csv"); // //specTVAFiles.Add(fileSpecDataList[0] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[0] + "_CVL.csv"); // //specTVAFiles.Add(fileSpecDataList[5] + "_TVA_CTPS.csv"); //specCVLFiles.Add(fileSpecDataList[5] + "_CVL.csv"); // //specTVAFiles.Add(fileSpecDataList[6] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[6] + "_CVL.csv"); // //specTVAFiles.Add(fileSpecDataList[7] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[7] + "_CVL.csv"); // //specTVAFiles.Add(fileSpecDataList[8] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[8] + "_CVL.csv"); // ////specTVAFiles.Add(fileSpecDataList[9] + "_TVA.csv"); ////specCVLFiles.Add(fileSpecDataList[9] + "_CVL.csv"); // //specTVAFiles.Add(fileSpecDataList[10] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[10] + "_CVL.csv"); //specTVAFiles.Add(fileSpecDataList[11] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[11] + "_CVL.csv"); //specTVAFiles.Add(fileSpecDataList[12] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[12] + "_CVL.csv"); //specTVAFiles.Add(fileSpecDataList[13] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[13] + "_CVL.csv"); //specTVAFiles.Add(fileSpecDataList[14] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[14] + "_CVL.csv"); //specTVAFiles.Add(fileSpecDataList[15] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[15] + "_CVL.csv"); //specTVAFiles.Add(fileSpecDataList[16] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[16] + "_CVL.csv"); break; case "att": //specTVAFiles.Add(fileSpecDataList[2] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[2] + "_CVL.csv"); // //specTVAFiles.Add(fileSpecDataList[4] + "_TVA_RF.csv"); //specCVLFiles.Add(fileSpecDataList[4] + "_CVL.csv"); // //specTVAFiles.Add(fileSpecDataList[5] + "_TVA_RF.csv"); //specCVLFiles.Add(fileSpecDataList[5] + "_CVL.csv"); break; default: break; case "vzw": //specTVAFiles.Add(fileSpecDataList[1] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[1] + "_CVL.csv"); // //specTVAFiles.Add(fileSpecDataList[0] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[0] + "_CVL.csv"); // //specTVAFiles.Add(fileSpecDataList[5] + "_TVA_CTPS.csv"); //specCVLFiles.Add(fileSpecDataList[5] + "_CVL.csv"); // //specTVAFiles.Add(fileSpecDataList[6] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[6] + "_CVL.csv"); // //specTVAFiles.Add(fileSpecDataList[7] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[7] + "_CVL.csv"); // //specTVAFiles.Add(fileSpecDataList[8] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[8] + "_CVL.csv"); //specTVAFiles.Add(fileSpecDataList[9] + "_TVA.csv"); //specCVLFiles.Add(fileSpecDataList[9] + "_CVL.csv"); // specTVAFiles.Add(fileSpecDataList[10] + "_TVA.csv"); // specCVLFiles.Add(fileSpecDataList[10] + "_CVL.csv"); // specTVAFiles.Add(fileSpecDataList[11] + "_TVA.csv"); // specCVLFiles.Add(fileSpecDataList[11] + "_CVL.csv"); // specTVAFiles.Add(fileSpecDataList[12] + "_TVA.csv"); // specCVLFiles.Add(fileSpecDataList[12] + "_CVL.csv"); // specTVAFiles.Add(fileSpecDataList[13] + "_TVA.csv"); // specCVLFiles.Add(fileSpecDataList[13] + "_CVL.csv"); // specTVAFiles.Add(fileSpecDataList[14] + "_TVA.csv"); // specCVLFiles.Add(fileSpecDataList[14] + "_CVL.csv"); // specTVAFiles.Add(fileSpecDataList[15] + "_TVA.csv"); // specCVLFiles.Add(fileSpecDataList[15] + "_CVL.csv"); // specTVAFiles.Add(fileSpecDataList[16] + "_TVA.csv"); // specCVLFiles.Add(fileSpecDataList[16] + "_CVL.csv"); break; } //PICSParseProcessing.mainprocess(this.textBoxPath.Text, specTVAFiles, specCVLFiles, lg, dbobj, this); PICSParseProcessing.mainprocess(this.textBoxPath.Text, specTRLFiles, lg, dbobj, this); } } /* * */ apendlog("Processing complete"); EnableButton(true); SetLabelstat("Idle"); SetLabelstat2("Task Completed. "); }
static void Main(string[] args) { /* * TwoKeyDictionary<string, string, string> readconf = new TwoKeyDictionary<string, string, string>(); * MISC.readconfig_2kdict("conf\\GCF_BI_IRAT_TC.conf",readconf); * Debug.Print(readconf.ToString()); * Dictionary< * string,string> ab = readconf["36.523-1"]; * _Dictionary<string,string> abc = new _Dictionary<string, string>(ab); * Debug.Print(abc.ToString()); * Dictionary<string, List<string>> t1 = MISC.readconfiglist("conf\\PTCRB_IRAT_band.conf",'\t'); * foreach (KeyValuePair<string , List<string>> kvp in t1) * { * Debug.Print(kvp.Key); * Debug.Print("\t\t"+string.Join(",",kvp.Value)); * } */ Logging lg = new Logging("log.log", 0); MISC.lgstr = lg; _Dictionary <string, string> configdic = MISC.readconfig(@"conf\\config.conf"); string[] excelfilearr_env = configdic["ecfile"].Split(','); string[] sheetnamearr_env = configdic["ecsheet"].Split(','); string printlevelforenvcondition = configdic["envdebprint"]; string bandsupportfile = configdic["bandsupportfile"]; string bandsupportproject = configdic["bandsupportproject"]; bool sheetspecwise = Convert.ToBoolean(configdic["sheetspecwise"]); string[] gcfsheetarr = configdic["gcfsheetarr"].Split(','); string[] gcfarrBI = configdic["gcfbandlistforBI"].Split(','); string[] gcfarrBIM = configdic["gcfbandlistforBIM"].Split(','); string[] gcfarrBIW = configdic["gcfbandlistforBIW"].Split(','); string[] ptcrbspecarr = configdic["ptcrbspecarr"].Trim().Split(','); string[] ptcrbarrBI = configdic["ptcrbbandlistforBI"].Trim().Split(','); string[] ptcrbarrBIW = configdic["ptcrbbandlistforBIW"].Trim().Split(','); _Dictionary <string, string> bandlistdic = MISC.readconfig(bandsupportfile); Debug.Print(bandlistdic.ToString()); Dictionary <string, string[]> prjsupbandlist = MISC.prjsupbl(bandlistdic, bandsupportproject); _List <string> allband = new _List <string>(); _List <string> ulcaband = new _List <string>(); foreach (KeyValuePair <string, string[]> kvp in prjsupbandlist) { if (kvp.Key.ToUpper() == "ULCA") { ulcaband.AddRange(kvp.Value); } else { allband.AddRange(kvp.Value); } lg.deb("key: " + kvp.Key + " val: " + String.Join(" ", kvp.Value)); } lg.inf("All together" + allband.ToString()); MISC.PICSBandSupportList = allband; Dictionary <string, List <string> > spec_tc_env = new Dictionary <string, List <string> >(); for (int xl = 0; xl < excelfilearr_env.Count(); xl++) { string excelfile_env = excelfilearr_env[xl]; string sheetname_env = sheetnamearr_env[xl]; string[] filenamepart = excelfile_env.Split('_'); string spec = filenamepart[0];// +"."+ filenamepart[1]; Debug.Print("spec:" + spec + ":"); spec_tc_env.Add(spec, new List <string>()); ParseExcel envpe = new ParseExcel(excelfile_env); envpe.lgx = lg; DataTable dt_env = envpe.GetExcelData(sheetname_env + "$"); envpe.processenv(dt_env, spec_tc_env, printlevelforenvcondition); } foreach (KeyValuePair <string, List <string> > kvp in spec_tc_env) { lg.war("spec: " + kvp.Key); lg.war("bandlist extreme" + String.Join("#", kvp.Value.ToArray())); } //ParseExcel envcond = new ParseExcel(excelfile_env); Console.WriteLine("This program will parse and process GCF/PTCRB file."); Console.WriteLine("First argument is g/p g=> GCF, p=> PTCRB."); Console.WriteLine("Second argument is file name"); Console.WriteLine("========================================================\n\n"); if (args.Length != 2) { Console.WriteLine("Please add exactly two argument "); } else { string file = args[1]; if (File.Exists(file)) { if (args[0].ToLower() == "g") { //code for gcf here. Console.WriteLine("Now GCF file processing ..."); ParseExcel.BIlist = gcfarrBI; ParseExcel.BIlistW = gcfarrBIW; ParseExcel.BIlistM = gcfarrBIM; ParseExcel pex = new ParseExcel(file, "g"); pex.lgx = lg; pex.cleanupfolder(); //List<string> sheetlist = pex.GetExcelsheetslist(); foreach (string sh in gcfsheetarr) { lg.inf("processing Sheet: " + sh); DataTable dt = pex.GetExcelData(sh + "$"); pex.processgcffile(dt, spec_tc_env); } pex.writeoutput(); Console.WriteLine("Processing done"); } else if (args[0].ToLower() == "p") { //code for ptcrb here. Console.WriteLine("Now PTCRB file processing ..."); ParseExcel.BIlist = ptcrbarrBI; ParseExcel.BIlistW = ptcrbarrBIW; ParseExcel pex = new ParseExcel(file, "p"); pex.lgx = lg; pex.cleanupfolder(); DataTable dt = pex.GetExcelData("Sheet$"); pex.processptcrbfile(dt, spec_tc_env, ptcrbspecarr); pex.writeoutput(); Console.WriteLine("Processing done"); } else { Console.WriteLine("Please use letter g/p as the first argument "); } } else { Console.WriteLine("The file path is invalid"); Debug.Print("file not found"); lg.cri("file not found"); } } }
private static bool Put(_List toRelease) { return(pool.Put(toRelease)); }
public _List <string> fallbackCA(string inputBand) { _List <string> fallbackCAOutput = new _List <string>(); string patt1 = @"(\d+)D"; string patt2 = @"(\d+)A-(\d+)A-(\d+)A"; string patt3 = @"(\d+)C-(\d+)A"; string patt4 = @"(\d+)B-(\d+)A"; string patt5 = @"(\d+)A-(\d+)C"; string patt6 = @"(\d+)A-(\d+)B"; var mc1 = Regex.Match(inputBand, patt1); var mc2 = Regex.Match(inputBand, patt2); var mc3 = Regex.Match(inputBand, patt3); var mc4 = Regex.Match(inputBand, patt4); var mc5 = Regex.Match(inputBand, patt5); var mc6 = Regex.Match(inputBand, patt6); if (mc1.Success) { string res1 = mc1.Groups[1].ToString(); fallbackCAOutput.Add(res1 + "C"); } if (mc2.Success) { string res2A = mc2.Groups[1].ToString(); string res2B = mc2.Groups[2].ToString(); string res2C = mc2.Groups[3].ToString(); fallbackCAOutput.Add(res2A + "A" + "-" + res2B + "A"); fallbackCAOutput.Add(res2A + "A" + "-" + res2C + "A"); fallbackCAOutput.Add(res2B + "A" + "-" + res2C + "A"); } if (mc3.Success) { string res3A = mc3.Groups[1].ToString(); string res3B = mc3.Groups[2].ToString(); fallbackCAOutput.Add(res3A + "C"); fallbackCAOutput.Add(res3A + "A" + "-" + res3B + "A"); } if (mc4.Success) { string res4A = mc4.Groups[1].ToString(); string res4B = mc4.Groups[2].ToString(); fallbackCAOutput.Add(res4A + "B"); fallbackCAOutput.Add(res4A + "A" + "-" + res4B + "A"); } if (mc5.Success) { string res5A = mc5.Groups[1].ToString(); string res5B = mc5.Groups[2].ToString(); fallbackCAOutput.Add(res5B + "C"); fallbackCAOutput.Add(res5A + "A" + "-" + res5B + "A"); } if (mc6.Success) { string res6A = mc6.Groups[1].ToString(); string res6B = mc6.Groups[2].ToString(); fallbackCAOutput.Add(res6B + "B"); fallbackCAOutput.Add(res6A + "A" + "-" + res6B + "A"); } return(fallbackCAOutput); }
/// <summary> /// 筛选相同工料机 /// </summary> /// <param name="info">工料机汇总集合</param> public void DoFilter(_List info) { this.gridControl1.DataSource = info; }
private static _Dictionary <string, string> processRequiredBand(_Dictionary <string, string> band_status_in, string bandapplicability) { _Dictionary <string, string> band_rb = new _Dictionary <string, string>(); _Dictionary <string, string> band_status = new _Dictionary <string, string>(); foreach (KeyValuePair <string, string> keyval in band_status_in) { string b = keyval.Key; string bpatt = @"[FT]DD\s*(\w+)"; Match bc = Regex.Match(keyval.Key, bpatt); if (bc.Success) { b = bc.Groups[1].ToString(); } band_status[b] = keyval.Value; } //this might be used for required band. //_List<string> bandOther = new _List<string> { "CA_4A-12A", "CA_2A-12A", "CA_4A-7A", // "CA_4A-29A", "CA_2A-29A", "CA_4A-5A", "CA_4A-4A", "CA_2A-4A", "CA_2A-5A", // "CA_2A-30A", "CA_5A-30A", "CA_4A-30A", // "CA_30A-29A", "CA_12A-30A", "CA_4A-17A", "CA_2A-17A", // "CA_5A-29A", "CA_7A-7A", "CA_66A-66A", "CA_66B", "CA_66C", "CA_66A-29A","4", "17", "14", "25", "2", "5", "7", "12", "13", "30", "II", "V","IV", "1900", "850"}; //_List<string> bandHO = new _List<string> { "E04-UII", "E04-UV", "E04-UIV", "E17-UII", "E17-UV", "E17-UIV", "E14-UII", "E14-UV", "E14-UIV", "E25-UII", "E25-UV", "E25-UIV", "E02-UII", "E02-UV", "E02-UIV", "E05-UII", "E05-UV", "E05-UIV", "E07-UII", "E07-UV", "E07-UIV", "E12-UII", "E12-UV", "E12-UIV", "E13-UII", "E13-UV", "E13-UIV", "E30-UII", "E30-UV", "E30-UIV", "UII-E04", "UII-E17", "UII-E14", "UII-E25", "UII-E02", "UII-E05", "UII-E07", "UII-E12", "UII-E13", "UII-E30", "UV-E04", "UV-E17", "UV-E14", "UV-E25", "UV-E02", "UV-E05", "UV-E07", "UV-E12", "UV-E13", "UV-E30", "UIV-E04", "UIV-E17", "UIV-E14", "UIV-E25", "UIV-E02", "UIV-E05", "UIV-E07", "UIV-E12", "UIV-E13", "UIV-E30" }; _List <string> intersectprioritybandlist = new _List <string>(); _List <string> statuslist = new _List <string> { "A", "B", "P" }; _List <string> bandlist = new _List <string>(band_status.Keys.ToList <string>()); lgstr.deb("bandlist" + bandlist.ToString()); _List <string> finalbandlist = getListSupportedBand(bandlist); foreach (string bl in bandlist) { //string b = bl; ////_Dictionary<string, string> bb = new _Dictionary<string, string>(); //string bpatt = @"FDD\s*(\w+)"; //Match bc = Regex.Match(bl, bpatt); //if (bc.Success) //{ // b = bc.Groups[1].ToString(); //} band_rb[bl] = "N"; } if (bandapplicability.ToLower() == "all") { foreach (string d in finalbandlist) { band_rb[d] = "Y"; } } else { // filtered with testcase status. generate list for ABP foreach (string d in finalbandlist) { var val = statuslist.Find(x => x == band_status[d]); if (val != null) { intersectprioritybandlist.Add(d); //list of bands which are common within priority bands as per PTCRB } } if (bandapplicability.ToLower() == "single") { foreach (string g in bandOther) { var gval = intersectprioritybandlist.Find(y => y == g.Trim()); if (gval != null) { band_rb[gval] = "Y"; break; } } } else if (bandapplicability.ToLower() == "irat-single") { foreach (string g in bandHO) { var gval = intersectprioritybandlist.Find(y => y == g.Trim()); if (gval != null) { band_rb[gval] = "Y"; break; } } } } lgstr.inf("band_rb: " + band_rb.ToString()); return(band_rb); }
//public static Logging lg; //public static void mainprocess(string filePICSFullPath, _List<string> specTVAFiles, _List<string> specCVLFiles, Logging lg, MySqlDb dbobj, FormUpload frm) public static void mainprocess(string filePICSFullPath, _List <string> specTRLFiles, Logging lg, MySqlDb dbobj, FormUpload frm) { frm.SetProgress(0); frm.apendlog("Started PICS process", 4); lg.deb(" ++++ PICS Process started ++++ "); lg.deb("PICS User File : " + filePICSFullPath); lg.deb("List of CSV files on server spec data: \n\t\t" + specTRLFiles.ToString()); progressint = Convert.ToInt32(progress); //lg.inf("progress: " + progress.ToString() + " t : " + DateTime.Now.ToString("h:mm:ss tt")); // START string curDir = System.Environment.CurrentDirectory; string outputfilename = Path.Combine(curDir, "combinedOutput.csv"); string file_picsmapping = Path.Combine(curDir, "_picsmapping.csv"); string file_picsstatus = Path.Combine(curDir, "_picsstatus.csv"); string icebandall = ""; string icebandulca = ""; string ice4x4MIMO = ""; GenericParser gp = new GenericParser(@filePICSFullPath); List <string> excelsheetlist = MySqlDb.GetExcelsheetslist(@filePICSFullPath); Debug.Print("all sheet name: " + string.Join(" , ", excelsheetlist)); gp.lg = lg; List <int> x = new List <int> { 1, 6 }; //itemno vs [support, pnemonic] Dictionary <string, object> PICSoutput = gp.readwholepics(); // //lg.inf("PICS file Data: itemno vs [support,pnemonic]"); //lg.inf(PICSoutput.ToString()); TwoKeyDictionary <string, string, string> pics_reco_dic = new TwoKeyDictionary <string, string, string>(); _Dictionary <string, string> pics_reco_table; _Dictionary <string, string> PICSFormattedSupportOutput = gp.PICSFormatChangeSupport(PICSoutput); //lg.deb("PICS file Data. calculated to True/False with #"); //lg.deb(PICSFormattedSupportOutput.ToString()); _Dictionary <string, string> PICSmnemonicDic = gp.PICSFormatMnemonicsChangeSupport(PICSoutput); StringProcess.PICSmnemonicDic = PICSmnemonicDic; lg.inf("PICSmnemonicDic only for spec 12 = 102 230 :\n" + PICSmnemonicDic.ToString()); picsSupBandList = gp.PICSSupportedBands(PICSFormattedSupportOutput, PICSoutput); lg.inf("picsSupBandList :\n" + picsSupBandList.ToString()); progress = 2; //lg.inf("progress: " + progress.ToString() + "t : " + DateTime.Now.ToString("h:mm:ss tt")); progressint = Convert.ToInt32(progress); frm.SetProgress(progressint); Dictionary <string, object> RFBandListD = gp.RFBandTableD(PICSFormattedSupportOutput); Dictionary <string, object> RFBandListE = gp.RFBandTableE(PICSFormattedSupportOutput, PICSoutput); TwoKeyDictionary <string, string, string> user_bs_rb_pics = new TwoKeyDictionary <string, string, string>(); dbobj.tablename = "user_bs_rb_pics"; DataTable dt = dbobj.getdatatble(); Debug.Print("Reading Data Table"); foreach (DataRow dr in dt.Rows) { user_bs_rb_pics[dr["bandsupport"].ToString(), dr["requiredband"].ToString()] = dr["id"].ToString(); } //lg.inf("user_bs_rb_pics" + user_bs_rb_pics.ToString()); // user_picsver | picsver -> picssupportedbandlist -> id#gcfver // write user_picsver and get id. this will return picsversionid too. string idpicsver = frm.insertpicsver(picsSupBandList.toCommaList()); DataTable icebanddt = dbobj.getDtFromSqlSt(String.Format("Select icebands, icebands_ulca, 4x4_mimo from user_picsver where id = {0}", idpicsver)); foreach (DataRow row in icebanddt.Rows) { //returnval[row[0].ToString(),row[1].ToString()] = row[2].ToString(); //Debug.Print(row[0].ToString()); icebandall = row[0].ToString(); icebandulca = row[1].ToString(); ice4x4MIMO = row[2].ToString(); break; } lg.inf("customer band from db: (all) " + icebandall); lg.inf("customer band from db:(ulca) " + icebandulca); frm.getbandicesupport(icebandall); //string servDir = @"\\sd-ct-opiot.sn.intel.com\Dropbox\tools\TPG\sampleinput\Specs"; //New Code End progress = 3; progressint = Convert.ToInt32(progress); frm.SetProgress(progressint); int specfilescount = specTRLFiles.Count(); double progressinc = 97 / specfilescount; for (int i = 0; i < specfilescount; i++) { //lg.inf("progress: " + progress.ToString() + " t : " + DateTime.Now.ToString("h:mm:ss tt")); string status = "Processing : " + specTRLFiles[i]; frm.SetLabelstat(status); //string fileNameTVA = specTVAFiles[i]; //string fileNameCVL = specCVLFiles[i]; string filenameTRL = specTRLFiles[i]; string fileTRLPath = Path.Combine(servDir, filenameTRL); gp.clearVar(); // Getting a portion of string: string patt = @"(.+?)_\w+"; var mc = Regex.Match(filenameTRL, patt); string spec = mc.Groups[1].ToString(); //string fileCVLPath = Path.Combine(servDir, fileNameCVL); //string fileTVAPath = Path.Combine(servDir, fileNameTVA); lg.deb("{MainProcess} Processing -> spec: " + spec + "\tfiles: " + filenameTRL.ToString()); frm.apendlog("Processing spec = " + spec, 4); //_Dictionary<string, string> condVsLogicDic = gp.getdictionaryRowCol(1, 0, fileCVLPath); // this function will change condDict make adding hash. (not sure) // itemProcess is not needed for new algo //itemProcess(condVsLogicDic, spec); //lg.inf("{MainProcess} Condition vs. logical exp from server csv for Spec: " + spec); //lg.inf(condVsLogicDic.ToString()); //this will convert item to true false as per PICS // Here, we are changing the conDict according to spec. It is different only for Spec:102.230. //combinedCond(condVsLogicDic, PICSFormattedSupportOutput); //lg.deb(@"{MainProcess} Condition vs T/F after using PICS for Spec: " + spec); //lg.deb(condVsLogicDic.ToString()); // filter spec string to address spec confusion for 51.010 //string spec = spec; //if (spec.StartsWith("51.010")) //{ // spec = "51.010"; //} //lg.inf("tempdebug: spec: " + spec +" new spec: "+ spec); frm.SetLabelstat(status + " db query to get test configuration"); // Database query to get all the info for the spec. from tcconfig table frm.gettable_tcno_spec_id_band(spec); //TwoKeyDictionary<string, string, string> tc_band_sheet = frm.tc_band_sheet; _Dictionary <string, string> tc_des = frm.tc_des; TwoKeyDictionary <string, string, string> tc_band_id = frm.tc_band_id; TwoKeyDictionary <string, string, string> tc_band_status = frm.tc_band_status; _Dictionary <string, string> tc_bandapplicability = frm.tc_bandapplicability; //lg.deb("sheetname from db"+tc_band_sheet.ToString()); //lg.deb("testconfig from DB"); //lg.deb(tc_band_id.ToString()); //lg.deb("tc_bandapplicability from DB"); //lg.deb(tc_bandapplicability.ToString()); //lg.deb("tc_band_status from DB"); //lg.deb(tc_band_status.ToString()); _Dictionary <string, string> TCvsApp = new _Dictionary <string, string>(); _Dictionary <string, string> TCvsAppFiltered = new _Dictionary <string, string>(); _Dictionary <string, string> csvTCvsRel = new _Dictionary <string, string>(); _Dictionary <string, object> TCvsBand = new _Dictionary <string, object>(); TwoKeyDictionary <string, string, string> bsrbidxdic = new TwoKeyDictionary <string, string, string>(); if (File.Exists(fileTRLPath)) { _Dictionary <string, string> dict_logic = new _Dictionary <string, string>(); _Dictionary <string, string> dict_logic_TF = new _Dictionary <string, string>(); _Dictionary <string, string> dict_rel = new _Dictionary <string, string>(); _Dictionary <string, string> dict_de = new _Dictionary <string, string>(); _Dictionary <string, string> dict_pnemonic = new _Dictionary <string, string>(); StringProcess.specDash1 = spec; StringProcess.readconfigpics(); //StringProcess. gp.dict_de = dict_de; gp.dict_logic = dict_logic; gp.dict_logic_TF = dict_logic_TF; gp.dict_pnemonic = dict_pnemonic; gp.dict_rel = dict_rel; GenericParser.picssupport = PICSFormattedSupportOutput; //this will generate logic to TF gp.processlogic(fileTRLPath); if (GenericParser.missingpicsitem.Count > 0) { lg.inf("{MainProcess} Missing Item in pics file:"); lg.war(GenericParser.missingpicsitem.ToString()); } lg.inf("{MainProcess} TC vs True False TRL + pics file:"); lg.inf(dict_logic_TF.ToString()); lg.inf("{MainProcess} TC vs Logic from TRL:"); lg.inf(dict_logic.ToString()); //_Dictionary<string, string> csvTCvsCond; //_Dictionary<string, string> dict_de; //frm.SetLabelstat(status + " process tc vs cond"); //csvTCvsCond = new _Dictionary<string, string>(gp.getdictionaryRowCol(1, 0, fileTVAPath,true)); //frm.SetLabelstat(status + " process tc vs rel"); //csvTCvsRel = new _Dictionary<string, string>(gp.getdictionaryRowCol(2, 0, fileTVAPath,true)); //frm.SetLabelstat(status + " process tc vs Band cond"); //dict_de = new _Dictionary<string, string>(gp.getdictionaryRowCol(3, 0, fileTVAPath,true)); //lg.inf("{MainProcess} TC vs Condion from server csv file:"); //lg.inf(csvTCvsCond.ToString()); // This loop iterates over the configurations obtained from the database progress += progressinc * 0.1; progressint = Convert.ToInt32(progress); double progressinc2 = progressinc * 0.8; int tccount = tc_band_id.getCount(); double progressinc3 = progressinc2 / tccount; //lg.inf(String.Format("progress: {0} ,progressinc: {1}, progressinc2: {2},progressinc3: {3} tccount: {4}", progress, progressinc, progressinc2, progressinc3, tccount)); StringProcess.mismatchedbandbandsupporthelper.Clear(); //read new csv file here //string picslogic = ""; foreach (KeyValuePair <string, Dictionary <string, string> > temp in tc_band_id) {// reading database test case - band vs id start string ms1 = DateTime.Now.Millisecond.ToString(); string s1 = DateTime.Now.Second.ToString(); string tc = temp.Key.Replace(" ", "").ToLower(); string oldTC = tc; string picstmpstr = ""; string picsBand = ""; string picsRel = "Rel: NF"; string picsTCReco = ""; _Dictionary <string, string> band_id = new _Dictionary <string, string>(temp.Value); _List <string> bandsPerTC = new _List <string>(band_id.Keys.ToList()); lg.inf("{MainProcess} List of bands from db for TestCase: " + tc); lg.inf(bandsPerTC.ToString()); // Start: For Remving V1 or V2 from TC string TCvsAppFilteredTempSingle = ""; string pattTC = @"(.*)\s\(v\d+\)"; Match mcTC = Regex.Match(tc, pattTC); if (mcTC.Success) { tc = mcTC.Groups[1].ToString().Trim(); lg.war("TC Converted from old " + oldTC + " to " + tc); frm.apendlog("TC Converted from old " + oldTC + " to " + tc); } // End: For Remving V1 or V2 from TC // for spec 37.901 to match test case after the dash everything should be removed if (spec == "37.901") { tc = tc.Split('-')[0]; } //var tctemplist = dict_logic_TF.Keys.Where(t => t.Trim().Replace(" ", "").ToLower() == tc.Trim().Replace(" ", "").ToLower()); string tcapplicability = ""; foreach (string tctemp in dict_logic_TF.Keys) { if (tctemp.Trim().Replace(" ", "").ToLower() == tc.Trim().Replace(" ", "").ToLower()) { tcapplicability = dict_logic_TF[tctemp]; if (dict_rel.ContainsKey(tctemp)) { picsRel = dict_rel[tctemp]; } //if (dict_logic.ContainsKey(tctemp)) // picslogic = dict_logic[tctemp]; break; } } // checking if csvTCvsCond has the tc(after removing v1/v2) if (tcapplicability != "") { //string tcapplicability = dict_logic_TF[tc].Trim(); if (tcapplicability == "R") { TCvsApp.Add(tc, "R"); picsTCReco = "TC: R"; } else if (tcapplicability == "m") { TCvsApp.Add(tc, "R"); picsTCReco = "TC: R"; } else if (tcapplicability != "") { string dbgexception = " TC = " + tc; //string condCurTC = ""; string resCurTC = tcapplicability; try { // Pass it through a function: addressing special case 51.010-4... //condCurTC = csvTCvsCond[tc]; //dbgexception += "\tcondCurTC = " + condCurTC; // Pass it through a function: //resCurTC = tcapplicability;//dict_logic_TF[tc]; //resCurTC = StringProcess.TCVsTF(condCurTC, condVsLogicDic); dbgexception += "\tresCurTC = " + resCurTC; //lg.deb("Result from condition map: " + resCurTC + "for TestCase: " + tc); if (!TCvsApp.ContainsKey(tc)) { TCvsApp.Add(tc, resCurTC); } TCvsAppFilteredTempSingle = gp.TCvsAppRefined(resCurTC); if (!TCvsAppFiltered.ContainsKey(tc)) { TCvsAppFiltered.Add(tc, TCvsAppFilteredTempSingle); } dbgexception += "\tresCurTCFiltered = " + TCvsAppFilteredTempSingle; picsTCReco = "TC: " + TCvsAppFilteredTempSingle; } catch (Exception ex) { lg.err("{MainProcess} Exception: " + ex.Message + "\n\t\t\t" + dbgexception); picsTCReco = "TC: X"; frm.apendlog(ex.Message, 2); } } } else { // tc is not in the dictionary. csvTCvsCond.ContainsKey(tc) if (spec == "tty") { picsTCReco = "TC: R"; } else { picsTCReco = "TC: -"; lg.war("{MainProcess} CSVOutputTCApp KeyNotFound = " + tc); frm.apendlog("TC missing : " + tc, 3); } } _List <string> bandListDE = new _List <string>(); //_List<string> keyInTCvsRel = new _List<string>(csvTCvsRel.Keys.ToList()); //if (csvTCvsRel.ContainsKey(tc)) // picsRel = csvTCvsRel[tc]; if (spec == "36.521-1") { if (dict_de.ContainsKey(tc)) { patt = @"([DE])\d+"; var mc1 = Regex.Match(dict_de[tc], patt); string res = mc1.Groups[1].ToString(); if (res == "D") { List <string> bandListD = new List <string>(); if (RFBandListD.ContainsKey(dict_de[tc])) { bandListD = (List <string>)RFBandListD[dict_de[tc]]; } TCvsBand.Add(tc, bandListD); foreach (string bandVal in bandListD) { bandListDE.Add(bandVal); } } else if (res == "E") { List <string> bandListE = new List <string>(); if (RFBandListE.ContainsKey(dict_de[tc])) { bandListE = (List <string>)RFBandListE[dict_de[tc]]; } TCvsBand.Add(tc, bandListE); foreach (string bandVal in bandListE) { bandListDE.Add(bandVal); } } } else { lg.war("{MainProcess} CSVOutputTCBand KeyNotFound = " + tc); frm.apendlog("TC missing :: " + tc, 3); } lg.inf("DE Check: " + tc + " band list: " + bandListDE.ToString()); //frm.apendlog("bandlist error " + tc, 1); } _Dictionary <string, string> band_status = new _Dictionary <string, string>(frm.tc_band_status[oldTC]); lg.inf(" " + band_status.ToString()); bandHO = frm.rb_order_ho_str.Split(','); bandOther = frm.rb_order_other_str.Split(','); _Dictionary <string, string> band_rb = processRequiredBand(band_status, tc_bandapplicability[oldTC]); foreach (KeyValuePair <string, string> kvp in band_id) { string band_id_key = kvp.Key; string band_id_val = kvp.Value; string band_rb_val = "E"; _List <string> modifiedband = StringProcess.getValIntiligent(band_id_key, band_rb); band_rb_val = modifiedband[2]; if (modifiedband[0] != "1") { lg.inf("bandchange" + modifiedband.ToString()); } string pics_reco_str = picstmpstr; picsBand = ""; bool isSuppBand = StringProcess.bandSupportHelper(band_id_key, picsSupBandList); if ((frm.testcat == "rf") || (frm.testcat == "att") || (frm.testcat == "vzw") || (frm.testcat == "cmcc")) { band_rb_val = ""; } if (spec == "36.521-1") { //string PICSRecoBand = ""; bool PICSRecoBand = StringProcess.bandSupportHelper(band_id_key, bandListDE); //lg.cri("After call: " + tc + " band list: " + bandListDE.ToString()); if (PICSRecoBand) { //picsBand = "Band: R"; picsBand = ""; } else { picsBand = "Band: NR"; } if (tc.StartsWith("8") | tc.StartsWith("9")) { picsBand = ""; } //if ((tc_band_sheet[tc, band_id_key] == "LTE_UL_CA") || ((tc_band_sheet[tc, band_id_key] == "64QAM"))) string desc = tc_des[tc].ToLower(); if (desc.Contains("64qam") || desc.Contains("dl ca and ul ca")) { string pattULCA = @"CA_(\d+[A-E])"; Match mcULCA = Regex.Match(band_id_key, pattULCA); if (mcULCA.Success) { string band_id_key_mod = "UL" + band_id_key; if (picsSupBandList.Contains(band_id_key_mod)) { isSuppBand = true; } } } } picsRel = picsRel.Replace(",", " "); if (picsTCReco != "") { if (pics_reco_str == "") { pics_reco_str += picsTCReco; } else { pics_reco_str += ", " + picsTCReco; } } if (picsRel != "") { if (pics_reco_str == "") { pics_reco_str += picsRel; } else { pics_reco_str += ", " + picsRel; } } if (picsBand != "") { if (pics_reco_str == "") { pics_reco_str += picsBand; } else { pics_reco_str += ", " + picsBand; } } //if (picsRel.ToLower().Contains("only")) // pics_reco_str += ",Rel:NR"; //r(?:el)?(?:ease)?[-\s]?\d+\s*(?:to|and)\s*r(?:el)?(?:ease)?[-\s]?(\d+)\s*only //\s*r(?:el)?(?:ease)?[-\s]?(\d+)\s*only // rel 2 to rel 6 // string relpatt = @"(?:r(?:el)?(?:ease)?[-\s]?\d+\s*(?:to|and)\s*)?r(?:el)?(?:ease)?[-\s]?(\d+)\s*only"; // Match relm = Regex.Match(picsRel, relpatt,RegexOptions.IgnoreCase); // if (relm.Success) // { // int rel = int.Parse(relm.Groups[1].ToString()); // if ((rel < 90) && (rel < int.Parse(uerelease))) // { // pics_reco_str += ", Rel:NR"; // } // // } string PICSSuppBand = "NS"; if (isSuppBand) { PICSSuppBand = "S"; } string idstr = "-1"; if (user_bs_rb_pics.ContainsKey(PICSSuppBand, band_rb_val)) { idstr = user_bs_rb_pics[PICSSuppBand, band_rb_val]; } else { lg.cri("no key found: picssupband" + PICSSuppBand + " requiredband " + band_rb_val + "\n" + user_bs_rb_pics.ToString()); frm.apendlog("pics support band and requiredband process failed for band:" + band_id_key, 1); } if (!bsrbidxdic.ContainsKey(oldTC, band_id_key)) { bsrbidxdic[oldTC, band_id_key] = idstr; } // user_picsstatus | picsstatus // //string idstr = FormUpload.getid_Reco(pics_reco_table, PICSOutputStr); if (!pics_reco_dic.ContainsKey(oldTC, band_id_val)) { pics_reco_dic[oldTC, band_id_val] = pics_reco_str; } GenericParser.writetocsv(file_picsstatus, pics_reco_str + "\t"); pics_reco_str = String.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}", band_id_key, oldTC, band_id_val, pics_reco_str, PICSSuppBand, idstr); GenericParser.writetocsv(outputfilename, pics_reco_str); lg.deb("FinalOutput: " + tc + " Result: " + pics_reco_str); } progress += progressinc3; if (progressint < Convert.ToInt32(progress)) { progressint = Convert.ToInt32(progress); frm.SetProgress(progressint); } progressint = Convert.ToInt32(progress); }// reading database test case - band vs id end lg.war("Missing Bands from 'picsSupBandList':\n\t\t " + string.Join(" ", StringProcess.mismatchedbandbandsupporthelper)); // GET user_picsstatus table here. as a dictionary. dbobj.tablename = "user_picsstatus"; file_picsstatus = file_picsstatus.Replace(@"\", @"/"); dbobj.insertfile(file_picsstatus, "picsstatus"); pics_reco_table = frm.getfulltable("user_picsstatus", "picsstatus"); //lg.deb("PICS Reco String table from DB"); //lg.deb(pics_reco_table.ToString()); //lg.deb("rb_sb"); //lg.deb(bsrbidxdic.ToString()); //lg.deb("tcr: " + pics_reco_table["TC: R, REL-8"]); foreach (KeyValuePair <string, Dictionary <string, string> > temp in tc_band_id) { string tc = temp.Key.Replace(" ", ""); _Dictionary <string, string> band_id = new _Dictionary <string, string>(temp.Value); foreach (KeyValuePair <string, string> kvp in band_id) { string picsrecoid = "-1"; string bsrbidx = "-1"; string band_id_key = kvp.Key; string band_id_val = kvp.Value; string pics_reco_str = pics_reco_dic[tc, band_id_val]; string picslogic = ""; if (dict_logic.ContainsKey(tc)) { picslogic = dict_logic[tc]; } else { picslogic = ""; lg.war("logicstring error" + tc); } //------converting REL to Rel - start--------- foreach (KeyValuePair <string, string> kvp1 in pics_reco_table) { string picsstringdb = kvp1.Key; if (picsstringdb.ToLower().Trim() == pics_reco_str.ToLower().Trim()) { picsrecoid = kvp1.Value; } } //if (pics_reco_table.ContainsKey(pics_reco_str)) //{ // picsrecoid = pics_reco_table[pics_reco_str]; //} //else if (picsrecoid == "-1") { lg.cri("No Key for " + pics_reco_str); lg.deb(pics_reco_table.ToString()); } if (bsrbidxdic.ContainsKey(tc, band_id_key)) { bsrbidx = bsrbidxdic[tc, band_id_key]; } else { lg.cri(String.Format("Missing ID for BS: {0} and RB : {1}", tc, band_id_key)); lg.deb(bsrbidxdic.ToString()); } string picsbs = frm.band_vs_icesupport[band_id_key]; if (spec == "36.521-1") { //if ((tc_band_sheet[tc, band_id_key] == "LTE_ UL_CA") || ((tc_band_sheet[tc, band_id_key] == "64QAM"))) string desc = tc_des[tc].ToLower(); if (desc.Contains("64qam") || desc.Contains("dl ca and ul ca")) { string band_id_key_mod = band_id_key.ToUpper().Replace("CA_", ""); if (BandProcess.containstheword(icebandulca, band_id_key_mod)) { picsbs = "S"; } else { picsbs = "NS"; } } if (desc.Contains("x4") || desc.Contains("4 rx")) { string band_id_key_mod = band_id_key.ToUpper().Replace("CA_", ""); if (BandProcess.containstheword(ice4x4MIMO, band_id_key_mod)) { picsbs = "S"; } else { picsbs = "NS"; } } } string map_str = String.Format("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t", idpicsver, bsrbidx, picsrecoid, band_id_val, picsbs, picslogic); GenericParser.writetocsv(file_picsmapping, map_str); } } progress += progressinc * 0.1; progressint = Convert.ToInt32(progress); //lg.inf("progress: " + progress.ToString() + "t : " + DateTime.Now.ToString("h:mm:ss tt")); frm.SetProgress(progressint); dbobj.tablename = "user_picsmappingtable"; file_picsmapping = file_picsmapping.Replace(@"\", @"/"); frm.SetLabelstat(status + " uploading pics information to db"); dbobj.insertfile(file_picsmapping, String.Format("`{0}`,`{1}`,`{2}`,`{3}`,`{4}`,`{5}`", "id#pics", "id#bsrb", "id#picsstat", "id#v_comb_serv_info", "icebs", "PICSLogic")); frm.SetLabelstat(status + " Uploading pics Complete"); } else { lg.cri("{MainProcess} File Does not exist ! =>" + filenameTRL); Debug.Print("File " + filenameTRL + " NOT found!"); frm.apendlog("File " + filenameTRL + " NOT found!", 1); } //////lg.inf("{MainProcess} TC (from db) vs App: RAW"); //////lg.inf("======================"); //////lg.inf(TCvsApp.ToString()); //////lg.deb("{MainProcess} TC (from db) vs App: FILTERED"); //////lg.deb("======================"); //////lg.deb(TCvsAppFiltered.ToString()); //////lg.cri("Band Support: Verification:"); //////lg.cri(TCBandSupport.ToString()); // End of the Loop: } progress = 100; progressint = Convert.ToInt32(progress); frm.SetProgress(progressint); frm.SetLabelstat("Idle"); // END }
// RF CA Bands Table E: public Dictionary <string, object> RFBandTableE(Dictionary <string, string> PICSItemSupportFormatted, Dictionary <string, object> PICSFull) { string specIdForBand = specIDForBandFun(); string pattern4613UL = specIdForBand + @"\#\bA\.4\.6\.1\-3\/(\d+\w)_UL\b"; string pattern4613ULValue = @"CA.+"; string pattern4623UL = specIdForBand + @"\#\bA\.4\.6\.2\-3\/(\d+\w\-\d+\w)_UL\b"; string pattern4623ULValue = @"CA.+"; string pattern4633UL = specIdForBand + @"\#\bA\.4\.6\.3\-3\/(\d+\w\-\d+\w\-?(?:\d+)?\w?\-?(?:\d+)?\w?)_UL\b"; string pattern4633ULValue = @"CA.+"; string pattern4634UL = specIdForBand + @"\#\bA\.4\.6\.3\-4\/(\d+\w\-\d+\w\-?(?:\d+)?\w?\-?(?:\d+)?\w?)_UL\b"; string pattern4634ULValue = @"CA.+"; string pattern4635UL = specIdForBand + @"\#\bA\.4\.6\.3\-5\/(\d+\w\-?(?:\d+)?\w?\-?(?:\d+)?\w?\-?(?:\d+)?\w?)_UL\b"; string pattern4635ULValue = @"CA.+"; _List <string> BandList4613UL = new _List <string>(); _List <string> BandList4623UL = new _List <string>(); _List <string> BandList4633UL = new _List <string>(); _List <string> BandList4634UL = new _List <string>(); _List <string> BandList4635UL = new _List <string>(); Dictionary <string, object> EList = new Dictionary <string, object>(); foreach (KeyValuePair <string, object> temp in PICSFull) { var mc4613UL = Regex.Match(temp.Key, pattern4613UL); var mc4623UL = Regex.Match(temp.Key, pattern4623UL); var mc4633UL = Regex.Match(temp.Key, pattern4633UL); var mc4634UL = Regex.Match(temp.Key, pattern4634UL); var mc4635UL = Regex.Match(temp.Key, pattern4635UL); string res4613UL = mc4613UL.Groups[1].ToString(); string res4623UL = mc4623UL.Groups[1].ToString(); string res4633UL = mc4633UL.Groups[1].ToString(); string res4634UL = mc4634UL.Groups[1].ToString(); string res4635UL = mc4635UL.Groups[1].ToString(); _List <string> abc = (_List <string>)temp.Value; var mc4613ULValue = Regex.Match(abc[0], pattern4613ULValue); var mc4623ULValue = Regex.Match(abc[0], pattern4623ULValue); var mc4633ULValue = Regex.Match(abc[0], pattern4633ULValue); var mc4634ULValue = Regex.Match(abc[0], pattern4634ULValue); var mc4635ULValue = Regex.Match(abc[0], pattern4635ULValue); string res4613ULValue = mc4613ULValue.Value.ToString(); string res4623ULValue = mc4623ULValue.Value.ToString(); string res4633ULValue = mc4633ULValue.Value.ToString(); string res4634ULValue = mc4634ULValue.Value.ToString(); string res4635ULValue = mc4635ULValue.Value.ToString(); if ((res4613UL != "") && (res4613ULValue != "")) { BandList4613UL.Add(res4613UL); } if ((res4623UL != "") && (res4623ULValue != "")) { BandList4623UL.Add(res4623UL); } if ((res4633UL != "") && (res4633ULValue != "")) { BandList4633UL.Add(res4633UL); } if ((res4634UL != "") && (res4634ULValue != "")) { BandList4634UL.Add(res4634UL); } if ((res4635UL != "") && (res4635ULValue != "")) { BandList4635UL.Add(res4635UL); } } // Fallbacks: _List <string> resA4613FB = new _List <string>(); _List <string> resA4623FB = new _List <string>(); _List <string> resA4633FB = new _List <string>(); _List <string> resA4634FB = new _List <string>(); foreach (string temp in CABandListTable1) { _List <string> A4613FB = new _List <string>(); A4613FB = fallbackCA(temp); resA4613FB.Concat(A4613FB).ToList(); } foreach (string temp in CABandListTable2) { _List <string> A4623FB = new _List <string>(); A4623FB = fallbackCA(temp); resA4623FB.Concat(A4623FB).ToList(); } foreach (string temp in CABandListTable3) { _List <string> A4633FB = new _List <string>(); A4633FB = fallbackCA(temp); resA4633FB.Concat(A4633FB).ToList(); } foreach (string temp in CABandListTable4) { _List <string> A4634FB = new _List <string>(); A4634FB = fallbackCA(temp); resA4634FB.Concat(A4634FB).ToList(); } var DLFallbackAB = resA4613FB.Union(resA4623FB).ToList(); var DLFallbackABC = DLFallbackAB.Union(resA4633FB).ToList(); var DLFallbackABCD = DLFallbackABC.Union(resA4634FB).ToList(); // E01, E02, E03: _List <string> E01Selection = carrierNo2(BandList4613UL); _List <string> E02Selection = carrierNo2(BandList4623UL); _List <string> E03Selection = carrierNo2(BandList4633UL); // E04: _List <string> E04SelectionPartA = carrierNo2(CABandListTable1); _List <string> E04Selection = new _List <string>(E04SelectionPartA.Except(BandList4613UL).ToList()); //E05: _List <string> E05Selection = carrierNo2(CABandListTable2); //E06: _List <string> E06Selection = carrierNo2(CABandListTable3); //E07: _List <string> E07SelectionPartA = new _List <string>(CABandListTable1.Except(BandList4613UL).ToList()); _List <string> E07SelectionPartB = new _List <string>(CABandListTable2.Except(BandList4623UL).ToList()); _List <string> E07SelectionPartC = new _List <string>(CABandListTable3.Except(BandList4633UL).ToList()); _List <string> E07SelectionPartD = new _List <string>(CABandListTable4.Except(BandList4634UL).ToList()); var E07SelectionPartAB = new _List <string>(E07SelectionPartA.Union(E07SelectionPartB).ToList()); var E07SelectionPartABC = new _List <string>(E07SelectionPartAB.Union(E07SelectionPartC).ToList()); var E07SelectionPartABCD = new _List <string>(E07SelectionPartABC.Union(E07SelectionPartD).ToList()); _List <string> E07Selection = carrierNo3(E07SelectionPartABCD); //E08: var E08Selection = E04Selection.Except(DLFallbackABCD).ToList(); //E09: var E09Selection = E05Selection.Except(DLFallbackABCD).ToList(); //E10: var E10Selection = E06Selection.Except(DLFallbackABCD).ToList(); //E11: var E11SecPart = resA4623FB.Union(resA4633FB).Union(resA4634FB).ToList(); var E11Selection = E04Selection.Except(E11SecPart).ToList(); //E12: var E12SecPart = resA4623FB.Union(resA4634FB).ToList(); var E12Selection = E06Selection.Except(E12SecPart).ToList(); //E13: _List <string> E13Selection = DLOnlyBand(E06Selection); EList.Add("E01", E01Selection); EList.Add("E02", E02Selection); EList.Add("E03", E03Selection); EList.Add("E04", E04Selection); EList.Add("E05", E05Selection); EList.Add("E06", E06Selection); EList.Add("E07", E07Selection); EList.Add("E08", E08Selection); EList.Add("E09", E09Selection); EList.Add("E10", E10Selection); EList.Add("E11", E11Selection); EList.Add("E12", E12Selection); EList.Add("E13", E13Selection); return(EList); }
// New Function: public Dictionary <string, object> RFBandTableD(Dictionary <string, string> PICSItemSupportFormatted) { Dictionary <string, object> DList = new Dictionary <string, object>(); Dictionary <string, object> DTableCodeSelection = new Dictionary <string, object>(); string specIdForBand = specIDForBandFun(); XmlNodeList all3GPPLTEBands = xmlDoc.GetElementsByTagName("Bands"); _List <string> FDDBands = new _List <string>(); _List <string> TDDBands = new _List <string>(); _List <string> Bands1441 = new _List <string>(); string FDDBandsRaw1 = ""; string TDDBandsRaw1 = ""; string Bands1441Raw1 = ""; foreach (XmlNode pl in all3GPPLTEBands) { FDDBandsRaw1 = pl.ChildNodes[0].InnerText.Trim(); TDDBandsRaw1 = pl.ChildNodes[1].InnerText.Trim(); Bands1441Raw1 = pl.ChildNodes[2].InnerText.Trim(); } string[] FDDBandsRaw2 = FDDBandsRaw1.Split(','); string[] TDDBandsRaw2 = TDDBandsRaw1.Split(','); string[] Bands1441Raw2 = Bands1441Raw1.Split(','); foreach (string temp in FDDBandsRaw2) { FDDBands.Add(temp); } foreach (string temp in TDDBandsRaw2) { TDDBands.Add(temp); } foreach (string temp in Bands1441Raw2) { Bands1441.Add(temp); } XmlNodeList DTableCodes = xmlDoc.GetElementsByTagName("DTable"); foreach (XmlNode pl in DTableCodes) { DTableCodeSelection.Add(pl.ChildNodes[0].InnerText.Trim(), pl.ChildNodes[1].InnerText.Trim()); } var D01Selection = SCBandList.ToList(); var D02Selection = SCBandList.Intersect(FDDBands).ToList(); var D03Selection = SCBandList.Intersect(TDDBands).ToList(); var D04Selection = SCBandList.Intersect(Bands1441).ToList(); string pattern453Band = specIdForBand + @"\#A\.4\.5\-3\/(\d+)"; string pattern454Band = specIdForBand + @"\#A\.4\.5\-4\/(\d+)"; string pattern455Band = specIdForBand + @"\#A\.4\.5\-5\/(\d+)"; string pattern456aBand = specIdForBand + @"\#A\.4\.5\-6a\/(\d+)"; foreach (KeyValuePair <string, string> temp in PICSItemSupportFormatted) { //Debug.Print("Inside the PICS Support Band For Loop:::::"); var mc453 = Regex.Match(temp.Key, pattern453Band); var mc454 = Regex.Match(temp.Key, pattern454Band); var mc455 = Regex.Match(temp.Key, pattern455Band); var mc456a = Regex.Match(temp.Key, pattern456aBand); string res453 = mc453.Groups[1].ToString(); string res454 = mc454.Groups[1].ToString(); string res455 = mc455.Groups[1].ToString(); string res456a = mc456a.Groups[1].ToString(); if ((res453 != "") && (temp.Value == "True")) { List453.Add(res453); } if ((res454 != "") && (temp.Value == "True")) { List454.Add(res454); } if ((res455 != "") && (temp.Value == "True")) { List455.Add(res455); } if ((res456a != "") && (temp.Value == "True")) { List456a.Add(res456a); } } var D05Selection = SCBandList.Intersect(List453).ToList(); var D06Selection = SCBandList.Except(List453).ToList(); var D07Selection = SCBandList.Intersect(List454).ToList(); var D09Selection = SCBandList.Intersect(List455).ToList(); var D10Selection = SCBandList.Intersect(List456a).ToList(); _List <string> FBA4613 = new _List <string>(); foreach (string temp in CABandListTable1) { FBA4613.Add(fallbackBand(temp)); } var D08Selection = SCBandList.Except(FBA4613).ToList(); DList.Add("D01", D01Selection); DList.Add("D02", D02Selection); DList.Add("D03", D03Selection); DList.Add("D04", D04Selection); DList.Add("D05", D05Selection); DList.Add("D06", D06Selection); DList.Add("D07", D07Selection); DList.Add("D08", D08Selection); DList.Add("D09", D09Selection); DList.Add("D10", D10Selection); return(DList); }
public _List <string> PICSSupportedBands(Dictionary <string, string> PICSItemSupportFormatted, Dictionary <string, object> PICSFull) { // Fetching ID for spec: 36.521-2: specIdForBand _List <string> BandList = new _List <string>(); string specIdForBand = specIDForBandFun(); string patternSCBand = specIdForBand + @"\#A\.4\.3\-3\/(\d+)"; string patternCABandTable1 = specIdForBand + @"\#\bA\.4\.6\.1\-3\/(\d+\w)\b"; string patternCABandTable2 = specIdForBand + @"\#\bA\.4\.6\.2\-3\/(\d+\w\-\d+\w)\b"; string patternCABandTable3 = specIdForBand + @"\#\bA\.4\.6\.3\-3\/(\d+\w\-\d+\w\-?(?:\d+)?\w?\-?(?:\d+)?\w?)\b"; string patternCABandTable4 = specIdForBand + @"\#\bA\.4\.6\.3\-4\/(\d+\w\-\d+\w\-?(?:\d+)?\w?\-?(?:\d+)?\w?)_DL\b"; string patternCABandTable5 = specIdForBand + @"\#\bA\.4\.6\.3\-5\/(\d+\w\-?(?:\d+)?\w?\-?(?:\d+)?\w?\-?(?:\d+)?\w?)\b"; string patternULCASupport = @"CA_(.+)"; // Combined: foreach (KeyValuePair <string, string> temp in PICSItemSupportFormatted) { //Debug.Print("Inside the PICS Support Band For Loop:::::"); var mcSC = Regex.Match(temp.Key, patternSCBand); var mcCA1 = Regex.Match(temp.Key, patternCABandTable1); var mcCA2 = Regex.Match(temp.Key, patternCABandTable2); var mcCA3 = Regex.Match(temp.Key, patternCABandTable3); var mcCA4 = Regex.Match(temp.Key, patternCABandTable4); var mcCA5 = Regex.Match(temp.Key, patternCABandTable5); string resSC = mcSC.Groups[1].ToString(); string resCA1 = mcCA1.Groups[1].ToString(); string resCA2 = mcCA2.Groups[1].ToString(); string resCA3 = mcCA3.Groups[1].ToString(); string resCA4 = mcCA4.Groups[1].ToString(); string resCA5 = mcCA5.Groups[1].ToString(); if ((resSC != "") && (temp.Value == "True")) { SCBandList.Add(resSC); } if ((resCA1 != "") && (temp.Value == "True")) { CABandListTable1.Add(resCA1); } if ((resCA2 != "") && (temp.Value == "True")) { CABandListTable2.Add(resCA2); } if ((resCA3 != "") && (temp.Value == "True")) { CABandListTable3.Add(resCA3); } if ((resCA4 != "") && (temp.Value == "True")) { CABandListTable4.Add(resCA4); } if ((resCA5 != "") && (temp.Value == "True")) { CABandListTable5.Add(resCA5); } } foreach (KeyValuePair <string, object> temp in PICSFull) { _List <string> abc = (_List <string>)temp.Value; var mcULCA = Regex.Match(abc[0], patternULCASupport); string resULCA = mcULCA.Groups[1].ToString(); string patternWI = specIdForBand + @"\#.*"; var mcpatternWI = Regex.Match(temp.Key, patternWI); string respatternWI = mcpatternWI.Value.ToString(); if (respatternWI != "") { if (resULCA != "") { ULCAList.Add("ULCA_" + resULCA); } } } XmlNodeList allPICSBands = xmlDoc.GetElementsByTagName("PICSBandSupport"); //_List<int> mappingInfo = new _List<int>(); foreach (XmlNode pl in allPICSBands) { string band2G = pl.ChildNodes[0].InnerText.Trim(); string band3G = pl.ChildNodes[1].InnerText.Trim(); string bandTDS = pl.ChildNodes[3].InnerText.Trim(); string[] band2GPro1 = band2G.Split(','); string[] band3GPro1 = band3G.Split(','); string[] bandTDSPro1 = bandTDS.Split(','); foreach (string temp in band2GPro1) { GSMList.Add(temp.Trim()); } foreach (string temp in band3GPro1) { UMTSList.Add(temp.Trim()); } foreach (string temp in bandTDSPro1) { TDSList.Add(temp.Trim()); } } CABandList.AddRange(CABandListTable1); CABandList.AddRange(CABandListTable2); CABandList.AddRange(CABandListTable3); CABandList.AddRange(CABandListTable4); CABandList.AddRange(CABandListTable5); BandList.AddRange(SCBandList); BandList.AddRange(CABandList); BandList.AddRange(ULCAList); BandList.AddRange(GSMList); BandList.AddRange(UMTSList); BandList.AddRange(TDSList); return(BandList); }
public void getalldictfromTRLfile(string CSVName, bool remspacefrmkey = false) { int key_id = 0; int logic_id = 4; int rel_id = 2; int de_id = 3; int pnemonic_id = 5; lg.deb("TRL FILE: " + CSVName); using (var fs = File.OpenRead(CSVName)) { using (var reader = new StreamReader(fs)) { while (!reader.EndOfStream) { _List <string> valTot = new _List <string>(); var line = reader.ReadLine(); if (line != "") { var values = line.Split('\t'); int colidx = 0; foreach (string val in values) { string val2 = val.Replace("\"", ""); if ((colidx == key_id) && (remspacefrmkey)) { val2 = val2.Replace(" ", ""); } valTot.Add(val2); colidx++; } string dctkey = valTot[key_id]; dctkey = dctkey.ToLower(); if (dctkey.Trim() == "") { continue; } if (values.Count() > 5) { try { if (dict_logic.ContainsKey(dctkey)) { //lg.war("\t{gp:getdictionary} duplicate entry in " + CSVName + " " + valTot[key_id] + " " + valTot[logic_id]); dict_logic[dctkey] = valTot[logic_id]; dict_de[dctkey] = valTot[de_id]; dict_rel[dctkey] = valTot[rel_id]; dict_pnemonic[dctkey] = valTot[pnemonic_id]; } else { dict_logic.Add(dctkey, valTot[logic_id]); dict_de.Add(dctkey, valTot[de_id]); dict_rel.Add(dctkey, valTot[rel_id]); dict_pnemonic.Add(dctkey, valTot[pnemonic_id]); } } catch { lg.err("\t{gp:getdictionary} " + valTot[key_id] + " \n\t\t\t" + valTot[logic_id]); } } else { lg.war("{gp:getdictionary} line has few elements " + line); //if (values.Count() > key_id) //{ // dict_logic.Add(dctkey, @"N/A"); //} } } } } } //List<_Dictionary<string, string>> alldict = new List<_Dictionary<string, string>>(); //alldict.Add(dict_logic); //alldict.Add(dict_rel); //alldict.Add(dict_pnemonic); //alldict.Add(dict_de); }
// it returns a dictionary from a csv file with key and value column index passed. public _Dictionary <string, string> getdictionaryRowCol(int val_id, int key_id = 0, string CSVName = "", bool remspacefrmkey = false) { lg.deb("FILE: " + CSVName); _Dictionary <string, string> dictcsv = new _Dictionary <string, string>(); using (var fs = File.OpenRead(CSVName)) { using (var reader = new StreamReader(fs)) { while (!reader.EndOfStream) { _List <string> valTot = new _List <string>(); var line = reader.ReadLine(); if (line != "") { var values = line.Split('\t'); int colidx = 0; foreach (string val in values) { string val2 = val.Replace("\"", ""); if ((colidx == key_id) && (remspacefrmkey)) { val2 = val2.Replace(" ", ""); } valTot.Add(val2); colidx++; } string dctkey = valTot[key_id]; string fn = Path.GetFileName(CSVName); if (fn.Contains("TVA")) { dctkey = dctkey.ToLower(); } if ((values.Count() > val_id) && (values.Count() > key_id)) { try { if (dictcsv.ContainsKey(dctkey)) { lg.war("\t{gp:getdictionary} duplicate entry in " + CSVName + " " + valTot[key_id] + " " + valTot[val_id]); } else { dictcsv.Add(dctkey, valTot[val_id]); } } catch { lg.err("\t{gp:getdictionary} " + valTot[key_id] + " \n\t\t\t" + valTot[val_id]); } } else { //lg.war("{gp:getdictionary} "+ line); if (values.Count() > key_id) { dictcsv.Add(dctkey, @"N/A"); } } } } } } return(dictcsv); }