mvm_gui_send_tupleT_mvm_gui_send_tupleMvmGuiSendTupleMvmGuiSendTuple (Operator)

Name

mvm_gui_send_tupleT_mvm_gui_send_tupleMvmGuiSendTupleMvmGuiSendTuple — Send a tuple to a webclient.

Signature

mvm_gui_send_tuple( : : ServerHandle, ConnectionHandle, Id, Tuple : )

Herror T_mvm_gui_send_tuple(const Htuple ServerHandle, const Htuple ConnectionHandle, const Htuple Id, const Htuple Tuple)

void MvmGuiSendTuple(const HTuple& ServerHandle, const HTuple& ConnectionHandle, const HTuple& Id, const HTuple& Tuple)

static void HHdevguiServerExtpack.MvmGuiSendTuple(HTuple serverHandle, HTuple connectionHandle, HTuple id, HTuple tuple)

Description

Sends a tuple in TupleTupleTupleTupletuple via a server specified by ServerHandleServerHandleServerHandleServerHandleserverHandle to a connected webclient specified by ConnectionHandleConnectionHandleConnectionHandleConnectionHandleconnectionHandle.

Multiple connections can be specified as tuple. A ConnectionHandleConnectionHandleConnectionHandleConnectionHandleconnectionHandle with the value 'all'"all""all""all""all" means that the message is sent to all connected clients and is the default. A value of 'first'"first""first""first""first" addresses only the first connection. Additionally, an optional custom error handling can be specified in ConnectionHandleConnectionHandleConnectionHandleConnectionHandleconnectionHandle. For further explanations on connection handles and custom error handling, see the MachineVisionMakers / HDevGUI chapter documentation for this extension package.

The message ID by which the message will be received on client side has to be given in IdIdIdIdid. The ID must be a valid C identifier which consists of letters, digits, and underscores and must start with a letter or underscore.

It is up to the UI element on how the value in TupleTupleTupleTupletuple is handled:

<div>, <span>, <h1>, <h2>, <h3>, <h4>, <h5>, <h6>, <h7>, <h8>, <h9>, <p data-bind="my_id">:

String values are set as the plain literal text.

<input type="text" data-bind="my_id">:

String values are set as plain literal value for the attribute "value".

<select data-bind="my_id"><option value="my_tuple"></option></select>:

String values which match the "value" attribute of an "option" element are selected.

<input type="checkbox" data-bind="my_id">:

The values 'true'"true""true""true""true", 'true'"true""true""true""true", 1, and all other positive integers are interpreted as checked. The values 'false'"false""false""false""false", 'false'"false""false""false""false", 0 are interpreted as unchecked.

<input type="radio" data-bind="my_id">:

String values which match the "value" attribute of a radio button are interpreted as checked.

<input type="range" data-bind="my_id">:

The corresponding value is set as value for the "value" attribute.

<ul class="listview" data-bind="my_id">:

The corresponding array of strings is used to add the same amount of li elements containing the corresponding plain literal text.

<div class="status-indicator" data-bind="my_id">:

The corresponding string value is set as background color (CSS style "background-color") for the status indicator circle. Example values: 'red'"red""red""red""red", '#007F00'"#007F00""#007F00""#007F00""#007F00".

If the option ackTimeoutMillis is set to a positive value (default), the operator mvm_gui_send_tuplemvm_gui_send_tupleMvmGuiSendTupleMvmGuiSendTupleMvmGuiSendTuple waits for an acknowledge package from the client. If there is no acknowledge package within the given timeout the operator mvm_gui_send_tuplemvm_gui_send_tupleMvmGuiSendTupleMvmGuiSendTupleMvmGuiSendTuple returns with error code HDGERR_SERVER_ACK_TIMEOUT. If the ID was not handled by the client scripting code, the error code HDGERR_SERVER_ACK_NOT_HANDLED will be returned.

Execution Information

Parameters

ServerHandleServerHandleServerHandleServerHandleserverHandle (input_control)  serial HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

GUI server handle

ConnectionHandleConnectionHandleConnectionHandleConnectionHandleconnectionHandle (input_control)  socket(-array) HTupleHTupleHtuple (handle / string) (IntPtr / IntPtr) (HHandle / HString) (handle / char*)

The destination connection handle

Default value: 'all' "all" "all" "all" "all"

List of values: 'ack_error_ignore'"ack_error_ignore""ack_error_ignore""ack_error_ignore""ack_error_ignore", 'ack_error_lowlevel'"ack_error_lowlevel""ack_error_lowlevel""ack_error_lowlevel""ack_error_lowlevel", 'ack_error_raise'"ack_error_raise""ack_error_raise""ack_error_raise""ack_error_raise", 'all'"all""all""all""all", 'connection_error_ignore'"connection_error_ignore""connection_error_ignore""connection_error_ignore""connection_error_ignore", 'connection_error_lowlevel'"connection_error_lowlevel""connection_error_lowlevel""connection_error_lowlevel""connection_error_lowlevel", 'connection_error_raise'"connection_error_raise""connection_error_raise""connection_error_raise""connection_error_raise", 'first'"first""first""first""first"

IdIdIdIdid (input_control)  proc_name HTupleHTupleHtuple (string) (string) (HString) (char*)

message ID

TupleTupleTupleTupletuple (input_control)  integer(-array) HTupleHTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)

The tuple to be sent

Example (HDevelop)

mvm_gui_send_tuple (ServerHandle, 'all', 'result1', NumRegions)
mvm_gui_send_tuple (ServerHandle, 'all', 'checkbox1', true)
mvm_gui_send_tuple (ServerHandle, 'all', 'alert', 'could not open File device.')

See also

mvm_gui_send_imagemvm_gui_send_imageMvmGuiSendImageMvmGuiSendImageMvmGuiSendImage, mvm_gui_set_htmlmvm_gui_set_htmlMvmGuiSetHtmlMvmGuiSetHtmlMvmGuiSetHtml

Module

Foundation