implement relative timeshift #173

Merged
muellerr merged 10 commits from time-service-relative-timeshift into develop 2024-04-09 13:31:13 +02:00
Owner
No description provided.
muellerr added 1 commit 2024-04-03 16:15:39 +02:00
muellerr requested review from rschweigert 2024-04-03 16:15:58 +02:00
muellerr added 1 commit 2024-04-03 16:19:45 +02:00
muellerr added 1 commit 2024-04-03 16:23:23 +02:00
meggert removed review request for rschweigert 2024-04-08 08:32:01 +02:00
meggert requested review from meggert 2024-04-08 08:32:06 +02:00
meggert requested changes 2024-04-08 09:03:42 +02:00
Dismissed
@ -29,0 +27,4 @@
if (result != returnvalue::OK) {
return result;
}
triggerEvent(CLOCK_DUMP, newTime.tv_sec, newTime.tv_usec);
Owner

either still dump milliseconds for P2 or change the description of the event

either still dump milliseconds for P2 or change the description of the event
muellerr marked this conversation as resolved
@ -31,0 +52,4 @@
positiveShift = false;
}
timeval offset{};
offset.tv_sec = std::abs(timeshiftNanos) / 1000000000;
Owner

my man refusing to use 1e-9 so that one has to count the 0 individually

my man refusing to use 1e-9 so that one has to count the 0 individually
Author
Owner

Isn't that a float/double implicitely? WE are using C++17 anyway, we can just use 1'000'000'000 I guess

Isn't that a float/double implicitely? WE are using C++17 anyway, we can just use 1'000'000'000 I guess
Owner

1e9 is what i meant

1e9 is what i meant
muellerr marked this conversation as resolved
@ -31,0 +64,4 @@
result = Clock::setClock(&newTime);
if (result == returnvalue::OK) {
// Report new time as event.
triggerEvent(CLOCK_DUMP, newTime.tv_sec, newTime.tv_usec);
Owner

see above

see above
muellerr marked this conversation as resolved
muellerr added 1 commit 2024-04-08 10:34:56 +02:00
meggert approved these changes 2024-04-08 10:38:40 +02:00
meggert left a comment
Owner
https://giphy.com/gifs/happy-car-home-rdma0nDFZMR32/fullscreen
muellerr added 1 commit 2024-04-08 13:14:24 +02:00
muellerr added 1 commit 2024-04-08 13:27:00 +02:00
Author
Owner

I have mode some more changes and improvements. There is now a timedump before and after setting an absolute time or a relative timeshift.

I have mode some more changes and improvements. There is now a timedump before and after setting an absolute time or a relative timeshift.
muellerr added 1 commit 2024-04-08 13:31:24 +02:00
meggert reviewed 2024-04-08 13:37:27 +02:00
@ -21,1 +21,3 @@
return setTime();
reportCurrentTime();
ReturnValue_t result = setTime();
reportCurrentTime();
Owner

if we are doing this twice, why did we not use the CLOCK_SET event then? it already contained old and new time. or are we really interessted in microseconds here?

if we are doing this twice, why did we not use the CLOCK_SET event then? it already contained old and new time. or are we really interessted in microseconds here?
Author
Owner

events are cheap, and why lose resolution here? The correct approach probably would be to delete the weird CLOCK_SET event. If we still want to distinguish events which come from time changes, we could introduce, TIME_DUMP_BEFORE_CLOCK_UPDATE and TIME_DUMP_AFTER_CLOCK_UPDATE..

events are cheap, and why lose resolution here? The correct approach probably would be to delete the weird `CLOCK_SET` event. If we still want to distinguish events which come from time changes, we could introduce, `TIME_DUMP_BEFORE_CLOCK_UPDATE` and `TIME_DUMP_AFTER_CLOCK_UPDATE`..
Owner

I would advise splitting the events in those two types yes. Otherwise, this might be confusing for the operator. Calculating the time delta on ground is going to be more tricky now (but still possible if we store the parameter tm as actual tm). Maybe ask OPS what they prefer here

I would advise splitting the events in those two types yes. Otherwise, this might be confusing for the operator. Calculating the time delta on ground is going to be more tricky now (but still possible if we store the parameter tm as actual tm). Maybe ask OPS what they prefer here
Author
Owner

done

done
@ -31,0 +66,4 @@
}
result = Clock::setClock(&newTime);
if (result == returnvalue::OK) {
reportTime(newTime);
Owner

the same here

the same here
@ -59,0 +100,4 @@
}
void Service9TimeManagement::reportTime(timeval time) {
triggerEvent(CLOCK_DUMP, time.tv_sec, time.tv_usec);
Owner

best function ever

best function ever
muellerr added 1 commit 2024-04-08 13:38:17 +02:00
muellerr added 1 commit 2024-04-09 10:57:26 +02:00
muellerr added 1 commit 2024-04-09 11:12:02 +02:00
muellerr merged commit 8b21dd276d into develop 2024-04-09 13:31:13 +02:00
muellerr deleted branch time-service-relative-timeshift 2024-04-09 13:31:15 +02:00
Sign in to join this conversation.
No description provided.