A line like “:XXX;” is a header line (the XXX will be green in the GUI).
All other lines are parameter lines, each divided into fields by the “;” delimiter:
First field is a name and must begin with the “-“ character (for clift).
Second field is the parameter name to be passed to the Tool.
Third field is the parameter type (INT, FLOAT, STRING).
Fourth field is the parameter short description to appear in the GUI and in the Tool header.
Gift file cont’
Fourth field parameter
If the field ends with “#0” the field is read only – user can change it only if it has a drop-down menu.
If the field ends with “#5!” the field appears as a button. The five subsequent lines will correspond to a sub window that will pop up when clicking the button.
Fifth field is the parameter help line that appears in the GUI when the mouse points at the parameter.
Sixth field is optional. When it exists the field becomes a menu field.
The tokens in the field (separated by coma “,”) are the menu contents.
If the content of the field is “<2#>” the menu content will come from the configuration file.
Seventh field is also optional. The value(s) of each token replaces the corresponding item selected in the sixth field menu for transmission to the Tool.
Gift file Example.
# GIFT/CLIFT Configuration file for Example
# UF: Example
# -------------------------------------------
# This is a comment.
:This is the header;
-First; DBG_First_Param; int; First Parameter#0; Help line 1; One,Two; 1,2;
# Empty line
: ;
-Second; DBG_Second_Param; string; Second Parameter; Help line 2; One,Two,Three;
:This is another header;
-Third; DBG_Third_Param; int; Third Parameter; Help line 3;
-Options; DBG_Options; string; Options#2!; More options; Yes,No; 1,2;
:Options header;
-FirstOption; DBG_First_Options; int; First Option;
-SecondOption; DBG_Second_Options; int; Second Option;
#end of gift file
Execute Tool
In order to execute a tool the server translate a string tool name to the func pointer.
Get Tool Name form the .gift file
E.g. MyTool
Loading the tool from the disk to mem.
P = dlopen(“ MyTool ”);
Get ‘MyTool’ exec & Check functions
Pcheck = dlsym(p,” MyTool _Check”);
Prun = dlsym(p,” MyTool _Run”)
Note:
The name of Run/Check functions has to be the same as Tool MyTool file name.
0 comments
Post a comment