系数校准接收数据个数调整
This commit is contained in:
@@ -612,7 +612,7 @@ public class SocketDevResponseService {
|
||||
|
||||
private void assemblyEntity(List<DevData> deList, DevXiNumData.F F, DevXiNumData.GF startF, CoefficientVO coefficientVO, CoefficientVO.DevParameter devParameter) {
|
||||
//表示接收完成,必须保证3个数
|
||||
if (deList.size() >= 3) {
|
||||
if (deList.size() >= 7) {
|
||||
List<Double> aList = deList.stream().map(it -> it.getSqlData().get(0).getList().getA()).collect(Collectors.toList());
|
||||
List<Double> bList = deList.stream().map(it -> it.getSqlData().get(0).getList().getB()).collect(Collectors.toList());
|
||||
List<Double> cList = deList.stream().map(it -> it.getSqlData().get(0).getList().getC()).collect(Collectors.toList());
|
||||
@@ -687,7 +687,7 @@ public class SocketDevResponseService {
|
||||
*/
|
||||
private Double reduceList(List<Double> valList) {
|
||||
// valList.subList(0, 5).clear();
|
||||
// valList.subList(valList.size() - 3, valList.size() - 1).clear();
|
||||
valList.subList(valList.size() - 2, valList.size()).clear();
|
||||
return valList.stream().mapToDouble(Double::doubleValue).average().getAsDouble();
|
||||
}
|
||||
|
||||
|
||||
@@ -334,9 +334,9 @@ public class SocketSourceResponseService {
|
||||
// 系数校验固定检测项:实时电压有效值和实时电流有效值
|
||||
phaseSequenceParam.setDataType(Arrays.asList("real$VRMS", "real$IRMS"));
|
||||
// 读取3次数据用于系数计算
|
||||
phaseSequenceParam.setReadCount(3);
|
||||
phaseSequenceParam.setReadCount(7); //3
|
||||
// 忽略前4次数据,等待测量稳定
|
||||
phaseSequenceParam.setIgnoreCount(4);
|
||||
phaseSequenceParam.setIgnoreCount(3); //4
|
||||
socketMsg.setData(JSON.toJSONString(phaseSequenceParam));
|
||||
SocketManager.sendMsg(s, JSON.toJSONString(socketMsg));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user