-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds PlaybackPlugin with ignition-gui 3 #376
Conversation
2f81bc1 --> Changes icon style for the buttons |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL
// An ignition transport node. | ||
ignition::transport::Node node_; | ||
|
||
SimTimes time_status_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
timeStatus_ to keep the format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I believe you should remove the underscore at the end and add one in all function arguments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done x2 !
// @brief Converts from ignition::msgs::Time to std::chrono::duration. | ||
// @param[in] src Time to be converted | ||
// @returns `src` converted to std::chrono::duration::nanoseconds. | ||
std::chrono::nanoseconds TimeToChrono(const ignition::msgs::Time& src) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's call it IgnitionTimeToChrono
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
// @param[out] dst Duration | ||
// @throws When `dst` is nullptr. | ||
void ChronoToDuration(const std::chrono::nanoseconds& src, ignition::msgs::Duration* dst) { | ||
DELPHYNE_DEMAND(dst != nullptr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Throw instead of abort.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
// @throws When `dst` is nullptr. | ||
void ChronoToDuration(const std::chrono::nanoseconds& src, ignition::msgs::Duration* dst) { | ||
DELPHYNE_DEMAND(dst != nullptr); | ||
std::chrono::seconds src_in_seconds = std::chrono::duration_cast<std::chrono::seconds>(src); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it can be const.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
PlaybackPlugin::PlaybackPlugin() : ignition::gui::Plugin() { qRegisterMetaType<ignition::msgs::PlaybackStatus>(); } | ||
|
||
PlaybackPlugin::~PlaybackPlugin() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make it default or implicit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
import QtQuick.Controls.Material 2.1 | ||
import QtQuick.Layouts 1.3 | ||
|
||
Rectangle { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code in this file should also be documented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just added some minor comments. I don't know how deep it should be given that there isn't that much code here.
# | ||
|
||
""" | ||
The replay tool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you please a doctring explaining how it works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
OUTPUT_NAME PlaybackPlugin | ||
) | ||
|
||
target_link_libraries(PlaybackPlugin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you need to link against ignition-plugin1::register
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently. However It didn't complain about it.
Added.
ARCHIVE DESTINATION lib | ||
) | ||
|
||
include_directories( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already four times in this file. Can we just leave it once?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Done.
anchors.leftMargin : 10 | ||
anchors.verticalCenter : rewindButton.verticalCenter | ||
onClicked: { | ||
if (isPlaying){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that 2 spaces indentation is OK. Would you please adjust it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Part of #332
PlaybackWidget
which uses ign-gui0.delphyne_replay2.mp4
layout2_for_playback.config
in which thePlaybackPlugin
is added.In addition a
delphyne_gui/python/toolkit/replay2.py
script was added for executing the replayer with the new visualizer and with thePlaybackPlugin
.Note: In essence this app is equal to the
delphyne_gui/python/toolkit/replay.py
script that runs the old visualizer withPlaybackWidget
, the only difference is that during this script the plugin is injected to the default layout instead of directly using the layout created for that end.For executing the
replay
app:1 - Create a log file, e.g.:
2 - Execute
delphyne_replay2
app: