implement relative timeshift #173
No reviewers
Labels
No Label
api change
breaking api change
bug
documentation
duplicate
feature
help wanted
invalid
question
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: eive/fsfw#173
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "time-service-relative-timeshift"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -29,0 +27,4 @@
if (result != returnvalue::OK) {
return result;
}
triggerEvent(CLOCK_DUMP, newTime.tv_sec, newTime.tv_usec);
either still dump milliseconds for P2 or change the description of the event
@ -31,0 +52,4 @@
positiveShift = false;
}
timeval offset{};
offset.tv_sec = std::abs(timeshiftNanos) / 1000000000;
my man refusing to use 1e-9 so that one has to count the 0 individually
Isn't that a float/double implicitely? WE are using C++17 anyway, we can just use 1'000'000'000 I guess
1e9 is what i meant
@ -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);
see above
https://giphy.com/gifs/happy-car-home-rdma0nDFZMR32/fullscreen
I have mode some more changes and improvements. There is now a timedump before and after setting an absolute time or a relative timeshift.
@ -21,1 +21,3 @@
return setTime();
reportCurrentTime();
ReturnValue_t result = setTime();
reportCurrentTime();
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?
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
andTIME_DUMP_AFTER_CLOCK_UPDATE
..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
done
@ -31,0 +66,4 @@
}
result = Clock::setClock(&newTime);
if (result == returnvalue::OK) {
reportTime(newTime);
the same here
@ -59,0 +100,4 @@
}
void Service9TimeManagement::reportTime(timeval time) {
triggerEvent(CLOCK_DUMP, time.tv_sec, time.tv_usec);
best function ever