Beruflich Dokumente
Kultur Dokumente
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
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
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.
www.isscctv.com
SecurOS 7 Programming Guide
Introduction
For any further information you can contact our Technical Support Team:
• phone in USA:
• phone in Brazil:
• phone in Chile:
• phone in Russia:
+7 (495) 645 21 21 (Monday to Thursday, 9am – 6pm MST; Friday, 9am – 5pm MST)
• e-mail:
Note: To solve problems faster, we recommend preparing service information described in SecurOS
Administration Guide
• 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.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).
www.isscctv.com
SecurOS 10 Programming Guide
Scripting
y = 2;
y = 2;
y = str(y + 1); // y now equals ‘3’, because we used numeric values here
o = SomeStringExpectingFuction("1"); // OK
n = 1;
= Assignment operator m = 3;
www.isscctv.com
SecurOS 11 Programming Guide
Scripting
www.isscctv.com
SecurOS 12 Programming Guide
Scripting
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
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
www.isscctv.com
SecurOS 13 Programming Guide
Scripting
www.isscctv.com
SecurOS 14 Programming Guide
Scripting
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
www.isscctv.com
SecurOS 15 Programming Guide
Scripting
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
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
www.isscctv.com
SecurOS 17 Programming Guide
Scripting
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
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
www.isscctv.com
SecurOS 19 Programming Guide
Scripting
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>,..."])
www.isscctv.com
SecurOS 20 Programming Guide
Scripting
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:
X, Y — reserved.
OnTime(W,D,X,Y,H,C,S)
H — hour.
C — minutes.
S — seconds.
www.isscctv.com
SecurOS 21 Programming Guide
Scripting
Procedure Description
Performed on a specified event of the object within entire SecurOS
network. Parameter placeholders are:
www.isscctv.com
SecurOS 22 Programming Guide
Scripting
1. Shutdown SecurOS.
2. Launch the system utility for registry editing (type regedit in Start → Run box).
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:
2. Restart SecurOS.
www.isscctv.com
SecurOS 24 Programming Guide
Objects Reference
2. Objects Reference
2.1 Core Subsystem
2.1.2 Department
Object type identifier: DEPARTMENT.
Events: none.
Commands: none.
Commands: none.
www.isscctv.com
SecurOS 25 Programming Guide
Objects Reference
Commands: none.
2.1.6 Computer
Object type identifier: SLAVE.
CONNECTED Connected
Core connection
CONN_OVERLOAD (alarm)
blocked
www.isscctv.com
SecurOS 26 Programming Guide
Objects Reference
2.1.10 Region
Object type identifier: REGION.
Commands: none.
2.2.1 Screen
Object type identifier: DISPLAY.
www.isscctv.com
SecurOS 27 Programming Guide
Objects Reference
Events: none.
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.
Commands: none.
www.isscctv.com
SecurOS 28 Programming Guide
Objects Reference
www.isscctv.com
SecurOS 29 Programming Guide
Objects Reference
2.3.2 Camera
Object type identifier: CAM.
www.isscctv.com
SecurOS 30 Programming Guide
Objects Reference
Name used in
Event Identifier Description
macros
www.isscctv.com
SecurOS 31 Programming Guide
Objects Reference
compression — compression (0 — no
compression, 1 — max quality,
. . . , 5 — min quality)
www.isscctv.com
SecurOS 32 Programming Guide
Objects Reference
Name used in
Command Identifier Description
map/macros
www.isscctv.com
SecurOS 33 Programming Guide
Objects Reference
Name used in
Command Identifier Description
map/macros
Begin recording. Parameter:
REC Start record hot_rec_time — hot record time, s.
www.isscctv.com
SecurOS 34 Programming Guide
Objects Reference
Name used in
Command Identifier Description
map/macros
Parameter:
REQUEST_MASK mask — mask
2.3.3 Zone
Object type identifier: CAM_ZONE.
ARM Arm
DISARM Disarm
MD_START Alarm
ARM Arm
DISARM Disarm
LIGHT_ON Light on
(continued on next page)
www.isscctv.com
SecurOS 35 Programming Guide
Objects Reference
Name used in
Event Identifier Description
macros
Commands: none.
www.isscctv.com
SecurOS 36 Programming Guide
Objects Reference
zone_id — zone ID
SETUP (beginning)
frames — number of frames for initial
scene building stage
www.isscctv.com
SecurOS 37 Programming Guide
Objects Reference
AUTOFOCUS_ON Autofocus on
Autopan end point
AUTOPAN_END_P Assign end position
set
D2ON Superdynamic on
FOCUS_IN Focus on
GO_PRESET Go to preset
www.isscctv.com
SecurOS 38 Programming Guide
Objects Reference
Name used in
Command Identifier Description
map/macros
LEFT_DOWN Down-left
LEFT_UP Up-left
RIGHT_UP Up-right
UP (arm) Up
ZOOM_IN Zoom +
ZOOM_OUT Zoom –
www.isscctv.com
SecurOS 39 Programming Guide
Objects Reference
Name used in
Event Identifier Description
macros
Convert parameters list is incorrect. Pa-
rameters:
www.isscctv.com
SecurOS 40 Programming Guide
Objects Reference
www.isscctv.com
SecurOS 41 Programming Guide
Objects Reference
Name used in
Command Identifier Description
map/macros
www.isscctv.com
SecurOS 42 Programming Guide
Objects Reference
2.3.10 Archiver
Object type identifier: ARCHIVER.
Events: none.
Commands: none.
www.isscctv.com
SecurOS 43 Programming Guide
Objects Reference
2.3.12 Monitor
Object type identifier: MONITOR.
cam — camera ID
ARCH_FRAME_TIME
time — time in DD-MM-YY
HH:MM:SS:FFF format
www.isscctv.com
SecurOS 44 Programming Guide
Objects Reference
Name used in
Command Identifier Description
map/macros
Exports archive frame in JPEG file. Pa-
rameters:
www.isscctv.com
SecurOS 45 Programming Guide
Objects Reference
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
www.isscctv.com
SecurOS 46 Programming Guide
Objects Reference
Name used in
Command Identifier Description
map/macros
Export frame of the live video to a file.
Supported file types: jpg, png. Param-
eters:
2.4.2 Microphone
Object type identifier: AUDIO_LINE.
www.isscctv.com
SecurOS 47 Programming Guide
Objects Reference
Name used in
Event Identifier Description
macros
www.isscctv.com
SecurOS 48 Programming Guide
Objects Reference
2.4.4 Intercom
Object type identifier: INTERCOM.
Events: none.
Commands: none.
2.5.1 Sensor
Object type identifier: GRAY.
ALARM Alarm
ARM Arm
CONFIRM Confirm
DISARM Disarm
OPEN Open
NORM Normal
NOT_VALID_STATE
SABOTAGE Sabotage
www.isscctv.com
SecurOS 49 Programming Guide
Objects Reference
ARM Arm
CONFIRM Confirm
DISARM Disarm
Disable sensor object. Parameter:
2.5.2 Relay
Object type identifier: GRELE.
ON Relay on Relay on
www.isscctv.com
SecurOS 50 Programming Guide
Objects Reference
www.isscctv.com
SecurOS 51 Programming Guide
Objects Reference
www.isscctv.com
SecurOS 52 Programming Guide
Objects Reference
Commands: none.
2.7.2 Macro
Object type identifier: MACRO.
www.isscctv.com
SecurOS 53 Programming Guide
Objects Reference
2.7.3 Program
Object type identifier: PROGRAM.
Commands: none.
2.7.4 CellBox
Object type identifier: CELLBOX.
www.isscctv.com
SecurOS 54 Programming Guide
Objects Reference
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.
• 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.
www.isscctv.com
SecurOS 56 Programming Guide
HTML Forms
www.isscctv.com
SecurOS 57 Programming Guide
HTML Forms
www.isscctv.com
SecurOS 58 Programming Guide
HTML Forms
Method Description
removeHandler
Removes the previously created handler
(FunctionName)
www.isscctv.com
SecurOS 59 Programming Guide
HTML Forms
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
<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
}
<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
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
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.
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.
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
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
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.
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
www.isscctv.com
SecurOS 67 Programming Guide
Index
www.isscctv.com
SecurOS 68 Programming Guide
Index
www.isscctv.com
SecurOS 69 Programming Guide
Index
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