Skip to content

Commit 6baf9f6

Browse files
committed
panel: optionally disable time column
1 parent 1b3f8fe commit 6baf9f6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

visualization/motion_planning_tasks/src/task_panel.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,9 @@ TaskView::TaskView(moveit_rviz_plugin::TaskPanel* parent, rviz::Property* root)
288288
initial_task_expand->addOption("Top-level Expanded", EXPAND_TOP);
289289
initial_task_expand->addOption("All Expanded", EXPAND_ALL);
290290
initial_task_expand->addOption("All Closed", EXPAND_NONE);
291+
292+
show_time_column = new rviz::BoolProperty("Show Computation Times", true, "Show the 'time' column", configs);
293+
connect(show_time_column, SIGNAL(changed()), this, SLOT(onShowTimeChanged()));
291294
}
292295

293296
TaskView::~TaskView() {
@@ -475,6 +478,12 @@ void TaskView::onExecCurrentSolution() const {
475478
d_ptr->exec_action_client_.sendGoal(goal);
476479
}
477480

481+
void TaskView::onShowTimeChanged() {
482+
auto* header = d_ptr->tasks_view->header();
483+
if (header->count() > 3)
484+
d_ptr->tasks_view->header()->setSectionHidden(3, !show_time_column->getBool());
485+
}
486+
478487
GlobalSettingsWidgetPrivate::GlobalSettingsWidgetPrivate(GlobalSettingsWidget* q_ptr, rviz::Property* root)
479488
: q_ptr(q_ptr) {
480489
setupUi(q_ptr);

visualization/motion_planning_tasks/src/task_panel.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class QIcon;
4747
namespace rviz {
4848
class WindowManagerInterface;
4949
class Property;
50+
class BoolProperty;
5051
class EnumProperty;
5152
}
5253

@@ -125,6 +126,8 @@ class TaskView : public SubPanel
125126
};
126127
rviz::EnumProperty* initial_task_expand;
127128

129+
rviz::BoolProperty* show_time_column;
130+
128131
public:
129132
TaskView(TaskPanel* parent, rviz::Property* root);
130133
~TaskView() override;
@@ -141,6 +144,7 @@ protected Q_SLOTS:
141144
void onCurrentSolutionChanged(const QModelIndex& current, const QModelIndex& previous);
142145
void onSolutionSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
143146
void onExecCurrentSolution() const;
147+
void onShowTimeChanged();
144148
};
145149

146150
class GlobalSettingsWidgetPrivate;

0 commit comments

Comments
 (0)