Skip to content
Snippets Groups Projects
Commit ee9af093 authored by Fabian Paus's avatar Fabian Paus
Browse files

ArViz: Create new function to send back interactions during a pullUpdates call

parent 59b494a7
No related branches found
No related tags found
No related merge requests found
......@@ -205,6 +205,14 @@ namespace armarx
return result;
}
viz::data::LayerUpdates ArVizStorage::pullUpdatesSinceAndSendInteractions(
Ice::Long revision, viz::data::InteractionFeedbackSeq const& interactions, const Ice::Current& c)
{
// TODO: Implement storing the interactions somewhere
return pullUpdatesSince(revision, c);
}
void ArVizStorage::record()
{
while (!recordingTask->isStopped())
......
......@@ -86,6 +86,10 @@ namespace armarx
// StorageInterface interface
viz::data::LayerUpdates pullUpdatesSince(Ice::Long revision, const Ice::Current&) override;
viz::data::LayerUpdates pullUpdatesSinceAndSendInteractions(
Ice::Long revision,
viz::data::InteractionFeedbackSeq const& interactions,
const Ice::Current&) override;
std::string startRecording(std::string const& prefix, const Ice::Current&) override;
void stopRecording(const Ice::Current&) override;
viz::data::RecordingSeq getAllRecordings(const Ice::Current&) override;
......
......@@ -95,7 +95,7 @@ namespace armarx::viz
callbackData = new CoinVisualizerWrapper;
callbackData->this_ = this;
callback = newCallback_StorageInterface_pullUpdatesSince(callbackData,
callback = newCallback_StorageInterface_pullUpdatesSinceAndSendInteractions(callbackData,
&CoinVisualizerWrapper::onUpdateSuccess,
&CoinVisualizerWrapper::onUpdateFailure);
......@@ -385,8 +385,8 @@ namespace armarx::viz
storage = stateStorage;
root->removeAllChildren();
layers.data.clear();
edUpdates.revision = 0;
edUpdates.updates.clear();
pulledUpdates.revision = 0;
pulledUpdates.updates.clear();
updateResult = CoinVisualizerUpdateResult::SUCCESS;
state = CoinVisualizerState::RUNNING;
}
......@@ -417,10 +417,8 @@ namespace armarx::viz
data::LayerUpdates currentUpdates = pulledUpdates;
updateResult = CoinVisualizerUpdateResult::WAITING;
timing.waitStart = time_start;
storage->begin_pullUpdatesSince(currentUpdates.revision, callback);
// TODO: Also send the interaction feedback to the storage
// Would be best to do it in a single network call
storage->begin_pullUpdatesSinceAndSendInteractions(
currentUpdates.revision, interactionFeedbackBuffer, callback);
// Clear interaction feedback buffer after it has been sent
interactionFeedbackBuffer.clear();
......
......@@ -247,7 +247,7 @@ namespace armarx::viz
void onUpdateSuccess(data::LayerUpdates const& updates);
void onUpdateFailure(Ice::Exception const& ex);
IceUtil::Handle<CoinVisualizerWrapper> callbackData;
armarx::viz::Callback_StorageInterface_pullUpdatesSincePtr callback;
armarx::viz::Callback_StorageInterface_pullUpdatesSinceAndSendInteractionsPtr callback;
std::mutex storageMutex;
viz::StorageInterfacePrx storage;
......
......@@ -90,6 +90,9 @@ interface StorageInterface
{
data::LayerUpdates pullUpdatesSince(long revision);
data::LayerUpdates pullUpdatesSinceAndSendInteractions(
long revision, data::InteractionFeedbackSeq interactions);
string startRecording(string prefix);
void stopRecording();
......
......@@ -99,6 +99,8 @@ module data
GlobalPose chosenPose;
};
sequence<InteractionFeedback> InteractionFeedbackSeq;
module ElementFlags
{
const int NONE = 0;
......
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