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

lp.GenerateModalJPG

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

value =lp.GenerateModalJPG('array')

Description

Generate an image file (JPEG format) from an Active View template.

Parameters

array : A LUA table with the following parameter :

array.JPGFile : The path and name of the file where to save the image

array.CMPFile : The path and name of the ACtive View template file (a .cmp file)

array.Width : The width of the image to generate

array.Height : The height of the image to generate

array/timeout : the maximum time to wait for the iamge generation

array.IP : the default IP address to use when generating the Active View template

 

Return Values

value : 1 if succeeded

Return nil if an error occurs

Example

cmp={};
lpav.GetInformation('aa');
lpav.GetGlobalOption('aaa');
cmp.JPGFile=string.format(lp.GetPath().."/www/tmp/__g05_%s_%s.jpg",aaa.mapname,aa.UID);
cmp.CMPFile=lp.GetPath().."/config/active-view/tlp/serveur_01.cmp"
cmp.Width=1024;
cmp.Height=1024;
cmp.timeout=10000; --ms
cmp.IP="127.0.0.1"
lp.Print("go to modal Screen\n");
rst=lp.GenerateModalJPG(cmp);
lp.Print("return ",rst," from modal Screen\n");
if rst then
lp.Print("Make the chart ");
if lpav.LoadImg(cmp.JPGFile) then
lp.Print("Load the modal ");
lp_value = rst;
lp_buffer=rst
return
end
end


www.loriotpro.com