public static void JudgeVolt(DataGridView rowMergeView_Volt, DataTable checkListVolt, float[] voltResult, int h, int ChanelNumber, float VoltErroMin, float VoltErroMax) { float voltTheory; int num = checkListVolt.Columns.IndexOf("理论值/V"); for (int i = 0; i < checkListVolt.Columns.Count; i++) { if (checkListVolt.Columns[i].ColumnName.Contains("理论值")) { num = i; break; } } for (int k = 1; k <= ChanelNumber; k++) { if (checkListVolt.Rows[h][0].ToString() == ("电压输出测试通道" + k.ToString())) { voltTheory = Math.Abs(float.Parse(checkListVolt.Rows[h][num].ToString())); checkListVolt.Rows[h][num + 1] = voltResult[k - 1]; //插入虚拟表格checkListVolt1 if ((Math.Abs(voltResult[k - 1]) < voltTheory * VoltErroMin) || (Math.Abs(voltResult[k - 1]) > voltTheory * VoltErroMax)) //判断 { rowMergeView_Volt.DataSource = checkListVolt; rowMergeView_Volt.Refresh(); RowStyle.ChangeRowStyle(rowMergeView_Volt, h); } else { rowMergeView_Volt.DataSource = checkListVolt; rowMergeView_Volt.Refresh(); RowStyle.ChangeNormalRowStyle(rowMergeView_Volt, h); } break; } } }
public static void JudgeShort(DataGridView rowMergeView_Short, DataTable checkListShort, ushort[] shortResult, int h, int ChanelNumber, ushort ShortMin) { UInt16 shortTheory; int num = checkListShort.Columns.IndexOf("理论值/Ω"); for (int k = 1; k <= ChanelNumber; k++) { if (checkListShort.Rows[h][0].ToString() == ("短路测试通道" + k.ToString())) { shortTheory = UInt16.Parse(checkListShort.Rows[h][num].ToString()); checkListShort.Rows[h][num + 1] = shortResult[k - 1]; //插入虚拟表格checkListShort1 if (shortResult[k - 1] <= ShortMin) //判断 { rowMergeView_Short.DataSource = checkListShort; rowMergeView_Short.Refresh(); RowStyle.ChangeRowStyle(rowMergeView_Short, h); } else { rowMergeView_Short.DataSource = checkListShort; rowMergeView_Short.Refresh(); RowStyle.ChangeNormalRowStyle(rowMergeView_Short, h); } break; } } }
public static void JudgeAD(DataGridView rowMergeView_Fuction, DataTable checkListfuction, float[] ADResult, float[] ADResulta, int h, int ChanelNumber, float ADErroMin, float ADErroMax) { float ADTheory; float ADTheorya; int num = checkListfuction.Columns.IndexOf("理论值/V"); for (int k = 1; k <= 38; k++) { if (checkListfuction.Rows[h][0].ToString() == ("AD输入测试通道" + k.ToString())) { ADTheory = float.Parse(checkListfuction.Rows[h][num].ToString()); checkListfuction.Rows[h][num + 1] = ADResult[k - 1]; //插入虚拟表格checkListfuciton1 if ((ADResult[k - 1] < ADTheory * ADErroMin) || (ADResult[k - 1] > ADTheory * ADErroMax)) //判断 { rowMergeView_Fuction.DataSource = checkListfuction; rowMergeView_Fuction.Refresh(); RowStyle.ChangeRowStyle(rowMergeView_Fuction, h); } else { rowMergeView_Fuction.DataSource = checkListfuction; rowMergeView_Fuction.Refresh(); RowStyle.ChangeNormalRowStyle(rowMergeView_Fuction, h); } ADTheorya = float.Parse(checkListfuction.Rows[h + 1][num].ToString()); checkListfuction.Rows[h + 1][num + 1] = ADResulta[k - 1]; //插入虚拟表格checkListfuction if ((ADResulta[k - 1] < ADTheorya * ADErroMin) || (ADResulta[k - 1] > ADTheorya * ADErroMax)) //判断 { rowMergeView_Fuction.DataSource = checkListfuction; rowMergeView_Fuction.Refresh(); RowStyle.ChangeRowStyle(rowMergeView_Fuction, h + 1); } else { rowMergeView_Fuction.DataSource = checkListfuction; rowMergeView_Fuction.Refresh(); RowStyle.ChangeNormalRowStyle(rowMergeView_Fuction, h + 1); } break; } } }
public static void JudgeDA(DataGridView rowMergeView_Fuction, DataTable checkListfuction, float[] DAResult, float[] DAResulta, int h, int ChanelNumber, float DAErroMin, float DAErroMax, float DAOffset, String formName) { float DATheory; float DATheorya; int num = checkListfuction.Columns.IndexOf("理论值/V"); for (int k = 1; k <= ChanelNumber; k++) { if (checkListfuction.Rows[h][0].ToString() == ("DA输出测试通道" + k.ToString())) { if (formName == "Zuhe" || formName == "Zhengji" || formName == "Gonglv" || formName == "Zonghe" || formName == "Laolian") { DATheory = float.Parse(checkListfuction.Rows[h][num].ToString()); checkListfuction.Rows[h][num + 1] = DAResult[k - 1]; //插入虚拟表格checkListfuction if ((DAResult[k - 1] < DATheory * DAErroMin) || (DAResult[k - 1] > DATheory * DAErroMax)) //判断 { rowMergeView_Fuction.DataSource = checkListfuction; rowMergeView_Fuction.Refresh(); RowStyle.ChangeRowStyle(rowMergeView_Fuction, h); } else { rowMergeView_Fuction.DataSource = checkListfuction; rowMergeView_Fuction.Refresh(); RowStyle.ChangeNormalRowStyle(rowMergeView_Fuction, h); } DATheorya = float.Parse(checkListfuction.Rows[h + 1][num].ToString()); checkListfuction.Rows[h + 1][num + 1] = DAResulta[k - 1]; //插入虚拟表格checkListfuction if ((DAResulta[k - 1] < DATheorya - DAOffset) || (DAResulta[k - 1] > DATheorya + DAOffset)) //判断 { rowMergeView_Fuction.DataSource = checkListfuction; rowMergeView_Fuction.Refresh(); RowStyle.ChangeRowStyle(rowMergeView_Fuction, h + 1); } else { rowMergeView_Fuction.DataSource = checkListfuction; rowMergeView_Fuction.Refresh(); RowStyle.ChangeNormalRowStyle(rowMergeView_Fuction, h + 1); } } if (formName == "Kongzhi") { DATheory = float.Parse(checkListfuction.Rows[h][num].ToString()); checkListfuction.Rows[h][num + 1] = DAResult[k - 1]; //插入虚拟表格checkListfuction if ((DAResult[k - 1] < DATheory * DAErroMin) || (DAResult[k - 1] > DATheory * DAErroMax)) //判断 { rowMergeView_Fuction.DataSource = checkListfuction; rowMergeView_Fuction.Refresh(); RowStyle.ChangeRowStyle(rowMergeView_Fuction, h); } else { rowMergeView_Fuction.DataSource = checkListfuction; rowMergeView_Fuction.Refresh(); RowStyle.ChangeNormalRowStyle(rowMergeView_Fuction, h); } DATheorya = float.Parse(checkListfuction.Rows[h + 1][num].ToString()); checkListfuction.Rows[h + 1][num + 1] = DAResulta[k - 1]; //插入虚拟表格checkListfuction if ((DAResulta[k - 1] < DATheorya * DAErroMin) || (DAResulta[k - 1] > DATheorya * DAErroMax)) //判断 { rowMergeView_Fuction.DataSource = checkListfuction; rowMergeView_Fuction.Refresh(); RowStyle.ChangeRowStyle(rowMergeView_Fuction, h + 1); } else { rowMergeView_Fuction.DataSource = checkListfuction; rowMergeView_Fuction.Refresh(); RowStyle.ChangeNormalRowStyle(rowMergeView_Fuction, h + 1); } } break; } } }