bug fixed: 参与平滑的记录时间判断有错

This commit is contained in:
weidong 2023-12-10 21:02:06 +08:00
parent 73cd9e9662
commit 29df3ebbfb

View File

@ -131,7 +131,7 @@ public class GNSSDeviceLocationRecordServiceImpl implements GNSSDeviceLocationRe
List<GnssCalcData> gnssDeviceLocationRecords = repository.selectList(query);
LocalDateTime newRecordTime = newRecord.getCreatetime();
LocalDateTime filterAfterTime = newRecordTime.plusHours(filterCycleHour);
LocalDateTime filterAfterTime = newRecordTime.minusHours(filterCycleHour);
boolean hasCheck = false;
if(gnssDeviceLocationRecords.size() > 0){
// 求本组和最近recordNum组原始值的平均值
@ -153,8 +153,8 @@ public class GNSSDeviceLocationRecordServiceImpl implements GNSSDeviceLocationRe
}
hasCheck = true;
}
// 超过平滑周期的不参与平滑计算
if(newRecordTime.isAfter(filterAfterTime)) break;
// 如果记录超过平滑周期的不参与平滑计算
if(record.getCreatetime().isBefore(filterAfterTime)) break;
if (record.getEnabled()) {//只选取好点参与滤波
sumE += record.getB562e();
sumN += record.getB562n();