Skip to content
Snippets Groups Projects
Commit 37a09ed2 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Merge remote-tracking branch 'origin/armem/subscribe' into armem/client-query

# Conflicts:
#	source/RobotAPI/components/armem/ArMemExampleClient/ArMemExampleClient.cpp
parents 74ff1751 4fb12cfa
No related branches found
No related tags found
2 merge requests!102ArMem Memory Updates,!100Memory QueryBuilder
......@@ -233,6 +233,6 @@ ArmarX.ArMemExampleClient.tpc.sub.MemoryListener = MemoryUpdates
# - Case sensitivity: yes
# - Required: no
# - Possible values: {Debug, Error, Fatal, Important, Info, Undefined, Verbose, Warning}
# ArmarX.Verbosity = Info
ArmarX.Verbosity = Debug
......@@ -88,7 +88,6 @@ namespace armarx
}
ARMARX_CHECK_NOT_NULL(memory);
armem::MemoryID providerID;
if (true)
{
armem::data::AddSegmentInput input;
......@@ -113,9 +112,7 @@ namespace armarx
providerID = armem::MemoryID::fromString(result.segmentID);
}
armem::Writer writer(memory);
armem::MemoryID entityID = providerID;
entityID = providerID;
entityID.entityName = "example_entity";
// Subscribe to example_entity updates
......@@ -124,6 +121,29 @@ namespace armarx
example_entityUpdated(sid);
});
task = new RunningTask<ArMemExampleClient>(this, &ArMemExampleClient::run);
task->start();
}
void ArMemExampleClient::onDisconnectComponent()
{
}
void ArMemExampleClient::onExitComponent()
{
}
void ArMemExampleClient::run()
{
sleep(2);
ARMARX_IMPORTANT << "Running now.";
armem::Writer writer(memory);
armem::MemoryID snapshotID;
{
armem::Commit commit;
......@@ -179,15 +199,6 @@ namespace armarx
}
void ArMemExampleClient::onDisconnectComponent()
{
}
void ArMemExampleClient::onExitComponent()
{
}
bool ArMemExampleClient::queryLatestRawIce(const armem::MemoryID& entityID)
{
ARMARX_IMPORTANT
......@@ -254,7 +265,6 @@ namespace armarx
{
ARMARX_ERROR << qResult.errorMessage;
}
return qResult.success;
}
......
......@@ -27,6 +27,7 @@
// ArmarX
#include <ArmarXCore/core/Component.h>
#include <ArmarXCore/interface/observers/ObserverInterface.h>
#include <ArmarXCore/util/tasks.h>
#include <ArmarXGui/libraries/ArmarXGuiComponentPlugins/LightweightRemoteGuiComponentPlugin.h>
// RobotAPI
......@@ -96,9 +97,14 @@ namespace armarx
/// @see PropertyUser::createPropertyDefinitions()
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override;
void run();
private:
armem::MemoryID providerID;
armem::MemoryID entityID;
// Callback for updates on `example_entity`.
void example_entityUpdated(const armem::MemoryID& id);
......@@ -111,6 +117,8 @@ namespace armarx
private:
armarx::RunningTask<ArMemExampleClient>::pointer_type task;
armarx::DebugObserverInterfacePrx debugObserver;
std::string memoryName = "Example";
......
......@@ -37,6 +37,7 @@ armarx::armem::client::ReaderComponentPluginUser::~ReaderComponentPluginUser()
void
armarx::armem::client::ReaderComponentPluginUser::memoryUpdated(const std::vector<data::MemoryID>& updatedIDsIce, const Ice::Current& current)
{
ARMARX_ERROR << "Updated memory ";
std::vector<MemoryID> updatedIDs;
fromIce(updatedIDsIce, updatedIDs);
memoryReader.updated(updatedIDs);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment