|
@@ -35,10 +35,8 @@ TestService::TestService(QThread *parent)
|
|
m_tank.m_comparts[i].m_id = i;
|
|
m_tank.m_comparts[i].m_id = i;
|
|
}
|
|
}
|
|
|
|
|
|
- //moveToThread(&m_Thread);
|
|
|
|
- //connect(this, SIGNAL(operate()), this, SLOT(doTest()));
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
TestService::~TestService()
|
|
TestService::~TestService()
|
|
{
|
|
{
|
|
|
|
|
|
@@ -299,7 +297,7 @@ bool TestService::reportpic_Ready(int compartmentid)
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
-bool TestService::check_alltest_ok()
|
|
|
|
|
|
+bool TestService::check_alltest_ok(int with_tips)
|
|
{
|
|
{
|
|
bool ret_flag = true;
|
|
bool ret_flag = true;
|
|
for(int i=0; i< m_tank.compartment_num; i++){
|
|
for(int i=0; i< m_tank.compartment_num; i++){
|
|
@@ -310,7 +308,7 @@ bool TestService::check_alltest_ok()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if(false == ret_flag){
|
|
|
|
|
|
+ if((false == ret_flag) && (1 == with_tips)){
|
|
QMessageBox::StandardButton result = QMessageBox::question(NULL, "提示:", "有油仓还未进行检测,是否强制生成报告?", QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
|
|
QMessageBox::StandardButton result = QMessageBox::question(NULL, "提示:", "有油仓还未进行检测,是否强制生成报告?", QMessageBox::Yes|QMessageBox::No, QMessageBox::No);
|
|
|
|
|
|
switch (result)
|
|
switch (result)
|
|
@@ -351,6 +349,38 @@ bool TestService::genReport(QString word_path, QString pic_dir)
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+bool TestService::genReport_Self(QString word_path, QString pic_dir)
|
|
|
|
+{
|
|
|
|
+ bool ret = false;
|
|
|
|
+
|
|
|
|
+ if(word_path.contains(".doc") || word_path.contains(".pdf") ){
|
|
|
|
+ m_report.makeReport_Self(m_devinfo, word_path, pic_dir);
|
|
|
|
+ }else{
|
|
|
|
+ QString str = "word_path invalid!";
|
|
|
|
+ qDebug() << str;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return ret;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+bool TestService::genReport_Self2(const QString& jsonStr, QString word_path, QString pic_dir)
|
|
|
|
+{
|
|
|
|
+ bool ret = false;
|
|
|
|
+
|
|
|
|
+ if(word_path.contains(".doc") || word_path.contains(".pdf") ){
|
|
|
|
+
|
|
|
|
+ qDebug() << "genReport_Self2 jsonStr:" << jsonStr;
|
|
|
|
+ m_devinfo2.update_testinfo(jsonStr);
|
|
|
|
+ m_report.makeReport_Self(m_devinfo2, word_path, pic_dir);
|
|
|
|
+
|
|
|
|
+ }else{
|
|
|
|
+ QString str = "word_path invalid!";
|
|
|
|
+ qDebug() << str;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return ret;
|
|
|
|
+}
|
|
|
|
+
|
|
QJsonObject TestService::get_vrs_items()
|
|
QJsonObject TestService::get_vrs_items()
|
|
{
|
|
{
|
|
return m_tank.get_vrs_items();
|
|
return m_tank.get_vrs_items();
|
|
@@ -366,8 +396,28 @@ bool TestService::set_item_result(const QString& jsonStr )
|
|
return m_tank.set_item_result(jsonStr);
|
|
return m_tank.set_item_result(jsonStr);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+bool TestService::set_leakage_value(const QString& jsonStr)
|
|
|
|
+{
|
|
|
|
+ return m_tank.set_leakage_value(jsonStr);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+QJsonObject TestService::get_selftest_info()
|
|
|
|
+{
|
|
|
|
+ QJsonObject rootObj;
|
|
|
|
+
|
|
|
|
+ rootObj.insert("target", m_devinfo.m_testinfo.m_target);
|
|
|
|
+ rootObj.insert("interval", m_devinfo.m_testinfo.m_interval);
|
|
|
|
+ rootObj.insert("threshold", m_devinfo.m_testinfo.m_threshold);
|
|
|
|
+ rootObj.insert("begin", m_devinfo.m_testinfo.m_begin);
|
|
|
|
+ rootObj.insert("end", m_devinfo.m_testinfo.m_end);
|
|
|
|
+ rootObj.insert("delta", m_devinfo.m_testinfo.m_delta);
|
|
|
|
+ rootObj.insert("passed", m_devinfo.m_testinfo.m_passed);
|
|
|
|
+
|
|
|
|
+ return rootObj;
|
|
|
|
+}
|
|
|
|
|
|
-void TestService::push_pressurelist(float pressure)
|
|
|
|
|
|
+
|
|
|
|
+void TestService::push_pressurelist(double pressure)
|
|
{
|
|
{
|
|
m_pressuremutex.lock();
|
|
m_pressuremutex.lock();
|
|
|
|
|
|
@@ -384,16 +434,16 @@ void TestService::clear_pressurelist()
|
|
m_pressuremutex.unlock();
|
|
m_pressuremutex.unlock();
|
|
}
|
|
}
|
|
|
|
|
|
-float TestService::calculate_averagepressure()
|
|
|
|
|
|
+double TestService::calculate_averagepressure()
|
|
{
|
|
{
|
|
- float average = 0.0;
|
|
|
|
|
|
+ double average = 0.0;
|
|
|
|
|
|
m_pressuremutex.lock();
|
|
m_pressuremutex.lock();
|
|
int n = m_pressurelist.size();
|
|
int n = m_pressurelist.size();
|
|
|
|
|
|
if(n>0){
|
|
if(n>0){
|
|
|
|
|
|
- float sum = 0.0;
|
|
|
|
|
|
+ double sum = 0.0;
|
|
for(int i=0; i<n; i++){
|
|
for(int i=0; i<n; i++){
|
|
sum += m_pressurelist.at(i);
|
|
sum += m_pressurelist.at(i);
|
|
//qDebug("push_pressurelist 333 size[%f]", m_pressurelist.at(i));
|
|
//qDebug("push_pressurelist 333 size[%f]", m_pressurelist.at(i));
|
|
@@ -433,6 +483,7 @@ bool TestService::valve_close(Valve_ID id)
|
|
QString TestService::read_PressureValue()
|
|
QString TestService::read_PressureValue()
|
|
{
|
|
{
|
|
float pressure = 0.0;
|
|
float pressure = 0.0;
|
|
|
|
+ double d_pressure = 0.0;
|
|
static int timeout_count =0;
|
|
static int timeout_count =0;
|
|
|
|
|
|
PressureSensor ps(&m_SerialUi4);
|
|
PressureSensor ps(&m_SerialUi4);
|
|
@@ -454,9 +505,9 @@ QString TestService::read_PressureValue()
|
|
|
|
|
|
int _ipressure = pressure*1000;
|
|
int _ipressure = pressure*1000;
|
|
_ipressure = (_ipressure/PRESSURE_DIVISION_VALUE)*PRESSURE_DIVISION_VALUE;
|
|
_ipressure = (_ipressure/PRESSURE_DIVISION_VALUE)*PRESSURE_DIVISION_VALUE;
|
|
- pressure = _ipressure/1000.0;
|
|
|
|
|
|
+ d_pressure = _ipressure/1000.0;
|
|
|
|
|
|
- QString pressure_str = QString("%1").arg(pressure, 4,'f',2,QLatin1Char('0'));
|
|
|
|
|
|
+ QString pressure_str = QString("%1").arg(d_pressure, 4,'f',2,QLatin1Char('0'));
|
|
return pressure_str;
|
|
return pressure_str;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -540,6 +591,18 @@ void TestService::OnTimer1()
|
|
|
|
|
|
PressureSensor ps(&m_SerialUi4);
|
|
PressureSensor ps(&m_SerialUi4);
|
|
if(ps.Read(pressure)){
|
|
if(ps.Read(pressure)){
|
|
|
|
+ if(m_direction == Test_Direction_Positive){
|
|
|
|
+ //正压检测,不允许出现负值
|
|
|
|
+ if(pressure < 0.0){
|
|
|
|
+ pressure = 0.0;
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ // 负压检测,不允许出现正值
|
|
|
|
+ if(pressure > 0.0){
|
|
|
|
+ pressure = 0.0;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
push_pressurelist(pressure);
|
|
push_pressurelist(pressure);
|
|
timeout_count=0;
|
|
timeout_count=0;
|
|
@@ -560,12 +623,13 @@ void TestService::OnTimer1()
|
|
if(0 == times_count%2){
|
|
if(0 == times_count%2){
|
|
|
|
|
|
int _ipressure = 0;
|
|
int _ipressure = 0;
|
|
|
|
+ double d_pressure = 0.00;
|
|
|
|
|
|
_ipressure = pressure*1000;
|
|
_ipressure = pressure*1000;
|
|
_ipressure = (_ipressure/PRESSURE_DIVISION_VALUE)*PRESSURE_DIVISION_VALUE;
|
|
_ipressure = (_ipressure/PRESSURE_DIVISION_VALUE)*PRESSURE_DIVISION_VALUE;
|
|
- pressure = _ipressure/1000.0;
|
|
|
|
|
|
+ d_pressure = _ipressure/1000.0;
|
|
|
|
|
|
- QString pressure_str = QString("%1").arg(pressure, 4,'f',2,QLatin1Char('0'));
|
|
|
|
|
|
+ QString pressure_str = QString("%1").arg(d_pressure, 4,'f',2,QLatin1Char('0'));
|
|
|
|
|
|
PressureItem item;
|
|
PressureItem item;
|
|
//item.m_pressure = pressure_str;
|
|
//item.m_pressure = pressure_str;
|
|
@@ -614,8 +678,8 @@ Ret_Value TestService::PositivePressure_Add(const TestExpect& expect, bool bSav
|
|
|
|
|
|
QElapsedTimer timer;
|
|
QElapsedTimer timer;
|
|
timer.start();
|
|
timer.start();
|
|
- float prev_pressure = 0;
|
|
|
|
- float current_pressure = 0;
|
|
|
|
|
|
+ double prev_pressure = 0;
|
|
|
|
+ double current_pressure = 0;
|
|
|
|
|
|
double current_speed = 0;
|
|
double current_speed = 0;
|
|
unsigned char bvstatus;
|
|
unsigned char bvstatus;
|
|
@@ -651,7 +715,7 @@ Ret_Value TestService::PositivePressure_Add(const TestExpect& expect, bool bSav
|
|
|
|
|
|
Valve in_v(&m_SerialUi3, VALVE_INTAKE);
|
|
Valve in_v(&m_SerialUi3, VALVE_INTAKE);
|
|
bool bOpen_intake = false;
|
|
bool bOpen_intake = false;
|
|
- //bOpen_intake = in_v.Open();
|
|
|
|
|
|
+ bOpen_intake = in_v.Open();
|
|
|
|
|
|
//
|
|
//
|
|
QDateTime datetime = QDateTime::currentDateTime();
|
|
QDateTime datetime = QDateTime::currentDateTime();
|
|
@@ -688,6 +752,11 @@ Ret_Value TestService::PositivePressure_Add(const TestExpect& expect, bool bSav
|
|
bv.SetPosition(bvoffset);
|
|
bv.SetPosition(bvoffset);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //
|
|
|
|
+ if(true == bv_ready){
|
|
|
|
+ pPIDinner->reset();
|
|
|
|
+ }
|
|
}else{
|
|
}else{
|
|
|
|
|
|
current_pressure = calculate_averagepressure();
|
|
current_pressure = calculate_averagepressure();
|
|
@@ -902,7 +971,7 @@ Ret_Value TestService::PositivePressure_Add_V2(const TestExpect& expect)
|
|
|
|
|
|
QElapsedTimer timer;
|
|
QElapsedTimer timer;
|
|
timer.start();
|
|
timer.start();
|
|
- float current_pressure = 0;
|
|
|
|
|
|
+ double current_pressure = 0;
|
|
unsigned char bvstatus;
|
|
unsigned char bvstatus;
|
|
unsigned short bvposition;
|
|
unsigned short bvposition;
|
|
unsigned short bvoffset = 120;
|
|
unsigned short bvoffset = 120;
|
|
@@ -1059,6 +1128,8 @@ Ret_Value TestService::PositivePressure_Add_V2(const TestExpect& expect)
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+//将打开泄压阀,等待压力归零 (小于 0.01Kpa )。
|
|
Ret_Value TestService::Pressure_Relief(const TestExpect& expect)
|
|
Ret_Value TestService::Pressure_Relief(const TestExpect& expect)
|
|
{
|
|
{
|
|
Ret_Value ret_v = Ret_OK;
|
|
Ret_Value ret_v = Ret_OK;
|
|
@@ -1094,7 +1165,7 @@ Ret_Value TestService::Pressure_Relief(const TestExpect& expect)
|
|
last_pressure = current_pressure;
|
|
last_pressure = current_pressure;
|
|
}
|
|
}
|
|
|
|
|
|
- if((count > 20) ||(current_pressure < 0.01)){
|
|
|
|
|
|
+ if((count > 20) ||(fabs(current_pressure) < 0.01)){
|
|
//关闭泄压阀
|
|
//关闭泄压阀
|
|
vent_v.Close();
|
|
vent_v.Close();
|
|
break;
|
|
break;
|
|
@@ -1178,15 +1249,18 @@ Ret_Value TestService::Pressure_Relief()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-Ret_Value TestService::Pressure_Keep(int keeptime, float& start_value, float& end_value)
|
|
|
|
|
|
+Ret_Value TestService::Pressure_Keep(int keeptime, double& start_value, double& end_value)
|
|
{
|
|
{
|
|
int count = 0;
|
|
int count = 0;
|
|
|
|
|
|
Ret_Value ret_v = Ret_OK;
|
|
Ret_Value ret_v = Ret_OK;
|
|
|
|
|
|
start_value = calculate_averagepressure();
|
|
start_value = calculate_averagepressure();
|
|
- int _ipressure = start_value*100;
|
|
|
|
- start_value = _ipressure/100.0;
|
|
|
|
|
|
+
|
|
|
|
+ int _ipressure = start_value*1000;
|
|
|
|
+ _ipressure = (_ipressure/PRESSURE_DIVISION_VALUE)*PRESSURE_DIVISION_VALUE;
|
|
|
|
+ start_value = _ipressure/1000.0;
|
|
|
|
+
|
|
|
|
|
|
while((count < keeptime) && m_bRunning){
|
|
while((count < keeptime) && m_bRunning){
|
|
QThread::msleep(1000);
|
|
QThread::msleep(1000);
|
|
@@ -1195,8 +1269,9 @@ Ret_Value TestService::Pressure_Keep(int keeptime, float& start_value, float& e
|
|
|
|
|
|
end_value = calculate_averagepressure();
|
|
end_value = calculate_averagepressure();
|
|
|
|
|
|
- _ipressure = end_value*100;
|
|
|
|
- end_value = _ipressure/100.0;
|
|
|
|
|
|
+ _ipressure = end_value*1000;
|
|
|
|
+ _ipressure = (_ipressure/PRESSURE_DIVISION_VALUE)*PRESSURE_DIVISION_VALUE;
|
|
|
|
+ end_value = _ipressure/1000.0;
|
|
|
|
|
|
|
|
|
|
if(!m_bRunning){
|
|
if(!m_bRunning){
|
|
@@ -1419,9 +1494,9 @@ void TestService::run()
|
|
//bool bPassed = true;
|
|
//bool bPassed = true;
|
|
|
|
|
|
// 检测 5分钟都没超限,就是通过了
|
|
// 检测 5分钟都没超限,就是通过了
|
|
- float delta = 0;
|
|
|
|
- float start_value = 0.0;
|
|
|
|
- float end_value = 0.0;
|
|
|
|
|
|
+ double delta = 0;
|
|
|
|
+ double start_value = 0.0;
|
|
|
|
+ double end_value = 0.0;
|
|
bool bPassed = true;
|
|
bool bPassed = true;
|
|
|
|
|
|
//ret_v = Pressure_Keep2(5*60, start_value, end_value);
|
|
//ret_v = Pressure_Keep2(5*60, start_value, end_value);
|
|
@@ -1534,7 +1609,7 @@ void TestService::run()
|
|
|
|
|
|
texpect.volume = 0;
|
|
texpect.volume = 0;
|
|
texpect.target = 0.0;
|
|
texpect.target = 0.0;
|
|
- texpect.timeout = 60;//m_tank.m_comparts[m_compartmentid].get_adjust_timeout();
|
|
|
|
|
|
+ texpect.timeout = 90;//m_tank.m_comparts[m_compartmentid].get_adjust_timeout();
|
|
ret_v = Pressure_Relief(texpect);
|
|
ret_v = Pressure_Relief(texpect);
|
|
if(Ret_Exit == ret_v){
|
|
if(Ret_Exit == ret_v){
|
|
bQuit = true;
|
|
bQuit = true;
|
|
@@ -1580,6 +1655,38 @@ void TestService::run()
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if(Test_Step_End == m_step){
|
|
|
|
+ ret_btn = m_msgbox.information(NULL, "提示:", "检测结束,是否要泄压? 此过程可能需要很长时间", QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes);
|
|
|
|
+ }else{
|
|
|
|
+
|
|
|
|
+ ret_btn = QMessageBox::NoButton;
|
|
|
|
+ if(true == bQuit){
|
|
|
|
+ ret_btn = m_msgbox.information(NULL, "提示:", "程序即将退出,是否要泄压? 此过程可能需要很长时间", QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ switch (ret_btn)
|
|
|
|
+ {
|
|
|
|
+ case QMessageBox::Yes:
|
|
|
|
+ if(m_step == Test_Step_reliefPressure){
|
|
|
|
+ m_msgbox.information(NULL, "提示:", "即将对罐仓内压力进行泄放,请确认已打开油气回收阀", QMessageBox::Yes, QMessageBox::Yes);
|
|
|
|
+ }
|
|
|
|
+ Pressure_Relief();
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ if((true == m_tank.m_comparts[m_compartmentid].m_result.sys_test_finished))
|
|
|
|
+ //&& (true == m_tank.m_comparts[m_compartmentid].m_result.valve_test_finished))
|
|
|
|
+ {
|
|
|
|
+ m_tank.m_comparts[m_compartmentid].m_testfinished = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ emit sigStop(m_compartmentid+1);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
}else{
|
|
}else{
|
|
//负压测试, 暂不支持
|
|
//负压测试, 暂不支持
|
|
@@ -1625,8 +1732,8 @@ void TestService::run()
|
|
QThread::msleep(2000);
|
|
QThread::msleep(2000);
|
|
|
|
|
|
texpect.volume = 0;
|
|
texpect.volume = 0;
|
|
- texpect.target = 4.50;
|
|
|
|
- texpect.timeout = 5*60; //3分钟
|
|
|
|
|
|
+ texpect.target = m_devinfo.m_testinfo.m_target;
|
|
|
|
+ texpect.timeout = 5*60; //5分钟
|
|
ret_v = PositivePressure_Add(texpect);
|
|
ret_v = PositivePressure_Add(texpect);
|
|
|
|
|
|
if(Ret_Exit == ret_v){
|
|
if(Ret_Exit == ret_v){
|
|
@@ -1636,27 +1743,24 @@ void TestService::run()
|
|
}else{
|
|
}else{
|
|
|
|
|
|
ret_btn = QMessageBox::NoButton;
|
|
ret_btn = QMessageBox::NoButton;
|
|
- if(Ret_Timeout == ret_v){
|
|
|
|
- notice_str = "正压加压超时, 是否重试?";
|
|
|
|
- ret_btn = m_msgbox.information(NULL, "提示:", notice_str, QMessageBox::Retry|QMessageBox::Abort, QMessageBox::Retry);
|
|
|
|
- }else{
|
|
|
|
- notice_str = "继电器通信失败, 程序终止";
|
|
|
|
- ret_btn = m_msgbox.information(NULL, "提示:", notice_str, QMessageBox::Ok, QMessageBox::Ok);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- switch (ret_btn)
|
|
|
|
- {
|
|
|
|
- case QMessageBox::Retry:
|
|
|
|
- break;
|
|
|
|
- case QMessageBox::Abort:
|
|
|
|
- bQuit = true;
|
|
|
|
- break;
|
|
|
|
- case QMessageBox::Ok:
|
|
|
|
- bQuit = true;
|
|
|
|
- break;
|
|
|
|
- default:
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ ret_btn = make_messagebox(m_direction, m_step, ret_v);
|
|
|
|
+ switch (ret_btn)
|
|
|
|
+ {
|
|
|
|
+ case QMessageBox::Retry:
|
|
|
|
+ qDebug()<<"Retry";
|
|
|
|
+
|
|
|
|
+ break;
|
|
|
|
+ case QMessageBox::Abort:
|
|
|
|
+ qDebug()<<"Abort";
|
|
|
|
+ bQuit = true;
|
|
|
|
+ break;
|
|
|
|
+ case QMessageBox::Ok:
|
|
|
|
+ qDebug()<<"OK";
|
|
|
|
+ bQuit = true;
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1667,24 +1771,34 @@ void TestService::run()
|
|
emit sigState(m_compartmentid+1, "保压", "");
|
|
emit sigState(m_compartmentid+1, "保压", "");
|
|
|
|
|
|
// 检测 5分钟都没超限,就是通过了
|
|
// 检测 5分钟都没超限,就是通过了
|
|
- float delta = 0;
|
|
|
|
- float start_value = 0.0;
|
|
|
|
- float end_value = 0.0;
|
|
|
|
|
|
+ double delta = 0;
|
|
|
|
+ double start_value = 0.0;
|
|
|
|
+ double end_value = 0.0;
|
|
bool bPassed = true;
|
|
bool bPassed = true;
|
|
|
|
|
|
- ret_v = Pressure_Keep(5*60, start_value, end_value);
|
|
|
|
|
|
+ ret_v = Pressure_Keep(m_devinfo.m_testinfo.m_interval, start_value, end_value);
|
|
|
|
|
|
if(Ret_Exit == ret_v){
|
|
if(Ret_Exit == ret_v){
|
|
bQuit = true;
|
|
bQuit = true;
|
|
}else {
|
|
}else {
|
|
|
|
|
|
|
|
+ m_devinfo.m_testinfo.m_begin = start_value;
|
|
|
|
+ m_devinfo.m_testinfo.m_end = end_value;
|
|
|
|
+
|
|
delta = start_value - end_value;
|
|
delta = start_value - end_value;
|
|
- if(delta <= 0.5){
|
|
|
|
|
|
+
|
|
|
|
+ if(delta <= m_devinfo.m_testinfo.m_threshold){
|
|
bPassed = true;
|
|
bPassed = true;
|
|
}else{
|
|
}else{
|
|
bPassed = false;
|
|
bPassed = false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // m_devinfo.m_testinfo.m_delta = delta;
|
|
|
|
+ int i_delta = delta*1000;
|
|
|
|
+ i_delta = (i_delta/PRESSURE_DIVISION_VALUE)*PRESSURE_DIVISION_VALUE;
|
|
|
|
+ m_devinfo.m_testinfo.m_delta = i_delta/1000.0;
|
|
|
|
+ m_devinfo.m_testinfo.m_passed = (bPassed == true?1:0);
|
|
|
|
+
|
|
//QString delta_str = QString("%1").arg(delta, 4,'f',2,QLatin1Char('0'));
|
|
//QString delta_str = QString("%1").arg(delta, 4,'f',2,QLatin1Char('0'));
|
|
QString info_str = "初始压力:";
|
|
QString info_str = "初始压力:";
|
|
info_str += QString("%1").arg(start_value, 4,'f',2,QLatin1Char('0'));
|
|
info_str += QString("%1").arg(start_value, 4,'f',2,QLatin1Char('0'));
|
|
@@ -1712,12 +1826,7 @@ void TestService::run()
|
|
case QMessageBox::Yes:
|
|
case QMessageBox::Yes:
|
|
qDebug()<<"Yes";
|
|
qDebug()<<"Yes";
|
|
{
|
|
{
|
|
- TestExpect expect;
|
|
|
|
- expect.target = 0.0;
|
|
|
|
- expect.volume = 0;
|
|
|
|
- expect.timeout = 30;
|
|
|
|
-
|
|
|
|
- ret_v = Pressure_Relief(expect);
|
|
|
|
|
|
+ ret_v = Pressure_Relief();
|
|
if(Ret_Exit == ret_v){
|
|
if(Ret_Exit == ret_v){
|
|
bQuit = true;
|
|
bQuit = true;
|
|
}
|
|
}
|
|
@@ -1739,44 +1848,37 @@ void TestService::run()
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- }else{ //negtive
|
|
|
|
|
|
+ if(Test_Step_End == m_step){
|
|
|
|
+ ret_btn = QMessageBox::NoButton;
|
|
|
|
+ }else{
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ ret_btn = QMessageBox::NoButton;
|
|
|
|
+ if(true == bQuit){
|
|
|
|
+ ret_btn = m_msgbox.information(NULL, "提示:", "程序即将退出,是否要泄压?", QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes);
|
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
|
|
|
+ switch (ret_btn)
|
|
|
|
+ {
|
|
|
|
+ case QMessageBox::Yes:
|
|
|
|
+ Pressure_Relief();
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
|
|
- if(Test_Step_End == m_step){
|
|
|
|
- ret_btn = QMessageBox::NoButton;
|
|
|
|
- }else{
|
|
|
|
- if(true == bQuit){
|
|
|
|
- if(Ret_Exit == ret_v){ // 主动退出
|
|
|
|
- ret_btn = m_msgbox.information(NULL, "提示:", "程序退出,是否要泄压?", QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes);
|
|
|
|
- }else if(Ret_Timeout == ret_v){ // 超时退出
|
|
|
|
- ret_btn = m_msgbox.information(NULL, "提示:", "程序超时退出,是否要泄压?", QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes);
|
|
|
|
- }else{//通信错误退出
|
|
|
|
- ret_btn = m_msgbox.information(NULL, "提示:", "程序通信错误退出,是否要泄压?", QMessageBox::Yes|QMessageBox::No, QMessageBox::Yes);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
- switch (ret_btn)
|
|
|
|
- {
|
|
|
|
- case QMessageBox::Yes:
|
|
|
|
- Pressure_Relief();
|
|
|
|
- break;
|
|
|
|
- default:
|
|
|
|
- break;
|
|
|
|
|
|
+ }else{ //negtive
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
if(m_bRunning){
|
|
if(m_bRunning){
|
|
m_bRunning = false;
|
|
m_bRunning = false;
|
|
- if(m_compartmentid >= 0){ //不是系统自测
|
|
|
|
- if(true == m_tank.m_comparts[m_compartmentid].m_result.sys_test_finished){
|
|
|
|
- m_tank.m_comparts[m_compartmentid].m_testfinished = true;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
emit sigStop(m_compartmentid+1);
|
|
emit sigStop(m_compartmentid+1);
|
|
}
|
|
}
|
|
|
|
|