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.SetExpression - Define the expression of a dynamic object

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.SetExpression(“expression”);

Description

This function allows you to define the expression attached to a dynamic graphical Active View object.

Parameters

expression - A character string that define the expression, the job to do, at each polling interval. The Active scheduler execute the job define by the expression is when the timer ends.

You can use the user graphic interface to create the expression and import it into your script.

Remark

The syntax of the expression is not checked.

You should set the polling interval if you want to have an active object.

lpav.SetOption(LPAV_POLLING_INTERVAL, « 15 ») ;
lpav.SetOption(LPAV_POLLING, « 1») ;

You can use the lpav.SetOption for configuring this expression

lpav.SetOption(LPAV_EXPRESSION, « getipoid defip sysname») ;

Return Values

result = 1 or return nil if error

Example

lp_value = 0;
lp_buffer ="error";

dofile(lp.GetPath().."/config/script/loriotinit.lua");

zz=LPAV_OBJ_ANALOGIC_METER_01;

k=0;
for i=0,20 do
lpav.Insert(10*i,1,9,9,zz);
lpav.SetClipart( lp.GetPath().."/card/vumeters/vumeter8.emf");
lpav.SetOption(LPAV_UNIT,"%");
lpav.SetOption(LPAV_POLLING_INTERVAL, "15") ;
lpav.SetOption(LPAV_POLLING, "1") ;
lpav.SetOption(LPAV_EXPRESSION, "getipoid defip sysname") ;
lpav.GetInformation("a");
lp.Trace(a.expression, a.polling,a.polling_interval);
lpav.SetExpression("getipoid defip sysname");
lpav.GetInformation("a");
lp.Trace("set",a.expression, a.polling,a.polling_interval);

end
lp.Trace("fin");
lpav.RefreshMap();




www.loriotpro.com