---
title: "Applets - EventsScheduler"
canonical: "https://docs.cuesystem.com/space/CVCGC/448921606/Applets%20-%20EventsScheduler"
format: markdown
---
> Macro (toc)

---

# Description

In Applet EventsScheduler, in Properties, you can choose one of 39 Picture features and Name. Name may be up to 15 characters long. In EventSchedulerUI in each particular TouchPanel, you can only use Events, which are filled in the Controller Applet EventsScheduler Properties. Respectively the Event becomes usable, if it has assigned Picture, Name or both. Maximum number of Events is 20, each Event has its eventnumber.

# Picture

|  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- |
| Picture | Name | Picture | Name | Picture | Name |
| ![image](media://549dc5d9-2b5c-48f5-a77d-c6be1ab313c9) | Animals | ![image](media://407c3712-1f2b-4963-8e2f-93de1b65df76) | Garden | ![image](media://65f1f645-0db8-4ef0-85f3-9b4584357594) | Sauna |
| ![image](media://a9dae6da-ee9a-4ed9-b33a-8050514837d1) | AudioVideo | ![image](media://e4de54c7-c498-49aa-903d-e2337166c143) | Gate Close | ![image](media://1d307018-aaf4-4ba7-a1cf-d668e6af4a74) | SecurityLock |
| ![image](media://08e504d9-82dd-44f9-ae77-8508eaadb8c8) | Blind Close | ![image](media://297f3989-12e0-4809-881d-a117fd719fe6) | Gate Open | ![image](media://e3665de1-e183-4378-afc4-6a98948dfa8c) | SecurityUnlock |
| ![image](media://510605d4-a2d7-4aac-9f48-2c4c72981991) | Blind Open | ![image](media://a74fc5e0-9fe7-4e96-b4a4-63fb74596100) | Heating1 | ![image](media://0e5d5a11-2a6a-4f26-a591-9d7eed77f04b) | Temperature |
| ![image](media://a1ff3d85-2f83-4286-af55-c2d39a0ac95e) | Boiler | ![image](media://bc4ec64b-ad49-44c7-8f6c-fbeb7440ec74) | Heating2 | ![image](media://080a582e-4f95-4ca5-bfa2-0ca2cd9c3dac) | TemperatureHigh |
| ![image](media://bffde5e6-8719-4ec8-8ab8-2dd1940c0703) | Camera | ![image](media://5afbf80b-039c-46e9-bab8-9a535538b941) | Henhouse | ![image](media://ee28eec4-5803-4da7-8445-54d1c18d31db) | TemperatureLow |
| ![image](media://7c0a1130-c94b-48a2-ac84-9e52a1564750) | Day | ![image](media://4b10b681-e2c3-449b-883a-c56193290b8f) | LightFluorescent | ![image](media://ac7944b5-148d-43e5-afe3-31c6dfe42377) | TemperatureMedium |
| ![image](media://292fec8d-5983-426e-b535-c53120838309) | Door Close | ![image](media://81cd2b41-4ad9-4ba3-ab65-a4af25bdb449) | LightIncandescent | ![image](media://ed5820a3-30d1-4083-af46-3d0130ffd3eb) | Ventilation off |
| ![image](media://c48b27aa-87dd-4cc8-b5bb-dff26cf789c4) | DoorOpen | ![image](media://d2711744-fd9c-4e08-abd8-c65538d97a5e) | LightLED | ![image](media://851388ca-afe4-43dd-9d3e-d64efb2a1458) | Ventilation on |
| ![image](media://a6aaf0c1-04a0-4216-b743-bdc098d8f56d) | Energy | ![image](media://e5288d11-9d02-4641-8925-8c4c7d56f878) | Night | ![image](media://84b78b28-821f-40a2-8611-72518145eb35) | Water off |
| ![image](media://3538219c-da45-45f9-895e-0bb4afd33412) | Fish | ![image](media://3fbb276b-f3bf-4e69-a8cc-02e071d5ab19) | Photovoltaic | ![image](media://1b1e6f6a-0611-4ac7-b254-859322ba2316) | Water on |
| ![image](media://56119b6b-3a26-47d8-b8c1-dcf1caabf92a) | Flame | ![image](media://a5492dfe-37b7-404e-8bbc-140e2f489401) | Pool | ![image](media://5e1c5bad-493e-4f2e-baef-d6e57e22d576) | Window close |
| ![image](media://d6029d72-0a6c-486b-ac42-5abca7be8edd) | Garage | ![image](media://e5a08cd5-e81d-44a7-934f-0e4133996049) | Projection | ![image](media://a61423be-2741-4183-939f-1ac1400b26bb) | Window open |

# Properties

|  |  |  |  |  |
| --- | --- | --- | --- | --- |
| Property Name | Data Type | Allowed Values | Default Value | Description |
| ObjectID | Long | 1 - 10 | 1 | All setting changed during runtime in the Applet object is stored in the EventSchedulers Applet file storage in file EventScheduler_xx.cfg, where xx is ObjectID of EventScheduler instance.<br>If you have more instances of EventScheduler Applet object in one controller, set different ObjectID for every instance. You can use up to 10 instances of object in one controller. |
| SchedulerName | As AddressOf  
Text | Any | Nothing | Scheduler may be named. SchedulerName may be up to 50 characters long. |
| Event1 |
| Picture | Long | ##### 1 = Animals         20 = LightFluorescent  
2 = AudioVideo  21 = LightIncandescent  
3 = Blind Close   22 = LightLED  
4 = Blind Open   23 = Night  
5 = Boiler            24 = Photovoltaic  
6 = Camera         25 = Pool  
7 = Day               26 = Projection   
8 = Door Close   27 = Sauna  
9 = Door Open   28 = Security Lock   
10 = Energy        29 = Security Unlock   
11 = Fish              30 = Temperature  
12 = Flame          31 = TemperatureHigh  
13 = Garage        32 = TemperatureLow  
14 = Garden        33 = TemperatureMedium   
15 = Gate Close   34 = Ventilation off  
16 = Gate Open   35 = Ventilation on   
17 = Heating1      36 = Water off  
18 = Heating2     37 = Water on  
19 = Henhouse    38 = Window close  
                             39 = Window open | Nothing | Event picture. |
| Name | As AddressOf  
Text | Any | Nothing | Name may be up to 15 characters long. |
| ...<br>Event20 |

# Functions

## GetEventName

This function returns AddressOf Text of the event eventnumber name in ByRef parameter eventname. This function return True on succes or false if an error occurs (event must be defined in the object properties).

#### Syntax

```visualbasic
Function GetEventName(
  eventnumber As Long, 
  ByRef eventname As AddressOf Text) 
As Boolean
```

> 📝 The following functions are used in the EventSchedulerInterface module and is not expected to use them anywhere else in the program.

## GetSchedulerPlansAndEvents

This Function returns the current plans of EventsScheduler and events of EventsScheduler. This function must be called, when the OnGetPlansAndEvents by graphic class EventSchedulerUI is generated.

#### Syntax

```visualbasic
Function GetSchedulerPlansAndEvents(
  plans As AddressOf SchedulerPlans, 
  events As AddressOf SchedulerEvent)
```

[Descriptions of structures](https://cue.atlassian.net/wiki/spaces/CVCGC/pages/448921606/Applets+-+EventsScheduler#Descriptions-of-structure) 

## IsActive

This function returns True if the Controller is active.

#### Syntax

```visualbasic
Function IsActive() As Boolean
```

## SetSchedulerPlan

This function saves your plans and generates an event OnPlanChange. This function must be called, when OnSchedulerChangePlan by graphic class EventSchedulerUI is generated.

#### Syntax

```visualbasic
Function SetSchedulerPlan(plans As SchedulerPlans)
```

 [Description of structre of SchedulerPlans](https://cue.atlassian.net/wiki/spaces/CVCGC/pages/448921606/Applets+-+EventsScheduler#Descriptions-of-structure) 

# Events

## OnEvent1 - 20 

This event is generated when the time of the Event comes.

#### Syntax

```visualbasic
Event OnEvent1 - 20 As Process()
```

> 📝 The following events are used in the EventSchedulerInterface module and is not expected to use them anywhere else in the program.

## OnHeartbeat 

This event is generated each second when the Applet EventsScheduler is active. In this process, call function of graphic classes EventSchedulerUI Heartbeat().

#### Syntax

```visualbasic
Event OnHeartbeat As Process()
```

## OnPlanChange 

This event is generated when there is a change of plan. In this process, call function of graphic classes EventSchedulerUI SetPlan(newplan).

#### Syntax

```visualbasic
Event OnPlanChange As Process(newplan As SchedulerPlans)
```

# Descriptions of structure

```visualbasic
Public Structure SchedulerPlans
  Var WeekPlan [7] As Long 
  Var Plans[MAXPLANS] As ShedulerPlan
End Structure
```

```visualbasic
Public Structure ShedulerPlan
  Var NamePlan As Text [15]
  Var TimeSplitter[COUNTOFSPLITTERS] As _TimeStructure
  Var LeftBorder[COUNTOFSPLITTERS] As Boolean
  Var RightBorder[COUNTOFSPLITTERS] As Boolean
  Var Eventindex[COUNTOFSPLITTERS] As Long
  Var IsUsed As Boolean
  Var PositionJ As Long
  Var ActualPlanPosition As Long  
End Structure
```

```visualbasic
Public Structure SchedulerEvent
  Var EventPicture[COUNTOFEVENT] As AddressOf _Picture
  Var EventPictureIndex[COUNTOFEVENT] As Long
  Var EventText[COUNTOFEVENT] As Text [15]
  Var MaxEventNum As Long 
  Var EventIndex[COUNTOFEVENT] As Long
  Var SchedulerName As AddressOf Text
End Structure
```