Issues.00399 - lordmundi/wikidoctest GitHub Wiki

00399: Simdata oneshot/send text capability

« 00398 | Issues | 00400 »

Summary: Simdata oneshot/send text capability

Created: 2011–10–13 17:48

Status: Released

Category: Request

From: mark

Version: 2.2

Released_In: 2.3

Description:

This is a feature request. It would be useful in some cases to have simdata request a sim variable on an ad hoc basis for variables that are useful to users but which do not drive the graphics. Typically these would be variables which do not change over the course of a sim. Priority should be placed on the smooth running of graphics rather than on speedy retrieval — this feature is not designed to retrieve real-time variable values for processing.

The implementation design is as follows. There will be two new simdata APIs: simdata_oneshot for retrieving a variable value from the sim, and simdata_send_text for sending commands to the sim. The latter will not be supported for Trick 07 sims.

Retrieval of oneshot data


Signature: proc simdata_oneshot callback_fn

The callback function signature should be of the form: proc my_callback_fn { fields_list }

Behavior: - simdata_oneshot shall take a list of parameter names and return immediately with a status of −1 if no sim is connected, or 0 otherwise. - The callback function shall be called once for each parameter passed to simdata_oneshot. - The callback function will be passed a list structure composed as follows: index 0: parameter name index 1: status (0 if OK, non-zero = error) index 2: parameter value index 3: parameter units - if the status field is non-zero, no assumptions should be made about the contents of the parameter value and parameter units fields - no assumptions should be made about the time homogeneity of parameter values when multiple parameters are requested.

For testing purposes, simdata will add a test callback called simdata_echo_cb that works with simdata_oneshot and simply prints the values to stderr. This may be useful for developer troubleshooting.

Sending text command to a sim (not supported for Trick 07)


Signature: proc simdata_send_text

Behavior: This capability is designed for advanced users who want to embed commands to the sim within a tcl script that reuses an existing simdata connection. An immediate status of 0 (OK) or −1 (Error) will be returned to the user. Status 0 means only that simdata has received the message, verified that a Trick 10 sim is connected, and will attempt to send the message to the variable server.

The user is responsible for ensuring the correctness of all formatting and syntax. Due to the nature of the variable server API, it is not possible to return status on the success or failure of the message sent. Success or failure must therefore be determined indirectly through monitoring sim behavior.

Notes


When using these APIs, it is important to be aware of Tcl's tendencies to interpret square brackets as commands. It is a good idea to put parameter names containing array references in braces to prevent misinterpretation.


Comments

mark This has been submitted, and the send_text portion has been beta tested by MMSEV. So far, so good.


« 00398 | Issues | 00400 »

Associated Commits

| commit | 41a08a3b0323ca42a9b5068413fbcccd453e30ca [link] | || | Author: | Mark | | Date: | Thu Oct 13 18:20:49 2011 -0500 | | Message: | [@Issue 00399: Simdata support for oneshot retrieval and TVS text send @] |

Affected Files:

gui/remote_commanding_proc_allow.tcl               |   1 +
 gui/simdatadlg.tcl                                 |  67 +++++++±-
 lib_Darwin/libriver.a                              | Bin 3871688 -> 3874992 bytes
 lib_Darwin/libstream.a                             | Bin 1761192 -> 1761528 bytes
 lib_Darwin/libtvs.a                                | Bin 2049680 -> 2048760 bytes
 lib_Linux_FC3/libriver.a                           | Bin 3739410 -> 3742170 bytes
 lib_Linux_FC3/libstream.a                          | Bin 1771192 -> 1771192 bytes
 lib_Linux_FC3/libtvs.a                             | Bin 1871818 -> 1868296 bytes
 lib_Win32/libriver.a                               | Bin 3952168 -> 3955274 bytes
 lib_Win32/libstream.a                              | Bin 1416992 -> 1416992 bytes
 lib_Win32/libtvs.a                                 | Bin 1736968 -> 1734132 bytes
 plugin_Darwin/dsp_simdata.so                       | Bin 4244172 -> 4251656 bytes
 plugin_Linux_FC3/dsp_simdata.so                    | Bin 10656371 -> 10663475 bytes
 plugin_Win32/dsp_simdata.dll                       | Bin 10786267 -> 10799361 bytes
 src.dist/plugins/common/libriver/CsvRiver.cpp      |   2 ±
 src.dist/plugins/common/libriver/CsvRiver.hh       |   2 ±
 src.dist/plugins/common/libriver/DataRiver.cpp     |   8 ±
 src.dist/plugins/common/libriver/DataRiver.hh      |   7 ±
 src.dist/plugins/common/libriver/HDF5River.cpp     |   4 ±
 src.dist/plugins/common/libriver/HDF5River.hh      |   2 ±
 src.dist/plugins/common/libriver/Trick04River.cpp  |   2 ±
 src.dist/plugins/common/libriver/Trick04River.hh   |   2 ±
 …/plugins/common/libriver/TrickBinaryRiver.cpp   |   2 ±
 …/plugins/common/libriver/TrickBinaryRiver.hh    |   2 ±
 src.dist/plugins/common/libriver/TrickVSRiver.cpp  |   8 ±
 src.dist/plugins/common/libriver/TrickVSRiver.hh   |   5 ±
 src.dist/plugins/common/libstream/LiveStream.cpp   |   2 ±
 …/plugins/common/libstream/RiverFileStream.cpp   |   2 ±
 src.dist/plugins/common/libtvs/vsclientimpl.cpp    |   6 ±
 src.dist/plugins/common/libtvs/vsclientimpl.hh     |   2 +
 src.dist/plugins/common/libtvs/vscommunicator.hh   |  31 ++±-
 …/plugins/common/libtvs/vscommunicator07.cpp     |  18 +±
 src.dist/plugins/common/libtvs/vscommunicator07.hh |   1 +
 …/plugins/common/libtvs/vscommunicator10.cpp     |  30 ++±-
 src.dist/plugins/common/libtvs/vscommunicator10.hh |   1 +
 src.dist/plugins/playback/playback.cpp             | 148 +++++++++++++++++±--
 36 files changed, 272 insertions(+), 83 deletions(-)
⚠️ **GitHub.com Fallback** ⚠️