Sie sind auf Seite 1von 70

Release 7

Programming Guide
SecurOS Programming Guide (PG-En, build 5 on 17th October 2012).
c Copyright Intelligent Security Systems, 2012

Printed in US.
Intelligent Security Systems reserves the right to make changes to both this Manual and to the products it describes. System
specifications are subject to change without notice. Nothing contained within this Manual is intended as any offer, warranty,
promise or contractual condition, and must not be taken as such.
No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval system or translated into any
human or computer language in any form by any means without the express written permission of the copyright holder.
Unauthorized copying of this publication may not only infringe copyright but also reduce the ability of Intelligent Security
Systems to provide accurate and up-to-date information to both users and operators.
SecurOS 3 Programming Guide

Contents

Contents
Contents 3

Introduction 6
Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Target Audience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Using This Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Getting Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
SecurOS Editions Naming Convention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Design Convention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Design Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

1 Scripting 9
1.1 Language Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.1.1 Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.1.2 Variables and Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.1.2.1 Predefined Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.1.2.2 Local and Global Variables . . . . . . . . . . . . . . . . . . . . . . . . 10
1.1.3 Operators and Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.1.4 Mathematical Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.1.5 String Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.1.6 Miscellaneous Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
1.1.7 Object Handling Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.1.8 CellBox Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.1.9 Events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.1.9.1 Typical Program Structure . . . . . . . . . . . . . . . . . . . . . . . . 21
1.1.10 Debugging Your Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

2 Objects Reference 24
2.1 Core Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.1.1 Security Zone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.1.2 Department . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.1.3 User account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.1.4 User Rights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.1.5 Active Directory Storage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

www.isscctv.com
SecurOS 4 Programming Guide

Contents

2.1.6 Computer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.1.7 Protocol filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.1.8 Access Level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.1.9 Area Zone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.1.10 Region . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.1.11 Identity Cards Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.2 Interface Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.2.1 Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.2.2 Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.2.3 Map v2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.2.4 Event Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.2.5 External Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
2.2.6 HTML Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.2.7 HTML Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.3 Video Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.3.1 Video Capture Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
2.3.2 Camera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.3.3 Zone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.3.4 Light Detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.3.5 Zone Object Detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.3.6 PTZ Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.3.7 PTZ Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
2.3.8 Archive Converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
2.3.9 Archive Converter Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.3.10 Archiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
2.3.11 Archiver Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.3.12 Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
2.4 Audio Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.4.1 Audio Capture Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.4.2 Microphone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2.4.3 Audio Player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
2.4.4 Intercom . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.5 I/O Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.5.1 Sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
2.5.2 Relay . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.6 Notification Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.6.1 E-mail Message Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

www.isscctv.com
SecurOS 5 Programming Guide

Contents

2.6.2 E-mail Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51


2.6.3 Short Message Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.6.4 Short Message . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
2.6.5 Audible Notification Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.7 Automation Subsystem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.7.1 Time Zone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.7.2 Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.7.3 Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
2.7.4 CellBox . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
2.7.5 IIDK Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

3 HTML Forms 55
3.1 Setting up HTML Forms within SecurOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.2 _system.js File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
3.3 window.external.dispSOCoreProvider Object . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.4 IMsgFilter Object Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3.5 ICoreMsg Object Type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
3.6 Sample HTML Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

Appendix A: Script Samples 61


A.1 Start Recording from Active Camera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
A.2 Start/Stop Switching Cameras on Analog Display . . . . . . . . . . . . . . . . . . . . . . . . 61
A.3 Turn on an Execution Unit upon Motion Detection . . . . . . . . . . . . . . . . . . . . . . . . 62
A.4 Play a Sound File upon Event . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
A.5 Show/Hide Telemetry Window upon Activating Screen . . . . . . . . . . . . . . . . . . . . . 62
A.6 Allow Recording Video by Both Motion Detection and Acoustic Level Monitoring . . . . . . . . . 63
A.7 Play Sound by Microphone Assigned to Active Camera . . . . . . . . . . . . . . . . . . . . . 64
A.8 Play Audio Continuously until Manually Interrupted . . . . . . . . . . . . . . . . . . . . . . . 64

Index 65

www.isscctv.com
SecurOS 6 Programming Guide

Introduction

Introduction
Scope
Current manual provides general information about programming SecurOS security system, describes
the process of writing scripts, objects events and commands, gives some troubleshooting tips and
recommendations.
It is assumed that the user have already deployed the security network physically and installed SecurOS
software on all computers of this network.

Target Audience
We have designed this guide particularly for SecurOS programmers. It is assumed the user has
advanced computer skills including skills on Microsoft
R Windows
R Operating System, has prac-
tical experience with TCP/IP networking, serial (COM) ports and general CCTV knowledge and
overview.

Using This Manual


This document is organized as a book, so the user can print it or use the electronic version. In the
latter case one can use the Adobe Reader’s Bookmarks feature as well as cross-reference hyperlinks
to navigate through content. In several topics this manual refers to other SecurOS manuals (SecurOS
Administration Guide, etc.). One can find these manuals as separate files on SecurOS installation CD
or download them from our web site (www.isscctv.com).

Getting Technical Support


If you have any questions this manual does not give answers to, we recommend you to contact your
system installer, who knows your system configuration in depth and can solve the problem.

www.isscctv.com
SecurOS 7 Programming Guide

Introduction

For any further information you can contact our Technical Support Team:

• phone in USA:

+1 732 855 1111 (Monday to Friday, 9am – 6pm EST)

• phone in Brazil:

+55 11 2262 2894 (Monday to Friday, 9am – 6pm BRST)

• phone in Chile:

+56 2 897 7320 (Monday to Friday, 9am – 6pm CLST)

• phone in Russia:

+7 (495) 645 21 21 (Monday to Thursday, 9am – 6pm MST; Friday, 9am – 5pm MST)

• e-mail:

in USA, in Brazil, in Chile: support@isscctv.com


in Russia: support@iss.ru

Note: To solve problems faster, we recommend preparing service information described in SecurOS
Administration Guide

SecurOS Editions Naming Convention


This document represents a common manual for several editions of the “SecurOS security system”
that differs on functional capabilities:

• SecurOS Enterprise

• SecurOS Professional

• SecurOS Xpress

• SecurOS Lite

For the product designation regardless of its edition the SecurOS united term is used in the framework
of the given document.
Sections that describe the functionality available for some editions are marked by the special footnote
which example is presented below:

The functionality is available in the following editions: SecurOS Professional, SecurOS Xpress, SecurOS
Lite.

www.isscctv.com
SecurOS 8 Programming Guide

Introduction

Design Convention
For various terms and titles representation the following fonts and formatting tools are used in this
document.

Font Description
bold type Used on writing the workstation names, utilities or screens, windows and
dialog boxes as well as the names of their elements (GUI elements)
italic type Used to mark out the SecurOS objects SecurOS and tasks performed in
one step
bold italic type Used to mark out the elements of homogeneous lists
monospace Used to mark out macros text and programming code, file names and
paths to them. Also it is used to specify the necessary options, to mark
out values specified by the user from the keyboard (manually)
blue Used to mark out the cross-references within the document and links to
the external available ones, to mark out the addresses of web-pages

Design Elements

Warning! Serves to attract the user attention to information which is necessary for the correct
perception of the text set out below. Typically, this information has a warning character.

Note: Indicates the features of the description. The element may be preceded by an entire chapter,
section, sections or immediately follow the element to which it refers.

Additional information.
Used to display a complementary information. The element contains, for example, the description
of embodiments of the operation or reference to additional literature.

www.isscctv.com
SecurOS 9 Programming Guide

Scripting

1. Scripting
SecurOS has a flexible built-in scripting language that allows you to program custom security logic.
Language has ECMAScript (JavaScript) syntax. This chapter gives reference to language operators,
expressions, internal functions, then SecurOS-specific functions and script examples.

Listing 1: Sample script: When ray 1 is alarmed, relay 1 will be shortened for 5 seconds with
a 3 seconds interval for the duration of the alarm but not more than 10 times
OnEvent("RAY","1","ALARM") {[
for ( i = 0; i < 10 && CheckState("RAY","1","ALARM"); i = str(i + 1)) {
DoReact("RELE","1","ON");
Wait(5);
DoReact("RELE","1","OFF");
Wait(3);
}
]}

1.1 Language Reference

1.1.1 Syntax
Language syntax conforms the ECMAScript standards, but has additional feature of specifying the
execution thread. If you enclose some block in square brackets, this block will be executed in its own
thread. Use this feature when sending commands considered “slow”, to avoid main freezing of the
main execution thread (see 1.1.3 Operators and Expressions on page 10).

1.1.2 Variables and Constants


Variable and function names are case-sensitive. All variables and constants are treated as strings.
When you assign a numeric value to a variable, it is converted to the string automatically. However,
you should not pass a numeric value to a function if it expects a string; surround it with double quotes
to send it as a string.

www.isscctv.com
SecurOS 10 Programming Guide

Scripting

Listing 2: Understanding variables and constants


x = 5; // OK, converted to string (x now equals to ‘5’)

x = "5"; // OK, same as above

y = 2;

y = y + 1; // y now equals ‘21’, because we actually concatenated ‘2’ and ‘1’

y = 2;

y = str(y + 1); // y now equals ‘3’, because we used numeric values here

o = SomeStringExpectingFuction(1); // bad: function expects string parameter

o = SomeStringExpectingFuction("1"); // OK

n = 1;

o = SomeStringExpectingFuction(n); // OK, because n is already a string

1.1.2.1 Predefined Variables


There are two predefined system variables:

• Date — current system date string in DD-MM-YY format

• Time — current system time string in HH-MM-SS format

1.1.2.2 Local and Global Variables


All variables defined in script are computer-wide by default (i. e. accessible within any script on this
computer). You can also define and read global (system-wide) variables, which will be accessible from
any computer within SecurOS network.
Global variables are set with GlobalVarSet(Name,Value) function and retrieved with
GlobalVarGet(Name) function (see 1.1.8 CellBox Functions on page 19).

1.1.3 Operators and Expressions

Table 1: Script Language Operators


Operator Description Example

= Assignment operator m = 3;

+ Addition arithmetic operator m = i + 3;

- Subtraction arithmetic operator m = i - 3;

* Multiplication arithmetic operator m = i * 3;

/ Division arithmetic operator m = i / 3;

(continued on next page)

www.isscctv.com
SecurOS 11 Programming Guide

Scripting

(continued from previous page)

Operator Description Example

% MOD arithmetic operator m = i % 3;

(...) Group arithmetic operator m = (i - 1) % 3;

== Comparison operator “equal” a == b

!= Comparison operator “not equal” a != b

> Comparison operator “greater than” a > b

< Comparison operator “less than” a < b

&& Logical AND operator i < 10 && m < 3

! Logical NOT operator !n

var1 = expression1 ? If expression1 is true, assign var1


s = (n > 10) ?
expression2 : the value of expression2, else assign
"many" : "few";
expression3; var1 the value of expression3

Conditional operator. The


if (expression) {...} if (!y) {m = 2;}
else {...} operator may be
else {...} else {m = 3;}
omitted.
Recurring operator. Before the start
of the recurrence, expression1 is ex-
ecuted. The cycle is executed until
expression2 does not equal 0 or an-
for (i = 2; i < m;
for (expression1; other variable. At the end of each
i = str(i + 1) )
expression2; recurrence expression3 is executed.
{m = 7; s = str(i + 5);}
expression3) {...} If increment (i = i + 1) is used as
expression3, then one should use
conversion i = str(i + 1) of the
expression3 right part for correct
cycle execution
Select execution thread. Any code [for (i = 1; 100;
[...] that are between the brackets is com- i = str(i + 1) )
pleted within the separate thread. {m = y + i;}]

www.isscctv.com
SecurOS 12 Programming Guide

Scripting

1.1.4 Mathematical Functions

Table 2: Mathematical functions


Function Arguments Return value Description

sin(x) x — float number, in radians Float number [–1. . . +1] Calculates sine

cos(x) x — float number, in radians Float number [–1. . . +1] Calculates cosine

tan(x) x — float number, in radians Float number Calculates tangent

asin(x) x — float number [–1. . . +1] Float number, in radians Calculates arc sine

acos(x) x — float number [–1. . . +1] Float number, in radians Calculates arc cosine

atan(x) x — float number Float number, in radians Calculates arc tangent


Calculates hyperbolic
sinh(x) x — float number Float number
sine
Calculates hyperbolic
cosh(x) x — float number Float number
cosine
Calculates hyperbolic
tanh(x) x — float number Float number
tangent

exp(x) x — float number Float number Calculates exponent


Calculates natural loga-
log(x) x — float number Float number
rithm
Calculates common log-
log10(x) x — float number Float number
arithm

sqrt(x) x — float number Float number Calculates square root


Round to the lower inte-
floor(x) x — float number Integer number
ger number
Round to the higher in-
ceil(x) x — float number Integer number
teger number

abs(x) x — float number Float number Returns absolute value


Float number, in de- Converts radians to de-
deg(x) x — float number, in radians
grees grees
Converts degrees to ra-
rad(x) x — float number, in degrees Float number, in radians
dians
Round to the integer
int(x) x — float number Integer number
value
x — float number Determines the larger
max(x,y) Float number
y — float number number
x — float number Determines the smaller
min(x,y) Float number
y — float number number

www.isscctv.com
SecurOS 13 Programming Guide

Scripting

1.1.5 String Functions

Table 3: String functions


Return
Function Arguments Description Supplement
value
x — float num- Converts number If x = 0, returns
str0(x) String
ber into string empty string.
Works like the
x — float num- Converts number str0(x) function,
str(x) String
ber into string but if x = 0 re-
turns 0 as a string.
Float num- Converts string into
atof(x) x — string
ber number
Float num- Converts string into
val(x) x — string
ber number
d1 — date in
DD-MM-
YYYY format
d2 — format Formats date with
date_frm(d1,d2) String
that used in the defined format
GetDateFormat
WinAPI func-
tion
x — string with Converts GTD into
gtd2date(x) String
“/” symbol date
Converts scalar date
String in
format (number of
x — integer DD-MM-
scalar2date(x) days since epoch)
number YYYY
into string represen-
format
tation
Converts string date
If x is empty
x — string representation into
Integer string then the
scalar(x) in DD-MM- scalar format (num-
number system date is
YYYY format ber of days since
used.
epoch)
If the second quan-
Converts number of
String in tity is more than
x — integer seconds since begin-
long2time(x) HH:MM:SS a day contains, the
number ning of the day into
format empty string is re-
string representation
turned.
(continued on next page)

www.isscctv.com
SecurOS 14 Programming Guide

Scripting

(continued from previous page)

Return
Function Arguments Description Supplement
value
Converts string rep-
x — string in resentation of the
Integer
long2long(x) HH:MM:SS time to number of
number
format seconds since begin-
ning of the day
cmd — shell Executes the speci-
ExecuteCmd(cmd)
command fied shell command
Compares two Use the DD-
1, if s1 > s2
s1 — string strings containing MM-YYYY
timcmp(s1,s2) 0, if s1 = s2
s2 — string date and time (or HH:MM:SS for-
-1, if s1 < s2
just date / just time) mat
>0, if
s1 > s2
s1 — string Compares two
strcmp(s1,s2) 0, if s1 = s2
s2 — string strings char-by-char
<0, if
s1 < s2
s1 — string Returns s1 with
strreplace
s2 — string String all s2 occurrences
(s1,s2,s3)
s3 — string changed to s3
1, if strings
s1 — string
strequal(s1,s2) are equal; Compares strings
s2 — string
0, otherwise

Counts symbol num-


ber from the start of
s1 — string
strsub(s1,s2) Integer s1 to the first entry
s2 — string
of s2; then plus 1 to
the number
1, if empty
string or
Determines empty
strempty(s) s — string contains
string
only spaces;
0, otherwise

s — string Adds spaces to s1 to


straleft(s,x) x — integer String make its length equal
number to x
Does the same as the
s — string straleft(s1,x)
straright(s,x) x — integer String function, but adds
number spaces at the left of
the string
(continued on next page)

www.isscctv.com
SecurOS 15 Programming Guide

Scripting

(continued from previous page)

Return
Function Arguments Description Supplement
value
Integer Calculates string
strlen(s) s — string
number length
s — string
Returns substring
x — integer String symbols
starting from x
strmid(s,x,y) number String numeration starts
position and ending
y — integer with 0.
with y position
number
s — string Returns x symbols
strleft(s,x) x — integer String from the beginning
number of the string
s — string Returns x symbols
strright(s,x) x — integer String from the end of the
number string
Returns s1 exclud-
s — string x —
strnleft(s,x) String ing x symbols from
integer number
the beginning
s — string Returns s1 exclud-
strnright(s,x) x — integer String ing x symbols from
number the end
If s3 is not found,
Returns substring
s1 — string returns the string
get_substr starting from the
s2 — string String from the first s2
(s1,s2,s3) first s2 entry to the
s3 — string entry until the
first s3 entry
end.
s — string Returns substring
extract_substr c — symbol between n’th
and
String
(s,c,n) n — integer (n + 1)’th specified
number symbol c
s — string
Start counting
n1 — integer Returns n2 words
get_words from 1 (left
number String starting from n1’th
(s,n1,n2) hand side), word
n2 — integer word from s1
delimiter — space.
number
Cuts all spaces from
strltrim(s) s — string String the beginning of the
string
Cuts all spaces both
from the beginning
stratrim(s) s — string String
and from the end of
the string
(continued on next page)

www.isscctv.com
SecurOS 16 Programming Guide

Scripting

(continued from previous page)

Return
Function Arguments Description Supplement
value
Makes string upper-
strupr(s) s — string String
case
Makes string lower-
strlwr(s) s — string String
case
s — string
String symbol
n — integer Replace n’th symbol
set_at(s,n,c) String numeration starts
number with c symbol
with 0.
c — symbol

s — string String symbol


Returns the n’th
ger_at(s,n) n — integer Symbol numeration starts
symbol
number with 0.
If s does not have
the # symbol and
cannot be con-
Returns s till the #
verted to number,
symbol plus the n
n — integer returns n; if s can
number added by ze-
number be converted to
ros to quantity sym-
decl_num(n,s) s — string of String number, returns
bols N (if n = 23,
any symbols n added by ze-
and N = 4, then af-
#N type ros to quantity
ter the # symbol will
symbols that is
be 0023)
number from s:
(123, "5") →
00123.

s1 — string If s1 is empty or has


iif(s1,s2,s3) s2 — string String only spaces, returns
s3 — string s3; otherwise — s2

www.isscctv.com
SecurOS 17 Programming Guide

Scripting

1.1.6 Miscellaneous Functions

Table 4: Additional functions


Return
Function Arguments Description Supplement
value
Rounds floating
If n1 is integer
number to n2 signs then zeros will be
after point and
omitted; if n2 = 0
number_frm n1 — number
Number pads it with zeros,then returns n1
(n1,n2) n2 — number
if necessary, e. g.without changes;
number_frm(2.34,4) n2 should not be
→ 2.3400 greater than 6.
Pads integer value
with zeros to n2
n1 — number
int_frm(n1,n2) Number symbols, e. g.
n2 — number
int_frm(245,5) →
00245

Replace the first en-


currency(s) s — string String try of the “.” symbol
to the “-” symbol
s—
Calculates given
mathematical
evaluate(s) Number string as a mathe-
string expres-
matical expression
sion
If n < 0 returns
end(n) n — number Number
100; otherwise — n

Filename — 0 — no file
IsFileExist Check a file presence
path and name 1 — file was
(Filename) on the disk
of file found
Red — number
0. . . 255 the
red color
representation;
Integer number that
RGB(Red,Green, Green — Integer
is representation of
Blue) 0. . . 255 number
RGB schema
green;
Blue —
0. . . 255
blue
(continued on next page)

www.isscctv.com
SecurOS 18 Programming Guide

Scripting

(continued from previous page)

Return
Function Arguments Description Supplement
value
Text — text
within the box.
Message is consid-
Mandatory pa-
ered error if Type is
rameter;
set to true (or 1).
MessageBox Type — Show a message box
void For any other values
(Text, Type) message on the screen.
message is consid-
type: informa-
ered informational.
tional or error.
Optional pa-
rameter.
The same as the
Sleep Wait function but
(Milliseconds) time interval is in
milliseconds
GlobalVarSet Sets the value for the
(Name,Value) global variable Name
Returns the value of
GlobalVarGet
the global variable
(Name)
Name

1.1.7 Object Handling Functions


System object type constants (OBJ_TYPE) and command identifier constants (COMMAND) as well as
events identifier constants (EVENT_TYPE) are listed in Objects Reference on page 24. In the following
table, OBJ_ID means identifier (ID) of the given object type.

Table 5: Object-handling functions


Function Description
Returns the quantity of objects of the specified type
GetObjectNum(OBJ_TYPE)
within the system

GetObjectName(OBJ_TYPE,OBJ_ID) Returns object name (as string)


GetObjectParam Returns value of the specified parameter of the object
(OBJ_TYPE,OBJ_ID,Param) (as string)
GetEventDescription Returns description of event queried for indicated ob-
(OBJ_TYPE,EVENT_TYPE) ject (as string)
(continued on next page)

www.isscctv.com
SecurOS 19 Programming Guide

Scripting

(continued from previous page)

Function Description
Returns ID of the specified type object at the
specified position of objects of the same type.
GetObjectId(OBJ_TYPE,Index)
Index should be within the following range:
[0. . . GetObjectNum(OBJ_TYPE) - 1]
DoReact(OBJ_TYPE,OBJ_ID,COMMAND Perform action on the specified object with optional
[,"param1<value1>, parameters. Given object must belong to local appli-
"param2<value2>,..."]) cation server
DoReactGlobal
The same as the DoReact function but command is
(OBJ_TYPE,OBJ_ID,COMMAND
sent globally (to all application servers within SecurOS
[,"param1<value1>,
network)
"param2<value2>,..."])

NotifyEvent
("CORE",CORE_ID,COMMAND Send a command to specific core to perform the action
[,"param1<value1>, on a given object
"param2<value2>,..."])

Executes specified system command (as if it was


DoCommand(Command)
launched from within command prompt)
The same as the DoCommand but script waits the com-
DoCommandAndWait(Command)
mand to finish before continuing
CheckState Returns 1 if the object is in the specified state, and 0
(OBJ_TYPE,OBJ_ID,State_type) if it is not

1.1.8 CellBox Functions


CellBox is a special object type used to “catch” multiple events within given time frame. If all cells
of an object are set within a defined time frame, CellBox fires a positive event and clears its cells. If
a time-out occurs, a negative event is fired and cells are also cleared. For example, you can set up
security system to authorize person if his car’s license plate is recognized and if he types in a PIN
code within 15 seconds.
For more information on CellBox events see .

www.isscctv.com
SecurOS 20 Programming Guide

Scripting

Table 6: CellBox functions


Function Arguments Description Supplement
If the CellBox object
Name — name of the box
with this name already
(string)
CellBoxCreate exists its content is
Cells — a number of cells Create a named
(Name,Cells, dropped down. The
(0. . . 65536) CellBox object
Timeout) new box is created with
Timeout — timeout in mil-
a new number of cells
liseconds (number)
and a timeout.
Destroy the
CellBoxDestroy Name — name of the box
named CellBox
(Name) (string)
object
All cells are emptied
Name — name of the box Reset the CellBox
CellBoxReset(Name) and time counter is ze-
(string) state
roed.
Name — name of the box
(string) If the cell is absent
CellBoxPut Ncell — cell index Set value to the then program run inter-
(Name,Ncell,Value) (0. . . 65536) cell rupts with the CellBox
Value — associated value does not exist error.
(string)

1.1.9 Events

Table 7: Procedures
Procedure Description
Executes once at system startup. It is used to initialize variables. No
OnInit()
parameters are passed to event.
Executes on schedule. Parameter placeholders are:

W — day of week (0 — Monday,. . . , 6 — Sunday).

D — date in DD-MM-YY format.

X, Y — reserved.
OnTime(W,D,X,Y,H,C,S)
H — hour.

C — minutes.

S — seconds.

(continued on next page)

www.isscctv.com
SecurOS 21 Programming Guide

Scripting

(continued from previous page)

Procedure Description
Performed on a specified event of the object within entire SecurOS
network. Parameter placeholders are:

OBJ_TYPE — object type (string). If constant value is passed, event


handler catches events from objects of specified type only. If
a placeholder used, catches events from objects of any type.
OnEvent(OBJ_TYPE, OBJ_ID — object identifier (string). If constant value is passed event
OBJ_ID,EVENT_TYPE) handler catches events from objects with specified ID only. If
a placeholder used, catches events from objects with any ID.

EVENT_TYPE — event type identifier (string). If constant value is


passed, event handler catches events of the specified type only.
If a placeholder used, catches any events.

1.1.9.1 Typical Program Structure


A script may consist of several event handling procedures. Each procedure works independently of
others. This allows including several event handlers into a single script. See also Appendix A: Script
Samples on page 61 for a list of full scripts.
The following shows the typical structure of a script.

Listing 3: Script structure


OnInit() { // Initialization of Variables
...
}

OnTime(...) { // Scheduled operations


...
}

OnEvent(...) { // Event driven operations


...
}

www.isscctv.com
SecurOS 22 Programming Guide

Scripting

Listing 4: Sample event handlers


OnEvent("RAY","1","ON") { // Ray with ID 1 is shortened
...
}

OnEvent("RAY",ID,"ON") { // Any Ray is shortened. ‘ID’ - source object ID


if (strequal(ID, "1")) { // Ray with ID 1
...
}
if (strequal(ID, "2")) { // Ray with ID 2
...
}
}

OnEvent(OBJ,ID,"ALARM") { // any object has entered ‘alarmed’ state


if (strequal(OBJ, "CAM")) { // object is a camera
...
}
...
}

OnTime(W,"16-08-05",X,Y,"8","11","30") { // performed 16th of August,


... // 2005, at 8:11:30
}

OnTime(W,D,X,Y,"16","30","0") { // performed every day at 16:30:00


...
}

OnTime(W,"16-08-05",X,Y,"11",M,"0") { // performed 16th of August, 2005, from


... // 11:00:00 for one hour every minute
}

OnTime("0",D,X,Y,"21","0","0") { // performed every Monday at 21:00:00


...
}

1.1.10 Debugging Your Scripts


When creating and debugging scripts, it is always handy to track events passed within SecurOS
network.
To run SecurOS in Debug mode:

1. Shutdown SecurOS.

2. Launch the system utility for registry editing (type regedit in Start → Run box).

3. Open \\HKEY_LOCAL_MACHINE\\SOFTWARE\\ISS\\SecurOS\\NISS400 key and create debug


string parameter with 2 as a value.

4. Close the regedit utility.

5. Launch SecurOS again.

www.isscctv.com
SecurOS 23 Programming Guide

Scripting

Now SecurOS is in Debug mode, and in the lower part of the screen of the administration mode an
additional ‘event log’ window will appear. Right-click on any log line to see it in a separate window.
To disable debug mode:

1. Set 0 as a value for the debug parameter (see above).

2. Restart SecurOS.

www.isscctv.com
SecurOS 24 Programming Guide

Objects Reference

2. Objects Reference
2.1 Core Subsystem

2.1.1 Security Zone


Object type identifier: MAIN.
Events: none.
Commands: none.

2.1.2 Department
Object type identifier: DEPARTMENT.
Events: none.
Commands: none.

2.1.3 User account


Object type identifier: PERSON.

Table 8: PERSON events


Name used in
Event Identifier Description
macros
Person card
CARD_DUPLICATED Duplication of person card
duplicated

REGISTERED Registered Person registered

UNREGISTERED (info) Unregistered Person finished session

Commands: none.

2.1.4 User Rights


Object type identifier: RIGHTS.
Events: none.
Commands: none.

2.1.5 Active Directory Storage


Object type identifier: DB_PERSON_PROVIDER.
Events: none.

www.isscctv.com
SecurOS 25 Programming Guide

Objects Reference

Commands: none.

2.1.6 Computer
Object type identifier: SLAVE.

Table 9: SLAVE events


Name used in
Event Identifier Description
macros

CONNECTED Connected
Core connection
CONN_OVERLOAD (alarm)
blocked

DB_OVERLOAD (alarm) Database overload

DISCONNECTED (alarm) Disconnected

PROGRAM Program changed

PROTOCOL_RCVD Protocol received

QUEUE_CRITICAL (alarm) Workload is critical

QUEUE_NORMAL Workload is normal


Workload is too
QUEUE_WARNING
high

REGISTER_ERROR Register error


Display a window
SHOW_INFO_MESSAGE with an information
or error message

Table 10: SLAVE commands


Name used in
Command Identifier Description
map/macros

CONNECT_ONE Connect Connect to computer

CONNECT_OTHER Connect all Connect to core

DISCONNECT_ONE Disconnect Disconnect from computer

SYNC_PROTOCOL Get protocol Receive protocol

www.isscctv.com
SecurOS 26 Programming Guide

Objects Reference

2.1.7 Protocol filter


Object type identifier: PROTOCOL_FILTER.
Events: none.
Commands: none.

2.1.8 Access Level


Object type identifier: LEVEL.
Events: none.
Commands: none.

2.1.9 Area Zone


Object type identifier: ZONE.
Events: none.
Commands: none.

2.1.10 Region
Object type identifier: REGION.

Table 11: REGION events


Name used in
Event Identifier Description
macros

ARM Arm Region has been armed

DISARM Disarm Region has been disarmed

Commands: none.

2.1.11 Identity Cards Service


Object type identifier: AGENCY_PERSON1.
Events: none.
Commands: none.

2.2 Interface Subsystem

2.2.1 Screen
Object type identifier: DISPLAY.

www.isscctv.com
SecurOS 27 Programming Guide

Objects Reference

Events: none.

Table 12: DISPLAY commands


Name used in
Command Identifier Description
map/macros
Show current monitor on computer dis-
ACTIVATE Show
play

DEACTIVATE Hide Hide current monitor from display

2.2.2 Map
Object type identifier: MAP.
Events: none.
Commands: none.

2.2.3 Map v2
Object type identifier: MAP2.
Events: none.
Commands: none.

2.2.4 Event Viewer


Object type identifier: EVENT_VIEWER.

Table 13: EVENT_VIEWER events


Name used in
Event Identifier Description
macros
Generated when a line is double clicked
ACTIVATE_OBJECT
in the event viewer

Commands: none.

2.2.5 External Window


Object type identifier: WINDOW.
Events: none.
Commands: none.

www.isscctv.com
SecurOS 28 Programming Guide

Objects Reference

2.2.6 HTML Form


Object type identifier: SCREEN_FORM.
Events: none.

Table 14: SCREEN_FORM commands


Name used in
Command Identifier Description
map/macros

SHOW Show Show HTML form

HIDE Hide Hide HTML form

2.2.7 HTML Dialog


Object type identifier: DIALOG_POPUP.
Events: none.

Table 15: DIALOG_POPUP commands


Name used in
Command Identifier Description
map/macros

SHOW Show Show HTML dialog

HIDE Hide Hide HTML dialog

2.3 Video Subsystem

2.3.1 Video Capture Device


Object type identifier: GRABBER.

www.isscctv.com
SecurOS 29 Programming Guide

Objects Reference

Table 16: GRABBER commands


Name used in
Command Identifier Description
map/macros
Change settings of video card. Settings
are applied temporarily (until server
which is responsible for that object
restarts). Parameters:

chan — channel number (0, 1, 2. . . )

mode — frame rate (0 — maximum, 1 —


medium, 2 — minimum)

resolution — resolution (0 — quarter


frame, 384 × 288; 1 — half
SETUP frame, 768 × 288; 2 — full frame,
768 × 576)

format — format (PAL or NTSC)

drives — disk for video archive


(DRIVE1:\, DRIVE2:\. . . )

ip — IP address for network hardware

watchdog — enabling watchdog func-


tion (0 — disable, 1 — enable)

Set drives for video archiving. Parame-


ter:
SET_DRIVES
drives — disks for video archiving.

2.3.2 Camera
Object type identifier: CAM.

Table 17: CAM events


Name used in
Event Identifier Description
macros
Camera was armed by the ARM command
from a Zone object.
Note. On arming camera by means of
ARMED Camera was armed
a video monitor (the Arm button) all
corresponding zones are arming too, the
ARMED event takes place.

(continued on next page)

www.isscctv.com
SecurOS 30 Programming Guide

Objects Reference

(continued from previous page)

Name used in
Event Identifier Description
macros

ATTACH Attached Camera signal has been detected

BLINDING (alarm) Blinding Camera has been blinding

DETACH (alarm) Detached Camera signal has been disrupted


Camera was disarmed by the ARM com-
mand from a Zone object.
Camera was Note. On arming camera by means of
DISARMED
disarmed a video monitor (the Disarm button) all
corresponding zones are arming too, the
DISARMED event takes place.

FILE_REC_ERROR (alarm) File record error Error recording to hard disk


Generated at the moment of motion de-
MD_START Alarm
tection in the frame of the armed camera

MD_STOP Alarm end Motion has stopped


Generated when a frame has been print-
PRINT Print frame
ing
Camera signal has begun recording onto
REC Record start
hard disk

REC_STOP Record stop Camera signal has stopped recording

DISK_FULL (alarm) Disk is full

DISK_NOT_FULL (info) Disk is ready

UNBLINDING (alarm) Unblinding Camera has been unblinded

DEFOCUSED Camera is out-of-focus, focus is lost

FOCUSED Camera is focused, image is normalized

www.isscctv.com
SecurOS 31 Programming Guide

Objects Reference

Table 18: CAM commands


Name used in
Command Identifier Description
map/macros
Setup (change) camera parameters. Set-
tings are applied temporarily (until
server which is responsible for that ob-
ject restarts). Parameters:

mux — channel (0 — 1 channel, 15 — 16


channel)

compression — compression (0 — no
compression, 1 — max quality,
. . . , 5 — min quality)

agc — enabling automatic gain control


SETUP (beginning) (0 — disable, 1 — enable)

bc_auto — manual brightness and con-


trast adjustment (0 — disable, 1 —
enable)

color — color (0 — enabled, 1—


disabled)

contrast — contrast (0 — min, 10 —


max)

bright — brightness (0 — min, 10 —


max)

(continued on next page)

www.isscctv.com
SecurOS 32 Programming Guide

Objects Reference

(continued from previous page)

Name used in
Command Identifier Description
map/macros

sat_u — saturation (0 — min, 10 —


max)

hue — color balance (0 — min, 255 —


max)

audio_type — audio type

audio_id — microphone ID (empty if


no microphone exists)

telemetry_id — telemetry ID (PTZ


id)

alarm_rec — record alarms (1 —


enabled, 2 — disabled)

pre_rec_time — rollback record pe-


riod (s)
SETUP (ending)
hot_rec_time — hot record time (s)

post_rec_time — post-recording time


(s)

rec_fps — frame rate on recording

hot_rec_fps — frame rate on hot


recording

hot_alarms_config — hot recording


mode (0 — do not use hot record,
1 — use hot record, 2 — all alarms
are hot recording)

deinterlace — software image dein-


terlacing (0 — disable, 1 — adaptive
deinterlacing algorithm (Smart),
2 — blur algorithm)

Show on monitor. Parameter:


ACTIVATE Show monitor — monitor ID.

ARM Arm Arm camera

DISARM Disarm Disarm camera


(continued on next page)

www.isscctv.com
SecurOS 33 Programming Guide

Objects Reference

(continued from previous page)

Name used in
Command Identifier Description
map/macros
Begin recording. Parameter:
REC Start record hot_rec_time — hot record time, s.

Begin recording with rollback. Parame-


ters:

rollback_time_abs — absolute pre-


alarm record time (if empty then
the entire buffer is used)
Start record with start_rec — record parameter (1 or
REC_ROLLBACK
prealarm empty — record starts after pre-
alarm buffer saving; 0 — only pre-
alarm buffer is used, and if it the
rollback_time_abs is set then
the one frame (the first after spec-
ified time) is saved only)

REC_STOP Stop record End recording.


Remove camera from monitor (tem-
DELETE porarily, until monitor object is recre-
ated)
Turn on video stream for current cam-
era. Parameters:

slave_id — name of computer to


which the camera is attached to

compress — compression enabling


(0 — do not use compression, the
START_VIDEO compression parameter will be
ignored; 1 — enable)

compression — level of compression


(0 — no compression, 1 — high
quality, . . . , 1 — low quality)

speed — video feed speed (fps)

Turn off video stream for current cam-


era. Parameter:
STOP_VIDEO slave_id — name of computer to
which the camera is attached to

(continued on next page)

www.isscctv.com
SecurOS 34 Programming Guide

Objects Reference

(continued from previous page)

Name used in
Command Identifier Description
map/macros
Parameter:
REQUEST_MASK mask — mask

2.3.3 Zone
Object type identifier: CAM_ZONE.

Table 19: CAM_ZONE events


Name used in
Event Identifier Description
macros

ARM Arm

DISARM Disarm

MD_START Alarm

MD_STOP Alarm end

Table 20: CAM_ZONE commands


Name used in
Command Identifier Description
map/macros

ARM Arm

DISARM Disarm

2.3.4 Light Detector


Object type identifier: LD.

Table 21: LD events


Name used in
Event Identifier Description
macros

LIGHT_ON Light on
(continued on next page)

www.isscctv.com
SecurOS 35 Programming Guide

Objects Reference

(continued from previous page)

Name used in
Event Identifier Description
macros

LIGHT_OFF Light off

Commands: none.

2.3.5 Zone Object Detector


Object type identifier: ZOD.

Table 22: ZOD events


Name used in
Event Identifier Description
macros

RESET Detector resets Initialization


Object is appeared Object is present in zone, appeared in
PRESENT
in the zone camera view
Object is
Object is absent, disappeared from cam-
ABSENT disappeared from
era view
the zone
Detector state is Unknown object state e. g. before ini-
UNKNOWN
unknown tialization

www.isscctv.com
SecurOS 36 Programming Guide

Objects Reference

Table 23: ZOD commands


Name used in
Command Identifier Description
map/macros
Setup (change) detector parameters. Pa-
rameters:

contrast_threshold — level of filter-


ing between an estimated back-
ground and an object (20. . . 50)

area_threshold — minimum size of


object to be detected with ZOD
(1. . . 10)

zone_id — zone ID
SETUP (beginning)
frames — number of frames for initial
scene building stage

delay_frames — number of frames the


ZOD is insensitive for state chang-
ing

min_bkgnd_threshold — low filtering


level for background updating
(1. . . 100)

Table 24: ZOD (ending) commands


Name used in
Command Identifier Description
map/macros

max_bkgnd_threshold — high filter-


ing level for background updating
(1. . . 100)
SETUP (beginning)
compensation — turn on/off bright-
ness compensation algorithm (pos-
sible values: 1 — on; 0 — off)

www.isscctv.com
SecurOS 37 Programming Guide

Objects Reference

2.3.6 PTZ Controller


Object type identifier: TELEMETRY_CARD.
Events: none.
Commands: none.

2.3.7 PTZ Device


Object type identifier: TELEMETRY.

Table 25: TELEMETRY events


Name used in
Event Identifier Description
macros
Time for telemetry
TIMEOUT
control exists

Table 26: TELEMETRY commands


Name used in
Command Identifier Description
map/macros

AUTOFOCUS_ON Autofocus on
Autopan end point
AUTOPAN_END_P Assign end position
set

AUTOPAN_START Autopan begin


Autopan begin point
AUTOPAN_START_P Assign start position
set

AUTOPAN_STOP Autopan stop

CLEAR_PRESET Clear preset

D2OFF Superdynamic 2 off

D2ON Superdynamic on

DOWN (arm) Down

FOCUS_IN Focus on

FOCUS_OUT Focus out

FOCUS_STOP Stop focus

GO_PRESET Go to preset

IRIS_CLOSE Close iris

IRIS_OPEN Open iris


(continued on next page)

www.isscctv.com
SecurOS 38 Programming Guide

Objects Reference

(continued from previous page)

Name used in
Command Identifier Description
map/macros

IRIS_STOP Stop iris

LEFT (arm) Left

LEFT_DOWN Down-left

LEFT_UP Up-left

PATROL_LEARN Patrol learn

PATROL_PLAY Patrol play

PATROL_STOP Patrol stop

RIGHT (arm) Right

RIGHT_DOWN (arm) Down-right

RIGHT_UP Up-right

SET_PRESET Set preset

STOP (arm) Stop

UP (arm) Up

ZOOM_IN Zoom +

ZOOM_OUT Zoom –

2.3.8 Archive Converter


Object type identifier: ARCH_CNV.

Table 27: ARCH_CNV events


Name used in
Event Identifier Description
macros
Export parameters list is incorrect. Pa-
rameters:

problem — problem description


ARCH_EXPORT_CMD_FAILED
session_magic — session ID received
from query

(continued on next page)

www.isscctv.com
SecurOS 39 Programming Guide

Objects Reference

(continued from previous page)

Name used in
Event Identifier Description
macros
Convert parameters list is incorrect. Pa-
rameters:

problem — problem description


ARCH_CONVERT_CMD_FAILED
session_magic — session ID received
from query

Task was put in queue. Parameters:

task_id — task ID (in queue)


TASK_ENQUEUED
session_magic — session ID received
from query

Task is in process. Parameter:


TASK_STARTED task_id — task ID (in queue)

Task was performed successfully. Pa-


rameter:
TASK_FINISHED
task_id — task ID (in queue)

Task was failed. There are some prob-


lems on task performing. Parameters:

TASK_FAILED task_id — task ID (in queue)

problem — problem description

www.isscctv.com
SecurOS 40 Programming Guide

Objects Reference

Table 28: ARCH_CNV commands


Name used in
Command Identifier Description
map/macros
Archive export. Parameters:

channel_id (mandatory) — requested


channel ID. Identifier of the cam-
era to convert archive for. The
camera must be registered in the
camera list of the Archive con-
verter object;

time_start (mandatory) — left edge


of the requested time interval
(start search time) in DD-MM-YY
HH:MM:SS.FFF format;

time_end (mandatory) — right edge


ARCH_EXPORT
of the requested time interval
(stop search time) in DD-MM-YY
HH:MM:SS.FFF format;

session_magic (optional) — query ID.


Will be included in converter an-
swer;

operator (optional) — name of the


user (operator), who started con-
version process;

comment (optional) — any comment on


the conversion process;

(continued on next page)

www.isscctv.com
SecurOS 41 Programming Guide

Objects Reference

(continued from previous page)

Name used in
Command Identifier Description
map/macros

client_type (optional) — type of the


query source object. Is used to
address notifications about conver-
sion results. If exists, value will
be transferred inside answer noti-
fication without change;

client_id (optional) — ID of the


query source object. Is used to
address notifications about conver-
sion results. If exists, value will
be transferred inside answer noti-
fication without change;

dir (optional) — directory to save con-


verted file (export directory). The
absolute path must be specified. If
not set then value defined in the
Archive converter will be used;
ARCH_EXPORT (continued)
file_name (optional) — name of the
converted file. Only name (not
path) must be specified;

arch_id (optional) — name of Com-


puter parent to Archiver. Is used
when converting long-term archive
files. Must be set in the following
format:
<Computer Name.Archiver ID>.
If not set or is incorrect only files
from operative archive can be con-
verted;

arch_port (optional) — port to com-


municate with Archiver. Possible
value — 901. If not set or is in-
correct only files from operative
archive can be converted.

www.isscctv.com
SecurOS 42 Programming Guide

Objects Reference

2.3.9 Archive Converter Dialog


Object type identifier: ARCH_CNV_DLG.
Events: none.
Commands: none.

2.3.10 Archiver
Object type identifier: ARCHIVER.
Events: none.

Table 29: ARCHIVER commands


Name used in
Command Identifier Description
map/macros
Archive on time interval. Parameters:

time1 — the beginning of the time in-


terval to archive (if not set then
it’s value is the time of the long-
term archive last frame for the
camera; if there is no such archive
then the value is 01/01/1901)

time2 — the ending of the time interval


START to archive (if not set, then is the
time of the command coming)

cam_count — number of cameras to


archive

cam_id.x — cameras identifications to


archive (if not set then all cameras
from archives settings)

Note: the command may be without pa-


rameters.
Stop archiving. Parameters:

cam_count — number of cameras to


archive
STOP
cam_id.x — cameras identifications to
archive (if not set then all cameras
from archives settings)

Commands: none.

www.isscctv.com
SecurOS 43 Programming Guide

Objects Reference

2.3.11 Archiver Dialog


Object type identifier: ARCHIVER_DLG.
Events: none.
Commands: none.

2.3.12 Monitor
Object type identifier: MONITOR.

Table 30: MONITOR events


Name used in
Event Identifier Description
macros
Selected camera has been activated. Pa-
rameter:
ACTIVATE_CAM
cam — selected camera ID

Camera has been added to monitor. Pa-


rameter:
CAM_ADDED
camid — added camera ID

Camera has been removed from monitor.


Parameter:
CAM_REMOVED
camid — removed camera ID

Table 31: MONITOR commands


Name used in
Command Identifier Description
map/macros
Shows virtual monitor on the computer
ACTIVATE Show
screen

DEACTIVATE Hide Hides monitor


Locates the camera archive on the spec-
ified time. Parameters:

cam — camera ID
ARCH_FRAME_TIME
time — time in DD-MM-YY
HH:MM:SS:FFF format

(continued on next page)

www.isscctv.com
SecurOS 44 Programming Guide

Objects Reference

(continued from previous page)

Name used in
Command Identifier Description
map/macros
Exports archive frame in JPEG file. Pa-
rameters:

cam — camera ID for which archive


search will be

time — time in DD-MM-YY


HH:MM:SS:FFF format

file — JPEG file path in which


the frame will be exported
(if empty by default the
ARCH_FRAME_TIME_EXPORT <time>_<date>_<cam_id>.jpg
file of the root directory
SecurOS\Export is used)

quality — JPEG file quality (by de-


fault 75)

password_crc — password for the


archive entrance (necessary, if
the archive is protected by the
password)

Navigate through archive. Parameters:

time — date and time in DD-MM-YY


HH:MM:SS format

exact — position identifier. Possible


ARCH_FRAME_TIME_ANY values: 0 — jump to the first
frame, 1 — jump to the nearest to
time parameter frame

Note: if the command was failed then


the ARCH_ERROR event will be send.
Jump to the first frame of the specified
video archive file. Parameter:

ARCH_FRAME_FIRST file — video archive file name

Note: if the command was failed then


the ARCH_ERROR event will be send.
(continued on next page)

www.isscctv.com
SecurOS 45 Programming Guide

Objects Reference

(continued from previous page)

Name used in
Command Identifier Description
map/macros
Jump to the next frame (relative to
the current one) of the specified video
archive file. Parameter:
ARCH_FRAME_NEXT
file — video archive file name

Note: if the command was failed then


the ARCH_ERROR event will be send.
Jump to the previous frame (relative to
the current one) of the specified video
archive file. Parameter:
ARCH_FRAME_PREV
file — video archive file name

Note: if the command was failed then


the ARCH_ERROR event will be send.
Jump to the last frame of the specified
video archive file. Parameter:

ARCH_FRAME_LAST file — video archive file name

Note: if the command was failed then


the ARCH_ERROR event will be send.
Jump to the specified by time frame of
the video archive file. Parameter:

time — date and time in DD-MM-YY


ARCH_FRAME_TIME_EXACT
HH:MM:SS format

Note: if the command was failed then


the ARCH_ERROR event will be send.
Jump to the specified frame of the video
archive file. Parameters:

file — video archive file name


ARCH_FRAME_POSITION
frame_number — frame number (id)

Note: if the command was failed then


the ARCH_ERROR event will be send.
Switch monitor layout. Parameters:

mode — layout ID (e. g. 1, 4)


ADD_SEQUENCE
seq — cameras ID through the separa-
tor “|”

(continued on next page)

www.isscctv.com
SecurOS 46 Programming Guide

Objects Reference

(continued from previous page)

Name used in
Command Identifier Description
map/macros
Export frame of the live video to a file.
Supported file types: jpg, png. Param-
eters:

cam — camera id (1, 4 etc.);

directory — directory to save file,


which is specified by file param-
eter (C:\Exported frames).
When specifying directory
backslash mark (\) is al-
EXPORT_FRAME lowed at the end of the string
(C:\Exported frames\);

file — file name in the specified direc-


tory. If full file name is specified,
then directory parameter can be
dropped;

quality — image quality, in % of the


source frame quality. Optional pa-
rameter.

2.4 Audio Subsystem

2.4.1 Audio Capture Device


Object type identifier: AUDIO.
Events: none.
Commands: none.

2.4.2 Microphone
Object type identifier: AUDIO_LINE.

Table 32: AUDIO_LINE events


Name used in
Event Identifier Description
macros

ARM Arm Audio sensor is turned on


(continued on next page)

www.isscctv.com
SecurOS 47 Programming Guide

Objects Reference

(continued from previous page)

Name used in
Event Identifier Description
macros

DISARM Disarm Audio sensor is turned off

REC Record start Recording of signal has occurred

REC_STOP Record stop Record stop

RESET Reset line Microphone attached

VOX_OFF Accu stop Audio enable

VOX_ON Accu start Audio disable

Table 33: AUDIO_LINE commands


Name used in
Command Identifier Description
map/macros

ARM Record start Start record

DISARM Record stop Stop record

2.4.3 Audio Player


Object type identifier: PLAYER.

Table 34: PLAYER events


Name used in
Event Identifier Description
macros

START_LISTEN Start listening

STOP_LISTEN Stop listening

Table 35: PLAYER commands


Name used in
Command Identifier Description
map/macros

START_LISTEN Begin listening

STOP_LISTEN Stop listening

www.isscctv.com
SecurOS 48 Programming Guide

Objects Reference

2.4.4 Intercom
Object type identifier: INTERCOM.
Events: none.
Commands: none.

2.5 I/O Subsystem

2.5.1 Sensor
Object type identifier: GRAY.

Table 36: GRAY events


Name used in
Event Identifier Description
macros

ALARM Alarm

ARM Arm

CONFIRM Confirm

DISARM Disarm

OPEN Open

NORM Normal

NOT_VALID_STATE

SHORT_CIRCUIT Short circuit

SABOTAGE Sabotage

www.isscctv.com
SecurOS 49 Programming Guide

Objects Reference

Table 37: GRAY commands


Name used in
Command Identifier Description
map/macros
Setup (change) sensor parameters. Set-
tings are applied temporarily (until
server which is responsible for that ob-
ject restarts). Parameters:

chan — channel number (0. . . 7)


INIT parent_id — video capture device ID
(possible values: 1. . . n)

type — sensors type (0 — ray with on


locking abrasion type; 1 — ray with
on breaking abrasion type

ARM Arm

CONFIRM Confirm

DISARM Disarm
Disable sensor object. Parameter:

DISABLE_RAY Disable sensor parent_id — video capture device ID


(1 . . . n )

2.5.2 Relay
Object type identifier: GRELE.

Table 38: GRELE events


Name used in
Event Identifier Description
macros

OFF Relay off Relay off

ON Relay on Relay on

www.isscctv.com
SecurOS 50 Programming Guide

Objects Reference

Table 39: GRELE commands


Name used in
Command Identifier Description
map/macros
Change settings of relay. Settings are
applied temporarily (until server which
is responsible for that object restarts).
Parameters:
INIT
chan — channel number (0. . . 7)

parent_id — video capture device ID


(1 . . . n )

OFF Switch off Switch relay off

ON Switch on Switch relay on


Disable relay object. Parameter:

DISABLE_RELE Disable relay parent_id — video capture device ID


(1 . . . n )

2.6 Notification Subsystem

2.6.1 E-mail Message Service


Object type identifier: MMS.
Events: none.
Commands: none.

www.isscctv.com
SecurOS 51 Programming Guide

Objects Reference

2.6.2 E-mail Message


Object type identifier: MAIL_MESSAGE.

Table 40: MAIL_MESSAGE events


Name used in
Event Identifier Description
macros
Message sending
SEND_ERROR (alarm)
error

SENT Message sent

Table 41: MAIL_MESSAGE commands


Name used in
Command Identifier Description
map/macros
Send message. Parameters:

param_1 — message title

SEND Send message param_2 — beginning of a message


body

param_3 — ending of a message body

2.6.3 Short Message Service


Object type identifier: SMS.
Events: none.
Commands: none.

2.6.4 Short Message


Object type identifier: SHORT_MESSAGE.

Table 42: SHORT_MESSAGE events


Name used in
Event Identifier Description
macros
Message sending
SEND_ERROR (alarm)
error

SENT Message sent

www.isscctv.com
SecurOS 52 Programming Guide

Objects Reference

Table 43: SHORT_MESSAGE commands


Name used in
Command Identifier Description
map/macros

SEND Send message

2.6.5 Audible Notification Service


Object type identifier: VNS.
Events: none.

Table 44: VNS commands


Name used in
Command Identifier Description
map/macros
Play WAV-file. Parameter:
file — path to WAV file (with exten-
PLAY_WAV Play wave file
sion) relative to SecurOS folder (e. g.
file<\wav\cam_alarm_1.wav>)

2.7 Automation Subsystem

2.7.1 Time Zone


Object type identifier: TIME_ZONE.

Table 45: TIME_ZONE events


Name used in
Event Identifier Description
macros

ACTIVATE Begin Beginning zone

DEACTIVATE End End of zone

Commands: none.

2.7.2 Macro
Object type identifier: MACRO.

www.isscctv.com
SecurOS 53 Programming Guide

Objects Reference

Table 46: MACRO events


Name used in
Event Identifier Description
macros

RUN Execute Macro has been executed

Table 47: MACRO commands


Name used in
Command Identifier Description
map/macros

RUN Execute Execute macro

2.7.3 Program
Object type identifier: PROGRAM.

Table 48: PROGRAM events


Name used in
Event Identifier Description
macros

ERROR Error occurred

Commands: none.

2.7.4 CellBox
Object type identifier: CELLBOX.

Table 49: CELLBOX events


Name used in
Event Identifier Description
macros
Timeout occurred: the CellBox object is
TIMEOUT
not filled within given time frame
CellBox object is filled. Parameters:

count — number of cells in the CellBox


object
FILLEDUP
cell0, cell1, . . . cellN — value of the
corresponding cell

www.isscctv.com
SecurOS 54 Programming Guide

Objects Reference

Commands: none.

2.7.5 IIDK Interface


Object type identifier: ACTIVEX.
Events: none.
Commands: none.

www.isscctv.com
SecurOS 55 Programming Guide

HTML Forms

3. HTML Forms
SecurOS has a mechanism of creating custom user interface by means of HTML forms.

3.1 Setting up HTML Forms within SecurOS


SecurOS provides two types of HTML-based interface objects:

• HTML Form — this interface object belongs to a Screen object and, thus, appears on monitor
when the corresponding screen is activated, and stays there unless screen is deactivated or
SecurOS is shut down.

• HTML Dialog — this object appears on monitor temporarily upon some external event or system
behavior (i. e. it can be opened from SecurOS script). Objects of this kind can be closed by
users manually or automatically by system. The HTML Dialog objects belong to the Computer
object.

Before creating HTML Forms and HTML Dialogs, consider the following ideology behind HTML
Forms and Dialogs:

• Define an onLoad event handling function within HTML to perform initialization at object
startup. This includes adding event and command filters and corresponding handlers if your
HTML Form should respond to these external events and commands.

• Within event/command handlers write code that modifies the DHTML or otherwise responds to
incoming events.

• Define onClick event handlers for buttons or other interactive elements within HTML to send
commands back to SecurOS.

3.2 _system.js File


SecurOS comes with _system.js file located in \dialogscript\Data subfolder of Se-
curOS root folder, which wraps calls to window.external.dispSOCoreProvider object (see
next chapter 3.3 window.external.dispSOCoreProvider Object on page 56) to be more easy-
to-use and provides additional helper functions. It also creates a global io variable
as a shortcut to this object, so you could use io.MethodName(...) syntax instead of
window.external.dispSOCoreProvider.MethodName(...).

www.isscctv.com
SecurOS 56 Programming Guide

HTML Forms

Table 50: _system.js functions


Function Description
Wraps DoReact(RawString), constructing raw string automati-
react(target_type, cally from target_type, target_id, command and array of pa-
target_id,command, rameters and values. Example:
params_array) react("CAM","1","REC",["param1","value1",
"param2","value2"]);

Wraps Send2Core(RawString), constructing raw string automat-


ically from own type and ID, command and array of parameters
event(command,params) and values, thus sending event on behalf on oneself. Example:
event("ALARMED",["param1","value1",
"param2","value2"]);

Wraps Send2Core(RawString), constructing RawString auto-


matically from source_type, source_id, command and array of
event_from parameters and values, thus sending event on behalf on arbitrary
(command,params) object. Example:
event_from("RAY","3","ALARMED",
["param1","value1","param2","value2"]);

react_raw(raw_string) Shortcut to io.DoReact(raw_string)

event_raw(raw_string) Shortcut to io.Send2Core(raw_string)


Resizes window to specified width and height, or content size,
obeying optional min and max constraints. Examples:

resize_win() — automatically resize window by its contents

resize_win(x, y) — set window size to x, y

resize_win(0, 0, minx, miny) — automatically resize win-


resize_win(x, y, minx, dow, but obey minimum size constraints
miny, maxx, maxy)
resize_win(0, 0, 0, 0, maxx, maxy) — automatically
resize window, but obey maximum size constraints

resize_win(0, 0, minx, miny, maxx, maxy) —


automatically resize window, but obey minimum/maximum
size constraints

3.3 window.external.dispSOCoreProvider Object


Special window.external.dispSOCoreProvider object provides interfaces for subscribing to system
events, enumerating and performing actions on security objects, checking their states, etc. This
allows building fully customized interface solutions that integrate tightly into SecurOS.

www.isscctv.com
SecurOS 57 Programming Guide

HTML Forms

Table 51: window.external.dispSOCoreProvider object properties


Property Type Description
Type of an object this HTML document is loaded into. Read-only.
Possible values:

bsType String SCREEN_FORM — object is an HTML Form

DIALOG_POPUP — object is an HTML Dialog

bsID String ID of an object this HTML document is loaded into. Read-only.

nID Integer Same as bsID, but returns an integer value. Read-only.

Table 52: window.external.dispSOCoreProvider object methods


Method Description
Creates and returns a new IMsgFilter object (see 3.4 IMsgFilter
createFilter()
Object Type on page 57)
Sends raw event string to SecurOS. String syntax:
Send2Core(RawString) OBJ_TYPE|OBJ_ID|EVENT_TYPE|param1<value1>,
param2<value2>,...,paramN<valueN>

Sends raw react string to SecurOS. String syntax:


DoReact(RawString) OBJ_TYPE|OBJ_ID|COMMAND|param1<value1>,
param2<value2>,...,paramN<valueN>

Resize window to specified width and height. Use this function


ResizeTo(Width,Height)
instead of external window.resizeTo() function.

3.4 IMsgFilter Object Type


System object type constants (OBJ_TYPE) and command identifier constants (COMMAND) as well as
events identifier constants (EVENT_TYPE) are listed in 2 Objects Reference on page 24. In the following
table, OBJ_ID means identifier (ID) of the given object type.

Table 53: IMsgFilter object methods


Method Description
Adds the handler for the to the given javascript function. Upon
event/command, the given javascript function will receive an
addHandler(FunctionName) ICoreMsg object as a parameter (see 3.5 ICoreMsg Object Type
on page 58). Returns event handler ID, which can be passed to
removeHandler method.

(continued on next page)

www.isscctv.com
SecurOS 58 Programming Guide

HTML Forms

(continued from previous page)

Method Description
removeHandler
Removes the previously created handler
(FunctionName)

clearHandlers() Clears all handlers


Subscribes to specified commands. If the “*” wildcard is used,
addReact(COMMAND)
subscribes to all commands.

removeReact(COMMAND) Unsubscribes from the specified command

clearReacts() Removes all commands from the filter


Excludes the specified command from being processed by filter. If
addBlockReact(COMMAND)
the “*” wildcard is used, excludes all commands.

removeBlockReact(COMMAND) Removes the specified command from block list

clearBlockReacts() Removes all command exclusions from the filter


Subscribes to all events that match provided object type, ID and
addEvent(OBJ_TYPE,OBJ_ID,
event type. Any parameter can accept the “*” wildcard which
EVENT_TYPE)
means “any”.
Removes the previous subscription. Combination of OBJ_TYPE,
removeEvent(OBJ_TYPE,
OBJ_ID and EVENT_TYPE should be the same as in one of the
OBJ_ID,EVENT_TYPE)
previous calls to addEvent().

clearEvents() Removes all event subscriptions from the filter


Excludes all events that match provided object type, ID and event
addBlockEvent(OBJ_TYPE,
type from being processed by filter. Any parameter can accept the
OBJ_ID,EVENT_TYPE)
“*” wildcard which means “any”.
removeBlockEvent Removes the previously set combination of event exclusions. Com-
(OBJ_TYPE,OBJ_ID, bination of OBJ_TYPE, OBJ_ID and EVENT_TYPE should be the
EVENT_TYPE) same as in one of the previous calls to addBlockEvent().

clearBlockEvents() Removes all event exclusions from the filter

3.5 ICoreMsg Object Type


Object of this type is passed to event handling function as a parameter. It contains the data about
event or command. The event handlers must be processed as fast as possible, not to be blocked by
dialog appearing procedures.

www.isscctv.com
SecurOS 59 Programming Guide

HTML Forms

Table 54: ICoreMsg properties


Property Type Description

bsAction String Event or command identifier

bsSourceType String Type of an object that fired event/command

bsSourseID String ID of an object that fired event/command

bsParam(Name) String Returns the string value of the specified named parameter
intParam
Integer Returns the integer value of the specified named parameter
(Name)

www.isscctv.com
SecurOS 60 Programming Guide

HTML Forms

3.6 Sample HTML Form


Below is a sample form that subscribes to events and sends command upon button click.

Listing 5: Using event filter


<html>
<head>
<script type="text/javascript" src="data/_system.js"></script>

<script type="text/javascript">
function init() { // executed when object shows the first time
var f = io.createFilter(); // create new filter
f.addEvent("*","*","ALARM"); // monitor ‘ALARM’ events
// from any object
f.addHandler(onAlarm); // define a handler for this filter
}

function onAlarm(msg) { // event handler


var source = msg.bsParam("source");
var action = msg.bsParam("action");
var region = msg.bsParam("region");
var comment = msg.bsParam("comment");
var date = msg.bsParam("date");
var time = msg.bsParam("time");
var type = msg.bsParam("type");
// process the event (e.~g. add record to list)
...
}
</script>
</head>

<body onLoad="init()">
<!-- send "ALARM" event on button click -->
<input type="button" value="Alarm" onclick="event(’ALARM’);">
</body>
</html>

SecurOS comes with several HTML Forms, so you could use them as a starting point to create new
ones. These files have .html extension and can be found in <SecurOS_Folder>\dialogscript\
folder. The content of this folder must be the same for all the operator workstations, where HTML
Forms will be launched.

www.isscctv.com
SecurOS 61 Programming Guide

Appendix A: Script Samples

Appendix A: Script Samples


The following scripts use fictitious object identifiers. Make sure you specify valid object identifiers
when testing these scripts on your system.

A.1 Start Recording from Active Camera

Listing 6: Start recording from active camera


OnEvent("MONITOR","4","ACTIVATE_CAM"){ // camera activated in monitor
DoReact("CAM","1","MUX1");
}

A.2 Start/Stop Switching Cameras on Analog Display

Listing 7: Start/stop switching cameras on analog display


OnEvent("MACRO","1","RUN") {[ // run
AutoScanMode = 1;
for (i = 1; AutoScanMode; i = str(i + 1)) {
if (i > 6) {
i = 1;
}
Wait(3);
DoReact("CAM",i,"REC");
}
]}

OnEvent("MACRO","2","RUN") { // stop
AutoScanMode = 0;
}

Continuously switch six cameras (ID 1. . . 6) on an analog monitor every 3 seconds. Start by launching
Macro 1, stop by launching Macro 2.

www.isscctv.com
SecurOS 62 Programming Guide

Appendix A: Script Samples

A.3 Turn on an Execution Unit upon Motion Detection

Listing 8: Turn On an Execution Unit upon Motion Detection


OnEvent("CAM",N,"MD_START") {[ // on motion detection by any camera
for (i = 0; i < 5; i = str(i + 1)) { // do 5 times
DoReact("RELE","1","ON"); // turn execution unit on
Wait(1); // wait 1 second
DoReact("RELE","1","OFF"); // turn execution unit off
Wait(1);
}
]}

Upon motion in the field of site of any camera within 10 seconds (after last motion) turn on relay
number 1 with a duration of 1 second. The relay might be connected to a light for example. The
camera number can be fixed, the relay number can be general.

A.4 Play a Sound File upon Event

Listing 9: Play a sound file upon event


OnEvent("CAM","1","MD_START"){
DoReact("VNS","1","PLAY_WAV",
"file<\wav\cam_alarm_1.wav>");
}

On any event play any sound file. The WAV-file can be different. The path must always be specified
relative to SecurOS folder. The file will be played through the right audio channel independently on
audio player setup.

A.5 Show/Hide Telemetry Window upon Activating Screen

Listing 10: Open/hide telemetry window upon activating screen


OnEvent("DISPLAY","1","ACTIVATE") {
DoReact("DIALOG","telemetry","RUN"); // show HTML dialog
}

OnEvent("DISPLAY","1","DEACTIVATE") {
DoReact("DIALOG","telemetry","CLOSE"); // hide HTML dialog
}

Open/close the telemetry window upon activating/deactivating Screen 1. Screen number can be
different.

www.isscctv.com
SecurOS 63 Programming Guide

Appendix A: Script Samples

A.6 Allow Recording Video by Both Motion Detection and Acous-


tic Level Monitoring

Listing 11: Allow recording video by both motion detection and acoustic level monitoring
OnInit()
{
n2a = 0;
n2v = 0;

OnEvent("AUDIO_LINE","3","VOX_ON") {
n2a = 1; // "audio" flag is on
DoReact("CAM","1","REC");
}

OnEvent("CAM","1","MD_START") {
n2v = 1; // "video" flag is on
DoReact("CAM","2","REC");
}

OnEvent("AUDIO_LINE","3","VOX_OFF") {
n2a = 0; // "audio" flag is off
}

Note that the Record on Alarm option should be disabled by target video camera, and the camera
should be armed.

www.isscctv.com
SecurOS 64 Programming Guide

Appendix A: Script Samples

A.7 Play Sound by Microphone Assigned to Active Camera

Listing 12: Play sound by microphone assigned to active camera


OnInit() {
sound_on = 0;
}

OnEvent("MACRO","1","RUN") {
sound_on = 1;
}

OnEvent("MACRO","2","RUN") {
DoReact("PLAYER","1","STOP_LISTEN");
sound_on = 0;
}

OnEvent("MONITOR","1","ACTIVATE_CAM") {
if (sound_on) {
DoReact("PLAYER","1","START_LISTEN","audio_id<"+
GetObjectParam("CAM",cam,"audio_id")+">");
}
}

Listen to sound from microphone assigned to camera in real-time upon camera activation. Enable the
feature upon executing Macro 1, disable the feature by executing Macro 2.

A.8 Play Audio Continuously until Manually Interrupted

Listing 13: Play audio continuously until manually interrupted


OnEvent("MACRO","1","RUN") {
playback = 1; [
for (i = 1; playback; playback) {
DoReact("VNS","1","PLAY_WAV","file<\wav\alarm.wav>");
Wait(5);
}
]
}

OnEvent("MACRO","2","RUN") {
playback = 0;
}

Start continuous sound playback upon executing Macro 1. Stop playback upon executing Macro 2.
Note that duration of the sound file should not exceed the time specified in the Wait() call.

www.isscctv.com
SecurOS 65 Programming Guide

Index

Index
A Archiver Dialog object, 43
abs function, 12 Archiver object, 42
ABSENT event, 35 Area Zone object, 26
Access Level object, 26 ARM command, 29, 30, 32, 34, 47, 49
acos function, 12 ARM event, 26, 34, 46, 48
ACTIVATE command, 27, 32, 43 ARMED event, 29
ACTIVATE event, 52 asin function, 12
ACTIVATE_CAM event, 43 atan function, 12
ACTIVATE_OBJECT event, 27 atof function, 13
Active Directory Storage object, 24 ATTACH event, 30
ADD_SEQUENCE command, 45 Audible Notification Service object, 52
addBlockEvent function, 58 Audio Capture Device object, 46
addBlockReact function, 58 Audio Player object, 47
addEvent function, 58 AUTOFOCUS_ON command, 37
addHandler function, 57 AUTOPAN_END_P command, 37
addReact function, 58 AUTOPAN_START command, 37
Adobe Reader, 6 AUTOPAN_START_P command, 37
ALARM event, 48 AUTOPAN_STOP command, 37
ARCH_CONVERT_CMD_FAILED event, 39
B
ARCH_ERROR event, 44, 45
BLINDING event, 30
ARCH_EXPORT command, 40, 41
ARCH_EXPORT_CMD_FAILED event, 38
C
ARCH_FRAME_FIRST command, 44
CAM_ADDED event, 43
ARCH_FRAME_LAST command, 45
CAM_REMOVED event, 43
ARCH_FRAME_NEXT command, 45
Camera object, 29
ARCH_FRAME_POSITION command, 45
CARD_DUPLICATED event, 24
ARCH_FRAME_PREV command, 45
ceil function, 12
ARCH_FRAME_TIME command, 43
CellBox object, 19, 20, 53
ARCH_FRAME_TIME_ANY command, 44
CellBoxCreate function, 20
ARCH_FRAME_TIME_EXACT command, 45
CellBoxDestroy function, 20
ARCH_FRAME_TIME_EXPORT command, 44
CellBoxPut function, 20
Archive Converter Dialog object, 42
CellBoxReset function, 20
Archive Converter object, 38
CheckState function, 19

www.isscctv.com
SecurOS 66 Programming Guide

Index

CLEAR_PRESET command, 37 DISK_FULL event, 30


clearBlockEvents function, 58 DISK_NOT_FULL event, 30
clearBlockReacts function, 58 DoCommand function, 19
clearEvents function, 58 DoCommandAndWait function, 19
clearHandlers function, 58 DoReact function, 19, 57
clearReacts function, 58 DoReactGlobal function, 19
Computer object, 25, 55 DOWN command, 37
CONFIRM command, 49
E
CONFIRM event, 48
E-mail Message Service object, 50
CONN_OVERLOAD event, 25
E-mail Message object, 51
CONNECT_ONE command, 25
end function, 17
CONNECT_OTHER command, 25
ERROR event, 53
CONNECTED event, 25
evaluate function, 17
cos function, 12
Event Viewer object, 27
cosh function, 12
event function, 56
createFilter function, 57
event_from function, 56
currency function, 17
event_raw function, 56
D ExecuteCmd function, 14
D2OFF command, 37 exp function, 12
D2ON command, 37 EXPORT_FRAME command, 46
date_frm function, 13 External Window object, 27
DB_OVERLOAD event, 25 extract_substr function, 15
DEACTIVATE command, 27, 43
F
DEACTIVATE event, 52
FILE_REC_ERROR event, 30
decl_num function, 16
FILLEDUP event, 53
DEFOCUSED event, 30
floor function, 12
deg function, 12
FOCUS_IN command, 37
DELETE command, 33
FOCUS_OUT command, 37
Department object, 24
FOCUS_STOP command, 37
DETACH event, 30
FOCUSED event, 30
DISABLE_RAY command, 49
for . . . , 11
DISABLE_RELE command, 50
DISARM command, 32, 34, 47, 49 G
DISARM event, 26, 34, 47, 48 ger_at function, 16
DISARMED event, 30 get_substr function, 15
DISCONNECT_ONE command, 25 get_words function, 15
DISCONNECTED event, 25 GetEventDescription function, 18

www.isscctv.com
SecurOS 67 Programming Guide

Index

GetObjectId function, 19 LIGHT_ON event, 34


GetObjectName function, 18 log10 function, 12
GetObjectNum function, 18 log function, 12
GetObjectParam function, 18 long2long function, 14
GlobalVarGet function, 10, 18 long2time function, 13
GlobalVarSet function, 10, 18
M
GO_PRESET command, 37
Macro object, 52
gtd2date function, 13
Map v2 object, 27
H Map object, 27
HIDE command, 28 max function, 12
HTML Dialog object, 28, 55, 57 MD_START event, 30, 34
HTML Dialogs object, 55 MD_STOP event, 30, 34
HTML form, 55 MessageBox function, 18
HTML Form object, 28, 55, 57 Microphone object, 46
HTML Forms object, 55 min function, 12
Monitor object, 43
I
ICoreMsg object, 57 N
Identity Cards Service object, 26 NORM event, 48
if . . . else . . . function, 11 NOT_VALID_STATE event, 48
IIDK Interface object, 54 NotifyEvent function, 19
iif function, 16 number_frm function, 17
IMsgFilter object, 57
INIT command, 49, 50 O
int function, 12 OFF command, 50
int_frm function, 17 OFF event, 49
Intercom object, 48 ON command, 50
IRIS_CLOSE command, 37 ON event, 49
IRIS_OPEN command, 37 OnEvent function, 21
IRIS_STOP command, 38 OnInit function, 20
IsFileExist function, 17 OnTime function, 20
OPEN event, 48
L
LEFT command, 38 P
LEFT_DOWN command, 38 PATROL_LEARN command, 38
LEFT_UP command, 38 PATROL_PLAY command, 38
Light Detector object, 34 PATROL_STOP command, 38
LIGHT_OFF event, 35 PLAY_WAV command, 52

www.isscctv.com
SecurOS 68 Programming Guide

Index

PRESENT event, 35 RGB function, 17


PRINT event, 30 RIGHT command, 38
program structure, 21 RIGHT_DOWN command, 38
PROGRAM event, 25 RIGHT_UP command, 38
Program object, 53 RUN event, 53
Protocol filter object, 26
S
PROTOCOL_RCVD event, 25
SABOTAGE event, 48
PTZ Controller object, 37
scalar2date function, 13
PTZ Device object, 37
scalar function, 13

Q Screen object, 26, 55, 62

QUEUE_CRITICAL event, 25 Security Zone object, 24

QUEUE_NORMAL event, 25 Send2Core function, 57

QUEUE_WARNING event, 25 SEND command, 51, 52


SEND_ERROR event, 51
R Sensor object, 48
rad function, 12 SENT event, 51
react function, 56 set_at function, 16
react_raw function, 56 SET_DRIVES command, 29
REC command, 33 SET_PRESET command, 38
REC event, 30, 47 SETUP command, 29, 31, 32, 36
REC_ROLLBACK command, 33 Short Message Service object, 51
REC_STOP command, 33 Short Message object, 51
REC_STOP event, 30, 47 SHORT_CIRCUIT event, 48
regedit, 22 SHOW command, 28
Region object, 26 SHOW_INFO_MESSAGE event, 25
REGISTER_ERROR event, 25 sin function, 12
REGISTERED event, 24 sinh function, 12
Relay object, 49 Sleep function, 18
removeBlockEvent function, 58 sqrt function, 12
removeBlockReact function, 58 START command, 42
removeEvent function, 58 START_LISTEN command, 47
removeHandler function, 58 START_LISTEN event, 47
removeReact function, 58 START_VIDEO command, 33
REQUEST_MASK command, 34 STOP command, 38, 42
RESET event, 35, 47 STOP_LISTEN command, 47
resize_win function, 56 STOP_LISTEN event, 47
ResizeTo function, 57 STOP_VIDEO command, 33

www.isscctv.com
SecurOS 69 Programming Guide

Index

str0 function, 13 User account object, 24


str function, 13 User Rights object, 24
straleft function, 14
V
straright function, 14
val function, 13
stratrim function, 15
variables
strcmp function, 14
local and global variables, 10
strempty function, 14
predefined variables, 10
strequal function, 14
Video Capture Device object, 28
strleft function, 15
VOX_OFF event, 47
strlen function, 15
VOX_ON event, 47
strltrim function, 15
strlwr function, 16 W
strmid function, 15 window.external.dispSOCoreProvider object, 55,
strnleft function, 15 56

strnright function, 15 WINDOW event, 27

strreplace function, 14 Z
strright function, 15 Zone Object Detector object, 35
strsub function, 14 Zone object, 29, 30, 34
strupr function, 16 ZOOM_IN command, 38
SYNC_PROTOCOL command, 25 ZOOM_OUT command, 38

T
tan function, 12
tanh function, 12
TASK_ENQUEUED event, 39
TASK_FAILED event, 39
TASK_FINISHED event, 39
TASK_STARTED event, 39
technical support, 6
timcmp function, 14
Time Zone object, 52
TIMEOUT event, 37, 53

U
UNBLINDING event, 30
UNKNOWN event, 35
UNREGISTERED event, 24
UP command, 38

www.isscctv.com
SecurOS 70 Programming Guide

Index

www.isscctv.com

Das könnte Ihnen auch gefallen