diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index 07fa032..bb70bfc 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -903,20 +903,18 @@ //CliTable[0].id //1717086652508487681 //根据被检设备的检定项分类去查询 TODO - if(deviceCatoryName.contains("数字多用表(手持)")){ DataList=BaseCommonApi::getVerMultiCalClass(deviceCatoryName,CliTable[0].id,HeadList); - } break; case 4: - if (deviceCatoryName.contains("一般压力表")){ DataList=BaseCommonApi::getDeviceMeasureCalibratorPistonGauge(deviceCatoryName,CliTable[0].id,HeadList); - }//else if 后续可判断其他检定项分类 break; case 13: //示波器标准装置 = 13 - //DataList=BaseCommonApi::getDeviceOscilloscopeCalibration(deviceCatoryName,CliTable[0].id,HeadList); + DataList=BaseCommonApi::getDeviceOscilloscopeCalibration(deviceCatoryName,CliTable[0].id,HeadList); break; + default: + break; } return DataList; @@ -3086,7 +3084,7 @@ if (query.exec()) { while (query.next()) { result.clear(); - result.append(query.value("id").toString()); + result.append(query.value("id").toString()); result.append(query.value("item_id").toString()); //检定项目ID result.append(query.value("time_base").toString());//时基 result.append(query.value("current_gain").toString());//直流增益(示波器-数字) @@ -3116,6 +3114,7 @@ result.append(query.value("signal_frequency").toString());//信号频率 result.append(query.value("nominal_value").toString());//标称值 result.append(query.value("nominal_value_unit").toString());//标称值单位 + result.append(query.value("item_type").toString());//项目 result.append(query.value("create_time").toString()); result.append(query.value("update_time").toString()); resultData.append(result); @@ -3125,42 +3124,202 @@ } - DataMapList= GetDataReturnItemListByPistonGauge(itemCatoryName,resultData,DataMapList,headList); + DataMapList=GetDataReturnItemListByOscilloscope(itemCatoryName,resultData,DataMapList,headList); return DataMapList; } QMap> BaseCommonApi::GetDataReturnItemListByOscilloscope(QString itemCatoryName,QList ResultData,QMap> DataMapList,QMap *HeadMapList) { - QList IndicationErrorList; + QList time_baseList; + QList Current_gainList; + QList Current_biasList; + QList band_widthList; + QList trigger_sensitivityList; + QList rise_timeList; + QList input_resistanceList; + QList calibrating_signalList; + if(itemCatoryName.contains("数字示波器")){ for(const QStringList &row : ResultData) { QString VerificationItem=NULL; + QStringList head; + QStringList Data; if (!row.isEmpty() && row[2] =="1") { - VerificationItem = "示值误差"; + VerificationItem = "时基"; //添加列头 - QStringList head; - head <<"序号"<<"检定项目"<<"轻敲前示值-正"<<"轻敲前示值-反"<<"轻敲后示值-正" - <<"轻敲后示值-反"<<"轻敲前后变动量-正"<<"轻敲前后变动量-反" ; + head <<"序号"<<"检定项目"<<"参考输出"<<"差拍波形频率测量值(Hz)"<<"时基相对误差△δ"<<"技术指标" + <<"结论"; HeadMapList->insert(VerificationItem,head); //添加数据 - QStringList Data; - Data.append(row[0]); //ID - Data.append(row[2]); //标准器示值 - - Data.append(row[2]);//轻敲前示值-正 - Data.append(row[2]);//"轻敲前示值-反" - Data.append(row[2]);//轻敲后示值-正 - Data.append(row[2]);//轻敲后示值-反 - Data.append("0");//轻敲前后变动量-正 - Data.append("0");//轻敲前后变动量-反 - IndicationErrorList.append(Data); + Data.append(VerificationItem); //检定项目 + Data.append("缺少");//参考输出 + Data.append("");//差拍波形频率测量值(Hz) + Data.append("");//时基相对误差△δ + Data.append("");//技术指标 + Data.append("");//结论 + time_baseList.append(Data); } + if (!row.isEmpty() && row[3] =="1") { + VerificationItem = "直流增益"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"阻抗"<<"垂直偏转系数(/div)"<<"标准值" + <<"测量值"<<"相对误差"<<"技术指标" <<"结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[16]);//阻抗 + Data.append(row[17]);//垂直偏转系数(/div) + Data.append(row[19]);//标准值 + Data.append("");//测量值 + Data.append("");//相对误差 + Data.append(row[13]);//技术指标 + Data.append("");//结论 + Current_gainList.append(Data); + } + if (!row.isEmpty() && row[4] =="1") { + VerificationItem = "直流偏置"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"阻抗"<<"垂直偏转系数(/div)"<<"标准值" + <<"测量值"<<"误差"<<"相对误差"<<"技术指标" <<"结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[16]);//阻抗 + Data.append(row[17]);//垂直偏转系数(/div) + Data.append(row[19]);//标准值 + Data.append("");//测量值 + Data.append("");//误差 + Data.append("");//相对误差 + Data.append(row[13]);//技术指标 + Data.append("");//结论 + Current_biasList.append(Data); + } + if (!row.isEmpty() && row[5] =="1") { + VerificationItem = "频带宽度"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"阻抗"<<"垂直偏转系数(/div)" + << "频带宽度" <<"参考幅度" <<"参考幅度单位" <<"测量幅度" <<"测量幅度单位" + <<"分贝数(dB)" <<"技术指标" << "结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[16]);//阻抗 + Data.append(row[17]);//垂直偏转系数(/div) + Data.append(row[22]);//频带宽度 + Data.append("");//参考幅度 + Data.append("");//参考幅度单位 + Data.append("");//测量幅度 + Data.append("");//测量幅度单位 + Data.append("");//分贝数(dB) + Data.append(row[13]);//技术指标 + Data.append("");//结论 + band_widthList.append(Data); + } + if (!row.isEmpty() && row[6] =="1") { + VerificationItem = "触发灵敏度"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"触发类型"<<"信号频率" + << "标称值" <<"测量值" <<"结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[26]);//触发类型 + Data.append(row[27]);//信号频率 + Data.append(row[28]);//标称值 + Data.append("");//测量值 + Data.append("");//结论 + trigger_sensitivityList.append(Data); + } + if (!row.isEmpty() && row[7] =="1") { + VerificationItem = "上升时间"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"阻抗"<<"垂直偏转系数(/div)" + <<"测量值"<<"测量值单位"<<"技术指标" <<"结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[16]);//阻抗 + Data.append(row[17]);//垂直偏转系数(/div) + Data.append("");//测量值 + Data.append("");//测量值单位 + Data.append(row[13]);//技术指标 + Data.append("");//结论 + rise_timeList.append(Data); + } + if (!row.isEmpty() && row[8] =="1") { + VerificationItem = "输入电阻"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"标称值"<<"垂直偏转系数(/div)" + <<"测量值"<<"测量值单位"<<"技术指标" <<"结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[28]+row[29]);//标称值 + Data.append(row[17]);//垂直偏转系数(/div) + Data.append("");//测量值 + Data.append("");//测量值单位 + Data.append(row[13]);//技术指标 + Data.append("");//结论 + input_resistanceList.append(Data); + } + if (!row.isEmpty() && row[9] =="1") { + VerificationItem = "校准信号"; + //添加列头 + head <<"序号"<<"检定项目"<<"项目"<<"标称值"<<"顶部测量值"<<"底部测量值" + <<"测量值"<<"测量值单位"<<"相对误差"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[30]);//项目 + Data.append(row[28]+row[29]);//标称值 + Data.append("");//顶部测量值 + Data.append("");//底部测量值 + Data.append("");//测量值 + Data.append("");//测量值单位 + Data.append(row[13]);//技术指标 + Data.append("");//相对误差 + calibrating_signalList.append(Data); + } } } - if(IndicationErrorList.count()!=0){ - DataMapList.insert("示值误差",IndicationErrorList); + if(time_baseList.count()!=0){ + DataMapList.insert("时基",time_baseList); + }; + if(Current_gainList.count()!=0){ + DataMapList.insert("直流增益",Current_gainList); + }; + if(Current_biasList.count()!=0){ + DataMapList.insert("直流偏置",Current_biasList); + }; + if(band_widthList.count()!=0){ + DataMapList.insert("频带宽度",band_widthList); + }; + if(trigger_sensitivityList.count()!=0){ + DataMapList.insert("触发灵敏度",trigger_sensitivityList); + }; + if(rise_timeList.count()!=0){ + DataMapList.insert("上升时间",rise_timeList); + }; + if(input_resistanceList.count()!=0){ + DataMapList.insert("输入电阻",input_resistanceList); + }; + if(calibrating_signalList.count()!=0){ + DataMapList.insert("校准信号",calibrating_signalList); }; return DataMapList; } diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index 07fa032..bb70bfc 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -903,20 +903,18 @@ //CliTable[0].id //1717086652508487681 //根据被检设备的检定项分类去查询 TODO - if(deviceCatoryName.contains("数字多用表(手持)")){ DataList=BaseCommonApi::getVerMultiCalClass(deviceCatoryName,CliTable[0].id,HeadList); - } break; case 4: - if (deviceCatoryName.contains("一般压力表")){ DataList=BaseCommonApi::getDeviceMeasureCalibratorPistonGauge(deviceCatoryName,CliTable[0].id,HeadList); - }//else if 后续可判断其他检定项分类 break; case 13: //示波器标准装置 = 13 - //DataList=BaseCommonApi::getDeviceOscilloscopeCalibration(deviceCatoryName,CliTable[0].id,HeadList); + DataList=BaseCommonApi::getDeviceOscilloscopeCalibration(deviceCatoryName,CliTable[0].id,HeadList); break; + default: + break; } return DataList; @@ -3086,7 +3084,7 @@ if (query.exec()) { while (query.next()) { result.clear(); - result.append(query.value("id").toString()); + result.append(query.value("id").toString()); result.append(query.value("item_id").toString()); //检定项目ID result.append(query.value("time_base").toString());//时基 result.append(query.value("current_gain").toString());//直流增益(示波器-数字) @@ -3116,6 +3114,7 @@ result.append(query.value("signal_frequency").toString());//信号频率 result.append(query.value("nominal_value").toString());//标称值 result.append(query.value("nominal_value_unit").toString());//标称值单位 + result.append(query.value("item_type").toString());//项目 result.append(query.value("create_time").toString()); result.append(query.value("update_time").toString()); resultData.append(result); @@ -3125,42 +3124,202 @@ } - DataMapList= GetDataReturnItemListByPistonGauge(itemCatoryName,resultData,DataMapList,headList); + DataMapList=GetDataReturnItemListByOscilloscope(itemCatoryName,resultData,DataMapList,headList); return DataMapList; } QMap> BaseCommonApi::GetDataReturnItemListByOscilloscope(QString itemCatoryName,QList ResultData,QMap> DataMapList,QMap *HeadMapList) { - QList IndicationErrorList; + QList time_baseList; + QList Current_gainList; + QList Current_biasList; + QList band_widthList; + QList trigger_sensitivityList; + QList rise_timeList; + QList input_resistanceList; + QList calibrating_signalList; + if(itemCatoryName.contains("数字示波器")){ for(const QStringList &row : ResultData) { QString VerificationItem=NULL; + QStringList head; + QStringList Data; if (!row.isEmpty() && row[2] =="1") { - VerificationItem = "示值误差"; + VerificationItem = "时基"; //添加列头 - QStringList head; - head <<"序号"<<"检定项目"<<"轻敲前示值-正"<<"轻敲前示值-反"<<"轻敲后示值-正" - <<"轻敲后示值-反"<<"轻敲前后变动量-正"<<"轻敲前后变动量-反" ; + head <<"序号"<<"检定项目"<<"参考输出"<<"差拍波形频率测量值(Hz)"<<"时基相对误差△δ"<<"技术指标" + <<"结论"; HeadMapList->insert(VerificationItem,head); //添加数据 - QStringList Data; - Data.append(row[0]); //ID - Data.append(row[2]); //标准器示值 - - Data.append(row[2]);//轻敲前示值-正 - Data.append(row[2]);//"轻敲前示值-反" - Data.append(row[2]);//轻敲后示值-正 - Data.append(row[2]);//轻敲后示值-反 - Data.append("0");//轻敲前后变动量-正 - Data.append("0");//轻敲前后变动量-反 - IndicationErrorList.append(Data); + Data.append(VerificationItem); //检定项目 + Data.append("缺少");//参考输出 + Data.append("");//差拍波形频率测量值(Hz) + Data.append("");//时基相对误差△δ + Data.append("");//技术指标 + Data.append("");//结论 + time_baseList.append(Data); } + if (!row.isEmpty() && row[3] =="1") { + VerificationItem = "直流增益"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"阻抗"<<"垂直偏转系数(/div)"<<"标准值" + <<"测量值"<<"相对误差"<<"技术指标" <<"结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[16]);//阻抗 + Data.append(row[17]);//垂直偏转系数(/div) + Data.append(row[19]);//标准值 + Data.append("");//测量值 + Data.append("");//相对误差 + Data.append(row[13]);//技术指标 + Data.append("");//结论 + Current_gainList.append(Data); + } + if (!row.isEmpty() && row[4] =="1") { + VerificationItem = "直流偏置"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"阻抗"<<"垂直偏转系数(/div)"<<"标准值" + <<"测量值"<<"误差"<<"相对误差"<<"技术指标" <<"结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[16]);//阻抗 + Data.append(row[17]);//垂直偏转系数(/div) + Data.append(row[19]);//标准值 + Data.append("");//测量值 + Data.append("");//误差 + Data.append("");//相对误差 + Data.append(row[13]);//技术指标 + Data.append("");//结论 + Current_biasList.append(Data); + } + if (!row.isEmpty() && row[5] =="1") { + VerificationItem = "频带宽度"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"阻抗"<<"垂直偏转系数(/div)" + << "频带宽度" <<"参考幅度" <<"参考幅度单位" <<"测量幅度" <<"测量幅度单位" + <<"分贝数(dB)" <<"技术指标" << "结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[16]);//阻抗 + Data.append(row[17]);//垂直偏转系数(/div) + Data.append(row[22]);//频带宽度 + Data.append("");//参考幅度 + Data.append("");//参考幅度单位 + Data.append("");//测量幅度 + Data.append("");//测量幅度单位 + Data.append("");//分贝数(dB) + Data.append(row[13]);//技术指标 + Data.append("");//结论 + band_widthList.append(Data); + } + if (!row.isEmpty() && row[6] =="1") { + VerificationItem = "触发灵敏度"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"触发类型"<<"信号频率" + << "标称值" <<"测量值" <<"结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[26]);//触发类型 + Data.append(row[27]);//信号频率 + Data.append(row[28]);//标称值 + Data.append("");//测量值 + Data.append("");//结论 + trigger_sensitivityList.append(Data); + } + if (!row.isEmpty() && row[7] =="1") { + VerificationItem = "上升时间"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"阻抗"<<"垂直偏转系数(/div)" + <<"测量值"<<"测量值单位"<<"技术指标" <<"结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[16]);//阻抗 + Data.append(row[17]);//垂直偏转系数(/div) + Data.append("");//测量值 + Data.append("");//测量值单位 + Data.append(row[13]);//技术指标 + Data.append("");//结论 + rise_timeList.append(Data); + } + if (!row.isEmpty() && row[8] =="1") { + VerificationItem = "输入电阻"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"标称值"<<"垂直偏转系数(/div)" + <<"测量值"<<"测量值单位"<<"技术指标" <<"结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[28]+row[29]);//标称值 + Data.append(row[17]);//垂直偏转系数(/div) + Data.append("");//测量值 + Data.append("");//测量值单位 + Data.append(row[13]);//技术指标 + Data.append("");//结论 + input_resistanceList.append(Data); + } + if (!row.isEmpty() && row[9] =="1") { + VerificationItem = "校准信号"; + //添加列头 + head <<"序号"<<"检定项目"<<"项目"<<"标称值"<<"顶部测量值"<<"底部测量值" + <<"测量值"<<"测量值单位"<<"相对误差"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[30]);//项目 + Data.append(row[28]+row[29]);//标称值 + Data.append("");//顶部测量值 + Data.append("");//底部测量值 + Data.append("");//测量值 + Data.append("");//测量值单位 + Data.append(row[13]);//技术指标 + Data.append("");//相对误差 + calibrating_signalList.append(Data); + } } } - if(IndicationErrorList.count()!=0){ - DataMapList.insert("示值误差",IndicationErrorList); + if(time_baseList.count()!=0){ + DataMapList.insert("时基",time_baseList); + }; + if(Current_gainList.count()!=0){ + DataMapList.insert("直流增益",Current_gainList); + }; + if(Current_biasList.count()!=0){ + DataMapList.insert("直流偏置",Current_biasList); + }; + if(band_widthList.count()!=0){ + DataMapList.insert("频带宽度",band_widthList); + }; + if(trigger_sensitivityList.count()!=0){ + DataMapList.insert("触发灵敏度",trigger_sensitivityList); + }; + if(rise_timeList.count()!=0){ + DataMapList.insert("上升时间",rise_timeList); + }; + if(input_resistanceList.count()!=0){ + DataMapList.insert("输入电阻",input_resistanceList); + }; + if(calibrating_signalList.count()!=0){ + DataMapList.insert("校准信号",calibrating_signalList); }; return DataMapList; } diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 3c51ea2..fad47ba 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -1226,7 +1226,7 @@ //示波器 static QMap> getDeviceOscilloscopeCalibration(QString itemCatoryName,QString itemId,QMap *headList); - QMap> GetDataReturnItemListByOscilloscope(QString itemCatoryName,QList ResultData,QMap> DataMapList,QMap *HeadMapList); + static QMap> GetDataReturnItemListByOscilloscope(QString itemCatoryName,QList ResultData,QMap> DataMapList,QMap *HeadMapList); }; #endif // BASECOMMONAPI_H diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.cpp b/softwareDirectory/AutoVerScheme/basecommonapi.cpp index 07fa032..bb70bfc 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.cpp +++ b/softwareDirectory/AutoVerScheme/basecommonapi.cpp @@ -903,20 +903,18 @@ //CliTable[0].id //1717086652508487681 //根据被检设备的检定项分类去查询 TODO - if(deviceCatoryName.contains("数字多用表(手持)")){ DataList=BaseCommonApi::getVerMultiCalClass(deviceCatoryName,CliTable[0].id,HeadList); - } break; case 4: - if (deviceCatoryName.contains("一般压力表")){ DataList=BaseCommonApi::getDeviceMeasureCalibratorPistonGauge(deviceCatoryName,CliTable[0].id,HeadList); - }//else if 后续可判断其他检定项分类 break; case 13: //示波器标准装置 = 13 - //DataList=BaseCommonApi::getDeviceOscilloscopeCalibration(deviceCatoryName,CliTable[0].id,HeadList); + DataList=BaseCommonApi::getDeviceOscilloscopeCalibration(deviceCatoryName,CliTable[0].id,HeadList); break; + default: + break; } return DataList; @@ -3086,7 +3084,7 @@ if (query.exec()) { while (query.next()) { result.clear(); - result.append(query.value("id").toString()); + result.append(query.value("id").toString()); result.append(query.value("item_id").toString()); //检定项目ID result.append(query.value("time_base").toString());//时基 result.append(query.value("current_gain").toString());//直流增益(示波器-数字) @@ -3116,6 +3114,7 @@ result.append(query.value("signal_frequency").toString());//信号频率 result.append(query.value("nominal_value").toString());//标称值 result.append(query.value("nominal_value_unit").toString());//标称值单位 + result.append(query.value("item_type").toString());//项目 result.append(query.value("create_time").toString()); result.append(query.value("update_time").toString()); resultData.append(result); @@ -3125,42 +3124,202 @@ } - DataMapList= GetDataReturnItemListByPistonGauge(itemCatoryName,resultData,DataMapList,headList); + DataMapList=GetDataReturnItemListByOscilloscope(itemCatoryName,resultData,DataMapList,headList); return DataMapList; } QMap> BaseCommonApi::GetDataReturnItemListByOscilloscope(QString itemCatoryName,QList ResultData,QMap> DataMapList,QMap *HeadMapList) { - QList IndicationErrorList; + QList time_baseList; + QList Current_gainList; + QList Current_biasList; + QList band_widthList; + QList trigger_sensitivityList; + QList rise_timeList; + QList input_resistanceList; + QList calibrating_signalList; + if(itemCatoryName.contains("数字示波器")){ for(const QStringList &row : ResultData) { QString VerificationItem=NULL; + QStringList head; + QStringList Data; if (!row.isEmpty() && row[2] =="1") { - VerificationItem = "示值误差"; + VerificationItem = "时基"; //添加列头 - QStringList head; - head <<"序号"<<"检定项目"<<"轻敲前示值-正"<<"轻敲前示值-反"<<"轻敲后示值-正" - <<"轻敲后示值-反"<<"轻敲前后变动量-正"<<"轻敲前后变动量-反" ; + head <<"序号"<<"检定项目"<<"参考输出"<<"差拍波形频率测量值(Hz)"<<"时基相对误差△δ"<<"技术指标" + <<"结论"; HeadMapList->insert(VerificationItem,head); //添加数据 - QStringList Data; - Data.append(row[0]); //ID - Data.append(row[2]); //标准器示值 - - Data.append(row[2]);//轻敲前示值-正 - Data.append(row[2]);//"轻敲前示值-反" - Data.append(row[2]);//轻敲后示值-正 - Data.append(row[2]);//轻敲后示值-反 - Data.append("0");//轻敲前后变动量-正 - Data.append("0");//轻敲前后变动量-反 - IndicationErrorList.append(Data); + Data.append(VerificationItem); //检定项目 + Data.append("缺少");//参考输出 + Data.append("");//差拍波形频率测量值(Hz) + Data.append("");//时基相对误差△δ + Data.append("");//技术指标 + Data.append("");//结论 + time_baseList.append(Data); } + if (!row.isEmpty() && row[3] =="1") { + VerificationItem = "直流增益"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"阻抗"<<"垂直偏转系数(/div)"<<"标准值" + <<"测量值"<<"相对误差"<<"技术指标" <<"结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[16]);//阻抗 + Data.append(row[17]);//垂直偏转系数(/div) + Data.append(row[19]);//标准值 + Data.append("");//测量值 + Data.append("");//相对误差 + Data.append(row[13]);//技术指标 + Data.append("");//结论 + Current_gainList.append(Data); + } + if (!row.isEmpty() && row[4] =="1") { + VerificationItem = "直流偏置"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"阻抗"<<"垂直偏转系数(/div)"<<"标准值" + <<"测量值"<<"误差"<<"相对误差"<<"技术指标" <<"结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[16]);//阻抗 + Data.append(row[17]);//垂直偏转系数(/div) + Data.append(row[19]);//标准值 + Data.append("");//测量值 + Data.append("");//误差 + Data.append("");//相对误差 + Data.append(row[13]);//技术指标 + Data.append("");//结论 + Current_biasList.append(Data); + } + if (!row.isEmpty() && row[5] =="1") { + VerificationItem = "频带宽度"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"阻抗"<<"垂直偏转系数(/div)" + << "频带宽度" <<"参考幅度" <<"参考幅度单位" <<"测量幅度" <<"测量幅度单位" + <<"分贝数(dB)" <<"技术指标" << "结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[16]);//阻抗 + Data.append(row[17]);//垂直偏转系数(/div) + Data.append(row[22]);//频带宽度 + Data.append("");//参考幅度 + Data.append("");//参考幅度单位 + Data.append("");//测量幅度 + Data.append("");//测量幅度单位 + Data.append("");//分贝数(dB) + Data.append(row[13]);//技术指标 + Data.append("");//结论 + band_widthList.append(Data); + } + if (!row.isEmpty() && row[6] =="1") { + VerificationItem = "触发灵敏度"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"触发类型"<<"信号频率" + << "标称值" <<"测量值" <<"结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[26]);//触发类型 + Data.append(row[27]);//信号频率 + Data.append(row[28]);//标称值 + Data.append("");//测量值 + Data.append("");//结论 + trigger_sensitivityList.append(Data); + } + if (!row.isEmpty() && row[7] =="1") { + VerificationItem = "上升时间"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"阻抗"<<"垂直偏转系数(/div)" + <<"测量值"<<"测量值单位"<<"技术指标" <<"结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[16]);//阻抗 + Data.append(row[17]);//垂直偏转系数(/div) + Data.append("");//测量值 + Data.append("");//测量值单位 + Data.append(row[13]);//技术指标 + Data.append("");//结论 + rise_timeList.append(Data); + } + if (!row.isEmpty() && row[8] =="1") { + VerificationItem = "输入电阻"; + //添加列头 + head <<"序号"<<"检定项目"<<"通道"<<"标称值"<<"垂直偏转系数(/div)" + <<"测量值"<<"测量值单位"<<"技术指标" <<"结论"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[15]);//通道 + Data.append(row[28]+row[29]);//标称值 + Data.append(row[17]);//垂直偏转系数(/div) + Data.append("");//测量值 + Data.append("");//测量值单位 + Data.append(row[13]);//技术指标 + Data.append("");//结论 + input_resistanceList.append(Data); + } + if (!row.isEmpty() && row[9] =="1") { + VerificationItem = "校准信号"; + //添加列头 + head <<"序号"<<"检定项目"<<"项目"<<"标称值"<<"顶部测量值"<<"底部测量值" + <<"测量值"<<"测量值单位"<<"相对误差"; + HeadMapList->insert(VerificationItem,head); + //添加数据 + Data.append(row[0]); //ID + Data.append(VerificationItem); //检定项目 + Data.append(row[30]);//项目 + Data.append(row[28]+row[29]);//标称值 + Data.append("");//顶部测量值 + Data.append("");//底部测量值 + Data.append("");//测量值 + Data.append("");//测量值单位 + Data.append(row[13]);//技术指标 + Data.append("");//相对误差 + calibrating_signalList.append(Data); + } } } - if(IndicationErrorList.count()!=0){ - DataMapList.insert("示值误差",IndicationErrorList); + if(time_baseList.count()!=0){ + DataMapList.insert("时基",time_baseList); + }; + if(Current_gainList.count()!=0){ + DataMapList.insert("直流增益",Current_gainList); + }; + if(Current_biasList.count()!=0){ + DataMapList.insert("直流偏置",Current_biasList); + }; + if(band_widthList.count()!=0){ + DataMapList.insert("频带宽度",band_widthList); + }; + if(trigger_sensitivityList.count()!=0){ + DataMapList.insert("触发灵敏度",trigger_sensitivityList); + }; + if(rise_timeList.count()!=0){ + DataMapList.insert("上升时间",rise_timeList); + }; + if(input_resistanceList.count()!=0){ + DataMapList.insert("输入电阻",input_resistanceList); + }; + if(calibrating_signalList.count()!=0){ + DataMapList.insert("校准信号",calibrating_signalList); }; return DataMapList; } diff --git a/softwareDirectory/AutoVerScheme/basecommonapi.h b/softwareDirectory/AutoVerScheme/basecommonapi.h index 3c51ea2..fad47ba 100644 --- a/softwareDirectory/AutoVerScheme/basecommonapi.h +++ b/softwareDirectory/AutoVerScheme/basecommonapi.h @@ -1226,7 +1226,7 @@ //示波器 static QMap> getDeviceOscilloscopeCalibration(QString itemCatoryName,QString itemId,QMap *headList); - QMap> GetDataReturnItemListByOscilloscope(QString itemCatoryName,QList ResultData,QMap> DataMapList,QMap *HeadMapList); + static QMap> GetDataReturnItemListByOscilloscope(QString itemCatoryName,QList ResultData,QMap> DataMapList,QMap *HeadMapList); }; #endif // BASECOMMONAPI_H diff --git a/softwareDirectory/AutoVerScheme/checkwindow.cpp b/softwareDirectory/AutoVerScheme/checkwindow.cpp index 19a4fc2..ed4e7dd 100644 --- a/softwareDirectory/AutoVerScheme/checkwindow.cpp +++ b/softwareDirectory/AutoVerScheme/checkwindow.cpp @@ -181,8 +181,15 @@ break; } } + if(programList.count()==1) + { + sId = programList[0].id; + } if(sId==""){ - QMessageBox::warning(this, "提示", "请选择检定程序!"); + + QMessageBox::warning(this, "提示", "请选择检定程序!"); + + }else{ programInfo = BaseCommonApi::getVerificationProgramInfo(sId); //catDeviceList.clear(); @@ -219,8 +226,14 @@ break; } } + if(catIdList.count()==1) + { + sId = catIdList[0]; + } if(sId==""){ - QMessageBox::warning(this, "提示", "请选择标准设备!"); + + QMessageBox::warning(this, "提示", "请选择标准设备!"); + }else{ //programInfo = BaseCommonApi::getVerificationProgramInfo(sId); initDeviceInfo(sId); @@ -361,7 +374,9 @@ headTableList.clear(); //calibrationList =BaseCommonApi::Search_CalibrationTable(deviceId,&headList); caliDataList = BaseCommonApi::Search_CalibrationTableClass(deviceId,&headTableList); - + if(caliDataList.count()<1){ + QMessageBox::warning(this, "提示", "此检定项未开发或此设备无检测点"); + return;}; //tableWidgetItem ui->tableWidget_Point->clearContents(); ui->tableWidget_Point->setRowCount(0); @@ -825,7 +840,7 @@ deviceEngine.openDevice(connectList[0].programInterface.visa,"Visa"); if(connectList.length()>1&&connectList[1].type==1) { - if(standardEngine.openDevice(connectList[1].programInterface.visa,"Visa")); + if(standardEngine.openDevice(connectList[1].programInterface.visa,"Visa")) ui->tableWidget_Standard->setItem(0,1,new QTableWidgetItem("ON")); }