/// <summary> ///新增Record类型,测试状态为Done,记录结果显示在ReportText中(实质为StringValueTest类型,只是取消字符串比较功能) /// </summary> /// <typeparam name="T"></typeparam> /// <param name="stepOrder"></param> /// <param name="data"></param> /// <returns></returns> public bool add_ME_MSTR_Record <T>(ref int stepOrder, T data) { ME_MSTR me = Arr_ME_MSTR[stepOrder]; me.StepType = "StringValueTest"; me.Step_Status = "Done"; me.ReportText = data.ToString(); me.ErrorCode = "0"; me.ErrorMessage = ""; Arr_ME_MSTR[stepOrder] = me; return(me.ErrorCode == "0"); }
/// <summary> /// 添加数据,注意:stepOrder起始值为0,对应第一个测试项 /// </summary> /// <param name="stepOrder"></param> /// <param name="limitLow"></param> /// <param name="limitHigh"></param> /// <param name="data"></param> /// <returns></returns> public bool add_ME_MSTR_NumericTest(ref int stepOrder, double limitLow, double limitHigh, double data) { ME_MSTR me = Arr_ME_MSTR[stepOrder]; me.limitLow = limitLow.ToString(); me.limitHigh = limitHigh.ToString(); me.LimitStep_Data = data.ToString(); bool result = CompareData(me.Comp, data, limitLow, limitHigh, ref me.ErrorCode, ref me.ErrorMessage); me.Step_Status = result ? "Passed" : "Failed"; Arr_ME_MSTR[stepOrder] = me; return(me.ErrorCode == "0"); }
/// <summary> /// 添加一项PassFail参数到ME_MSTR表中 /// </summary> /// <param name="stepOrder">参数在工位采集数据中的序号,按此序号查找存放的位置</param> /// <param name="errorCode">错误代码,如果没有出错,则设为0</param> /// <param name="errorMessage">如果errorCode不为0,则输入错误信息;如果errorCode为0,则为空</param> /// <param name="startOfTime">此参数所在动作开始工作的时间,格式yymmddHHMMSS</param> /// <param name="toalTime">采集参数的动作所花的时间,单位ms</param> /// <param name="value">值,一般为Passed或Failed</param> /// <returns>添加成功则返true,否则返回false</returns> public bool add_ME_MSTR_PassFailTest(int stepOrder, int errorCode, string errorMessage, string startOfTime, int toalTime, string value) { if (Arr_ME_MSTR == null) { LogHelper.Info("未初始化对象,添加PassFailTest项失败!"); return(false); } try { ME_MSTR me = Arr_ME_MSTR[stepOrder]; if (errorCode == 0) { if (value.ToUpper().Trim().Equals("FAILED") || (value.ToUpper().Trim().Equals("FALSE"))) { me.ErrorCode = "1"; value = "Failed"; } else { me.ErrorCode = "0"; value = "Passed"; } me.ErrorMessage = ""; me.Step_PassFail = value; me.Step_Status = value; } else { me.ErrorCode = errorCode.ToString(); me.ErrorMessage = errorMessage; me.Step_PassFail = value; me.Step_Status = "Error"; } me.ProductionTime = startOfTime; me.TotalTime = toalTime.ToString(); Arr_ME_MSTR[stepOrder] = me; LogHelper.Info("添加PasseFailTest项成功"); return(true); } catch (Exception ex) { LogHelper.Debug("添加PasseFailTest项异常", ex); return(false); } }
/// <summary> /// 添加一项字符串参数到ME_MSTR表中 /// </summary> /// <param name="stepOrder">参数在工位采集数据中的序号,按此序号查找存放的位置</param> /// <param name="errorCode">错误代码,如果没有出错,则设为0</param> /// <param name="errorMessage">如果errorCode不为0,则输入错误信息;如果errorCode为0,则为空</param> /// <param name="startOfTime">此参数所在动作开始工作的时间,格式yymmddHHMMSS</param> /// <param name="toalTime">采集参数的动作所花的时间,单位ms</param> /// <param name="value">要比较的字符串的值</param> /// <returns>添加成功则返true,否则返回false</returns> public bool add_ME_MSTR_StringValueTest(ref int stepOrder, string limitString, string value) { ME_MSTR me = Arr_ME_MSTR[stepOrder]; me.limits_String = limitString.Trim(); me.ReportText = value.ToString(); bool isEquals = me.ReportText.Equals(me.limits_String, StringComparison.CurrentCultureIgnoreCase); if (isEquals) { me.Step_Status = "Passed"; me.ErrorCode = "0"; me.ErrorMessage = ""; } else { me.Step_Status = "Failed"; me.ErrorMessage = "String Compare failed"; me.ErrorCode = "0"; } Arr_ME_MSTR[stepOrder] = me; return(isEquals); }