LUALoriotPro WEB site

LoriotPro scripting documentation
Extensions for LUA language

Table of contents Search function

Print the current page Mail this  link UTUBE Channel version française

lpav.SetRef - Attach a variable to a graphical objet

LoriotPro has extended the LUA sripting language by providing its own LUA libraries. The new functions provided are dedicated to the creation of monitoring and SNMP automation application.

Syntax

result = lpav.SetRef(number (1-4), string)

Description

Allow to set the reference reference variable of a graphical object.

A reference variable is a user defined reference that is assigned with the lpav.SetRef function. A graphical object has 4 reference variables. These reference variables are used to create groupe of graphical objects or for object manipulation.

Parameters

Number - The reference number either 1, 2, 3 or 4

string - The character string that your are looking for. The user defined reference.

Return Values

Result=1 egal ok sinon nil

Example

lp_value = 0;
lp_buffer ="error";

dofile(lp.GetPath().."/config/script/loriotinit.lua");
zz=LPAV_OBJ_FILL_CIRCLE;
-- Créé des objects s r
for i=0,20 do
lpav.Insert(10*i,30,9,9,zz);
if (k==0) then lpav.SetRef(1,"s"); k=1; else lpav.SetRef(1,"r"); k=0; end
lpav.SetBrush(0,255,0);
lpav.SetName("test-r"..i);
lpav.SetOption(LPAV_LINESTYLE,55);

end
i=lpav.FindRef(1,0,"r","a");
if (i>0) then
for j=0, i do
-- lp.Trace("pass"..j);
if lpav.SelectUID(a[j]) then
lpav.SetLineColor(255,45,89);
lpav.SetLineWidth(3);
end
end
end
lpav.RefreshMap();




www.loriotpro.com