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.SetGlobalOption - Set the global parameters of a view

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.SetGlobalOption(optionref,”value”);

Description

Change the Active View global parameters

Parameters

Optionref -The name of the option to set. The list of available options is defined in the loriotinit.lua file.

--lpav.SetGlobalOption

LPAV_G_DEFAULTIP =1;
LPAV_G_MAPNAME =2;
LPAV_G_FONTNAME =3;
LPAV_G_FONTSIZE =4;
LPAV_G_FONTITALIC =5;
LPAV_G_LINEWIDTH =6;
LPAV_G_LINESTYLE =7;
LPAV_G_MAX_X =8;
LPAV_G_MAX_Y =9;
LPAV_G_ZOOMAUTO =10;
LPAV_G_ZOOMINDEX =11;
LPAV_G_SCALEX=12 ;
LPAV_G_SCALEY=13 ;


value - The value of the option to set

Optionref Value
LPAV_G_DEFAULTIP

The dafault IP address of the ACtive View

LPAV_G_MAPNAME The name of the Active View
LPAV_G_FONTNAME

The default text font.

LPAV_G_FONTSIZE The default font size
LPAV_G_FONTITALIC

The font type, 0 normal, 1 italic

LPAV_G_LINEWIDTH The line object width
LPAV_G_LINESTYLE The line style
LPAV_G_MAX_X The maximum width of the Active View area
LPAV_G_MAX_Y The maximum high of the Active View area
LPAV_G_ZOOMAUTO

The zoom mode, 0 no zoom, 1 zoom

LPAV_G_ZOOMINDEX The zoom scale
LPAV_G_SCALEX The width scale
LPAV_G_SCALEY The high scale

Return Values

result = 1 if the array is filled or nil if error.

Example

lp_value = 0;
lp_buffer ="error";
dofile(lp.GetPath().."/config/script/loriotinit.lua");
--lpav.SetGlobalOption

lpav.SetGlobalOption(LPAV_G_DEFAULTIP,"127.0.0.1");
lpav.SetGlobalOption(LPAV_G_MAPNAME,"my map");
lpav.SetGlobalOption(LPAV_G_FONTNAME,"courrier");
lpav.SetGlobalOption(LPAV_G_FONTSIZE,"14");
lpav.SetGlobalOption(LPAV_G_FONTITALIC,"0"); -- 1 yes 0 no
lpav.SetGlobalOption(LPAV_G_LINEWIDTH,"3");
lpav.SetGlobalOption(LPAV_G_LINESTYLE,"14");
lpav.SetGlobalOption(LPAV_G_MAX_X,4000);
lpav.SetGlobalOption(LPAV_G_MAX_Y,4000);
lpav.SetGlobalOption(LPAV_G_ZOOMAUTO,1); -- 1 yes 0 no
lpav.SetGlobalOption(LPAV_G_ZOOMINDEX,6);

if lpav.GetGlobalOption("a") then -- place les réponses dans une array a
lp.Trace("defip>"..a.defip);
lp.Trace("mapname>"..a.mapname);
lp.Trace("fontname>"..a.fontname);
lp.Trace("fontsize>"..a.fontsize);
lp.Trace("fontitalic>"..a.fontitalic);
lp.Trace("linewidth>"..a.linewidth);
lp.Trace("linestyle>"..a.linestyle);
lp.Trace("maxx>"..a.maxx);
lp.Trace("maxy>"..a.maxy);
lp.Trace("ZoomAuto>"..a.ZoomAuto);
lp.Trace("ZoomIndex>"..a.ZoomIndex);

end

 


www.loriotpro.com