diff --git a/scenarios/ArMemCore/config/ArVizStorage.cfg b/scenarios/ArMemCore/config/ArVizStorage.cfg index 5e8b630736a25dcd37ccfe9547d599b49a8dd6c6..302ac28c37dd28de3e68fb4fe4c2174faa4ec3bf 100644 --- a/scenarios/ArMemCore/config/ArVizStorage.cfg +++ b/scenarios/ArMemCore/config/ArVizStorage.cfg @@ -27,7 +27,7 @@ # ArmarX.ArVizStorage.EnableProfiling = false -# ArmarX.ArVizStorage.HistoryPath: Destination path where the history are serialized to +# ArmarX.ArVizStorage.HistoryPath: Destination path where the history is serialized to # Attributes: # - Default: RobotAPI/ArVizStorage # - Case sensitivity: yes @@ -68,7 +68,7 @@ # ArmarX.ArVizStorage.TopicName = ArVizTopic -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes diff --git a/scenarios/ArMemCore/config/DebugObserver.cfg b/scenarios/ArMemCore/config/DebugObserver.cfg index 459d0d1a5bcd9ea89ef01e161eb903fc8a4bf1cb..8dc7ead26b3bd2f7678b3b3e7a1b00c01213225d 100644 --- a/scenarios/ArMemCore/config/DebugObserver.cfg +++ b/scenarios/ArMemCore/config/DebugObserver.cfg @@ -18,7 +18,7 @@ # ArmarX.ApplicationName = "" -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes diff --git a/scenarios/ArMemCore/config/MemoryNameSystem.cfg b/scenarios/ArMemCore/config/MemoryNameSystem.cfg index dfe9b389392a186f5baef2403145e31d49646f58..b8bc70a66ca7f32a628886ad1bf13e373f9750d3 100644 --- a/scenarios/ArMemCore/config/MemoryNameSystem.cfg +++ b/scenarios/ArMemCore/config/MemoryNameSystem.cfg @@ -18,7 +18,7 @@ # ArmarX.ApplicationName = "" -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes diff --git a/scenarios/ArMemCore/config/RemoteGuiProviderApp.cfg b/scenarios/ArMemCore/config/RemoteGuiProviderApp.cfg index 4683563a9c97e6bb11805b8d903dbe2f705a3fd2..4b6abea40d72afd7d313ee47a9b191f3b26de30d 100644 --- a/scenarios/ArMemCore/config/RemoteGuiProviderApp.cfg +++ b/scenarios/ArMemCore/config/RemoteGuiProviderApp.cfg @@ -18,7 +18,7 @@ # ArmarX.ApplicationName = "" -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes diff --git a/scenarios/ArMemExample/config/DebugObserver.cfg b/scenarios/ArMemExample/config/DebugObserver.cfg index 459d0d1a5bcd9ea89ef01e161eb903fc8a4bf1cb..8dc7ead26b3bd2f7678b3b3e7a1b00c01213225d 100644 --- a/scenarios/ArMemExample/config/DebugObserver.cfg +++ b/scenarios/ArMemExample/config/DebugObserver.cfg @@ -18,7 +18,7 @@ # ArmarX.ApplicationName = "" -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes diff --git a/scenarios/ArMemExample/config/ExampleMemory.cfg b/scenarios/ArMemExample/config/ExampleMemory.cfg index aac8c2e88be85372ac0296f79579f8d2c32665e4..e2e7bb719d4629ed88b2127cf7c97159bdb79341 100644 --- a/scenarios/ArMemExample/config/ExampleMemory.cfg +++ b/scenarios/ArMemExample/config/ExampleMemory.cfg @@ -26,7 +26,7 @@ ArmarX.ArMemExampleMemory.tpc.pub.MemoryListener = MemoryUpdates -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes @@ -143,6 +143,23 @@ ArmarX.ArMemExampleMemory.tpc.pub.MemoryListener = MemoryUpdates # ArmarX.ExampleMemory.mem.MemoryName = Example +# ArmarX.ExampleMemory.mem.ltm..buffer.storeFreq: Frequency to store the buffer to the LTM in Hz. +# Attributes: +# - Default: 10 +# - Case sensitivity: yes +# - Required: no +# ArmarX.ExampleMemory.mem.ltm..buffer.storeFreq = 10 + + +# ArmarX.ExampleMemory.mem.ltm.depthImageExtractor.Enabled: +# Attributes: +# - Default: true +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.ExampleMemory.mem.ltm.depthImageExtractor.Enabled = true + + # ArmarX.ExampleMemory.mem.ltm.enabled: # Attributes: # - Default: false @@ -152,12 +169,98 @@ ArmarX.ArMemExampleMemory.tpc.pub.MemoryListener = MemoryUpdates # ArmarX.ExampleMemory.mem.ltm.enabled = false -# ArmarX.ExampleMemory.mem.ltm.storagepath: The path to the memory storage. +# ArmarX.ExampleMemory.mem.ltm.exrConverter.Enabled: +# Attributes: +# - Default: true +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.ExampleMemory.mem.ltm.exrConverter.Enabled = true + + +# ArmarX.ExampleMemory.mem.ltm.imageExtractor.Enabled: +# Attributes: +# - Default: true +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.ExampleMemory.mem.ltm.imageExtractor.Enabled = true + + +# ArmarX.ExampleMemory.mem.ltm.memFreqFilter.Enabled: +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.ExampleMemory.mem.ltm.memFreqFilter.Enabled = false + + +# ArmarX.ExampleMemory.mem.ltm.memFreqFilter.WaitingTime: Waiting time in MS after each LTM update. +# Attributes: +# - Default: -1 +# - Case sensitivity: yes +# - Required: no +# ArmarX.ExampleMemory.mem.ltm.memFreqFilter.WaitingTime = -1 + + +# ArmarX.ExampleMemory.mem.ltm.pngConverter.Enabled: +# Attributes: +# - Default: true +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.ExampleMemory.mem.ltm.pngConverter.Enabled = true + + +# ArmarX.ExampleMemory.mem.ltm.sizeToCompressDataInMegaBytes: The size in MB to compress away the current export. Exports are numbered (lower number means newer). # Attributes: -# - Default: /tmp/MemoryExport/Example +# - Default: 1024 # - Case sensitivity: yes # - Required: no -# ArmarX.ExampleMemory.mem.ltm.storagepath = /tmp/MemoryExport/Example +# ArmarX.ExampleMemory.mem.ltm.sizeToCompressDataInMegaBytes = 1024 + + +# ArmarX.ExampleMemory.mem.ltm.snapEqFilter.Enabled: +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.ExampleMemory.mem.ltm.snapEqFilter.Enabled = false + + +# ArmarX.ExampleMemory.mem.ltm.snapEqFilter.MaxWaitingTime: Max Waiting time in MS after each Entity update. +# Attributes: +# - Default: -1 +# - Case sensitivity: yes +# - Required: no +# ArmarX.ExampleMemory.mem.ltm.snapEqFilter.MaxWaitingTime = -1 + + +# ArmarX.ExampleMemory.mem.ltm.snapFreqFilter.Enabled: +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.ExampleMemory.mem.ltm.snapFreqFilter.Enabled = false + + +# ArmarX.ExampleMemory.mem.ltm.snapFreqFilter.WaitingTime: Waiting time in MS after each Entity update. +# Attributes: +# - Default: -1 +# - Case sensitivity: yes +# - Required: no +# ArmarX.ExampleMemory.mem.ltm.snapFreqFilter.WaitingTime = -1 + + +# ArmarX.ExampleMemory.mem.ltm.storagepath: The path to the memory storage (the memory will be stored in a seperate subfolder). +# Attributes: +# - Default: Default value not mapped. +# - Case sensitivity: yes +# - Required: no +# ArmarX.ExampleMemory.mem.ltm.storagepath = Default value not mapped. # ArmarX.ExampleMemory.mns.MemoryNameSystemEnabled: Whether to use (and depend on) the Memory Name System (MNS). @@ -178,6 +281,15 @@ ArmarX.ArMemExampleMemory.tpc.pub.MemoryListener = MemoryUpdates # ArmarX.ExampleMemory.mns.MemoryNameSystemName = MemoryNameSystem +# ArmarX.ExampleMemory.p.enableRemoteGui: If true, the memory cotent is shown in the remote gui.Can be very slow for high-frequency updates! +# Attributes: +# - Default: false +# - Case sensitivity: yes +# - Required: no +# - Possible values: {0, 1, false, no, true, yes} +# ArmarX.ExampleMemory.p.enableRemoteGui = false + + # ArmarX.ExampleMemory.tpc.pub.DebugObserver: Name of the `DebugObserver` topic to publish data to. # Attributes: # - Default: DebugObserver diff --git a/scenarios/ArMemExample/config/ExampleMemoryClient.cfg b/scenarios/ArMemExample/config/ExampleMemoryClient.cfg index df84ec74b9f589842815ba742960cbc360da01e4..9c012266f8691c27cfa40be3ad793c081877178e 100644 --- a/scenarios/ArMemExample/config/ExampleMemoryClient.cfg +++ b/scenarios/ArMemExample/config/ExampleMemoryClient.cfg @@ -26,7 +26,7 @@ ArmarX.ArMemExampleClient.tpc.sub.MemoryListener = MemoryUpdates -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes diff --git a/scenarios/ArMemExample/config/MemoryNameSystem.cfg b/scenarios/ArMemExample/config/MemoryNameSystem.cfg index dfe9b389392a186f5baef2403145e31d49646f58..b8bc70a66ca7f32a628886ad1bf13e373f9750d3 100644 --- a/scenarios/ArMemExample/config/MemoryNameSystem.cfg +++ b/scenarios/ArMemExample/config/MemoryNameSystem.cfg @@ -18,7 +18,7 @@ # ArmarX.ApplicationName = "" -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes diff --git a/scenarios/ArMemExample/config/RemoteGuiProviderApp.cfg b/scenarios/ArMemExample/config/RemoteGuiProviderApp.cfg index 4683563a9c97e6bb11805b8d903dbe2f705a3fd2..4b6abea40d72afd7d313ee47a9b191f3b26de30d 100644 --- a/scenarios/ArMemExample/config/RemoteGuiProviderApp.cfg +++ b/scenarios/ArMemExample/config/RemoteGuiProviderApp.cfg @@ -18,7 +18,7 @@ # ArmarX.ApplicationName = "" -# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${HOME}/.armarx) +# ArmarX.CachePath: Path for cache files. If relative path AND env. variable ARMARX_CONFIG_DIR is set, the cache path will be made relative to ARMARX_CONFIG_DIR. Otherwise if relative it will be relative to the default ArmarX config dir (${ARMARX_WORKSPACE}/armarx_config) # Attributes: # - Default: mongo/.cache # - Case sensitivity: yes diff --git a/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.cpp b/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.cpp index 7a7d65f0740024f7ef1d7b43c667c2971962429b..dc7309cf18c368d85994cc06a2944b856d9832f4 100644 --- a/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.cpp +++ b/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.cpp @@ -51,6 +51,9 @@ namespace armarx "If enabled, core segments are added when required by a new provider segment." "This will usually be off for most memory servers."); + defs->optional(p.enableRemoteGui, "p.enableRemoteGui", + "If true, the memory cotent is shown in the remote gui." + "Can be very slow for high-frequency updates!"); return defs; } @@ -60,6 +63,7 @@ namespace armarx return "ExampleMemory"; } + void ExampleMemory::onInitComponent() { // Usually, the memory server will specify a number of core segments with a specific aron type. @@ -80,8 +84,11 @@ namespace armarx void ExampleMemory::onConnectComponent() { - createRemoteGuiTab(); - RemoteGui_startRunningTask(); + if (p.enableRemoteGui) + { + createRemoteGuiTab(); + RemoteGui_startRunningTask(); + } } void ExampleMemory::onDisconnectComponent() diff --git a/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.h b/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.h index 66a500eeb43043ceb660d9ad9c720d2dc946fb66..62ea177f496296082cac90aecc6e9e6f35d450a8 100644 --- a/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.h +++ b/source/RobotAPI/components/armem/server/ExampleMemory/ExampleMemory.h @@ -96,6 +96,8 @@ namespace armarx }; CoreSegments core; + + bool enableRemoteGui = false; }; Properties p; diff --git a/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp b/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp index 0d89cd82cce205a1032dfe9d895bb4845f7bdc53..36b2e7036df83d0b99731d6773eb4465e7b75997 100644 --- a/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp +++ b/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp @@ -224,7 +224,7 @@ namespace armarx::armem::gui for (auto& [name, reader] : memoryReaders) { data::StoreInput input; - input.query = memoryGroup->queryWidget()->queryInput().toIce(); + input.query = memoryGroup->queryInput().toIce(); reader.readAndStore(input); } @@ -294,7 +294,7 @@ namespace armarx::armem::gui { std::string status; std::map<std::string, wm::Memory> data = - diskControl->loadFromDisk(directory, memoryGroup->queryWidget()->queryInput(), &status); + diskControl->loadFromDisk(directory, memoryGroup->queryInput(), &status); memoryWriters = mns.getAllWriters(true); for (auto& [name, memory] : data) @@ -361,7 +361,7 @@ namespace armarx::armem::gui std::map<std::string, std::future<armem::query::data::Result>>& queries, const std::map<std::string, armem::client::Reader>& readers) { - armem::client::QueryInput input = memoryGroup->queryWidget()->queryInput(); + armem::client::QueryInput input = memoryGroup->queryInput(); int recursionDepth = memoryGroup->queryWidget()->queryLinkRecursionDepth(); // Can't use a structured binding here because you can't capture those in a lambda diff --git a/source/RobotAPI/libraries/armem_gui/memory/GroupBox.cpp b/source/RobotAPI/libraries/armem_gui/memory/GroupBox.cpp index 27af95f6223db049ff9f26fd41632ac2d7850173..8796557cdcfa2d8f337166cb6181bab6f92111c5 100644 --- a/source/RobotAPI/libraries/armem_gui/memory/GroupBox.cpp +++ b/source/RobotAPI/libraries/armem_gui/memory/GroupBox.cpp @@ -39,7 +39,13 @@ namespace armarx::armem::gui::memory _queryWidget = new armem::gui::QueryWidget(); _queryWidget->setSizePolicy(QSizePolicy::Policy::Expanding, QSizePolicy::Policy::Maximum); - _memoryTabWidget->addTab(_queryWidget, QString("Query")); + _memoryTabWidget->addTab(_queryWidget, QString("Query Settings")); + } + { + _snapshotSelectorWidget = new armem::gui::SnapshotSelectorWidget(); + _snapshotSelectorWidget->setSizePolicy(QSizePolicy::Policy::Expanding, QSizePolicy::Policy::Maximum); + + _memoryTabWidget->addTab(_snapshotSelectorWidget, QString("Snapshot Selection")); } { _commitWidget = new armem::gui::CommitWidget(); @@ -67,6 +73,11 @@ namespace armarx::armem::gui::memory return _memoryTabGroup; } + SnapshotSelectorWidget* GroupBox::snapshotSelectorWidget() const + { + return _snapshotSelectorWidget; + } + CommitWidget* GroupBox::commitWidget() const { return _commitWidget; @@ -77,4 +88,16 @@ namespace armarx::armem::gui::memory return _tree; } -} + armem::client::QueryInput GroupBox::queryInput() const + { + armem::client::query::Builder queryBuilder(_queryWidget->dataMode()); + queryBuilder.queryTargets(_snapshotSelectorWidget->queryTargets()) + .coreSegments().all().queryTargets(_snapshotSelectorWidget->queryTargets()) + .providerSegments().all().queryTargets(_snapshotSelectorWidget->queryTargets()) + .entities().all().queryTargets(_snapshotSelectorWidget->queryTargets()) + .snapshots(_snapshotSelectorWidget->selector()); + + return queryBuilder.buildQueryInput(); + } + +} // namespace armarx::armem::gui::memory diff --git a/source/RobotAPI/libraries/armem_gui/memory/GroupBox.h b/source/RobotAPI/libraries/armem_gui/memory/GroupBox.h index 562432d11bb4db79873dd97d200950127bf2e1db..10cf3d5972cc607cfb89fb9b2b0e1962027c9a75 100644 --- a/source/RobotAPI/libraries/armem_gui/memory/GroupBox.h +++ b/source/RobotAPI/libraries/armem_gui/memory/GroupBox.h @@ -26,8 +26,11 @@ namespace armarx::armem::gui::memory TreeWidget* tree() const; QGroupBox* queryGroup() const; QueryWidget* queryWidget() const; + SnapshotSelectorWidget* snapshotSelectorWidget() const; CommitWidget* commitWidget() const; + armem::client::QueryInput queryInput() const; + public slots: @@ -45,6 +48,7 @@ namespace armarx::armem::gui::memory QTabWidget* _memoryTabWidget; QGroupBox* _memoryTabGroup; QueryWidget* _queryWidget; + SnapshotSelectorWidget* _snapshotSelectorWidget; CommitWidget* _commitWidget; }; diff --git a/source/RobotAPI/libraries/armem_gui/query_widgets/QueryWidget.cpp b/source/RobotAPI/libraries/armem_gui/query_widgets/QueryWidget.cpp index 82a8cca0b365cbdb367d28cff620864c72c570f6..ad07dc5b0de991b1e3296a94c66418caa20bf011 100644 --- a/source/RobotAPI/libraries/armem_gui/query_widgets/QueryWidget.cpp +++ b/source/RobotAPI/libraries/armem_gui/query_widgets/QueryWidget.cpp @@ -1,5 +1,7 @@ #include "QueryWidget.h" +#include <limits> + #include <QCheckBox> #include <QGroupBox> #include <QHBoxLayout> @@ -18,36 +20,28 @@ namespace armarx::armem::gui QueryWidget::QueryWidget() { - QHBoxLayout* hlayout1 = new QHBoxLayout(); - QHBoxLayout* hlayout2 = new QHBoxLayout(); - QVBoxLayout* vlayout = new QVBoxLayout(); + auto* vlayout = new QVBoxLayout(); _dataCheckBox = new QCheckBox("Get Data"); _dataCheckBox->setChecked(true); + vlayout->addWidget(_dataCheckBox); + + auto* recDepthHLayout = new QHBoxLayout(); + vlayout->addLayout(recDepthHLayout); - _recursionDepthSpinner = new QSpinBox(); - _recursionDepthSpinner->setMinimum(-1); + _recursionDepthSpinner = new QSpinBox(); // NOLINT + _recursionDepthSpinner->setRange(-1, std::numeric_limits<int>::max()); _recursionDepthSpinner->setValue(0); _recursionDepthSpinner->setEnabled(_dataCheckBox->isChecked()); + _recursionDepthSpinner->setSpecialValueText(QString("Unlimited")); + recDepthHLayout->addWidget(_recursionDepthSpinner); _recursionDepthLabel = new QLabel("Link resolution depth"); + recDepthHLayout->addWidget(_recursionDepthLabel); + recDepthHLayout->addStretch(); _storeInLTMButton = new QPushButton("Store query result in LTM"); - - _snapshotSelectorWidget = new SnapshotSelectorWidget(); - - hlayout1->addWidget(_dataCheckBox); - hlayout1->addWidget(_recursionDepthSpinner); - hlayout1->addWidget(_recursionDepthLabel); - hlayout1->addWidget(_storeInLTMButton); - - hlayout2->addWidget(_snapshotSelectorWidget); - - const int margin = 0; - vlayout->setContentsMargins(margin, margin, margin, margin); - - vlayout->addLayout(hlayout1); - vlayout->addLayout(hlayout2); + vlayout->addWidget(_storeInLTMButton); // Public connections. connect(_storeInLTMButton, &QPushButton::pressed, this, &This::storeInLTM); @@ -72,18 +66,6 @@ namespace armarx::armem::gui return _recursionDepthSpinner->value(); } - armem::client::QueryInput QueryWidget::queryInput() - { - armem::client::query::Builder qb(dataMode()); - qb.queryTargets(_snapshotSelectorWidget->queryTargets()) - .coreSegments().all().queryTargets(_snapshotSelectorWidget->queryTargets()) - .providerSegments().all().queryTargets(_snapshotSelectorWidget->queryTargets()) - .entities().all().queryTargets(_snapshotSelectorWidget->queryTargets()) - .snapshots(_snapshotSelectorWidget->selector()); - - return qb.buildQueryInput(); - } - void QueryWidget::setRecursionDepthSpinnerEnabled(int state) { diff --git a/source/RobotAPI/libraries/armem_gui/query_widgets/QueryWidget.h b/source/RobotAPI/libraries/armem_gui/query_widgets/QueryWidget.h index 3b950acf05899e1e187273d1a2d7da57def4de1e..e7a98a8026786a7c8e0c2acbfd8dc834cb72f16a 100644 --- a/source/RobotAPI/libraries/armem_gui/query_widgets/QueryWidget.h +++ b/source/RobotAPI/libraries/armem_gui/query_widgets/QueryWidget.h @@ -25,8 +25,6 @@ namespace armarx::armem::gui int queryLinkRecursionDepth() const; - armem::client::QueryInput queryInput(); - public slots: @@ -51,8 +49,6 @@ namespace armarx::armem::gui QSpinBox* _recursionDepthSpinner; QPushButton* _storeInLTMButton; - SnapshotSelectorWidget* _snapshotSelectorWidget; - }; }