14 auto start = std::chrono::high_resolution_clock::now();
15 bool instances_accepted =
false;
16 std::int64_t current = 0;
24 this->setNonCorruptedTimestampType(e);
33 if (this->lastTimesPerEntity.end() == this->lastTimesPerEntity.find(memID))
40 auto lastT = this->getNonCorruptedTimestamp(firstInsance, simulatedVersion);
42 auto end = std::chrono::high_resolution_clock::now();
47 this->lastTimesPerEntity[memID] = lastT;
52 auto lastTime = this->lastTimesPerEntity.at(memID);
57 [
this, &instances_accepted, ¤t, &lastTime, &simulatedVersion](
60 auto t = this->getNonCorruptedTimestamp(i, simulatedVersion);
61 int difference =
std::abs(t - lastTime);
62 if (difference > this->maxDifference)
64 instances_accepted =
true;
65 current = this->getNonCorruptedTimestamp(i, simulatedVersion);
69 if (instances_accepted)
72 this->lastTimesPerEntity[memID] = current;
77 auto end = std::chrono::high_resolution_clock::now();
81 if (instances_accepted)
90 return instances_accepted;
98 auto sentTime = firstInsance.metadata().sentTime;
99 auto arrivedTime = firstInsance.metadata().arrivedTime;
100 auto referencedTime = firstInsance.metadata().referencedTime;
107 if (referencedTime.toMilliSecondsSinceEpoch() < 946688400000)
110 if (sentTime.toMilliSecondsSinceEpoch() < 946688400000)
113 if (arrivedTime.toMilliSecondsSinceEpoch() < 946688400000)
116 if (!corruptedWarningGiven)
118 ARMARX_WARNING <<
"LTM recording does not work correctly, as frequency "
119 "filter is used, but "
120 <<
"time sent, arrived and referenced are all corrupted. \n"
121 <<
"Accepting all snapshots.";
123 corruptedWarningGiven =
true;
128 if (!corruptedWarningGiven)
130 ARMARX_INFO <<
"Time referenced and sent for snapshot corrupted, using "
131 "time arrived for filtering";
132 corruptedWarningGiven =
true;
139 if (!corruptedWarningGiven)
142 <<
"Time referenced snapshot corrupted, using time sent for filtering";
143 corruptedWarningGiven =
true;
186 bool simulatedVersion)
188 switch (this->nonCorruptedType)
191 if (!simulatedVersion)
193 return i.metadata().sentTime.toMilliSecondsSinceEpoch();
200 return i.metadata().arrivedTime.toMilliSecondsSinceEpoch();
202 return i.metadata().referencedTime.toMilliSecondsSinceEpoch();