系数校准接收数据个数调整
This commit is contained in:
@@ -628,7 +628,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());
|
||||
@@ -703,7 +703,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();
|
||||
}
|
||||
|
||||
|
||||
@@ -198,8 +198,10 @@ public class SocketSourceResponseService {
|
||||
DevPhaseSequenceParam phaseSequenceParam = new DevPhaseSequenceParam();
|
||||
phaseSequenceParam.setMoniterIdList(monitorIdList);
|
||||
phaseSequenceParam.setDataType(Arrays.asList("real$VRMS", "real$IRMS"));
|
||||
phaseSequenceParam.setReadCount(3);
|
||||
phaseSequenceParam.setIgnoreCount(8);
|
||||
// 读取3次数据用于系数计算
|
||||
phaseSequenceParam.setReadCount(7); //3
|
||||
// 忽略前4次数据,等待测量稳定
|
||||
phaseSequenceParam.setIgnoreCount(3); //4
|
||||
socketMsg.setData(JSON.toJSONString(phaseSequenceParam));
|
||||
SocketManager.sendMsg(s, JSON.toJSONString(socketMsg));
|
||||
|
||||
|
||||
@@ -602,8 +602,8 @@ public class PqReportServiceImpl extends ServiceImpl<PqReportMapper, PqReport> i
|
||||
dealDataModel(baseModelDocument, devReportParam, pqDevVO);
|
||||
// 处理需要输出的目录地址 基础路径+设备类型+装置编号.docx
|
||||
// 最终文件输出的路径
|
||||
String dirPath = reportPath.concat(File.separator).concat(devType.getName());
|
||||
// String dirPath = reportPath;
|
||||
// String dirPath = reportPath.concat(File.separator).concat(devType.getName());
|
||||
String dirPath = reportPath;
|
||||
// 确保目录存在
|
||||
ensureDirectoryExists(dirPath);
|
||||
String reportFullPath = dirPath.concat(File.separator).concat(pqDevVO.getCreateId()).concat(".docx");
|
||||
|
||||
Reference in New Issue
Block a user