|
@@ -10,6 +10,10 @@ var exit = false
|
|
var capsizeOpenPresure = 10
|
|
var capsizeOpenPresure = 10
|
|
var capsizeSetPressure = 32
|
|
var capsizeSetPressure = 32
|
|
|
|
|
|
|
|
+var pthreshold_Setzero = 0.2
|
|
|
|
+var nthreshold_Setzero = -0.2
|
|
|
|
+var delaycount_Setzero = 6
|
|
|
|
+
|
|
function positiveTestStop(controlSerial,pressureDisplaySigFun,spy,log){
|
|
function positiveTestStop(controlSerial,pressureDisplaySigFun,spy,log){
|
|
|
|
|
|
ModbusJs.pressureSensorCtrl(controlSerial,"高压")
|
|
ModbusJs.pressureSensorCtrl(controlSerial,"高压")
|
|
@@ -22,6 +26,7 @@ function positiveTestStop(controlSerial,pressureDisplaySigFun,spy,log){
|
|
console.log("打开正压罐头泄气阀门")
|
|
console.log("打开正压罐头泄气阀门")
|
|
//查看高压传感器值 等待正压罐头压力降到最低值
|
|
//查看高压传感器值 等待正压罐头压力降到最低值
|
|
var timeout = 0
|
|
var timeout = 0
|
|
|
|
+ var end_count = 0
|
|
do{
|
|
do{
|
|
//重新开始时 停止测试
|
|
//重新开始时 停止测试
|
|
if(runningBackup === false && running === true){
|
|
if(runningBackup === false && running === true){
|
|
@@ -43,8 +48,14 @@ function positiveTestStop(controlSerial,pressureDisplaySigFun,spy,log){
|
|
//延时
|
|
//延时
|
|
spy.wait(900)
|
|
spy.wait(900)
|
|
timeout++
|
|
timeout++
|
|
|
|
+ if(obj.pressureNumber <= pthreshold_Setzero){
|
|
|
|
+ end_count++;
|
|
|
|
+ //console.log("111: pressure:"+ obj.pressureNumber +", pthreshold_setzero:"+pthreshold_Setzero)
|
|
|
|
+ }else{
|
|
|
|
+ //console.log("222: pressure:"+ obj.pressureNumber +", pthreshold_setzero:"+pthreshold_Setzero)
|
|
|
|
+ }
|
|
|
|
|
|
- }while(obj.pressureNumber > 0.1 && timeout < 180)
|
|
|
|
|
|
+ }while(end_count < delaycount_Setzero && timeout < 180)
|
|
ModbusJs.closeAllValve(controlSerial)
|
|
ModbusJs.closeAllValve(controlSerial)
|
|
console.log("关闭 关闭所有阀门")
|
|
console.log("关闭 关闭所有阀门")
|
|
}
|
|
}
|
|
@@ -65,6 +76,7 @@ function negativeTestStop(controlSerial,pressureDisplaySigFun,spy,log){
|
|
console.log("打开负压罐头泄气阀门")
|
|
console.log("打开负压罐头泄气阀门")
|
|
//查看负压传感器值 等待负压罐头压力降到最低值
|
|
//查看负压传感器值 等待负压罐头压力降到最低值
|
|
var timeout = 0
|
|
var timeout = 0
|
|
|
|
+ var end_count =0
|
|
do{
|
|
do{
|
|
//重新开始时 停止测试
|
|
//重新开始时 停止测试
|
|
if(runningBackup === false && running === true){
|
|
if(runningBackup === false && running === true){
|
|
@@ -86,7 +98,11 @@ function negativeTestStop(controlSerial,pressureDisplaySigFun,spy,log){
|
|
//延时
|
|
//延时
|
|
spy.wait(900)
|
|
spy.wait(900)
|
|
timeout++
|
|
timeout++
|
|
- }while(obj.pressureNumber < -0.1 && timeout < 180)
|
|
|
|
|
|
+
|
|
|
|
+ if(obj.pressureNumber >= nthreshold_Setzero){
|
|
|
|
+ end_count++;
|
|
|
|
+ }
|
|
|
|
+ }while(end_count < delaycount_Setzero && timeout < 180)
|
|
ModbusJs.closeAllValve(controlSerial)
|
|
ModbusJs.closeAllValve(controlSerial)
|
|
console.log("关闭 关闭所有阀门")
|
|
console.log("关闭 关闭所有阀门")
|
|
}
|
|
}
|
|
@@ -123,6 +139,7 @@ function positiveTestStart(currentIndex,tabView,processWindow,controlSerial,sens
|
|
ModbusJs.positivePressureTankOutputCtrl(controlSerial,true)
|
|
ModbusJs.positivePressureTankOutputCtrl(controlSerial,true)
|
|
console.log("打开正压罐头泄气阀门")
|
|
console.log("打开正压罐头泄气阀门")
|
|
var timeout = 0
|
|
var timeout = 0
|
|
|
|
+ var end_count = 0
|
|
do{
|
|
do{
|
|
if(running === false){
|
|
if(running === false){
|
|
console.log("停止测试")
|
|
console.log("停止测试")
|
|
@@ -138,7 +155,11 @@ function positiveTestStart(currentIndex,tabView,processWindow,controlSerial,sens
|
|
//延时
|
|
//延时
|
|
spy.wait(900)
|
|
spy.wait(900)
|
|
timeout++
|
|
timeout++
|
|
- }while(obj.pressureNumber > 0.1 && timeout < 180)
|
|
|
|
|
|
+ if(obj.pressureNumber <= pthreshold_Setzero){
|
|
|
|
+ end_count++;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }while(end_count < delaycount_Setzero && timeout < 180)
|
|
if(timeout === 180){
|
|
if(timeout === 180){
|
|
log.show("泄压超时")
|
|
log.show("泄压超时")
|
|
ModbusJs.closeAllValve(controlSerial)
|
|
ModbusJs.closeAllValve(controlSerial)
|
|
@@ -300,6 +321,7 @@ function positiveTestStart(currentIndex,tabView,processWindow,controlSerial,sens
|
|
//查看低压传感器值 等待正压罐头压力降到最低值
|
|
//查看低压传感器值 等待正压罐头压力降到最低值
|
|
processWindow.show("试验结束,泄气中")
|
|
processWindow.show("试验结束,泄气中")
|
|
timeout = 0
|
|
timeout = 0
|
|
|
|
+ end_count = 0
|
|
do{
|
|
do{
|
|
if(running === false){
|
|
if(running === false){
|
|
console.log("停止测试")
|
|
console.log("停止测试")
|
|
@@ -316,7 +338,10 @@ function positiveTestStart(currentIndex,tabView,processWindow,controlSerial,sens
|
|
//延时
|
|
//延时
|
|
spy.wait(900)
|
|
spy.wait(900)
|
|
timeout++
|
|
timeout++
|
|
- }while(obj.pressureNumber > 0.1 && timeout < 180)
|
|
|
|
|
|
+ if(obj.pressureNumber <= pthreshold_Setzero){
|
|
|
|
+ end_count++;
|
|
|
|
+ }
|
|
|
|
+ }while(end_count < delaycount_Setzero && timeout < 180)
|
|
|
|
|
|
//关闭正压罐头泄气阀门
|
|
//关闭正压罐头泄气阀门
|
|
|
|
|
|
@@ -365,6 +390,7 @@ function negativeTestStart(currentIndex,tabView,processWindow,controlSerial,sens
|
|
//setp 2
|
|
//setp 2
|
|
//查看负压传感器值 等待负压压罐头压力至0kPa
|
|
//查看负压传感器值 等待负压压罐头压力至0kPa
|
|
var timeout = 0
|
|
var timeout = 0
|
|
|
|
+ var end_count=0
|
|
do{
|
|
do{
|
|
if(running === false){
|
|
if(running === false){
|
|
console.log("停止测试")
|
|
console.log("停止测试")
|
|
@@ -382,7 +408,11 @@ function negativeTestStart(currentIndex,tabView,processWindow,controlSerial,sens
|
|
//延时
|
|
//延时
|
|
spy.wait(900)
|
|
spy.wait(900)
|
|
timeout++
|
|
timeout++
|
|
- }while(obj.pressureNumber < 0 && timeout < 180)
|
|
|
|
|
|
+ if(obj.pressureNumber >= nthreshold_Setzero){
|
|
|
|
+ end_count++;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }while(end_count < delaycount_Setzero && timeout < 180)
|
|
if(timeout === 180){
|
|
if(timeout === 180){
|
|
log.show("泄压超时")
|
|
log.show("泄压超时")
|
|
ModbusJs.closeAllValve(controlSerial)
|
|
ModbusJs.closeAllValve(controlSerial)
|
|
@@ -523,6 +553,7 @@ function negativeTestStart(currentIndex,tabView,processWindow,controlSerial,sens
|
|
//查看负压传感器值 等待负压罐到0kPa
|
|
//查看负压传感器值 等待负压罐到0kPa
|
|
processWindow.show("试验结束,泄气中")
|
|
processWindow.show("试验结束,泄气中")
|
|
timeout = 0
|
|
timeout = 0
|
|
|
|
+ end_count = 0
|
|
do{
|
|
do{
|
|
if(running === false){
|
|
if(running === false){
|
|
console.log("停止测试")
|
|
console.log("停止测试")
|
|
@@ -539,7 +570,10 @@ function negativeTestStart(currentIndex,tabView,processWindow,controlSerial,sens
|
|
//延时
|
|
//延时
|
|
spy.wait(900)
|
|
spy.wait(900)
|
|
timeout++
|
|
timeout++
|
|
- }while(obj.pressureNumber < 0 && timeout<180)
|
|
|
|
|
|
+ if(obj.pressureNumber >= nthreshold_Setzero){
|
|
|
|
+ end_count++;
|
|
|
|
+ }
|
|
|
|
+ }while(end_count < delaycount_Setzero && timeout<180)
|
|
//关闭负压罐头泄气阀门
|
|
//关闭负压罐头泄气阀门
|
|
|
|
|
|
//setp 6
|
|
//setp 6
|
|
@@ -573,6 +607,7 @@ function capsizeTestStart(processWindow,controlSerial,sensorSerial,
|
|
ModbusJs.positivePressureTankOutputCtrl(controlSerial,true)
|
|
ModbusJs.positivePressureTankOutputCtrl(controlSerial,true)
|
|
console.log("打开正压罐头泄气阀门")
|
|
console.log("打开正压罐头泄气阀门")
|
|
var timeout = 0
|
|
var timeout = 0
|
|
|
|
+ var end_count=0
|
|
do{
|
|
do{
|
|
if(running === false){
|
|
if(running === false){
|
|
console.log("停止测试")
|
|
console.log("停止测试")
|
|
@@ -588,7 +623,10 @@ function capsizeTestStart(processWindow,controlSerial,sensorSerial,
|
|
//延时
|
|
//延时
|
|
spy.wait(900)
|
|
spy.wait(900)
|
|
timeout++
|
|
timeout++
|
|
- }while(obj.pressureNumber > 0.1 && timeout < 180)
|
|
|
|
|
|
+ if(obj.pressureNumber <= pthreshold_Setzero){
|
|
|
|
+ end_count++;
|
|
|
|
+ }
|
|
|
|
+ }while(end_count < delaycount_Setzero && timeout < 180)
|
|
console.log("压力降压到 0 kPa")
|
|
console.log("压力降压到 0 kPa")
|
|
if(timeout === 180){
|
|
if(timeout === 180){
|
|
log.show("泄压超时")
|
|
log.show("泄压超时")
|
|
@@ -708,6 +746,7 @@ function capsizeTestStart(processWindow,controlSerial,sensorSerial,
|
|
console.log("等待压力 0kPa")
|
|
console.log("等待压力 0kPa")
|
|
//查看高压传感器值 等待正压罐头压力降到最低值
|
|
//查看高压传感器值 等待正压罐头压力降到最低值
|
|
timeout =0
|
|
timeout =0
|
|
|
|
+ end_count = 0
|
|
do{
|
|
do{
|
|
if(running === false){
|
|
if(running === false){
|
|
console.log("停止测试")
|
|
console.log("停止测试")
|
|
@@ -723,7 +762,11 @@ function capsizeTestStart(processWindow,controlSerial,sensorSerial,
|
|
//延时
|
|
//延时
|
|
spy.wait(900)
|
|
spy.wait(900)
|
|
timeout++
|
|
timeout++
|
|
- }while(obj.pressureNumber > 0.1 && timeout < 180)
|
|
|
|
|
|
+ if(obj.pressureNumber <= pthreshold_Setzero){
|
|
|
|
+ end_count++;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }while(end_count < delaycount_Setzero && timeout < 180)
|
|
|
|
|
|
//setp 6
|
|
//setp 6
|
|
console.log("压力 0kPa")
|
|
console.log("压力 0kPa")
|