Graph Handling

Requests or suggestions for new features
Post Reply
psychemedia
Posts: 11
Joined: 09 Sep 2017, 01:10

Graph Handling

Post by psychemedia »

I am trying to put together a set of Jupyter notebook / Python teaching resources that will ideally manage a lot of the simulator operations from a notebook.

Regarding the graph object, it would be useful to have the ability to:

a) reset the graph object using simResetGraph via a Python call;
b) export data from a graph object via a Python call.

Also, when testing scenes that need to be reset and saved for distribution, how do I clear the data buffer from a graph object in the simulator? I half expected "Remove all static streams/curves" as a side effect (could that button be given an option to also clear the buffer?)

--tony

coppelia
Site Admin
Posts: 10336
Joined: 14 Dec 2012, 00:25

Re: Graph Handling

Post by coppelia »

Hello Tony,

the remote API only directly supports the most common commands. If you need to use special commands, you should use simxCallScriptFunction, and execute the desired function inside of the called script. For more info, have a look here.
About your second question: you can simply change the graph buffer size; this will also clear the graph data.

Cheers

psychemedia
Posts: 11
Joined: 09 Sep 2017, 01:10

Re: Graph Handling

Post by psychemedia »

Thanks.

Re: the display - doh, I had tried that, yes; but protocol for a graph window that is permanently displayed and needs to be reset is slightly more involved that just resetting the buffer size (instructions for my use case have to ultimately explicit:-(:

- open graph settings window
- change buffer size
- close graph window (untick Visible while simulation not running)
- reopen it (tick Visible while simulation not running)
- change buffer size back.

--tony

coppelia
Site Admin
Posts: 10336
Joined: 14 Dec 2012, 00:25

Re: Graph Handling

Post by coppelia »

Oh yes, right. The was the old way graphs used to work. With the new way, you would have to slightly adjust the customization script attached to a graph, by for instance adding an additional button to the graph dialog and adjusting what you display accordingly.

Cheers

Post Reply