[Paraview] server-side InvokeEvent(...) doesn't call client-side observer

Kolja Petersen petersenkolja at gmail.com
Tue Nov 28 13:22:48 EST 2017


Ok, vtkSMLiveInsituLinkProxy::NextTimestepAvailable calls PushUpdatedState,
again pushing from client to server. I pasted the code below for
convenience.
I don't get it, where the communication in the opposite direction is
initiated. I have tried before, but the RMI and Qt signals+events usage
makes it impossible to follow the sequence of procedure calls.

  211 void vtkSMLiveInsituLinkProxy::NextTimestepAvailable(vtkIdType
timeStep)  212 {  213   this->TimeStep = timeStep;  214   // Mark all
extract producer proxies as dirty.  215
vtkInternals::ExtractProxiesType::iterator iter;  216   for (iter =
this->Internals->ExtractProxies.begin();  217        iter !=
this->Internals->ExtractProxies.end(); ++iter)  218   {  219
iter->second->MarkModified(iter->second.GetPointer());  220   }  221
222   this->PushUpdatedState();  223   224
this->InvokeEvent(vtkCommand::UpdateEvent);  225 }  226   227
//----------------------------------------------------------------------------
 228 void vtkSMLiveInsituLinkProxy::PushUpdatedState()  229 {  230
if (this->StateDirty)  231   {  232
vtkSMLiveInsituLinkProxyDebugMacro(<< "Push new state to server.");
233     // push new state.  234     vtkPVXMLElement* root =
this->InsituProxyManager->SaveXMLState();  235     std::ostringstream
data;  236     root->PrintXML(data, vtkIndent());  237
root->Delete();  238   239     vtkClientServerStream stream;  240
stream << vtkClientServerStream::Invoke << VTKOBJECT(this) <<
"UpdateInsituXMLState"  241            << data.str().c_str() <<
vtkClientServerStream::End;  242
vtkSMLiveInsituLinkProxyDebugMacro(<< "Push new state to
server--done");  243     this->ExecuteStream(stream);  244   245
this->StateDirty = false;  246   }  247 }


<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virenfrei.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Mon, Nov 27, 2017 at 9:09 PM, Utkarsh Ayachit <
utkarsh.ayachit at kitware.com> wrote:

> Catalyst live-session is managed this custom engineering from both the
> client and the server side. Hence it's not a mechanism that arbitrary
> filters can use to communicate events from server to client. If you're
> interested in how Catalyst live sessions manages this, start by
> looking at vtkSMLiveInsituLinkProxy and vtkLiveInsituLink classes.
> Following the code path for NEXT_TIMESTEP_AVAILABLE might be helpeful.
>
> Utkarsh
>
> On Thu, Nov 23, 2017 at 12:57 PM, Kolja Petersen
> <petersenkolja at gmail.com> wrote:
> > Can anybody answer my question?
> > When Catalyst receives the next timestep update from some simulation
> every
> > few seconds or minutes, it sends its data to the pvserver process. The
> > pvserver somehow notifies the Paraview client, which will display the new
> > data.
> > If Utkarsh's comment is correct that no events can be forwarded from
> server
> > to client, then how does Paraview know that it should display the next
> > timestep?
> >
> > I need to implement a very similar use case, for which a better
> > understanding of the communication between the Catalyst session, the
> > pvserver and the Paraview client is of high importance.
> > Thanks
> > Kolja
> >
> > On Wed, Nov 22, 2017 at 7:54 PM, Kolja Petersen <petersenkolja at gmail.com
> >
> > wrote:
> >>
> >> Oh, well, but how is Catalyst forwarding new time step information from
> >> server to client?
> >> Time step updates can occur at any time. Which event mechanism notifies
> >> the client?
> >> Thanks
> >> Kolja
> >>
> >> On Wed, Nov 22, 2017 at 6:57 PM, Utkarsh Ayachit
> >> <utkarsh.ayachit at kitware.com> wrote:
> >>>
> >>> This is not a use-case supported in ParaView. We don't forward events
> >>> from server to client.
> >>>
> >>> On Wed, Nov 22, 2017 at 12:53 PM, Kolja Petersen
> >>> <petersenkolja at gmail.com> wrote:
> >>>>
> >>>> Hello,
> >>>> I would like to invoke a callback on a proxy in a pvpython session
> from
> >>>> a server-side method.
> >>>>
> >>>> In my server-side class "vtkCustom" I have a method
> >>>> void vtkCustom::SetData(int i){
> >>>>   ...
> >>>>   this->InvokeEvent(1999,NULL);
> >>>>   ...
> >>>> }
> >>>>
> >>>>
> >>>> On the client side, I create a proxy to a vtkCustom object, register
> an
> >>>> observer and set the "Data" property, which should invoke
> eventid=1999:
> >>>> ...
> >>>> custom=pxm.NewProxy("myextensions","Custom")
> >>>> pxm.RegisterProxy("myextensions","Custom",custom)
> >>>>
> >>>> def fun(obj,event):
> >>>>   print "CALLBACK",obj,event
> >>>>
> >>>> custom.AddObserver(1999,fun)
> >>>> vtk.vtkSMPropertyHelper(custom.GetProperty("Data")).Set(42)
> >>>> ...
> >>>>
> >>>> The observer function "fun" on the client is never invoked, although
> the
> >>>> server-side invokes that event. I'm misunderstanding some concept of
> >>>> Paraviews event mechanism for sure. Can you help me correct my steps?
> >>>> Thanks
> >>>> Kolja
> >>>>
> >>>>
> >>>> Virenfrei. www.avast.com
> >>>>
> >>>> _______________________________________________
> >>>> Powered by www.kitware.com
> >>>>
> >>>> Visit other Kitware open-source projects at
> >>>> http://www.kitware.com/opensource/opensource.html
> >>>>
> >>>> Please keep messages on-topic and check the ParaView Wiki at:
> >>>> http://paraview.org/Wiki/ParaView
> >>>>
> >>>> Search the list archives at: http://markmail.org/search/?q=ParaView
> >>>>
> >>>> Follow this link to subscribe/unsubscribe:
> >>>> http://public.kitware.com/mailman/listinfo/paraview
> >>>>
> >>>
> >>
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20171128/53d32c04/attachment.html>


More information about the ParaView mailing list