This commit is contained in:
liuyusheng 2024-05-13 11:57:54 +08:00
parent 36ae04dbb5
commit 7e245ba65d
2 changed files with 36 additions and 17 deletions

View File

@ -76,7 +76,26 @@ public class IPCPlcDataSyncThread implements Runnable {
if (plcParams.getFieldValue().equals("rstatus")) { if (plcParams.getFieldValue().equals("rstatus")) {
plcParams.setData(status); plcParams.setData(status);
} else { } else {
plcParams.setData(Math.random()); // plcParams.setData(Math.random());
if("pz4".equals(plcParams.getFieldValue())){
plcParams.setData(String.format("%.2f",(11+Math.random())));
}else if("pz6".equals(plcParams.getFieldValue())){
plcParams.setData(String.format("%.2f",(13+Math.random())));
}else if("pz14".equals(plcParams.getFieldValue())){
plcParams.setData(String.format("%.2f",(16+Math.random())));
}else if("pz21".equals(plcParams.getFieldValue())){
plcParams.setData(String.format("%.2f",(18+Math.random())));
}else if("owc".equals(plcParams.getFieldValue())){//油水含量
plcParams.setData(String.format("%.2f",(1+Math.random())));
}else if("ov".equals(plcParams.getFieldValue())){//油品粘度
plcParams.setData(String.format("%.0f",(680+10*Math.random())));
}else if("rot".equals(plcParams.getFieldValue())){//回油温度
plcParams.setData(String.format("%.2f",(60+3*Math.random())));
}else if("oip".equals(plcParams.getFieldValue())){//进油压力
plcParams.setData(String.format("%.2f",(-0.4+0.1*Math.random())));
}else if("od".equals(plcParams.getFieldValue())){//油液密度
plcParams.setData(String.format("%.0f",(880+10*Math.random())));
}
} }
// plcParams.setData(results.getValue(plcParams.getSourceField())); // plcParams.setData(results.getValue(plcParams.getSourceField()));
} }