SecurOS Programming Guide PDF
SecurOS Programming Guide PDF
SecurOS Programming Guide PDF
Programming Guide
SecurOS Programming Guide (PG - EN, build 64 on 22.09.2015).
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
1 Preface 6
1.1 Scope
........................................................................... 6
1.2 Target
. . . Audience
........................................................................ 6
1.3 Using
. . .This
. . . .Manual
.................................................................... 6
1.4 Getting
. . . .Technical
. . . . . . . . .Support
.............................................................. 6
1.5 SecurOS
. . . . . Editions
. . . . . . . .Naming
. . . . . . .Convention
....................................................... 7
1.6 Design
. . . .Convention
....................................................................... 8
1.7 Design
. . . .Elements
....................................................................... 8
2 VB/JScript Module 9
2.1 General
. . . . Features
....................................................................... 9
2.1.1 Supported
. . . JScript
. . . . . . .and
. . . VBScript
. . . . . . . . Engines
................................................................ 9
2.2 Installing
. . . . . . .Module
. . . . . . .Software
............................................................. 10
www.isscctv.com
SecurOS 4 Programming Guide
Contents
3.3.1.11 GetObjectState.......................................................................... 28
3.3.1.12 GetObjectParam.......................................................................... 28
3.3.1.13 GetObjectParentId
.......................................................................... 28
3.3.1.14 GetObjectParentType
.......................................................................... 29
3.3.1.15 GetObjectIds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.3.1.16 GetObjectChildIds
.......................................................................... 29
3.3.1.17 IsObjectExists. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.3.1.18 IsObjectDisabled
.......................................................................... 29
3.3.1.19 IsObjectState. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.3.2 Script .Object
. . . . . Methods
............................................................................... 30
3.3.2.1 SetTimeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.3.2.2 ClearTimeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.3.2.3 SetInterval .......................................................................... 31
3.3.2.4 ClearInterval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.3.3 Log Object
. . . . .Methods
................................................................................ 31
3.4 Checking
. . . . . . .Script
. . . . . Syntax
............................................................... 32
3.5 Debugging
. . . . . . . .Script
................................................................... 33
3.6 Launching
. . . . . . . .SecurOS
. . . . . . . .in
. .Debug
. . . . . . Mode
................................................... 34
3.7 Script
. . . .Examples
....................................................................... 34
3.7.1 Stopped. . .Vehicles
. . . . . . . Report
........................................................................... 34
3.7.2 Database
. . . Recording
. . . . . . . . . .of. .Recognition
. . . . . . . . . . Results
. . . . . . . for
. . .Wagon
. . . . . . Numbers
............................................ 35
3.7.3 Vehicle. .Speed
. . . . . Measurement
. . . . . . . . . . . . Report
.................................................................. 36
5 Appendixes 43
5.1 Appendix
. . . . . . .A.
. .VB/JScript
. . . . . . . . . .Program
. . . . . . . .Object
. . . . . .Events
.......................................... 43
5.2 Appendix
. . . . . . .B.
. . SecurOS
. . . . . . . . Objects
. . . . . . . Events
. . . . . . .and
. . . .Commands
. . . . . . . . . .Reference
.............................. 43
5.2.1 Core Subsystem
..................................................................................... 43
5.2.1.1 System .......................................................................... 43
5.2.1.2 User account . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.2.1.3 Computer .......................................................................... 44
5.2.1.4 Region .......................................................................... 47
5.2.2 Interface
. . .Subsystem
.................................................................................. 47
5.2.2.1 Desktop .......................................................................... 47
5.2.2.2 Map Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.2.2.3 Event Viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.2.2.4 HTML Form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.2.2.5 HTML Dialog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.2.3 Video Subsystem
..................................................................................... 49
5.2.3.1 Video Capture .Device
......................................................................... 50
5.2.3.2 Camera .......................................................................... 50
5.2.3.3 Zone .......................................................................... 58
5.2.3.4 Light Detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
5.2.3.5 Zone Object Detector
.......................................................................... 59
5.2.3.6 PTZ Device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
5.2.3.7 Archive Converter
.......................................................................... 64
5.2.3.8 Archiver .......................................................................... 67
www.isscctv.com
SecurOS 5 Programming Guide
Contents
Index 92
www.isscctv.com
SecurOS 6 Programming Guide
Preface
1 Preface
This section contains general information about this document, the means of its design and use, as well
as how to get additional technical support for the product.
1.1 Scope
This manual focuses on SecurOS security system programming in VBScript and JScript programming
languages using implemented SecurOS's VB/ JScript program object. A SecurOS' object methods,
available for use in scenarios are described in this manual. It also contains description of the specific
VB/ JScript program object events and events and commands of the SecurOS' subsystem objects.
It is assumed that the user have already deployed the security network physically and installed
SecurOS software on all computers of this network.
If you have any questions after reading this manual, please address them to your system administrator
or supervisor.
For any further information you can contact the Intelligent Security Systems Technical Support Team:
in USA:
phone: +1 732 855 1111 (Monday to Friday, 8:30am - 6pm EST);
e-mail: [email protected]
in Russia:
phone: +7 (495) 645 21 21 (Monday to Thursday, 9am - 6pm MST; Friday 9am - 5pm MST);
e-mail: [email protected]
www.isscctv.com
SecurOS 7 Programming Guide
Preface
in Brazil:
phone: +55 11 2262 2894 (Monday to Friday, 9am - 6pm BRT);
e-mail: [email protected]
in Mexico:
phone: +52 1 551330 0181 (Monday to Friday, 9am - 6pm CDT);
e-mail: [email protected]
in Colombia/Ecuador:
phone: +57 300 442 2808 (Monday to Friday, 9am - 6pm COT/ECT);
e-mail: [email protected]
in Chile:
phone: +56 9 6573 2993 (Monday to Friday, 9am - 6pm CLT);
e-mail: [email protected]
in Ukraine:
phone: +38 (044) 238 24 83 (Monday to Friday, 9am - 6pm EET);
e-mail: [email protected]
in Peru/Bolivia:
phone: +51 997 111 678 (Monday to Friday, 9am - 6pm PET/BOT);
e-mail: [email protected]
in Argentina:
phone: +54 91152528779 (Monday to Friday, 9am - 6pm ART);
e-mail: [email protected]
To solve problems faster, we recommend preparing the service information described in the Technical
Support Information Section before addressing the Technical Support Team.
For product designation regardless of its edition the SecurOS general term is used in the framework of
the given document.
Sections that describe the functionality available for some editions are marked by a special footnote as
in the example below:
www.isscctv.com
SecurOS 8 Programming Guide
Preface
The functionality is available in the following editions: SecurOS Monitoring & Control Center,
SecurOS Enterprise, SecurOS Premium, SecurOS Prof essional, SecurOS Xpress, SecurOS Lite.
Font Description
bold italic type Used to mark out the elements of homogeneous lists.
Used to mark out macro text and programming code, file names and
monospace their paths. Also it is used to specify the necessary options, to mark
out values specified by the user from the keyboard (manually).
Additional Information
Used to display additional information. These type of elements contain, for example, the description of options for
executing a task or reference to additional literature.
www.isscctv.com
SecurOS 9 Programming Guide
VB/JScript Module
2 VB/JScript Module
This section contains general description of the VB/JScript Module.
Before you begin, it is recommended for novice users to get acquainted with the fundamentals of the
language JScript (see https:/ / msdn.microsoft.com/ en-us/ library/ 6974wx4d(v=vs.94).aspx).
VB/JScript Module is designed to work with Microsoft jscript.dll and vbscript.dll libraries of
version 5.8, that are installed by operation systems supported by SecurOS (see SecurOS
Administration Guide).
To learn versions of the libraries installed in your operation system you can use the following scenarios:
function Init()
{
Log.Trace("JScript version: "+ ScriptEngineMajorVersion() + "."
+ ScriptEngineMinorVersion() + "." + ScriptEngineBuildVersion());
}
www.isscctv.com
SecurOS 10 Programming Guide
VB/JScript Module
Sub Init
Log.Trace "VBScript version: "& ScriptEngineMajorVersion() & "."
& ScriptEngineMinorVersion() & "." & ScriptEngineBuildVersion()
End Sub
www.isscctv.com
SecurOS 11 Programming Guide
Working with Module
The Module work is determined by the VB/ JScript program object (see below). The Module object
settings window is a text editor window containing script settings and VBScript or JScript languages
script text. The Module’s configuration consists of selecting a certain time zone so the script runs within
this period of time in the background. If an error occurs during script execution, then the Module
generates an event (see Appendix A. VB/ JScript Program Object Events).
This object has no configurable parameters and is used to group module objects.
To create and configure the VB/ JScript programs object do the following:
1. Enter the administration mode.
2. Select the Computer object in the SecurOS Object Tree, then create a VB/ JScript programs child object.
Set required values in the Parameters of created object window (here and hereinafter is not
presented).
3. Apply new settings.
This object contains the script’s settings interface as well as the programmer developing interface for
scripting.
www.isscctv.com
SecurOS 12 Programming Guide
Working with Module
To create and configure the VB/ JScript program object do the following:
1. Enter administration mode.
2. Select the VB/ JScript programs object in the SecurOS Object Tree, then create the VB/ JScript program
child object. Set required values in the Parameters of created object window (here and hereinafter is
not presented).
3. In the object settings window set object parameters.
4. Create scenario (see Creating and Executing Scripts) and check its correctness (see Checking Script
Syntax).
5. To exit the script configuration window click the Setup button on the administrator toolbar or OK
button in the settings window.
Note. To close settings window with rejecting changes click the Cancel button.
www.isscctv.com
SecurOS 13 Programming Guide
Working with Module
Before you begin, it is recommended for novice users to get acquainted with the fundamentals of the
JScript language (see https:/ / msdn.microsoft.com/ en-us/ library/ 6974wx4d%28v=vs.94%29.aspx).
Scripts are designed to automate working with SecurOS events and objects. They can be used to process
messages and perform various actions within the system.
Depending on assigned task different methods of VB/JScript are invoked. Example below illustrates
scenario, that automatically arms all cameras within the system according to schedule, specified in Time
Zone object settings.
www.isscctv.com
SecurOS 14 Programming Guide
Working with Module
This example shows the basic structure of the program. Init() function is used to initialize scenario
and executes its code immediately after VBJScript program object settings are applied/object is enabled/
SecurOS is started (see Script Initialization and Termination section).
RegisterEventHandler method of the Core object (see Event Handler Functions section) is used to
declare custom event handler function. This function will be called if event, specified by first three
parameters of the method, will occur within the system.
Custom event handler function invokes the Info method of the Log object, that is intended to record
custom information into the log file/debug window (see Logging section). Log object methods help to
monitor correctness of the scenario execution, and also to detect errors when scenario is being created.
DoReact method of the Core object (see Script Special Objectssection) sends specified command to
specified objects within the system Command and object are specified in method parameters. In
example above an arm command is sent to all cameras within the system.
Every VB/JScript scenario can contain the Init() function. This function is called immediately after
scenario is started. Scenario is started in the following cases:
User changed settings or code of the scenario and applied new settings (if Time Zone specified in
scenario settings is active);
When Time Zone, specified in scenario setting, starts;
When SecurOS starts;
Init() function is used to initialize variables and call procedures, required to start working. For
example, in function code one can register event handler functions and timer functions (see sections
Event Handler Functions and Delayed Code Execution).
Note. Script global variables are initialized repeatedly every time the time zone rules are reactivated or after
script settings change.
When scenario is terminated, then all resources, that were used in scenario, are automatically
deallocated:
connections to the databases are closed (ADODB.Connection object);
files are closed (Scripting.FileSystemObject object);
scenario variables are destroyed.
www.isscctv.com
SecurOS 15 Programming Guide
Working with Module
In some cases it is necessary to perform specific actions to terminate scenario. For example, copy or
delete temporary files or record information into the database, etc. In such a cases a Destroy()
method is used, that, if it was defined within scenario code, is call every time before scenario
termination.
Note. Use of Destroy() method in scenario is optional. In most cases all resources will be deallocated
automatically at scenario termination.
SecurOS object events and commands are described below (see Appendix 2. SecurOS Objects Events
and Commands Reference).
Sample scripts for some problem solving scenarios can be found in Script Examples.
Event handler f unction — function, that will be called when some event will occured within SecurOS
system. To register event handler function the RegisterEventHandler method of the Core object
(see Core Object Methods) is used. Event handler function can be defined with several ways
(see Handler Function Definition Methods). The only argument of the handler function is an "Event"
object with the following properties: type (sourceType) and identifier (sourceId) of the SecurOS
object (i.e. source of the processed event), name (action) and all parameters of the SecurOS object
event.
For example, to handle the CAR_IS_OUT_OF_LANES event, received from the SecurOS Auto Module's
Logic module (sourceType=LPR_LOGIC), whose id is 1 (sourceId=1), it is necessary to register the
handler function:
To get event parameter value use the property of the same name of the "Event" object, for example:
function OnCarIsOutOfLanes(f)
{
var value1=f.recognizer_type;
www.isscctv.com
SecurOS 16 Programming Guide
Working with Module
var value2=f.recognizer_id;
var value3=f.recognizer_name;
var value4=f.number;
var value5=f.logic_id;
var value6=f.best_view_time;
}
3.2.2.4 Logging
Logging is performed by the Log object (see Log Object Methods) that output custom messages both
into the log-file of the VB/ JScript program object and debug window of the VB/ JScript program object
settings interface window. Log file is created in the SecurOS root directory in the Logs folder and is
similar to other SecurOS log files. File name is generated automatically in VbjScript.id.log format,
where id — identifier of the appropriate VB/ JScript program object in the SecurOS Object Tree.
Object has some methods to output data into the log file. All these methods are similar and differ only
by log level name (see Log Object Methods):
Trace;
Debug;
Info;
Warn;
Error;
Fatal.
Levels are intended for more convenient and informative data representation in the log file/debug
window.
Debug window is used when it is necessary to get script operation results operatively. When script
settings are changed or object enabled/disabled, then all information, displayed in the debug window,
is deleted.
Besides custom messages, the script syntax errors and run-time errors are output in the debug window.
Note. Debug window displays maximum 300 messages. If this amount of messages is exceeded, the oldest
message is deleted, a new message is placed at the end of the list.
www.isscctv.com
SecurOS 17 Programming Guide
Working with Module
Warning! The information is displayed in the debug window only on the computer that is running the script.
Each SecurOS event has a mandatory and optional parameters. The mandatory parameters are:
sourceType — type of the SecurOS object, that generated event;
sourceId — identifier of the SecurOS object, that generated event;
action — event name.
Note. SecurOS object events are described below (see Appendix 2. SecurOS Objects Events and Commands
Reference). Events of the objects of the intelligent Modules (SecurOS Auto, SecurOS Transit, etc.) are
described in appropriate Manuals.
Object of the SecurOS event is passed into event handler function as a parameter. To get event
parameter value use the property of the same name.
Example below illustrates script, that process an event of motion detection and export a frame, where
moving object, framed with colored rectangle, is displayed.
www.isscctv.com
SecurOS 18 Programming Guide
Working with Module
function Init()
{
// register event handler function to process EVENT
// event generated by any camera within system
Core.RegisterEventHandler("CAM", "*", "EVENT", ExportFrame);
};
// initialize event handler function,
// that returns EVENT event parameter set
function ExportFrame(e)
{
// once EVENT event is generated
// export a frame for appropriate camera by sending
// Image Processor with id 1 an EXPORT command
Core.DoReact("IMAGE_EXPORT", "1", "EXPORT",
// assign "time" parameter of the EXPORT command date and time
// values of EVENT event, cam parameter - identifier of camera,
// for which EVENT event is occurred
"import", "cam$" + e.sourceId + ";time$" + e.date + " " + e.time,
"export_engine", "file",
"export", "filename$" + "Event" + ";dir$c:\\test",
// draw a rectangle frame from TrackingKitII
"export_image", "format$jpg;quality$100","process",e.vizualization);
}
In given example event handler function is used to get the following event parameters and pass them
into frame export command:
e.sourceId — identifier of the Camera object, for which an EVENT event is occurred (assigned cam
parameter of the EXPORT command);
e.date — date of the EVENT event (assigned time parameter of the EXPORT command);
e.time — time of the EVENT event (assigned time parameter of the EXPORT command);
e.vizualization — coordinates of the frame line, that is drawn on the frame by TrackingKit II
Module.
If names of the optional parameters concur with the names of the mandatory parameters, one must use
the "@" prefix to get optional parameter value.
Event: CAM|7|CUSTOM_EVENT|action<move_camera>,sourceId<number_one>,
sourceType<camera_mover>
www.isscctv.com
SecurOS 19 Programming Guide
Working with Module
function onEventHandler(event){
// *** Getting mandatory parameters
// learn type of the event source object
// will assign variable "CAM" value
var objectType = event.sourceType;
// learn identifier of the event source object
// will assign variable "7" value
var objectId = event.sourceId;
// will assign variable "CUSTOM_EVENT" value
var eventName = event.action;
VB/Jscript Module has a methods, that return string array as VBArray object (see https://
msdn.microsoft.com/library/ie/y39d47w8%28v=vs.94%29.aspx/). If JScript programming language is
used to create scenario, such array must be converted into JavaScript array before it can be accessible.
Example below illustrates scenario, that is used to check what system cameras are armed and what are
not. Checking results are output into the log file.
function Init()
{
Core.RegisterEventHandler("MACRO", "1.1", "RUN", CheckArmedCams);
}
function CheckArmedCams() {
// variables to access array elements
var armedCams = [];
var disarmedCams = [];
// record all security system camera identifiers into array
var cams = Core.GetObjectIds("CAM").toArray();
// iterate through an array to search armed cameras
for (var i = 0; i < cams.length; i++) {
if (Core.GetObjectState("CAM", cams[i]) == "ARMED")
armedCams.push(cams[i]);
};
www.isscctv.com
SecurOS 20 Programming Guide
Working with Module
In this example the toArray() method is used to convert initial VBArray array into standard JScript
array. Once array is converted, it can be accessible with JScript programming language means.
In the next procedure camera identifiers of the converted array are looped in for cycle to check camera
state: if camera is armed or disarmed. Then, the push method is used to populate user created array
with camera identifiers. This array later is output into the log file as a message, that contains a list of the
camera identifiers.
To execute some code at specified time-intervals a timer functions are used. Timer function can call
event handler function in the following cases:
at the specified time;
when specified timeout is expired;
in accordance with specified schedule.
To specify code execution conditions the SetTimeout and SetInterval methods of the Script
object (see Execution Delay and Periodical Actions section) are used, and also the
RegisterTimerHandler method of the Core object (see Scheduled Actions).
. . .
function Init(){
Core.RegisterTimerHandler("*","*","23","30","0",OnTimer);
}
. . .
function OnTimer(){
. . .
}
. . .
function OnTimer(), described in example above, will be called every day at 11:30 p.m.
www.isscctv.com
SecurOS 21 Programming Guide
Working with Module
function Init()
{
// arm all cameras command
// is delayed for 1000 ms
Script.SetTimeout('Core.DoReact("CAM","*","ARM");', 1000);
};
Event handler functions (callback-functions) — functions, that are implemented in script body, but are
called by VB/JScript Module when some event is occurred. Event handler functions are passed as a
parameters into the following methods of the Core object:
RegisterEventHandler;
RegisterTimerHandler;
and following methods of the Script object:
SetTimeout;
SetInterval.
The following objects can be used as event handler function:
anonymous function, declared "at place" (example 1);
previously declared function (example 2);
javascript-expression (example 3).
var n = 0;
function Init() {
Script.SetTimeout(function () {
Log.Trace("1. Anonymous event handler function,
declared "at place". n=", ++n);
}, 200);
Script.SetTimeout(callback, 400);
www.isscctv.com
SecurOS 22 Programming Guide
Working with Module
An ActiveXObject object is used to embed ActiveX controls into the SecurOS's scripts. This object is used
to create instances of OLE Automation objects in Internet Explorer on Windows operating systems.
var DBConnection;
var DBRecordset;
function Init()
{
//Create an ActiveX object to conect to DB
DBConnection = new ActiveXObject("ADODB.Connection");
//Specify DB connection string parameters
//(based on custom DSN)
DBConnection.ConnectionString = "DSN=PostDB;UID=postgres;PWD=postgres";
//Open connection using specified connection string parameters
DBConnection.Open();
function OnCarRecognized(e)
{
//Add new record into DB and make it current
DBRecordset.AddNew();
//Add values into specified table fields
DBRecordset.Fields("number") = e.number;
DBRecordset.Fields("country") = e.template_country_name;
//Save changes of the current table record
DBRecordset.Update();
}
SecurOS Auto Module data are received by custom event handler function, which also used to record
information into the database. Standard Microsoft ADODB library is used to connect to the database
and save data into (see https://msdn.microsoft.com/en-us/library/windows/desktop/ms675532%
28v=vs.85%29.aspx).
www.isscctv.com
SecurOS 23 Programming Guide
Working with Module
Note. Detailed description of the Http Event Gate object and custom HTTP-requests is represented in SecurOS
Administration Guide.
function Init()
{
Core.RegisterEventHandler("LPR_CAM", "*", "CAR_LP_RECOGNIZED",
postHttpRequest);
}
function postHttpRequest(e) {
//Create ActiveX object to send XML using HTTP
var HTTP = new ActiveXObject("Msxml2.ServerXMLHTTP.3.0");
//Create XML on the base of event parameters
var XML = "<root><node1>"+e.number+"</node1><node2>"
+e.best_view_date_time+"</node2></root>"
//Open specified url to transmit POST-request
HTTP.open("POST", url, false);
//Send XML
HTTP.send(XML);
//Request an answer
var response = HTTP.responseXML;
Log.Trace(response);
}
SecurOS Auto Module data are received by custom event handler function, which also used to create
XML document. Standard Microsoft ServerXMLHTTP library (see https://msdn.microsoft.com/en-us/
library/ms762278%28v=vs.85%29.aspx) is used to initialize and send HTTP request.
Example below illustrates use of Destroy() function, that contains the following commands
terminating scenario operations (see Script Initialization and Termination section):
recording a message into log file of the VB/ JScript program object using Info() method of the Log
object;
deleting previously created file using DeleteFile() method of the
Scripting.FileSystemObject object.
var fso;
var path = "c:\\test.txt";
www.isscctv.com
SecurOS 24 Programming Guide
Working with Module
function Init() {
//Create an ActiveX object to work with file system
fso = new ActiveXObject("Scripting.FileSystemObject");
// Create file
file = fso.CreateTextFile(path, true);
// Output string into the file
file.WriteLine("This is a test.");
};
function Destroy() {
Log.Info("Script destroying...");
fso.DeleteFile(path);
};
Methods of the Core object accessible from the Module VB/JScript scenarios are described in this
section.
3.3.1.1 RegisterEventHandler
Description: Registers a function to be called when the specified event of the specified object
occurs.
Parameters:
Return value:
www.isscctv.com
SecurOS 25 Programming Guide
Working with Module
Note. "*" value for sourceId, action parameters correspond to all their possible values (identifiers of all
accessible system objects and their events). For example, if "*" value is set for an object identifier then the
handler function will process the given events of all objects with sourceType type.
3.3.1.2 UnregisterEventHandler
Parameters:
3.3.1.3 RegisterTimerHandler
Parameters:
H Hours
M Minutes
S Seconds
Return value:
Note. "*" value for W, D, H, M, S parameters correspond to all their possible values (any date, hour etc.). For
example, if "*" value is set for W parameter then the timer function will be called in any day of a week.
Warning! This method is obsolete, not recommended to use and will be deleted in the next SecurOS releases.
Instead of method use it is recommended to create a schedule with the help of Time Zone object and, further,
subscribe for it events.
www.isscctv.com
SecurOS 26 Programming Guide
Working with Module
3.3.1.4 UnregisterTimerHandler
Parameters:
3.3.1.5 GetSelfId
Syntax: GetSelfId
Parameters: none
Return value:
3.3.1.6 RegisterReact
Description: Registers an action command for the current VB/ JScript program object. Once a
command is registered it become accessible both from within a current script and other scripts and
can be called by using the Core.DoReact method.
Parameters:
Return value:
3.3.1.7 UnregisterReact
www.isscctv.com
SecurOS 27 Programming Guide
Working with Module
Parameters:
3.3.1.8 SendEvent
Description: Send the event with stated values of parameters into SecurOS system on behalf of a
given object.
Parameters:
3.3.1.9 DoReact
Description: Send the SecurOS execution command with given parameters into the SecurOS system
on behalf of a given object.
Parameters:
action Name of the command that is sent to a SecurOS object with type type
param1, param2, . Parameter names (number of parameters is unlimited)
. .
value1, value2, . Values of corresponding parameters
. .
3.3.1.10 GetObjectName
www.isscctv.com
SecurOS 28 Programming Guide
Working with Module
Parameters:
3.3.1.11 GetObjectState
Description: Get the object state on the Map. Returned value type: String.
Parameters:
3.3.1.12 GetObjectParam
Description: Get the object parameter value. Returned value type: String.
Parameters:
3.3.1.13 GetObjectParentId
Description: Get an identifier of the parent object from the given object type and identifier. If
parent parameter is absent then return first level parent object data (the given object is a child
object relative to returned one). Returned value type: String.
Parameters:
www.isscctv.com
SecurOS 29 Programming Guide
Working with Module
3.3.1.14 GetObjectParentType
Description: Get first level parent object type from the given object type (the given object is a child
object relative to returned one). Returned value type: String.
Parameters:
3.3.1.15 GetObjectIds
Description: Get a list of all object identifiers with the given object type. Returned value type:
String array (VBArray object).
Parameters:
3.3.1.16 GetObjectChildIds
Description: Get a list of identifiers of child objects with childtype type related to the given
object. Returned value type: String array (VBArray object).
Parameters:
3.3.1.17 IsObjectExists
Description: Check if the object with the given name exists. Returned value type: Logical.
Parameters:
3.3.1.18 IsObjectDisabled
www.isscctv.com
SecurOS 30 Programming Guide
Working with Module
Parameters:
3.3.1.19 IsObjectState
Description: Check if the object is in the given state. Returned value type: Logical.
Parameters:
Methods of the Script object accessible from the Module VB/JScript scenarios are described in this
section.
3.3.2.1 SetTimeout
Parameters:
3.3.2.2 ClearTimeout
Parameters:
www.isscctv.com
SecurOS 31 Programming Guide
Working with Module
3.3.2.3 SetInterval
Parameters:
3.3.2.4 ClearInterval
Parameters:
Methods of the Log object accessible from the Module scripts are described in this section. Log object
methods are used to output messages, declared within VB/ JScript program program code, into the
Module's log-file (see Logging). Using the methods of the object can improve the convenience of
debugging scripts.
Log.Method_Name(p1[,p2,p3,...]), where:
Error — implements the output of the method parameters into log-file, if log level, specified in the
Log object settings (see Logging), does not exceed Error.
Warn — implements the output of the method parameters into log-file, if log level, specified in the
Log object settings (see Logging), does not exceed Warn.
Info — implements the output of the method parameters into log-file, if log level, specified in the
Log object settings (see Logging), does not exceed Info.
Debug — implements the output of the method parameters into log-file, if log level, specified in the
Log object settings (see Logging), does not exceed Debug.
Fatal — implements the output of the method parameters into log-file, if log level, specified in the
Log object settings (see Logging), is Fatal.
www.isscctv.com
SecurOS 32 Programming Guide
Working with Module
2. In case of an error, the standard message according to the script language will appear in the state line
and the source line of error will be highlighted in red in the script body (see figure 3). To continue
searching for other errors or to make sure there is no more errors, correct the error and repeat the
procedure.
The Module generates events in case of errors during script execution. Module event parameters are
listed in Appendix A. VB/ JScript Program Object Events). To view events, use the SecurOS log when
debug mode is enabled (see Debugging Script) or the Event Viewer window (Event Viewer object).
www.isscctv.com
SecurOS 33 Programming Guide
Working with Module
Note. If parameter does not exist, create it in specified system registry key and assign it value 1.
3. To call debugger to debug SecurOS JScript code select Script checkbox in the Just-In_Time
Debugging tab of the IDE settings window (see Figure 4).
Debugging Script
Debugger is call from within script if script body contains the debugger key word (see Listing 13).
function Init(){
Core.RegisterEventHandler("MACRO","1.3","RUN",function()
{
debugger;
var x = 1;
var y = 0;
var z = x*y;
www.isscctv.com
SecurOS 34 Programming Guide
Working with Module
x = z + 5;
Script.Echo("X =" + x);
});
}
When creating and debugging scripts, it is always handy to track events passed within SecurOS
network.
Now SecurOS is in Debug mode. 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.
Example: To obtain a report regarding vehicle stops occurring on a certain lane of the road based on the
results of the SecurOS Traffic Module.
Listing 14. Script for SecurOS Traffic events export into a plain text file (JScript language)
var file
function Init(){
var fso = new ActiveXObject("Scripting.FileSystemObject");
file = fso.CreateTextFile("C:\\cars.txt", true);
Core.RegisterEventHandler("TRAFFIC_CAM", 3, "STOPPED_VEHICLE",
OnStoppedVehicle);
}
www.isscctv.com
SecurOS 35 Programming Guide
Working with Module
function OnStoppedVehicle(e){
file.Write(e.time);
file.Write("\tSTOPPED VEHICLE\t");
file.Write(e.traffic_name);
file.Write("\t");
file.WriteLine(e.lane_number);
}
function Destroy(){
file.Close();
}
Execution results of this script are stored in the cars.txt file on the C drive.
Example: To record a list of recognized wagon numbers to the existing database based on the results of
the SecurOS Transit Module.
Listing 15. Script for SecurOS Transit Module events export into a database (VBScript language).
Sub Init()
Set DBConnection = CreateObject("ADODB.Connection")
DBConnection.ConnectionString = "DRIVER={PostgreSQL Unicode};" & _
"SERVER=localhost;port=5432;DATABASE=MyDatabase;UID=Me;PWD=MyPassword;"
DBConnection.Open
Set DBRecordset = CreateObject("ADODB.Recordset")
DBRecordset.Open "select * from wagons", DBConnection, 3, 3
Core.RegisterEventHandler "WAGON_RECOGNIZER", 1, "WAGNUM_RECOGN",
"OnWagonRecognized"
End Sub
Sub OnWagonRecognized(e)
DBRecordset.AddNew
DBRecordset.Fields("time") = e.Data_Time
DBRecordset.Fields("train") = e.Train_ID
DBRecordset.Fields("wagon") = e.Recognition_Result
DBRecordset.Update
End Sub
Sub Destroy()
DBRecordset.Close
DBConnection.Close
End Sub
www.isscctv.com
SecurOS 36 Programming Guide
Working with Module
Recognized wagon numbers are contained in the SecurOS Transit Module WAGNUM_RECOGN event
parameters (WAGON_RECOGNIZER object as an event source). Database recording is performed by the
ADODB.RecordSet ActiveX object. ConnectionString property of the ADODB.Connection
ActiveX object contains database connection parameters string. Data saves into the wagons table of the
MyDatabase PostgreSQL database. The following table fields are filled with data: time — recognition
time/date, train — train identifier and wagon — wagon number recognition results.
Note. Before running the script make sure the database exists and is accessible for recording.
Example: To get periodical graphic reports about vehicle speed measurements from the results of the
SecurOS Auto (License Plate Recognition) Module during a certain period of detection.
Listing 16. Script for SecurOS Auto (License Plate Recognition) Module data export into Microsoft Excel
file (VBScript language)
Dim currentLocale
currentLocale = GetLocale
Dim nMaxVelocity
nMaxVelocity = 0
Dim velocities(300,1)
Sub Init()
Core.RegisterTimerHandler "*", "*", "*", "0", "0", "OnTimer"
Core.RegisterEventHandler "LPR_CAM", 1, "CAR_LP_RECOGNIZED", _
"OnCarRecognized"
End Sub
Sub OnCarRecognized(e)
SetLocale("en-gb")
nVelocity = Fix(Abs(CDbl(e.velocity)) + 0.5)
SetLocale(currentLocale)
If nVelocity > 0 Then
velocities(nVelocity,0) = velocities(nVelocity,0) + 1
End If
If nVelocity > nMaxVelocity Then
nMaxVelocity = nVelocity
End If
End Sub
Sub OnTimer()
If nMaxVelocity <> 0 Then
Dim Rng, Wb, App
Set App = CreateObject("Excel.Application")
Directory_For_Writing = "C:\"
Set Wb = App.WorkBooks.Add
Set Rng = Wb.ActiveSheet.Range("A1").Resize(nMaxVelocity, 1)
Rng.Value = velocities
Wb.Charts.Add
Wb.ActiveChart.ChartType = 51
Wb.ActiveChart.SetSourceData Rng, 2
Wb.ActiveChart.Location 1, "Velocity"
App.ActiveWorkBook.SaveAs Directory_For_Writing & _
www.isscctv.com
SecurOS 37 Programming Guide
Working with Module
Execution of the script results in Microsoft Excel file saved on the C disk. Syntax of the file name is the
following: DD.MM.YYYY hh.mm.ss.xls where DD, MM, YYYY stands for the day, month and year, and
hh, mm,ss stands for hour, minute and second of the moment of data saving into the file.
Note. Before running the script, make sure that the SecurOS Auto (License Plate Recognition) Module
calculates moving vehicle speeds correctly (see SecurOS Auto User Guide).
www.isscctv.com
SecurOS 38 Programming Guide
Developing HTML Forms
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.
Function Description
www.isscctv.com
SecurOS 39 Programming Guide
Developing HTML Forms
Function Description
www.isscctv.com
SecurOS 40 Programming Guide
Developing HTML Forms
Method Description
ResizeTo Resize window to specified width and height. Use this function
(Width,Height) instead of external window.resizeTo() function.
System object type constants (OBJ_TYPE) and command identifier constants (COMMAND) as well as
events identifier constants (EVENT_TYPE) are listed in Appendix 2. SecurOS Object Events and
Commands Reference. In the following table, OBJ_ID means identifier (ID) of the given object type
OBJ_TYPE.
Method Description
www.isscctv.com
SecurOS 41 Programming Guide
Developing HTML Forms
Method Description
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 42 Programming Guide
Developing HTML Forms
<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
}
<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 43 Programming Guide
Appendixes
5 Appendixes
The section contains the following Appendixes:
Appendix A. VB/ JScript Program Object Events;
Appendix B. SecurOS Objects Events and Commands Reference.
Parameters:
This section describes the events and actions of core subsystem's objects.
5.2.1.1 System
Warning! When calling command from DoReact method leave ARCHITECT object ID empty.
www.isscctv.com
SecurOS 44 Programming Guide
Appendixes
Parameters:
Name of the saved file. Only file name, not full path, is specified. File is
filename saved in <SecurOS_installation_folder>\Sys_config. Mandatory
parameter
Option that allows to overwrite file when file names are concurrent.
Possible values:
overwrite
0 — do not overwrite file;
1 — overwrite file.
Parameters: none
Parameters: none
Parameters: none
Commands: none.
5.2.1.3 Computer
www.isscctv.com
SecurOS 45 Programming Guide
Appendixes
Description: Connected
Parameters: none
Parameters: none
Parameters: none
Description: Disconnected
Parameters: none
Parameters: none
Parameters: none
Parameters: none
Parameters: none
www.isscctv.com
SecurOS 46 Programming Guide
Appendixes
Parameters: none
Parameters: none
Parameters: none
Parameters: none
Parameters: none
Parameters: none
Parameters::
www.isscctv.com
SecurOS 47 Programming Guide
Appendixes
Parameters: none
5.2.1.4 Region
Parameters: none
Parameters: none
Commands: none.
This section describes the events and actions of interface subsystem's objects.
5.2.2.1 Desktop
Events: none.
www.isscctv.com
SecurOS 48 Programming Guide
Appendixes
Parameters: none
Parameters: none
Events: none.
Description: Jump to the object located on Map — displaying level where object is located and
backlighting object
Parameters:
Parameters:
event_objtype Type of the object that is displayed in the Event Viewer line
event_time Event time saved in the Event Viewer (in HH:MM:SS format)
event_date Event date saved in the Event Viewer (in DD:MM:YY format)
Commands: none.
www.isscctv.com
SecurOS 49 Programming Guide
Appendixes
Events: none.
Parameters: none
Parameters: none
Events: none.
Parameters: none
Parameters: none
This section describes the events and actions of video subsystem's objects.
www.isscctv.com
SecurOS 50 Programming Guide
Appendixes
Events: none.
Description: Change settings of video card. Settings are applied temporarily (until server which is
responsible for that object restarts)
Parameters:
Resolution: 0 — quarter frame (384×288); 1 — half frame (768×288); 2 —
resolution
full frame (768×576)
Parameters:
5.2.3.2 Camera
Description: Camera was armed by the ARM command from a Zone object.
Note. On arming camera by means of a Monitor (the Arm button) all corresponding zones are arming too,
the ARMED event takes place.
www.isscctv.com
SecurOS 51 Programming Guide
Appendixes
Parameters: none
Parameters: none
Parameters: none
Parameters: none
Description: Camera was disarmed by the DISARM command from a Zone object.
Note. On disarming camera by means of a Monitor (the Disarm button) all corresponding zones are
disarming too, the DISARMED event takes place.
Parameters: none
Description: Generated at the moment of motion detection in the frame of the armed camera
Parameters: none
Parameters: none
Parameters: none
www.isscctv.com
SecurOS 52 Programming Guide
Appendixes
Parameters: none
Parameters: none
Parameters: none
Parameters: none
Parameters: none
Parameters: none
Parameters: none
www.isscctv.com
SecurOS 53 Programming Guide
Appendixes
Parameters:
If parameter is not specified when command is sent from the VB/ JScript
program, it is considered that camera is switched to recording mode with
priority of 0.
Parameters:
rollback_time_a Absolute prealarm record time (if empty then the entire buffer is used)
bs
www.isscctv.com
SecurOS 54 Programming Guide
Appendixes
If parameter is not specified when command is sent from the VB/ JScript
program, it is considered that camera is switched to recording mode with
priority of 0.
Parameters:
Description: Remove camera from monitor (temporarily, until Monitor object is recreated)
Parameters: none
Parameters:
www.isscctv.com
SecurOS 55 Programming Guide
Appendixes
compression Compression (0 — no compression, 1 — max quality, . . . , 5 — min quality)
Codec profile's XML file full name (including file name extension). If
codec specified file not exists or specified nothing, then current camera profile
from the server will be used (for example, "codec","mjpeg.xml")
Parameters:
Parameters:
mask Mask
Parameters:
Note. Added subtitles are displayed in the Camera cell both on the Monitor and Media Client.
Parameters:
www.isscctv.com
SecurOS 56 Programming Guide
Appendixes
Text stream identifier. Is used if video stream contains several text streams.
To display given text stream in the Camera cell on the Monitor, specify its
token identifier in the Token parameter of the Monitor object (see SecurOS
(optional) Administration Guide).
Warning! When working with Camera's subtitles displayed on the Media Client
parameter is ignored.
Note. Subtitles are deleted from the Camera cell both on the Monitor and Media Client.
Parameters:
Parameters:
Parameters:
Tour identifier
patrol
Note. If not set the first tour from the camera's tour list is activated.
Parameters: none
www.isscctv.com
SecurOS 57 Programming Guide
Appendixes
Parameters: none
Note. Lens focal distance is changed continuously till FOCUS_STOP command is received.
Parameters: none
Note. Lens focal distance is changed continuously till FOCUS_STOP command is received.
Parameters: none
Parameters: none
Parameters: none
Parameters: none
www.isscctv.com
SecurOS 58 Programming Guide
Appendixes
Parameters: none
Parameters: none
Parameters: none
. . .
DoReact("CAM",CAM_ID,"ADD_SUBTITLES","command<<em><font color=green
face=cursive><font color=red>Alarm!</font><br>Motion detected
inside X area</font></em>>");
. . .
5.2.3.3 Zone
ARM Arm
DISARM Disarm
MD_START Alarm
ARM Arm
DISARM Disarm
www.isscctv.com
SecurOS 59 Programming Guide
Appendixes
LIGHT_ON Light on
Commands: none.
Parameters: none
Parameters: none
Parameters: none
Parameters: none
www.isscctv.com
SecurOS 60 Programming Guide
Appendixes
Parameters:
zone_id Zone ID
Description:
Parameters: none
Description:
Parameters: none
Parameters: none
www.isscctv.com
SecurOS 61 Programming Guide
Appendixes
Description:
Parameters: none
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
www.isscctv.com
SecurOS 62 Programming Guide
Appendixes
Description:
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
Description:
www.isscctv.com
SecurOS 63 Programming Guide
Appendixes
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
www.isscctv.com
SecurOS 64 Programming Guide
Appendixes
Description:
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
Description:
Parameters: none
Parameters:
www.isscctv.com
SecurOS 65 Programming Guide
Appendixes
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
Description: Task not exsists. Event is generated when Archive Converter cannot find the task that is
to be canceled.
Parameters:
www.isscctv.com
SecurOS 66 Programming Guide
Appendixes
Parameters:
channel_id Requested channel ID. Identifier of the camera to convert archive for
(mandatory)
time_start Left edge of the requested time interval (start search time) in DD-
(mandatory) MMYYYY HH:MM:SS.FFF format
time_end Right edge of the requested time interval (stop search time) in DD-
(mandatory) MMYYYY HH:MM:SS.FFF format
operator (optional) Name of the user (operator), who started conversion process
Name of the converted file. Only name (not path) must be specified. If
file_name not set then value specified in the Archive converter object settings will
(optional) be used. When specifying file name template it is possible to use macro
substitutions (see SecurOS Administration Guide)
www.isscctv.com
SecurOS 67 Programming Guide
Appendixes
arch_port Port to communicate with Archiver. Possible value — 901. If not set or
(optional) is incorrect only files from operative archive can be converted
5.2.3.8 Archiver
Events: none.
Parameters:
The beginning of the time interval to archive (if not set then it’s value is
time1 the time of the longterm archive last frame for the camera; if there is no
such archive then the value is 01/01/1901)
The ending of the time interval to archive (if not set, then is the time of the
time2
command coming)
Cameras identifications to archive (if not set then all cameras from
archives settings)
cam_id.x
Note. The command may be without parameters.
Parameters:
Cameras identifications to stop archive (if not set then all cameras from
cam_id.x
archives settings)
www.isscctv.com
SecurOS 68 Programming Guide
Appendixes
5.2.3.9 Monitor
Parameters:
Parameters:
Parameters:
Parameters:
Parameters:
www.isscctv.com
SecurOS 69 Programming Guide
Appendixes
cam Camera ID
Parameters:
Description: Jump to the first frame of the specified video archive file
Parameters:
Description: Jump to the next frame (relative to the current one) of the specified video archive file
Parameters:
Description: Jump to the previous frame (relative to the current one) of the specified video archive
file
Parameters:
www.isscctv.com
SecurOS 70 Programming Guide
Appendixes
Description: Jump to the last frame of the specified video archive file
Parameters:
Description: Jump to the specified by time frame of the video archive file
Parameters:
Parameters:
Parameters:
Description: Export frame of the live video to a file. Supported file types: jpg, png
www.isscctv.com
SecurOS 71 Programming Guide
Appendixes
Parameters:
File name in the specified directory. If full file name is specified, then
file
directory parameter can be dropped
seq_id Query ID. Optional parameter. If was specified, returned in the answer
EXPORTED_FRAME
Parameters:
Possible values:
Events: none.
Description: Jump to the specified time of the specified video archive file
Parameters:
cam Camera ID, which must be set to archive. If not specified, the number of cameras
(optional) that are in archive mode will not change
www.isscctv.com
SecurOS 72 Programming Guide
Appendixes
Parameters:
Parameters:
ID of the camera to activate. After command execution the video page that
cam contains activated camera is displayed. Current layout of the Media Client is not
changed
Parameters: none
Parameters: none
Parameters:
cam Camera ID
Parameters:
www.isscctv.com
SecurOS 73 Programming Guide
Appendixes
cam Camera ID
Parameters:
cam Camera ID
Parameters:
cam Camera ID
Parameters:
The list of camera IDs, separated by a "|" character. Position in the list
corresponds to the number of the cell, where camera will be placed.
seq Note. Cameras are placed into a cells left to right from top to bottom. If the list contains
an empty, incorrectly specified or non-existent camera's identifiers, then cells
corresponding to the positions of such identifiers remain empty.
The list of camera IDs in archive mode, separated by a "," character (comma).
arch
When command is executed, only cameras from previous list are considered
www.isscctv.com
SecurOS 74 Programming Guide
Appendixes
Note. Exported is the frame that is displayed in a camera cell at the moment of command execution.
Parameters: none
Parameters:
pan Panning
tilt Tilting
zoom Zooming
Description: Active camera cell size control: expand to full screen/collaps to previous size
Parameters: none
Parameters: none
Parameters: none
Note. Camera control commands are used only for active camera.
Parameters:
www.isscctv.com
SecurOS 75 Programming Guide
Appendixes
Possible values:
"ADD_SEQUENCE","mode","2x2","seq","1|2|3|4","arch","2,4"
/* Set 2x2 layout and place cameras with ID 1, 2,
/* 3, 4 into cells with according positions, cameras with IDs
/* 2 and 4 are displayed in archive mode
"ADD_SEQUENCE","mode","2x2","seq","1|||2"
/* Set 2x2 layout and place cameras with ID 1, 2
/* into the first and the last cells. Cells 2 and 3 are empty
www.isscctv.com
SecurOS 76 Programming Guide
Appendixes
Description: Task queue of the Image Processor is overloaded. A new tasks are not queued until
queue is underloaded (see TASK_QUEUE_UNDERLOADED notification below)
Parameters: none
Parameters: none
Parameters:
request_
id Query ID
Parameters:
request_
id Request ID specified in the image export query
Parameters:
www.isscctv.com
SecurOS 77 Programming Guide
Appendixes
time — date and time of the frame. May be specified in one of the
following formats:
DD-MM-YY HH:MM:SS.XXX;
YYYY-MM-DD HH:MM:SS.XXX.
import
Note. Milliseconds are optional (any number of characters).
Frame search is performed within one second interval to the left and right
from specified time. A frame that is closest to the specified time is exported.
For example, if specified time is 10:56:02 (or 10:56:02.xxx), then
system will search frame within 10:56:02.000 (10:56:02.xxx) -
10:56:02.999 interval.
If there is no frame within search interval for the specified camera archive on
the given video server, then command fails.
Export parameters.
filename — name of the saved file. File name extension is optional. If not
specified or set incorrect, system automatically changes extension
depending of the type of original file (see export_image parameter);
dir — full path to the file. You can define both existing and created
directory.
export
Note. Result file must be stored on the logical disks (or available network disks)
of that Video Server, where given Image Processor object is created.
www.isscctv.com
SecurOS 78 Programming Guide
Appendixes
format — format of the saved file. Possible values: jpeg, jpg, png.
Default value — jpg;
export_image
(optional) quality — image quality. Possible values: [-1; 0 — 100]. Default
value is -1, that correspond to the quality, specified inside used image
export library.
Note. The higher a parameter value, the better image quality and greater file size.
color — color of the figure to be drawn. A name or code of the color (in
RGB format, see http://www.w3.org/TR/SVG/
types.html#ColorKeywords) must be specified. Default value is green;
Note. If linear dimensions of the specified rectangle exceed image size, then
exceeding part of the rectangle is cropped.
process default — set default values for the color and penwidth parameters;
(optional)
font:N — font size (in pixels);
www.isscctv.com
SecurOS 79 Programming Guide
Appendixes
Notes:
1. If the input string contains a ";" character (semicolon), all text must be
screened with "$. . .$" characters, for example, "$one;two$".
2. If string length or font size exceeds frame size, only part of the inscription
that fits frame size is drawn.
3. The collection of fonts and languages depends on installed operation
system.
Warning! You can specify random number of the image processing parameters
inside the same export command. Specified parameters are processed sequentially,
i.e. each following specified parameter is applied to the image, that is a result of
execution of the command with previous specified parameter.
Width of area to be added is set equal to the width of the resulting image.
Height of area to be added is set automatically and depends on length of
initial string.
caption
Notes:
1. If length of a source string is greater than the width of the image, the
system automatically flows text to the next line "by words". If a single
word does not fit on one line, the system truncates the word characters for
the width of the image.
2. In the original text string it is allowed to use tab and carriage return
characters (for example, for VB/JScript these are "\t" and "\n",
accordingly). This can be applied to the Modules and third-party
integrations.
function Init(){
Core.RegisterEventHandler("MACRO","1.3","RUN",OnMacroEx);
}
function OnMacroEx(){
Core.DoReact("IMAGE_EXPORT","1","EXPORT","import","cam$1;
time$2015-02-06 09:36:36.000","export_engine","file","export",
www.isscctv.com
SecurOS 80 Programming Guide
Appendixes
"filename$ex_frame;dir$C:\\EXPORTED_FRAMES_EXAMPLE","export_image",
"format$png;quality$70","process","rect:10,10,30,40;color:255,0,0;
rect:5,5,20,20;color:blue;rect15,15,20,20;default;penwidth:5;
rect25,25,20.5,20;crop:0,0,50,55.5");
}
/* C:\EXPORTED_FRAMES_EXAMPLE\ex_frame.png
file is created as a result of command execution */
/* Rectangles are drawn above the image (coordinates are in %
/* of initial image size):
/* green 10,10,30,40, red 5,5,20,20, blue 15,15,20,20
/* drawn with line width 3,
/* green 25,25,20.5,20 drawn with line width 5.
/* Then the image is cropped
Events: none
Parameters: none
This section describes the events and actions of audio subsystem's objects.
5.2.4.1 Microphone
Parameters: none
www.isscctv.com
SecurOS 81 Programming Guide
Appendixes
Parameters: none
Parameters: none
Parameters: none
Parameters: none
Parameters: none
Parameters: none
Parameters: none
www.isscctv.com
SecurOS 82 Programming Guide
Appendixes
Parameters: none
Parameters: none
Parameters: none
Parameters: none
Parameters: none
This section describes the events and actions of i/o subsystem's objects.
5.2.5.1 Sensor
www.isscctv.com
SecurOS 83 Programming Guide
Appendixes
Parameters: none
Description: Armed
Parameters: none
Parameters: none
Description: Disarmed
Parameters: none
Parameters: none
Description: Open
Parameters: none
Parameters: none
Parameters: none
www.isscctv.com
SecurOS 84 Programming Guide
Appendixes
Description: Sabotage
Parameters: none
www.isscctv.com
SecurOS 85 Programming Guide
Appendixes
Description: Setup (change) sensor parameters. Settings are applied temporarily (until server
which is responsible for that object restarts)
Parameters:
Parameters:
Description: Arm
Parameters: none
Parameters: none
Description: Disarm
Parameters: none
5.2.5.2 Relay
www.isscctv.com
SecurOS 86 Programming Guide
Appendixes
Parameters: none
Event identifier: ON
Description: Relay on
Parameters: none
Description: Change settings of relay. Settings are applied temporarily (until server which is
responsible for that object restarts)
Parameters:
Parameters: none
Command identifier: ON
Parameters: none
Parameters:
www.isscctv.com
SecurOS 87 Programming Guide
Appendixes
This section describes the events and actions of notification subsystem's objects.
Parameters: none
Parameters: none
Parameters:
param_name_1, Arbitrary variables of the message, specified in the Subject and/or Message
param_name_2, ... f ield. Optional parameters
, param_name_N
Parameters: none
www.isscctv.com
SecurOS 88 Programming Guide
Appendixes
Parameters: none
Parameters: none
Events: none.
Parameters:
Path to WAV file (with extension) relative to SecurOS folder (e. g. file<
file
\wav\cam_alarm_1.wav>)
This section describes the events and actions of automation subsystem's objects.
www.isscctv.com
SecurOS 89 Programming Guide
Appendixes
Parameters: none
Parameters: none
Commands: none.
5.2.7.2 Macro
Parameters: none
Parameters: none
5.2.7.3 CellBox
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.
Description: Timeout occurred: the CellBox object is not filled within given time frame
www.isscctv.com
SecurOS 90 Programming Guide
Appendixes
Parameters: none
Parameters:
Commands: none.
Current section contains service information that is necessary on addressing to Intelligent Security
Systems Technical Support.
Note. Collected data have to be send by e-mail on Intelligent Security Systems Technical Support e-mail
address (see Getting Technical Support).
www.isscctv.com
SecurOS 91 Programming Guide
Appendixes
Note. Equipment Dallas code can be found by the ISS Hardware Report utility (see SecurOS Administration
Guide for detailed information about utility).
(*) name and version of the installed Intelligent Security Systems company software.
video capture cards driver version.
total number of video servers, remote administrator and monitoring (operator) workstations in the
system;
operating system (name and service pack version).
9. Another useful information, if possible. For example:
computer equipment configuration.
central processors load.
main and virtual memory used volumes.
network load.
network and network neighborhood configuration.
www.isscctv.com
SecurOS 92 Programming Guide
Index
AUTOPAN_END_P command, 60
AUTOPAN_START command, 60
AUTOPAN_START_P command, 61
AUTOPAN_STOP command, 61
Index B
BLINDING event, 51
_
_system.js file, 38 C
CAM_ADDED event, 68
A CAM_MODE command, 71
ABSENT event, 59 CAM_REMOVED event, 68
ACTIVATE command, Camera object, 50
Desktop, 47 CARD_DUPLICATED event, 44
ACTIVATE event, CellBox object, 89
Time Zone, 88 CLEAR_PRESET command, 61
ACTIVATE_CAM command, 72 ClearInterval function, 31
ACTIVATE_CAM event, 68 ClearTimeout function, 30
ACTIVATE_OBJECT event, 48 Computer object, 44
ADD_SEQUENCE command, CONFIRM command, 85
Media Client, 73 CONFIRM event, 83
Monitor, 70 CONN_OVERLOAD event, 45
ALARM event, 82 CONNECT_ONE command, 46
ARCH_CONVERT_CMD_FAILED event, 64 CONNECT_OTHER command, 46
ARCH_EXPORT command, 66 CONNECTED event, 44
ARCH_EXPORT_CMD_FAILED event, 64
ARCH_FRAME_FIRST command, 69 D
ARCH_FRAME_LAST command, 70
D2OFF command, 61
ARCH_FRAME_NEXT command, 69
D2ON command, 61
ARCH_FRAME_POSITION command, 70
DB_OVERLOAD event, 45
ARCH_FRAME_PREV command, 69
DEACTIVATE command,
ARCH_FRAME_TIME command, 68
Desktop, 48
ARCH_FRAME_TIME_ANY command, 69
DEACTIVATE event,
ARCH_FRAME_TIME_EXACT command, 70
Time Zone, 89
Archive Converter object, 64
Debugging Your Scripts, 34
Archiver object, 67
DEFOCUSED event, 52
ARM command,
DELETE command, 54
Camera, 52 Desktop object, 47
Microphone, 81 DETACH event, 51
Sensor, 85 DISABLE_RAY command, 85
Zone, 58 DISABLE_RELE command, 86
ARM event,
DISARM command,
Microphone, 80
Camera, 52
Region, 47
Microphone, 81
Sensor, 83
Sensor, 85
Zone, 58
Zone, 58
ARMED event, 50
DISARM event,
ATTACH event, 51
Microphone, 80
Audible Notification Service object, 88
Region, 47
Audio Player object, 82
Sensor, 83
AUTOFOCUS_ON command, 60
Zone, 58
www.isscctv.com
SecurOS 93 Programming Guide
Index
DISARMED event, 51
DISCONNECT_ONE command, 46 I
DISCONNECTED event, 45
ICoreMsg object, 41
DoReact, function, 27
Image Processor object, 75
DOWN command, 61
IMsgFilter object, 40
INIT command,
E Relay, 86
Edge Storage Sync object, 80 Sensor, 85
E-mail Message object, 87 IRIS_AUTO_MODE command, 58
ERROR event, IRIS_CLOSE command, 57, 62
VB/JScript program, 43 IRIS_OPEN command, 57, 62
Event handlers functions, 15 IRIS_STOP command, 58, 62
Event Viewer object, 48 IsObjectDisabled, function, 29
EXPORT command, 76 IsObjectExists, function, 29
EXPORT_DONE event, 76 IsObjectState, function, 30
EXPORT_FAILED event, 76
EXPORT_FRAME command, 70 J
EXPORT_FRAME_FROM_ACTIVE_CAM command,
JOYSTICK command, 74
73
EXPORTED_FRAME event, 68
K
F KEY_PRESSED command, 71, 74
FILLEDUP event, 90
FIND_OBJECT command,
L
Map Window, 48 LEFT command, 62
FOCUS_AUTO_MODE command, 57 LEFT_DOWN command, 62
FOCUS_IN command, 57, 61 LEFT_UP command, 63
FOCUS_OUT command, 57, 62 Light Detector object, 59
FOCUS_STOP command, 57, 62 LIGHT_OFF event, 59
FOCUSED event, 52 LIGHT_ON event, 59
G M
GetObjectChildIds, function, 29 Macro object, 89
GetObjectIds, function, 29 Map Window object, 48
GetObjectName, function, 27 MAXIMIZE_OR_RESTORE command, 74
GetObjectParam, function, 28 MD_START event,
GetObjectParentId, function, 28 Camera, 51
GetObjectParentType, function, 29 Zone, 58
GetObjectState, function, 28 MD_STOP event,
GetSelfId, function, 26 Camera, 51
GO_PRESET command, 62 Zone, 58
Media Client object, 71
H Microphone object, 80
HIDE command,
HTML Dialog, 49
N
HTML Form, 49 NEXT_FRAME command, 72
HOME command, 56 NEXT_RECORD command, 73
HTML Dialog object, 49 NORM event, 83
HTML Form object, 49 NOT_VALID_STATE event, 83
www.isscctv.com
SecurOS 94 Programming Guide
Index
RIGHT_DOWN command, 63
O RIGHT_UP command, 63
RUN command,
OFF command, 86
OFF event, 85 Macro, 89
RUN event,
ON command, 86
ON event, 86 Macro, 89
OPEN event, 83
S
P SABOTAGE event, 84
SAVE_CONFIG command, 43
PATROL_LEARN command, 63
SEEK command, 71
PATROL_PLAY command, 56, 63
SEND command,
PATROL_STOP command, 57, 63
PLAY command, 72 E-mail Message, 87
SEND event,
PLAY_WAV command, 88
PRESENT event, 59 Short Message, 88
SEND_ERROR event,
PRESET_RECALL command, 56
PREV_FRAME command, 72 E-mail Message, 87
PREV_RECORD command, 73 Short Message, 87
SendEvent, function, 27
PROGRAM event, 45
Sensor object, 82
PROTOCOL_RCVD event, 45
SENT event,
PTZ Device object, 60
E-mail Message, 87
Q Short Message, 88
SET_DRIVERS command, 50
QUEUE_CRITICAL event, 45 SET_MUX command, 55
QUEUE_NORMAL event, 45 SET_PRESET command, 63
QUEUE_WARNING event, 46 SetInterval function, 31
SetTimeout function, 30
R SETUP command,
REC command, 52 Video Capture Device, 50
REC event, Zone Object Detector, 59
Camera, 51 Short Message object, 87
Microphone, 81 SHORT_CIRCUIT event, 83
REC_ERROR event, SHOW command,
Camera, 52 HTML Dialog, 49
REC_ROLLBACK command, 53 HTML Form, 49
REC_STOP command, 54 SHOW_INFO_MESSAGE command, 46
REC_STOP event, SHOW_INFO_MESSAGE event, 46
Camera, 52 START command, 67
Microphone, 81 START_LISTEN command, 82
Region object, 47 START_LISTEN event, 82
REGISTER_ERROR event, 46 START_VIDEO command,
REGISTERED event, 44 Camera, 54
RegisterEventHandler, function, 24 STOP command,
RegisterReact, function, 26 Archiver, 67
RegisterTimerHandler, function, 25 Media Client, 72
Relay object, 85 PTZ Device, 64
REQUEST_MASK command, 55 STOP_LISTEN command, 82
RESET event, STOP_LISTEN event, 82
Microphone, 81 STOP_VIDEO command, 55
Zone Object Detector, 59 SWITCH_ALL_CAMERAS_TO_LIVE command, 74
RIGHT command, 63 SWITCH_PAGE_TO_ARCHIVE command, 74
www.isscctv.com
SecurOS 95 Programming Guide
Index
SYNC_NOW command,
Edge Storage Sync, 80
SYNC_PROTOCOL command, 47
System object, 43
T
TASK_ENQUEUED event, 65
TASK_FAILED event, 65
TASK_FINISHED event, 65
TASK_NOT_EXISTS event, 65
TASK_QUEUE_OVERLOADED event, 75
TASK_QUEUE_UNDERLOADED event, 76
TASK_STARTED event, 65
technical support,
how to get, 6
how to prepare service information, 90
Time Zone object, 88
TIMEOUT event,
CellBox, 89
PTZ Device, 60
Timer functions, 20
U
UNBLINDING event, 52
UNKNOWN event, 59
UNREGISTERED event, 44
UnregisterEventHandler, function, 25
UnregisterReact, function, 26
UnregisterTimerHandler, function, 26
UP command, 64
User account object, 44
V
VB/JScript program object description, 11
Video Capture Device object, 50
VOX_OFF event, 81
VOX_ON event, 81
W
window.external.dispSOCoreProvider object, 39
Z
Zone object, 58
Zone Object Detector object, 59
ZOOM_IN command, 64
ZOOM_OUT command, 64
www.isscctv.com