Application Developer Guide > Building VDA Tools > Tool-to-Tool Communication Routines
  

Tool-to-Tool Communication Routines
VDA Tools can exchange data such as variables, graphical elements, and selection information. For variables, an export function is provided on the standard File menu. This export function lets you export a variable to one or more VDA Tools. For graphical elements, functions on the standard Edit menu and the Button Bar let you cut or copy graphical elements from one VDA Tool and paste them in another VDA Tool. Data that is selected on one VDA Tool is shown highlighted in all other active VDA Tools displaying the same variable.
The Selection List
The Tools Manger uses a selection list to exchange data between VDA Tools. First, data to be exported or copied is placed on a “selected list”. The TmAddSelectedVars and TmAddSelectedGrael routines accomplish this step. The TmDeselectVars and TmDelSelectedGraels command removes specified variables or graphical elements from the selected list.
The TmExportSelection or TmPaste command can be used to send the data or graphical element(s) currently on the selection list to another VDA Tool.
Exporting Variables from $MAIN$
VDA Tools rely on the TmExport function to export variables on the $MAIN$ program level to specified VDA Tool(s).
VDA Tools Can Accept or Reject Exported Variables
You can provide a function so that the user can select whether or not a VDA Tool will accept an exported variable. This function is available on the View Attributes window of graphical VDA Tools such as WzPlot.
The following calls to TmSetAttribute set whether or not VDA Tools will accept exported variables.
; Sets the IMPORT attribute to 1. This setting indicates that the
; VDA Tool will accept variables. 
old= TmSetAttribute(tool_name, 'TM', 'IMPORT', 1)
; Sets the IMPORT attribute to 0. This setting indicates that the
; VDA Tool will accept not variables.
old = TmSetAttribute(tool_name, 'TM', 'IMPORT', 0)
 
; Sets REPLACEVAR attribute to 1. This setting indicates the VDA
; Tool will replace the current variable instead of adding to its
; list of variables. 
old = TmSetAttribute(tool_name, 'TM', 'REPLACEVAR', 1)
The TM_DATA_IMPORT method must be defined for the given VDA Tool. The method procedure for TM_DATA_IMPORT must perform the appropriate import actions.
We recommend you use the TM_DATA_IMPORT method procedure to check the value of the IMPORT attribute, and display an appropriate alert if importing is disabled.

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.