diff --git a/source/RobotAPI/interface/armem/query.ice b/source/RobotAPI/interface/armem/query.ice index 2a1586fece346e89cbe491cd21c026ddab603e0e..936294507f0b05627051fa6974309faa1db4d758 100644 --- a/source/RobotAPI/interface/armem/query.ice +++ b/source/RobotAPI/interface/armem/query.ice @@ -14,8 +14,7 @@ module armarx enum QueryTarget { WM, - LTM, - Disk + LTM }; sequence<QueryTarget> QueryTargets; diff --git a/source/RobotAPI/libraries/armem/core/longtermmemory/Memory.cpp b/source/RobotAPI/libraries/armem/core/longtermmemory/Memory.cpp index ecefdc46837818a8649e204efedf52cc05489494..50aee46722c2e7c7f153feed0853e4f8a1226724 100644 --- a/source/RobotAPI/libraries/armem/core/longtermmemory/Memory.cpp +++ b/source/RobotAPI/libraries/armem/core/longtermmemory/Memory.cpp @@ -15,7 +15,6 @@ namespace armarx::armem::ltm Memory::Memory(const Memory& other) : Base(other), dbsettings(other.dbsettings), - alwaysTransferSettings(other.alwaysTransferSettings), periodicTransferSettings(other.periodicTransferSettings), onFullTransferSettings(other.onFullTransferSettings), mongoDBMutex() @@ -27,7 +26,6 @@ namespace armarx::armem::ltm Memory::Memory(Memory&& other) : Base(std::move(other)), dbsettings(other.dbsettings), - alwaysTransferSettings(other.alwaysTransferSettings), periodicTransferSettings(other.periodicTransferSettings), onFullTransferSettings(other.onFullTransferSettings), reloaded(other.reloaded) @@ -41,7 +39,6 @@ namespace armarx::armem::ltm Base::operator=(other); dbsettings = other.dbsettings; - alwaysTransferSettings = other.alwaysTransferSettings; periodicTransferSettings = other.periodicTransferSettings; onFullTransferSettings = other.onFullTransferSettings; @@ -55,7 +52,6 @@ namespace armarx::armem::ltm Base::operator=(std::move(other)); dbsettings = std::move(other.dbsettings); - alwaysTransferSettings = std::move(other.alwaysTransferSettings); periodicTransferSettings = std::move(other.periodicTransferSettings); onFullTransferSettings = std::move(other.onFullTransferSettings); reloaded = other.reloaded; @@ -73,7 +69,7 @@ namespace armarx::armem::ltm ARMARX_WARNING << deactivateSpam("ConnectionIsNotValid") << "The connection to mongocxx for memory '" << name() << "' is not valid. Settings are: " << dbsettings.toString() << "\nTo start it, run e.g.: \n" - << "mongod --port " << dbsettings.port << " --dbpath \"/tmp/\"" + << "armarx memory start" << "\n\n"; return false; } @@ -87,9 +83,8 @@ namespace armarx::armem::ltm defs->optional(dbsettings.user, prefix + "ltm.20_user"); defs->optional(dbsettings.password, prefix + "ltm.21_password"); defs->optional(dbsettings.database, prefix + "ltm.22_database"); - defs->optional(alwaysTransferSettings.enabled, prefix + "ltm.30_enableAlwaysTransfer", "Enable transfer whenever new data is committed (This disables the other transfer modes!)."); - defs->optional(periodicTransferSettings.enabled, prefix + "ltm.31_enablePeriodicTransfer", "Enable transfer based on periodic interval."); - defs->optional(onFullTransferSettings.enabled, prefix + "ltm.32_enableOnFullTransfer", "Enable transfer whenever the wm is full (see maxHistorySize)."); + defs->optional(periodicTransferSettings.enabled, prefix + "ltm.30_enablePeriodicTransfer", "Enable transfer based on periodic interval."); + defs->optional(onFullTransferSettings.enabled, prefix + "ltm.31_enableOnFullTransfer", "Enable transfer whenever the wm is full (see maxHistorySize)."); } wm::Memory Memory::convert() const @@ -236,7 +231,6 @@ namespace armarx::armem::ltm toAppendQueue.push_back(m); return; } - _append(m); } } diff --git a/source/RobotAPI/libraries/armem/core/longtermmemory/Memory.h b/source/RobotAPI/libraries/armem/core/longtermmemory/Memory.h index dbeb2a53872b9c7ed7f042006c7ffcd1134b8f13..870bc0a7a7b668c7afb9f9766f4a4ec4c66faee7 100644 --- a/source/RobotAPI/libraries/armem/core/longtermmemory/Memory.h +++ b/source/RobotAPI/libraries/armem/core/longtermmemory/Memory.h @@ -26,11 +26,6 @@ namespace armarx::armem::ltm bool enabled = false; }; - struct AlwaysTransferSettings : public TransferSettings - { - - }; - struct PeriodicTransferSettings : public TransferSettings { bool deleteFromWMOnTransfer = false; @@ -46,6 +41,7 @@ namespace armarx::armem::ltm }; Mode mode; + int batch_size = 20; }; @@ -77,7 +73,6 @@ namespace armarx::armem::ltm public: MongoDBConnectionManager::MongoDBSettings dbsettings; - AlwaysTransferSettings alwaysTransferSettings; PeriodicTransferSettings periodicTransferSettings; OnFullTransferSettings onFullTransferSettings; diff --git a/source/RobotAPI/libraries/armem/core/wm/aron_conversions.cpp b/source/RobotAPI/libraries/armem/core/wm/aron_conversions.cpp index 0d9344be877417264f27c9370052b7fb4d098604..a4a5faa1404129feed5f2573c706c22900c108df 100644 --- a/source/RobotAPI/libraries/armem/core/wm/aron_conversions.cpp +++ b/source/RobotAPI/libraries/armem/core/wm/aron_conversions.cpp @@ -1,4 +1,7 @@ -#include "json_conversions.h" +#include "aron_conversions.h" + +#include <RobotAPI/libraries/aron/core/navigator/data/AllNavigators.h> + namespace armarx::armem { @@ -10,54 +13,57 @@ namespace armarx::armem constexpr const char* DATA_WRAPPER_TIME_ARRIVED_FIELD = "__ENTITY_METADATA__TIME_ARRIVED"; constexpr const char* DATA_WRAPPER_CONFIDENCE_FIELD = "__ENTITY_METADATA__CONFIDENCE"; - void from_aron(const aron::datanavigator::DictNavigatorPtr& dataWrapped, wm::EntityInstance& e) +} + + +void armarx::armem::from_aron(const aron::datanavigator::DictNavigatorPtr& dataWrapped, wm::EntityInstance& e) +{ + wm::EntityInstanceMetadata& metadata = e.metadata(); + + if (dataWrapped->hasElement(DATA_WRAPPER_DATA_FIELD)) { - wm::EntityInstanceMetadata& metadata = e.metadata(); + e.data() = aron::datanavigator::DictNavigator::DynamicCastAndCheck(dataWrapped->getElement(DATA_WRAPPER_DATA_FIELD)); + } - if (dataWrapped->hasElement(DATA_WRAPPER_DATA_FIELD)) - { - e.data() = aron::datanavigator::DictNavigator::DynamicCastAndCheck(dataWrapped->getElement(DATA_WRAPPER_DATA_FIELD)); - } + auto timeCreated = aron::datanavigator::LongNavigator::DynamicCastAndCheck(dataWrapped->getElement(DATA_WRAPPER_TIME_CREATED_FIELD)); + metadata.timeCreated = Time::microSeconds(timeCreated->toAronLongPtr()->value); - auto timeCreated = aron::datanavigator::LongNavigator::DynamicCastAndCheck(dataWrapped->getElement(DATA_WRAPPER_TIME_CREATED_FIELD)); - metadata.timeCreated = Time::microSeconds(timeCreated->toAronLongPtr()->value); + auto timeSent = aron::datanavigator::LongNavigator::DynamicCastAndCheck(dataWrapped->getElement(DATA_WRAPPER_TIME_SENT_FIELD)); + metadata.timeSent = Time::microSeconds(timeSent->toAronLongPtr()->value); - auto timeSent = aron::datanavigator::LongNavigator::DynamicCastAndCheck(dataWrapped->getElement(DATA_WRAPPER_TIME_SENT_FIELD)); - metadata.timeSent = Time::microSeconds(timeSent->toAronLongPtr()->value); + auto timeArrived = aron::datanavigator::LongNavigator::DynamicCastAndCheck(dataWrapped->getElement(DATA_WRAPPER_TIME_ARRIVED_FIELD)); + metadata.timeArrived = Time::microSeconds(timeArrived->toAronLongPtr()->value); - auto timeArrived = aron::datanavigator::LongNavigator::DynamicCastAndCheck(dataWrapped->getElement(DATA_WRAPPER_TIME_ARRIVED_FIELD)); - metadata.timeArrived = Time::microSeconds(timeArrived->toAronLongPtr()->value); + auto confidence = aron::datanavigator::DoubleNavigator::DynamicCastAndCheck(dataWrapped->getElement(DATA_WRAPPER_CONFIDENCE_FIELD)); + metadata.confidence = static_cast<float>(confidence->toAronDoublePtr()->value); +} - auto confidence = aron::datanavigator::DoubleNavigator::DynamicCastAndCheck(dataWrapped->getElement(DATA_WRAPPER_CONFIDENCE_FIELD)); - metadata.confidence = static_cast<float>(confidence->toAronDoublePtr()->value); - } - void to_aron(aron::datanavigator::DictNavigatorPtr& a, const wm::EntityInstance& e) +void armarx::armem::to_aron(aron::datanavigator::DictNavigatorPtr& a, const wm::EntityInstance& e) +{ + if (e.data()) { - if (e.data()) - { - a->addElement(DATA_WRAPPER_DATA_FIELD, e.data()); - } - - auto timeWrapped = std::make_shared<aron::datanavigator::LongNavigator>(); - timeWrapped->setValue(Time::now().toMicroSeconds()); - a->addElement(DATA_WRAPPER_TIME_STORED_FIELD, timeWrapped); - - const wm::EntityInstanceMetadata& metadata = e.metadata(); - auto timeCreated = std::make_shared<aron::datanavigator::LongNavigator>(); - timeCreated->setValue(metadata.timeCreated.toMicroSeconds()); - a->addElement(DATA_WRAPPER_TIME_CREATED_FIELD, timeCreated); - - auto timeSent = std::make_shared<aron::datanavigator::LongNavigator>(); - timeSent->setValue(metadata.timeSent.toMicroSeconds()); - a->addElement(DATA_WRAPPER_TIME_SENT_FIELD, timeSent); - - auto timeArrived = std::make_shared<aron::datanavigator::LongNavigator>(); - timeArrived->setValue(metadata.timeArrived.toMicroSeconds()); - a->addElement(DATA_WRAPPER_TIME_ARRIVED_FIELD, timeArrived); - - auto confidence = std::make_shared<aron::datanavigator::DoubleNavigator>(); - confidence->setValue(static_cast<double>(metadata.confidence)); - a->addElement(DATA_WRAPPER_CONFIDENCE_FIELD, confidence); + a->addElement(DATA_WRAPPER_DATA_FIELD, e.data()); } + + auto timeWrapped = std::make_shared<aron::datanavigator::LongNavigator>(); + timeWrapped->setValue(Time::now().toMicroSeconds()); + a->addElement(DATA_WRAPPER_TIME_STORED_FIELD, timeWrapped); + + const wm::EntityInstanceMetadata& metadata = e.metadata(); + auto timeCreated = std::make_shared<aron::datanavigator::LongNavigator>(); + timeCreated->setValue(metadata.timeCreated.toMicroSeconds()); + a->addElement(DATA_WRAPPER_TIME_CREATED_FIELD, timeCreated); + + auto timeSent = std::make_shared<aron::datanavigator::LongNavigator>(); + timeSent->setValue(metadata.timeSent.toMicroSeconds()); + a->addElement(DATA_WRAPPER_TIME_SENT_FIELD, timeSent); + + auto timeArrived = std::make_shared<aron::datanavigator::LongNavigator>(); + timeArrived->setValue(metadata.timeArrived.toMicroSeconds()); + a->addElement(DATA_WRAPPER_TIME_ARRIVED_FIELD, timeArrived); + + auto confidence = std::make_shared<aron::datanavigator::DoubleNavigator>(); + confidence->setValue(static_cast<double>(metadata.confidence)); + a->addElement(DATA_WRAPPER_CONFIDENCE_FIELD, confidence); } diff --git a/source/RobotAPI/libraries/armem/server/MemoryToIceAdapter.cpp b/source/RobotAPI/libraries/armem/server/MemoryToIceAdapter.cpp index b6c14f5a119d230efa54ae1b518981bad9b61827..9fd9d5ccf68640468ea18235ce2a7afe316d7d3d 100644 --- a/source/RobotAPI/libraries/armem/server/MemoryToIceAdapter.cpp +++ b/source/RobotAPI/libraries/armem/server/MemoryToIceAdapter.cpp @@ -179,17 +179,7 @@ namespace armarx::armem::server // TODO: Move outside of loop? if (longtermMemory) { - if (longtermMemory->alwaysTransferSettings.enabled) - { - wm::Memory tmp(longtermMemory->name()); - tmp._addMissingCoreSegmentDuringUpdate = true; - tmp.update(update); - longtermMemory->append(tmp); - } - else - { - // TODO: see below - } + } // TODO: Consollidate to ltm if onFilledTransfer is enabled (fabian.peller) diff --git a/source/RobotAPI/libraries/armem/server/query_proc/diskmemory/BaseQueryProcessor.h b/source/RobotAPI/libraries/armem/server/query_proc/diskmemory/BaseQueryProcessor.h index 469b5f907d01bbff757b1bea14ff8e80e5769315..0e3ddac45c6a8eee377f468767a3bc39a580c554 100644 --- a/source/RobotAPI/libraries/armem/server/query_proc/diskmemory/BaseQueryProcessor.h +++ b/source/RobotAPI/libraries/armem/server/query_proc/diskmemory/BaseQueryProcessor.h @@ -25,7 +25,7 @@ namespace armarx::armem::d_ltm::query_proc query::data::QueryTarget getTargetType() const override { - return query::data::QueryTarget::Disk; + return query::data::QueryTarget::LTM; } }; diff --git a/source/RobotAPI/libraries/armem_gui/MemoryControlWidget.cpp b/source/RobotAPI/libraries/armem_gui/MemoryControlWidget.cpp index 5016db50bf5da8dc10d0fac5b5c004b9178ddc40..38e4d8c88719541e7c4fca92964cfb069c22ba5e 100644 --- a/source/RobotAPI/libraries/armem_gui/MemoryControlWidget.cpp +++ b/source/RobotAPI/libraries/armem_gui/MemoryControlWidget.cpp @@ -4,6 +4,7 @@ #include <QLineEdit> #include <QTimer> #include <QHBoxLayout> +#include <QFileDialog> #include <cmath> @@ -16,32 +17,53 @@ namespace armarx::armem::gui setSizePolicy(QSizePolicy::Policy::Minimum, QSizePolicy::Policy::Fixed); auto vlayout = new QVBoxLayout(); - auto hlayout = new QHBoxLayout(); + auto hlayout1 = new QHBoxLayout(); + auto hlayout2 = new QHBoxLayout(); + + hlayout1->setContentsMargins(10, 2, 10, 2); + hlayout2->setContentsMargins(10, 2, 10, 2); const int margin = 0; vlayout->setContentsMargins(margin, margin, margin, margin); _lineEdit = new QLineEdit("/tmp/MemoryExport", this); _lineEdit->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Preferred); - _lineEdit->setMinimumWidth(400); + _lineEdit->setMinimumWidth(150); + + _openFileBrowserButton = new QPushButton("Search files", this); + + _storeOnDiskButton = new QPushButton("Store query (Disk)", this); + _storeInLTMButton = new QPushButton("Store query (LTM)", this); - _storeOnDiskButton = new QPushButton("Store current result on local Disk", this); + hlayout1->addWidget(_lineEdit); + hlayout1->addWidget(_openFileBrowserButton); - _storeInLTMButton = new QPushButton("Store current result in LTM", this); + hlayout2->addWidget(_storeOnDiskButton); + hlayout2->addWidget(_storeInLTMButton); - vlayout->addWidget(_lineEdit); - hlayout->addWidget(_storeOnDiskButton); - hlayout->addWidget(_storeInLTMButton); - vlayout->addItem(hlayout); + vlayout->addItem(hlayout1); + vlayout->addItem(hlayout2); this->setLayout(vlayout); // Private connections. // Public connections. + connect(_openFileBrowserButton, &QPushButton::pressed, this, &This::openFileBrowser); connect(_storeInLTMButton, &QPushButton::pressed, this, &This::storeInLTM); connect(_storeOnDiskButton, &QPushButton::pressed, this, &This::storeOnDisk); } + void MemoryControlWidget::openFileBrowser() + { + QFileDialog dialog; + dialog.setFileMode(QFileDialog::DirectoryOnly); + //dialog.setOption(QFileDialog::DontUseNativeDialog, true); + dialog.setOption(QFileDialog::ShowDirsOnly, false); + dialog.exec(); + QString open = dialog.directory().path(); + _lineEdit->setText(open); + } + QLineEdit* MemoryControlWidget::pathInputBox() { return _lineEdit; diff --git a/source/RobotAPI/libraries/armem_gui/MemoryControlWidget.h b/source/RobotAPI/libraries/armem_gui/MemoryControlWidget.h index 19831694acc7b9251c7d372b8381f755df1bc292..c6b156db313b01180a7f5884959ffc21b0a73f9d 100644 --- a/source/RobotAPI/libraries/armem_gui/MemoryControlWidget.h +++ b/source/RobotAPI/libraries/armem_gui/MemoryControlWidget.h @@ -4,6 +4,7 @@ class QPushButton; class QLineEdit; +class QFileDialog; namespace armarx::armem::gui { @@ -20,11 +21,15 @@ namespace armarx::armem::gui QLineEdit* pathInputBox(); QString getEnteredPath(); + QPushButton* openFileBrowserButton(); + QPushButton* storeInLTMButton(); QPushButton* storeOnDiskButton(); public slots: + void openFileBrowser(); + signals: void storeInLTM(); @@ -40,6 +45,8 @@ namespace armarx::armem::gui QLineEdit* _lineEdit; + QPushButton* _openFileBrowserButton; + QPushButton* _storeInLTMButton; QPushButton* _storeOnDiskButton; diff --git a/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp b/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp index ba8e66ff9527a3d2ed1f16a162a53e84f41a9b02..bc63d69b96701b226b10c83d3b28eca3a7ea154c 100644 --- a/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp +++ b/source/RobotAPI/libraries/armem_gui/MemoryViewer.cpp @@ -216,108 +216,111 @@ namespace armarx::armem::gui void MemoryViewer::updateMemories() { + int errorCount = 0; + memoryReaders.clear(); memoryData.clear(); memoryReaders = mns.getAllReaders(true); bool dataChanged = false; + std::filesystem::path path(memoryControlWidget->getEnteredPath().toStdString()); - QString qs = memoryControlWidget->getEnteredPath(); - std::string utf8_text = qs.toUtf8().constData(); - - std::filesystem::path p(utf8_text); + armem::client::QueryInput input = memoryGroup->queryWidget()->queryInput(); // first check if the local file system should be queried if (memoryGroup->queryWidget()->alsoQueryLocalDisk()) { - if (std::filesystem::is_directory(p)) + if (std::filesystem::is_directory(path)) { - for (const auto& d : std::filesystem::directory_iterator(p)) + for (const auto& directory : std::filesystem::directory_iterator(path)) { - if (d.is_directory()) + if (directory.is_directory()) { - std::string k = d.path().filename(); + std::string k = directory.path().filename(); armem::d_ltm::Memory dMem(k); - dMem.reload(p / k); + dMem.reload(path / k); - armem::client::QueryInput input = memoryGroup->queryWidget()->queryInput(); - input.addQueryTargetToAll(armem::query::data::QueryTarget::Disk); + input.addQueryTargetToAll(armem::query::data::QueryTarget::LTM); // We use LTM as query target for the disk armem::d_ltm::query_proc::MemoryQueryProcessor d_ltm_processor; dMem = d_ltm_processor.process(input.toIce(), dMem); wm::Memory converted = dMem.convert(); memoryData[k] = std::move(converted); - dataChanged = true; } } } else { - ARMARX_WARNING << "Could not import a memory from '" << utf8_text << "'. Skipping import."; + ARMARX_WARNING << "Could not import a memory from '" << path << "'. Skipping import."; } - } - armem::client::QueryInput input = memoryGroup->queryWidget()->queryInput(); - for (auto& [name, reader] : memoryReaders) + dataChanged = true; // in any case we update the view (even if there was no result) + } + else { - TIMING_START(MemoryQuery); + for (auto& [name, reader] : memoryReaders) { - armem::client::QueryResult result = reader.query(input); - if (result) + TIMING_START(MemoryQuery); { - if (not result.memory.empty()) + armem::client::QueryResult result = reader.query(input); + if (result) { if (auto it = memoryData.find(name); it != memoryData.end()) { result.memory.append(it->second); - - // requery (e.g. to get only the last n values instead of the last n from disk and the last n from wm) - armem::wm::query_proc::MemoryQueryProcessor wm_processor; - result.memory = wm_processor.process(input.toIce(), result.memory); - if (result.memory.empty()) { ARMARX_ERROR << "A memory which had data before lost data. This indicates that there is something wrong."; } - } - dataChanged = true; - memoryData[name] = std::move(result.memory); + memoryData[name] = std::move(result.memory); + } + else + { + ARMARX_INFO << "The memory " << name << " has no data after querying."; + } + dataChanged = true; // in any case we update the view (even if there was no result) } else { - ARMARX_INFO << "The memory " << name << " has no data after querying."; + ARMARX_WARNING << "A query for memory '" << name << "' produced an error: " << result.errorMessage; + errorCount++; } } - else + TIMING_END_STREAM(MemoryQuery, ARMARX_VERBOSE); + + if (debugObserver) { - ARMARX_WARNING << "A query for memory '" << name << "' produced an error: " << result.errorMessage; - if (statusLabel) - { - statusLabel->setText(QString::fromStdString(result.errorMessage)); - } + debugObserver->setDebugDatafield(Logging::tag.tagName, "Memory Query [ms]", new Variant(MemoryQuery.toMilliSecondsDouble())); } } - TIMING_END_STREAM(MemoryQuery, ARMARX_VERBOSE); - - if (debugObserver) - { - debugObserver->setDebugDatafield(Logging::tag.tagName, "Memory Query [ms]", new Variant(MemoryQuery.toMilliSecondsDouble())); - } } + // Code to output status label information + std::stringstream ss; + auto now = std::chrono::system_clock::now(); + auto in_time_t = std::chrono::system_clock::to_time_t(now); + ss << "Last update: " << std::put_time(std::localtime(&in_time_t), "%Y-%m-%d %X"); + if (dataChanged) { emit memoryDataChanged(); } else { - if (statusLabel) - { - statusLabel->setText("No query result."); - } + ss << "- No query result. "; + } + + if (errorCount > 0) + { + ss << "The query produced " << errorCount << " errors! Please check log."; + } + + if (statusLabel) + { + statusLabel->setText(ss.str().c_str()); } } diff --git a/source/RobotAPI/libraries/armem_gui/query_widgets/SnapshotSelectorWidget.cpp b/source/RobotAPI/libraries/armem_gui/query_widgets/SnapshotSelectorWidget.cpp index e41bed15cecbc599c7c97b4266a04e0e9a70e47e..9d5cc9ea6064bb6977892623649518791dcaffec 100644 --- a/source/RobotAPI/libraries/armem_gui/query_widgets/SnapshotSelectorWidget.cpp +++ b/source/RobotAPI/libraries/armem_gui/query_widgets/SnapshotSelectorWidget.cpp @@ -26,11 +26,23 @@ namespace armarx::armem::gui { targets.push_back(query::data::QueryTarget::LTM); } - if (_DiskMemoryQueryTargetCheckBox->isChecked()) + return targets; + } + + void SnapshotSelectorWidget::localDiskStateChanged() + { + if (_LocalDiskMemoryQueryTargetCheckBox->isChecked()) { - targets.push_back(query::data::QueryTarget::Disk); + _WMQueryTargetCheckBox->setChecked(false); + _LTMQueryTargetCheckBox->setChecked(false); + _WMQueryTargetCheckBox->setEnabled(false); + _LTMQueryTargetCheckBox->setEnabled(false); + } + else + { + _WMQueryTargetCheckBox->setEnabled(true); + _LTMQueryTargetCheckBox->setEnabled(true); } - return targets; } bool SnapshotSelectorWidget::queryTargetContainsLocalDisk() const @@ -59,13 +71,13 @@ namespace armarx::armem::gui // query type select box auto queryTargetLayout = new QHBoxLayout(); _WMQueryTargetCheckBox = new QCheckBox("WM"); - _LTMQueryTargetCheckBox = new QCheckBox("LTM (MongoDB)"); - _DiskMemoryQueryTargetCheckBox = new QCheckBox("LTM (Disk)"); + _LTMQueryTargetCheckBox = new QCheckBox("LTM"); _LocalDiskMemoryQueryTargetCheckBox = new QCheckBox("Local Disk"); + connect(_LocalDiskMemoryQueryTargetCheckBox, &QCheckBox::stateChanged, this, &This::localDiskStateChanged); + queryTargetLayout->addWidget(_WMQueryTargetCheckBox); queryTargetLayout->addWidget(_LTMQueryTargetCheckBox); - queryTargetLayout->addWidget(_DiskMemoryQueryTargetCheckBox); queryTargetLayout->addWidget(_LocalDiskMemoryQueryTargetCheckBox); _WMQueryTargetCheckBox->setChecked(true); diff --git a/source/RobotAPI/libraries/armem_gui/query_widgets/SnapshotSelectorWidget.h b/source/RobotAPI/libraries/armem_gui/query_widgets/SnapshotSelectorWidget.h index 6f6422c3cdbc7fd0e1899bce47efbaaa32589062..a0b69eb1b6f362e64880ab400c0bea29bcdc73fc 100644 --- a/source/RobotAPI/libraries/armem_gui/query_widgets/SnapshotSelectorWidget.h +++ b/source/RobotAPI/libraries/armem_gui/query_widgets/SnapshotSelectorWidget.h @@ -45,14 +45,13 @@ namespace armarx::armem::gui signals: void queryChanged(); - private slots: //void updateSelector(); void hideAllForms(); void showSelectedFormForQuery(QString selected); - + void localDiskStateChanged(); signals: void queryOutdated(); @@ -68,7 +67,6 @@ namespace armarx::armem::gui QComboBox* _queryComboBox; QCheckBox* _WMQueryTargetCheckBox; QCheckBox* _LTMQueryTargetCheckBox; - QCheckBox* _DiskMemoryQueryTargetCheckBox; QCheckBox* _LocalDiskMemoryQueryTargetCheckBox; /// The forms for the different query types. Hidden when not selected. std::map<QString, SnapshotForm*> _queryForms;