Skip to content

zonemanaged Lua Interface


get

Get a pointer to the ZoneManaged object

Arguments:
any ptr Pointer to Module object
Returns:
zonemanaged ptr Pointer to casted ZoneManaged object

Example

ptr = zonemanaged:.get(ptr)


get

Get a pointer to the ZoneManaged object

Arguments:
any ptr Pointer to Module object
Returns:
zonemanaged ptr Pointer to casted ZoneManaged object

Example

ptr = zonemanaged:.get(ptr)


getConfig

Get the configuration object for the plugin

Arguments:

Returns:
table obj Map with configurations

Example

obj = zonemanaged:.getConfig()


processZones

Check what targets are entering/exiting zones

Arguments:
CheckTarget[] targets List of targets to check

Example

zonemanaged:.processZones(targets)


processZones

Check what targets are entering/exiting selected zones

Arguments:
CheckTarget[] targets List of targets to check
string[] zonesFilter List of zones to process

Example

zonemanaged:.processZones(targets,zonesFilter)


processZones

Check what targets are entering/exiting zones

Arguments:
CheckTarget[] targets List of targets to check
table options Options to use (not implemented yet)

Example

zonemanaged:.processZones(targets,options)


processZones

Check what targets are entering/exiting selected zones

Arguments:
CheckTarget[] targets List of targets to check
string[] zonesFilter List of zones to process
table options Options to use (not implemented yet)

Example

zonemanaged:.processZones(targets,zonesFilter,options)


processZones

Check what targets are entering/exiting selected zones

Arguments:
CheckTarget[] targets List of targets to check
string groupFilter Group of zones to process

Example

zonemanaged:.processZones(targets,groupFilter)


processZones

Check what targets are entering/exiting selected zones

Arguments:
CheckTarget[] targets List of targets to check
string groupFilter Group of zones to process
table options Options to use (not implemented yet)

Example

zonemanaged:.processZones(targets,groupFilter,options)


getZoneEvents

Get enters and exits for all zones

Arguments:

Returns:
table Vector of vectors in the format { { targetId, zoneId, <0: enter, 1: exit> } }

Example

Vector = zonemanaged:.getZoneEvents()


getName

Get the plugin name

Arguments:

Returns:
string name Plugin Name

Example

name = zonemanaged:.getName()


createZone

Create a new zone

Arguments:
any ptr Pointer to ZoneManaged object
string name Zone name
string type Zone type
table shape Table with array of points that make the Zone shape
number[] color Color values (Array with 1 (grayscale) or 3 (RGB) or 4 (RGBA) values in range 0-1)
Returns:
number id ID for the new zone

Example

id = zonemanaged:.createZone(ptr,name,type,shape,color)


registerKnownZones

Register zones that are known in the config dict which are not created via zone interface

Arguments:

Example

zonemanaged:.registerKnownZones()


getZoneIds

Get a list of current Zone id's

Arguments:
any ptr Pointer to ZoneManaged object
Returns:
table ids table with zone id's

Example

ids = zonemanaged:.getZoneIds(ptr)


getZoneById

Get a Zone with a specific id

Arguments:
any ptr Pointer to ZoneManaged object
string zoneid **
Returns:
table zone Object representing zone

Example

zone = zonemanaged:.getZoneById(ptr,zoneid)


getZones

Get a list of current Zones

Arguments:
any ptr Pointer to ZoneManaged object
integer format 0: state data, 1: configuration data, 2: both merged
Returns:
table zones table

Example

zones = zonemanaged:.getZones(ptr,format)


deleteZoneById

Delete a Zone with a specific id

Arguments:
any ptr Pointer to ZoneManaged object
string zoneid **

Example

zonemanaged:.deleteZoneById(ptr,zoneid)


getZoneValue

Fetch the values correspond to a zone

Arguments:
any ptr Pointer to ZoneManaged object
string zoneid Id of the zone to get values from
string key Key to get value from
integer dictType 0: state data, 1: configuration data, 2: both merged
Returns:
any value Value corresponding to the key

Example

value = zonemanaged:.getZoneValue(ptr,zoneid,key,dictType)


getZoneValue

Fetch the values correspond to a zone

Arguments:
any ptr Pointer to ZoneManaged object
string zoneid Id of the zone to get values from
string[] keys Keys to get value from
integer dictType 0: state data, 1: configuration data, 2: both merged
Returns:
any value Value corresponding to the key

Example

value = zonemanaged:.getZoneValue(ptr,zoneid,keys,dictType)


setZoneValue

Save the values correspond to a zone

Arguments:
any ptr Pointer to ZoneManaged object
string zoneid Id of the zone to set values to
string key Key to set value to
any value Value to set
integer dictType 0: state data, 1: configuration data, 2: both merged

Example

zonemanaged:.setZoneValue(ptr,zoneid,key,value,dictType)


setZoneValue

Save the values correspond to a zone

Arguments:
any ptr Pointer to ZoneManaged object
string zoneid Id of the zone to set values to
table valueMap Map of values to set
integer dictType 0: state data, 1: configuration data, 2: both merged

Example

zonemanaged:.setZoneValue(ptr,zoneid,valueMap,dictType)


isPointInZone

Check if a Point is inside any zone

Arguments:
any ptr Pointer to ZoneManaged object
number[] pt Point to check (Array with 2 values)
Returns:
string[] ids vector of zone ids that match the condition

Example

ids = zonemanaged:.isPointInZone(ptr,pt)


resetZones

Clears state of all zones

Arguments:

Example

zonemanaged:.resetZones()


deleteZones

Deletes all zones

Arguments:

Example

zonemanaged:.deleteZones()