|
@@ -23,10 +23,27 @@ QString g_bookmark_test_picture[MAX_COMPARTMENT_NUM] = {BOOKMARK_TEST_PICTURE_1,
|
|
|
QString g_bookmark_systest_picture[MAX_COMPARTMENT_NUM] = {BOOKMARK_SYSTEST_PICTURE_1,BOOKMARK_SYSTEST_PICTURE_2,BOOKMARK_SYSTEST_PICTURE_3, BOOKMARK_SYSTEST_PICTURE_4};
|
|
|
QString g_bookmark_valvetest_picture[MAX_COMPARTMENT_NUM] = {BOOKMARK_VALVETEST_PICTURE_1,BOOKMARK_VALVETEST_PICTURE_2,BOOKMARK_VALVETEST_PICTURE_3, BOOKMARK_VALVETEST_PICTURE_4};
|
|
|
|
|
|
-
|
|
|
+QString g_bookmark_vrs_check[VRS_VISUAL_INSPECTION_ITEMS_NUM][3]={
|
|
|
+ {BOOKMARK_VRS_CHECK_ITEMS_1_0, BOOKMARK_VRS_CHECK_ITEMS_1_1, BOOKMARK_VRS_CHECK_ITEMS_1_2},
|
|
|
+ {BOOKMARK_VRS_CHECK_ITEMS_2_0, BOOKMARK_VRS_CHECK_ITEMS_2_1, BOOKMARK_VRS_CHECK_ITEMS_2_2},
|
|
|
+ {BOOKMARK_VRS_CHECK_ITEMS_3_0, BOOKMARK_VRS_CHECK_ITEMS_3_1, BOOKMARK_VRS_CHECK_ITEMS_3_2},
|
|
|
+ {BOOKMARK_VRS_CHECK_ITEMS_4_0, BOOKMARK_VRS_CHECK_ITEMS_4_1, BOOKMARK_VRS_CHECK_ITEMS_4_2},
|
|
|
+ {BOOKMARK_VRS_CHECK_ITEMS_5_0, BOOKMARK_VRS_CHECK_ITEMS_5_1, BOOKMARK_VRS_CHECK_ITEMS_5_2},
|
|
|
+ {BOOKMARK_VRS_CHECK_ITEMS_6_0, BOOKMARK_VRS_CHECK_ITEMS_6_1, BOOKMARK_VRS_CHECK_ITEMS_6_2},
|
|
|
+ {BOOKMARK_VRS_CHECK_ITEMS_7_0, BOOKMARK_VRS_CHECK_ITEMS_7_1, BOOKMARK_VRS_CHECK_ITEMS_7_2},
|
|
|
+ {BOOKMARK_VRS_CHECK_ITEMS_8_0, BOOKMARK_VRS_CHECK_ITEMS_8_1, BOOKMARK_VRS_CHECK_ITEMS_8_2}
|
|
|
+};
|
|
|
+
|
|
|
+QString g_bookmark_bls_check[BLS_VISUAL_INSPECTION_ITEMS_NUM][3]={
|
|
|
+ {BOOKMARK_BLS_CHECK_ITEMS_1_0, BOOKMARK_BLS_CHECK_ITEMS_1_1, BOOKMARK_BLS_CHECK_ITEMS_1_2},
|
|
|
+ {BOOKMARK_BLS_CHECK_ITEMS_2_0, BOOKMARK_BLS_CHECK_ITEMS_2_1, BOOKMARK_BLS_CHECK_ITEMS_2_2},
|
|
|
+ {BOOKMARK_BLS_CHECK_ITEMS_3_0, BOOKMARK_BLS_CHECK_ITEMS_3_1, BOOKMARK_BLS_CHECK_ITEMS_3_2},
|
|
|
+ {BOOKMARK_BLS_CHECK_ITEMS_4_0, BOOKMARK_BLS_CHECK_ITEMS_4_1, BOOKMARK_BLS_CHECK_ITEMS_4_2},
|
|
|
+ {BOOKMARK_BLS_CHECK_ITEMS_5_0, BOOKMARK_BLS_CHECK_ITEMS_5_1, BOOKMARK_BLS_CHECK_ITEMS_5_2}
|
|
|
+};
|
|
|
|
|
|
#define REPORT_TEMPLATES_PATH "D:/VaporRecoverySystemTest/Templates/"
|
|
|
-#define REPORT_TEMPLATES_NAME "report.dotx"
|
|
|
+#define REPORT_TEMPLATES_NAME "report_v2.dotx"
|
|
|
|
|
|
Report::Report()
|
|
|
{
|
|
@@ -96,6 +113,47 @@ bool Report::make_Word(Tanker& tanker, QString word_path, QString pic_dir)
|
|
|
bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
}
|
|
|
|
|
|
+ //外观检查项
|
|
|
+ for(int i=0; i<VRS_VISUAL_INSPECTION_ITEMS_NUM; i++){
|
|
|
+ int check_value = tanker.vrs_results[i];
|
|
|
+ if(check_value > 2 ) check_value = 2;
|
|
|
+ if(check_value < 0 ) check_value = 0;
|
|
|
+ //qDebug()<<g_bookmark_vrs_check[i][check_value];
|
|
|
+
|
|
|
+ bookmark = document->querySubObject("Bookmarks(QVariant)",g_bookmark_vrs_check[i][check_value]);
|
|
|
+ if(!bookmark->isNull())
|
|
|
+ {
|
|
|
+ QChar cc = 0x2611;
|
|
|
+ QString sText;
|
|
|
+ sText.insert(0, cc);
|
|
|
+ //int volume = m_tank.m_comparts[i].m_volume;
|
|
|
+ //QString sText=codec->toUnicode(QString::number(comp.m_volume).toStdString().c_str()); //此处为替换内容
|
|
|
+ //qDebug()<<"sText";
|
|
|
+
|
|
|
+ bookmark->dynamicCall("Select(void)"); //选中要选中的区域
|
|
|
+ bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for(int i=0; i<BLS_VISUAL_INSPECTION_ITEMS_NUM; i++){
|
|
|
+ int check_value = tanker.bls_results[i];
|
|
|
+ if(check_value > 2 ) check_value = 2;
|
|
|
+ if(check_value < 0 ) check_value = 0;
|
|
|
+ //qDebug()<<g_bookmark_bls_check[i][check_value];
|
|
|
+ bookmark = document->querySubObject("Bookmarks(QVariant)",g_bookmark_bls_check[i][check_value]);
|
|
|
+ if(!bookmark->isNull())
|
|
|
+ {
|
|
|
+ QChar cc = 0x2611;
|
|
|
+ QString sText;
|
|
|
+ sText.insert(0, cc);
|
|
|
+ //int volume = m_tank.m_comparts[i].m_volume;
|
|
|
+ //QString sText=codec->toUnicode(QString::number(comp.m_volume).toStdString().c_str()); //此处为替换内容
|
|
|
+ //qDebug()<<sText;
|
|
|
+ bookmark->dynamicCall("Select(void)"); //选中要选中的区域
|
|
|
+ bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//填写每仓容量
|
|
|
for(int i=0; i< tanker.compartment_num; i++){
|
|
|
|
|
@@ -110,7 +168,7 @@ bool Report::make_Word(Tanker& tanker, QString word_path, QString pic_dir)
|
|
|
bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
}
|
|
|
|
|
|
- if(comp.m_result.sys_test_ok){ //完成了系统密闭性检测
|
|
|
+ if(comp.m_result.sys_test_finished){ //完成了系统密闭性检测
|
|
|
|
|
|
//密闭性检测的初始表压
|
|
|
bookmark = document->querySubObject("Bookmarks(QVariant)",g_bookmark_systest_startpressure[i]);
|
|
@@ -162,7 +220,7 @@ bool Report::make_Word(Tanker& tanker, QString word_path, QString pic_dir)
|
|
|
|
|
|
}
|
|
|
|
|
|
- if(comp.m_result.valve_test_ok){ //完成了阀门密闭性检测
|
|
|
+ if(comp.m_result.valve_test_finished){ //完成了阀门密闭性检测
|
|
|
|
|
|
//密闭性检测的初始表压
|
|
|
bookmark = document->querySubObject("Bookmarks(QVariant)",g_bookmark_valvetest_startpressure[i]);
|
|
@@ -312,7 +370,7 @@ bool Report::make_Word(Tanker& tanker, QString word_path, QString pic_dir)
|
|
|
for(int i=0; i<tanker.compartment_num; i++){
|
|
|
|
|
|
Compartment& comp = tanker.get_compartment(i);
|
|
|
- if(comp.m_result.sys_test_ok){
|
|
|
+ if(comp.m_result.sys_test_finished){
|
|
|
if(!comp.m_result.pass_sys_pressure){
|
|
|
systest_pass = false;
|
|
|
}
|
|
@@ -320,7 +378,7 @@ bool Report::make_Word(Tanker& tanker, QString word_path, QString pic_dir)
|
|
|
nosys_testcount++;
|
|
|
}
|
|
|
|
|
|
- if(comp.m_result.valve_test_ok){
|
|
|
+ if(comp.m_result.valve_test_finished){
|
|
|
if(!comp.m_result.pass_valve_pressure){
|
|
|
valvetest_pass = false;
|
|
|
}
|
|
@@ -331,37 +389,48 @@ bool Report::make_Word(Tanker& tanker, QString word_path, QString pic_dir)
|
|
|
|
|
|
if(nosys_testcount != tanker.compartment_num){
|
|
|
//系统检测结果
|
|
|
- bookmark = document->querySubObject("Bookmarks(QVariant)",BOOKMARK_SYSTEST_RESULT);
|
|
|
- if(!bookmark->isNull())
|
|
|
- {
|
|
|
- QString sText;
|
|
|
- if(systest_pass){
|
|
|
- sText=codec->toUnicode("合格");
|
|
|
- }else{
|
|
|
- sText=codec->toUnicode("超标");
|
|
|
+ QChar cc = 0x2611;
|
|
|
+ QString sText;
|
|
|
+ sText.insert(0, cc);
|
|
|
+ if(systest_pass){
|
|
|
+ bookmark = document->querySubObject("Bookmarks(QVariant)",BOOKMARK_SYSTEST_PASS);
|
|
|
+ if(!bookmark->isNull())
|
|
|
+ {
|
|
|
+ bookmark->dynamicCall("Select(void)"); //选中要选中的区域
|
|
|
+ bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ bookmark = document->querySubObject("Bookmarks(QVariant)",BOOKMARK_SYSTEST_EXCEEDED);
|
|
|
+ if(!bookmark->isNull())
|
|
|
+ {
|
|
|
+ bookmark->dynamicCall("Select(void)"); //选中要选中的区域
|
|
|
+ bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
}
|
|
|
- qDebug()<<sText;
|
|
|
- bookmark->dynamicCall("Select(void)"); //选中要选中的区域
|
|
|
- bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
if(novalve_testcount != tanker.compartment_num){
|
|
|
//阀门检测结果
|
|
|
- bookmark = document->querySubObject("Bookmarks(QVariant)",BOOKMARK_VALVETEST_RESULT);
|
|
|
- if(!bookmark->isNull())
|
|
|
- {
|
|
|
- QString sText;
|
|
|
- if(valvetest_pass){
|
|
|
- sText=codec->toUnicode("合格");
|
|
|
- }else{
|
|
|
- sText=codec->toUnicode("超标");
|
|
|
+ QChar cc = 0x2611;
|
|
|
+ QString sText;
|
|
|
+ sText.insert(0, cc);
|
|
|
+ if(valvetest_pass){
|
|
|
+ bookmark = document->querySubObject("Bookmarks(QVariant)",BOOKMARK_VALVETEST_PASS);
|
|
|
+ if(!bookmark->isNull())
|
|
|
+ {
|
|
|
+ bookmark->dynamicCall("Select(void)"); //选中要选中的区域
|
|
|
+ bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ bookmark = document->querySubObject("Bookmarks(QVariant)",BOOKMARK_VALVETEST_EXCEEDED);
|
|
|
+ if(!bookmark->isNull())
|
|
|
+ {
|
|
|
+ bookmark->dynamicCall("Select(void)"); //选中要选中的区域
|
|
|
+ bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
}
|
|
|
-
|
|
|
- bookmark->dynamicCall("Select(void)"); //选中要选中的区域
|
|
|
- bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
@@ -470,6 +539,41 @@ bool Report::make_PDF(Tanker& tanker, QString word_path, QString pic_dir)
|
|
|
bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
}
|
|
|
|
|
|
+ //外观检查项
|
|
|
+ for(int i=0; i<VRS_VISUAL_INSPECTION_ITEMS_NUM; i++){
|
|
|
+ int check_value = tanker.vrs_results[i];
|
|
|
+ if(check_value > 2 ) check_value = 2;
|
|
|
+ if(check_value < 0 ) check_value = 0;
|
|
|
+
|
|
|
+ bookmark = document->querySubObject("Bookmarks(QVariant)",g_bookmark_vrs_check[i][check_value]);
|
|
|
+ if(!bookmark->isNull())
|
|
|
+ {
|
|
|
+ QChar cc = 0x2611;
|
|
|
+ QString sText;
|
|
|
+ sText.insert(0, cc);
|
|
|
+
|
|
|
+ bookmark->dynamicCall("Select(void)"); //选中要选中的区域
|
|
|
+ bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ for(int i=0; i<BLS_VISUAL_INSPECTION_ITEMS_NUM; i++){
|
|
|
+ int check_value = tanker.bls_results[i];
|
|
|
+ if(check_value > 2 ) check_value = 2;
|
|
|
+ if(check_value < 0 ) check_value = 0;
|
|
|
+
|
|
|
+ bookmark = document->querySubObject("Bookmarks(QVariant)",g_bookmark_bls_check[i][check_value]);
|
|
|
+ if(!bookmark->isNull())
|
|
|
+ {
|
|
|
+ QChar cc = 0x2611;
|
|
|
+ QString sText;
|
|
|
+ sText.insert(0, cc);
|
|
|
+
|
|
|
+ bookmark->dynamicCall("Select(void)"); //选中要选中的区域
|
|
|
+ bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//填写每仓容量
|
|
|
for(int i=0; i< tanker.compartment_num; i++){
|
|
|
|
|
@@ -484,7 +588,7 @@ bool Report::make_PDF(Tanker& tanker, QString word_path, QString pic_dir)
|
|
|
bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
}
|
|
|
|
|
|
- if(comp.m_result.sys_test_ok){ //完成了系统密闭性检测
|
|
|
+ if(comp.m_result.sys_test_finished){ //完成了系统密闭性检测
|
|
|
|
|
|
//密闭性检测的初始表压
|
|
|
bookmark = document->querySubObject("Bookmarks(QVariant)",g_bookmark_systest_startpressure[i]);
|
|
@@ -536,7 +640,7 @@ bool Report::make_PDF(Tanker& tanker, QString word_path, QString pic_dir)
|
|
|
|
|
|
}
|
|
|
|
|
|
- if(comp.m_result.valve_test_ok){ //完成了阀门密闭性检测
|
|
|
+ if(comp.m_result.valve_test_finished){ //完成了阀门密闭性检测
|
|
|
|
|
|
//密闭性检测的初始表压
|
|
|
bookmark = document->querySubObject("Bookmarks(QVariant)",g_bookmark_valvetest_startpressure[i]);
|
|
@@ -686,7 +790,7 @@ bool Report::make_PDF(Tanker& tanker, QString word_path, QString pic_dir)
|
|
|
for(int i=0; i<tanker.compartment_num; i++){
|
|
|
|
|
|
Compartment& comp = tanker.get_compartment(i);
|
|
|
- if(comp.m_result.sys_test_ok){
|
|
|
+ if(comp.m_result.sys_test_finished){
|
|
|
if(!comp.m_result.pass_sys_pressure){
|
|
|
systest_pass = false;
|
|
|
}
|
|
@@ -694,7 +798,7 @@ bool Report::make_PDF(Tanker& tanker, QString word_path, QString pic_dir)
|
|
|
nosys_testcount++;
|
|
|
}
|
|
|
|
|
|
- if(comp.m_result.valve_test_ok){
|
|
|
+ if(comp.m_result.valve_test_finished){
|
|
|
if(!comp.m_result.pass_valve_pressure){
|
|
|
valvetest_pass = false;
|
|
|
}
|
|
@@ -705,36 +809,46 @@ bool Report::make_PDF(Tanker& tanker, QString word_path, QString pic_dir)
|
|
|
|
|
|
if(nosys_testcount != tanker.compartment_num){
|
|
|
//系统检测结果
|
|
|
- bookmark = document->querySubObject("Bookmarks(QVariant)",BOOKMARK_SYSTEST_RESULT);
|
|
|
- if(!bookmark->isNull())
|
|
|
- {
|
|
|
- QString sText;
|
|
|
- if(systest_pass){
|
|
|
- sText=codec->toUnicode("合格");
|
|
|
- }else{
|
|
|
- sText=codec->toUnicode("超标");
|
|
|
+ QChar cc = 0x2611;
|
|
|
+ QString sText;
|
|
|
+ sText.insert(0, cc);
|
|
|
+ if(systest_pass){
|
|
|
+ bookmark = document->querySubObject("Bookmarks(QVariant)",BOOKMARK_SYSTEST_PASS);
|
|
|
+ if(!bookmark->isNull())
|
|
|
+ {
|
|
|
+ bookmark->dynamicCall("Select(void)"); //选中要选中的区域
|
|
|
+ bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ bookmark = document->querySubObject("Bookmarks(QVariant)",BOOKMARK_SYSTEST_EXCEEDED);
|
|
|
+ if(!bookmark->isNull())
|
|
|
+ {
|
|
|
+ bookmark->dynamicCall("Select(void)"); //选中要选中的区域
|
|
|
+ bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
}
|
|
|
- qDebug()<<sText;
|
|
|
- bookmark->dynamicCall("Select(void)"); //选中要选中的区域
|
|
|
- bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
if(novalve_testcount != tanker.compartment_num){
|
|
|
//阀门检测结果
|
|
|
- bookmark = document->querySubObject("Bookmarks(QVariant)",BOOKMARK_VALVETEST_RESULT);
|
|
|
- if(!bookmark->isNull())
|
|
|
- {
|
|
|
- QString sText;
|
|
|
- if(valvetest_pass){
|
|
|
- sText=codec->toUnicode("合格");
|
|
|
- }else{
|
|
|
- sText=codec->toUnicode("超标");
|
|
|
+ QChar cc = 0x2611;
|
|
|
+ QString sText;
|
|
|
+ sText.insert(0, cc);
|
|
|
+ if(valvetest_pass){
|
|
|
+ bookmark = document->querySubObject("Bookmarks(QVariant)",BOOKMARK_VALVETEST_PASS);
|
|
|
+ if(!bookmark->isNull())
|
|
|
+ {
|
|
|
+ bookmark->dynamicCall("Select(void)"); //选中要选中的区域
|
|
|
+ bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ bookmark = document->querySubObject("Bookmarks(QVariant)",BOOKMARK_VALVETEST_EXCEEDED);
|
|
|
+ if(!bookmark->isNull())
|
|
|
+ {
|
|
|
+ bookmark->dynamicCall("Select(void)"); //选中要选中的区域
|
|
|
+ bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
}
|
|
|
-
|
|
|
- bookmark->dynamicCall("Select(void)"); //选中要选中的区域
|
|
|
- bookmark->querySubObject("Range")->setProperty("Text",sText); //进行替换操作
|
|
|
}
|
|
|
}
|
|
|
|