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.SelectFirst - The first object of the view is selected

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

lpav.SelectFirst();

Description

The first graphical object of the Active View becomes the default object (selected).

Parameters

none

Return Values

none

Example

lp_value = 0;
lp_buffer ="error";

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

lpav.Load(lp.GetPath().."/config/active-view/sample/cisco3500.cmp");
lpav.RefreshMap();

function displayobjectInformation (co)

if lpav.GetInformation("a") then
lp.Trace("name>"..a.name);
lp.Trace("Object Type ------------------------------>");
if a.objtype==LPAV_OBJ_WORLD then lp.Trace("directory world (emf)")
elseif a.objtype==LPAV_OBJ_COUNTRY then lp.Trace("directory country (emf)")
elseif a.objtype==LPAV_OBJ_ORGANIZATION then lp.Trace("directory organization (emf)")
elseif a.objtype==LPAV_OBJ_ORGANIZATION_UNIT then lp.Trace("directory organization unit (emf)")
elseif a.objtype==LPAV_OBJ_NETWORK then lp.Trace("directory network (emf)")
elseif a.objtype==LPAV_OBJ_HOST_1 then lp.Trace("directory host 1 (emf)")
elseif a.objtype==LPAV_OBJ_ROUTER then lp.Trace("directory router (emf)")
elseif a.objtype==LPAV_OBJ_SHORTCUT_1 then lp.Trace("directory shortcut 1(emf)")
elseif a.objtype==LPAV_OBJ_SHORTCUT_2 then lp.Trace("directory shortcut 2(emf)")
elseif a.objtype==LPAV_OBJ_MRTG then lp.Trace("directory mrtg (emf)")
elseif a.objtype==LPAV_OBJ_PLUGIN then lp.Trace("directory plugin (emf)")
elseif a.objtype==LPAV_OBJ_BADPLUGIN then lp.Trace("directory badplugin (emf)")
elseif a.objtype==LPAV_OBJ_LORIOTPRO then lp.Trace("directory Loriotpro (emf)")
elseif a.objtype==LPAV_OBJ_HOST_2_ROUTER then lp.Trace("directory host 2 router (emf)")
elseif a.objtype==LPAV_OBJ_HOST_3_SWITCH then lp.Trace("directory host 3 switch (emf)")
elseif a.objtype==LPAV_OBJ_HOST_4 then lp.Trace("directory host 4 (emf)")
elseif a.objtype==LPAV_OBJ_HOST_5 then lp.Trace("directory host 5 (emf)")
elseif a.objtype==LPAV_OBJ_HOST_6 then lp.Trace("directory host 6 (emf)")
elseif a.objtype==LPAV_OBJ_VIEWPLUGIN then lp.Trace("directory viewplugin (emf)")
elseif a.objtype==LPAV_OBJ_HOST_SERVER then lp.Trace("directory host server (emf)")
elseif a.objtype==LPAV_OBJ_HOST_IMPRIMANTE then lp.Trace("directory host imprimante (emf)")
elseif a.objtype==LPAV_OBJ_HOST_PHONE then lp.Trace("directory host phone (emf)")
elseif a.objtype==LPAV_OBJ_RECT then lp.Trace("rectangle")
elseif a.objtype==LPAV_OBJ_CIRCLE then lp.Trace("circle")
elseif a.objtype==LPAV_OBJ_FILL_RECT then lp.Trace("fillrectangle")
elseif a.objtype==LPAV_OBJ_FILL_CIRCLE then lp.Trace("fill circle")
elseif a.objtype==LPAV_OBJ_H_LINE then lp.Trace("h line")
elseif a.objtype==LPAV_OBJ_V_LINE then lp.Trace("v line")
elseif a.objtype==LPAV_OBJ_DIR_EMF then lp.Trace("directory object (emf)")
elseif a.objtype==LPAV_OBJ_TEXT then lp.Trace("texte")
elseif a.objtype==LPAV_OBJ_FILL_TEXT then lp.Trace("fill texte")
elseif a.objtype==LPAV_OBJ_FULL_RECT then lp.Trace("full rectangle")
elseif a.objtype==LPAV_OBJ_FULL_CIRCLE then lp.Trace("full circle")
elseif a.objtype==LPAV_OBJ_H45_LINE then lp.Trace("H line 45")
elseif a.objtype==LPAV_OBJ_V45_LINE then lp.Trace("V line 45")
elseif a.objtype==LPAV_OBJ_FULL_TEXT then lp.Trace("full texte")
elseif a.objtype==LPAV_OBJ_BASIC_SHAPE then lp.Trace("basic shape (emf)")
elseif a.objtype==LPAV_OBJ_ANALOGIC_METER_01 then lp.Trace("analogic meter (emf)")
elseif a.objtype==LPAV_OBJ_HOST_HUB then lp.Trace("host hub")
elseif a.objtype==LPAV_OBJ_CONNECTOR then lp.Trace("connector")
end
lp.Trace("fontname>"..a.fontname);
lp.Trace("x>"..a.x);
lp.Trace("y>"..a.y);
lp.Trace("x1>"..a.x1);
lp.Trace("y1>"..a.y1);
lp.Trace("polling_interval>"..a.polling_interval);
lp.Trace("lastpolling>"..a.lastpolling);
lp.Trace("lastpollingresp>"..a.lastpollingresp);
lp.Trace("polling>"..a.polling);
lp.Trace("result>"..a.result);
lp.Trace("clipartname>"..a.clipartname);
lp.Trace("linewidth>"..a.linewidth);
lp.Trace("objtype>"..a.objtype);
lp.Trace("maptype>"..a.maptype);
lp.Trace("ref1>"..a.ref1);
lp.Trace("ref2>"..a.ref2);
lp.Trace("ref3>"..a.ref3);
lp.Trace("ref4>"..a.ref4);
lp.Trace("UID>"..a.UID);
return 1;
end
return 0;
end

if lpav.SelectFirst() then
co=lpav.SelectFirst();
while co~=nil do
lp.Trace("<<<object>>>");
displayobjectInformation (co);
co=lpav.SelectNext();
end
end

lp.Trace("fin");

 


www.loriotpro.com