/// <summary> /// 读取匹配结果 /// 文件结构 /// 数据类型 /// 结果 /// </summary> /// <param name="isLoopDebug"></param> /// <returns></returns> public ResultInfo ReadFromFile(bool isLoopDebug) { ResultInfo result = new ResultInfo(); try { string content = FileOperator.ReadFromFile2(_Path); if (content != null) { string[] resMatch = content.Split('\n'); if (resMatch.Length >= 2) { result.DataType = resMatch[0]; result.Result = resMatch[1]; } // this.picWin.setMatch(curPercent); // this.picWin.ShowCounter(); } } catch { } finally { if (isLoopDebug) { File.Delete(_Path); } } return result; }
/// <summary> /// 读取结果 /// 文件结构 /// 每一行:数据类型,结果 /// /// </summary> /// <param name="isLoopDebug"></param> /// <returns></returns> public List<ResultInfo> ReadFromFile2(bool isLoopDebug) { List<ResultInfo> resultList = new List<ResultInfo>(); try { ArrayList contentList = FileOperator.ReadFromFile(_Path); foreach (string content in contentList) { if (content != null) { string[] resMatch = content.Split(','); if (resMatch.Length >= 2) { ResultInfo result = new ResultInfo(); result.DataType = resMatch[0]; result.Result = resMatch[1]; resultList.Add(result); } } } } catch { } finally { if (isLoopDebug) { File.Delete(_Path); } } return resultList; }
private void SetStatusPicture(ResultInfo resultInfo) { switch (resultInfo.DataType) { case "BOOL": if (resultInfo.Result == "0") this.statusPic.Image = global::CaVeGen.Properties.Resources.fail; else if (resultInfo.Result == "1") this.statusPic.Image = global::CaVeGen.Properties.Resources.pass; this.statusPic.Visible = true; break; case "INT": this.statusPic.Visible = false; break; case "FLOAT": this.statusPic.Visible = false; break; } }