README 2.32 KB
Newer Older
Maxime Perrotin's avatar
Maxime Perrotin committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
At startup, TASTE parse the externalTools directory and add to the Tool menu
the .tcl script providing external tool corresponding to the current interface.

It is mandatory that a script called myScript.tcl:
- provides the package myScript
- defines its methodsin the namespace myScrypt
- provides the following methods:
      * getLabel {} 
      * getApplication {} 
      * getApplyTo {} 
      * getOutputManagement {}
      * myScript { args }

The getLabel function shall return a string defining the graphical name of the external 
tool that will be displayed in the TASTE editor.

The getApplication function shall return a string defining the kind of TASTE editor this
tool can be used (eiter InterfaceView of DeploymentView)

The getApplyTo function shall return a list defining the kind of TASTE element this
tool can be used on
The list is of the form { { "objecttype" { "atribute1" "value1" }* }* }
If the list is [list "alwayson"   ] then the external tool will be active all the time.
Arnaud Schach's avatar
Arnaud Schach committed
24
If the list is [list "allContext"   ] then the external tool will be active all the time in all context.
Maxime Perrotin's avatar
Maxime Perrotin committed
25 26

The getOutputManagement function shall return a list defining the way output result of
27 28 29 30 31 32
external tool is to be managed:
- print result in status bar ( statusBar in the list)
- print result in dialog box ( dialogBox in the list)
- print result in stdout ( stdout in the list)
- print error in dialog box ( dialogBoxOnError in the list )
- print error in stdout ( stdoutError in the list )
Maxime Perrotin's avatar
Maxime Perrotin committed
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

The myScript function is called by the Editor when clicking on the menu.
args is a list of parameters which can be retrieve using the followin command:
   Parameter::getParameter $args "paramName"
ParamName can be one of the following:
    * aadlFilePath (path to the aadl file)
    * package (package containing the element instance)
    * componentType (name of the aadl type in the package containing the element instance)
    * componentImpl (name of the aadl implementation in the package containing the element instance)
    * id (name of the element element instance)
The return of myScript function shall be:
    * either "" if the external tool is called asynchronously
    * or a list of the form {errorNumber, message}  if the external tool is called synchronously


 

template.tcl_ and template2.tcl_ are examples of Tcl scripts used to add an external tool to TASTE.