10#include <ArmarXGui/interface/RemoteGuiInterface.h>
17 namespace gui = RemoteGui;
35 MappingRemoteGui::createRemoteGuiTab()
39 auto boxLayout = gui::makeVBoxLayout();
42 const gui::WidgetPtr label = gui::makeTextLabel(
43 "Use this button to create a map after you collected enough data:");
44 const gui::WidgetPtr button =
45 gui::makeButton(CREATE_MAP_BUTTON).toolTip(
"Create and save the map.");
46 const gui::WidgetPtr line = gui::makeHBoxLayout().children({label, button});
47 boxLayout.addChild(line);
52 const gui::WidgetPtr label = gui::makeTextLabel(
"Output directory:");
54 const auto package = gui::makeLineEdit(outputDirPackageField)
55 .value(params.mapStorageDir.serialize().package);
57 gui::makeLineEdit(outputDirPathField).value(params.mapStorageDir.serialize().path);
59 const gui::WidgetPtr line = gui::makeHBoxLayout().children({label, package, path});
60 boxLayout.addChild(line);
68 MappingRemoteGui::run()
70 constexpr int kCycleDurationMs = 100;
72 CycleUtil
c(kCycleDurationMs);
73 while (!runningTask->isStopped())
81 c.waitForCycleDuration();
86 MappingRemoteGui::handleEvents(RemoteGui::TabProxy& tab)
89 const RemoteGui::ButtonProxy createMapButton = tab.getButton(CREATE_MAP_BUTTON);
92 if (createMapButton.clicked())
94 const RemoteGuiCallee::ButtonClickContext ctx{
96 armarx::PackagePath{tab.getValue<std::string>(outputDirPackageField).get(),
97 tab.getValue<std::string>(outputDirPathField).get()}};
99 callee.onCreateMapButtonClicked(ctx);
107 if (!runningTask->isStopped())
112 ARMARX_DEBUG <<
"Removing tab: " << params.remoteGuiTabName;
113 remoteGui->removeTab(params.remoteGuiTabName);
119 tab.internalSetDisabled(CREATE_MAP_BUTTON,
false);
125 tab.internalSetDisabled(CREATE_MAP_BUTTON,
true);
detail::MappingRemoteGuiParams Params
MappingRemoteGui(const RemoteGuiInterfacePrx &remoteGui, RemoteGuiCallee &callee, const Params ¶ms)
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
#define ARMARX_DEBUG
The logging level for output that is only interesting while debugging.
std::string remoteGuiTabName