programming guide - en.iss.ru · 3 securos programming guide contents contents 1 preface 7 1.1...
TRANSCRIPT
Programming Guide
Version 10
SecurOS Programming Guide (PG - EN, build 122 on 24.04.2020).
© Copyright Intelligent Security Systems, 2020.
Printed in US.
Intelligent Security Systems reserves the right to make changes to both this Manual and to the products it describes. Systemspecifications are subject to change without notice. Nothing contained within this Manual is intended as any offer, warranty, promiseor 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 orcomputer language in any form by any means without the express written permission of the copyright holder. Unauthorized copyingof this publication may not only infringe copyright but also reduce the ability of Intelligent Security Systems to provide accurate andup-to-date information to both users and operators.
3
www.issivs.com
Programming GuideSecurOS
Contents
Contents
1 Preface 7
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.1 Scope
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.2 Target Audience
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.3 Using This Manual
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.4 Getting Technical Support
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.5 SecurOS Editions Naming Convention
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.6 Design Convention
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101.7 Design Elements
2 VB/JScript Module 11
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.1 General Features
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.1.1 Supported JScript and VBScript Engines
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.2 Installing Module Software
3 Working with Module 13
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.1 Module Configuration and Interface
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.1.1 Module Working Principles
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.1.2 Creating and Configuring VB/JScript programs object
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133.1.3 Creating and Configuring VB/JScript program object
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.2 Creating and Executing Scripts
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.2.1 JScript Fundamentals for Novice Users
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.2.2 How Does Script Work
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163.2.2.1 Script Initialization and Termination
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.2.2.2 Script Special Objects
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.2.2.3 Event Handler Functions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183.2.2.4 Logging
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203.2.3 Working with Event Parameters
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.2.3.1 Specifics of Event Parameters Processing
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.2.4 Working with Arrays
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223.2.5 Delayed Code Execution
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.2.5.1 Scheduled Actions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.2.5.2 Execution Delay and Periodical Actions
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.2.6 Handler Function Definition Methods
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243.2.7 Working with ActiveX
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243.2.7.1 Recording Data into Database
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253.2.7.2 Sending HTTP Request
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.2.8 Destroy() Function
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263.3 SecurOS Object Methods
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273.3.1 Core Object Methods
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273.3.1.1 RegisterObjectHandler
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273.3.1.2 UnregisterObjectHandler
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273.3.1.3 RegisterEventHandler
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283.3.1.4 UnregisterEventHandler
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283.3.1.5 RegisterTimerHandler
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293.3.1.6 UnregisterTimerHandler
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293.3.1.7 GetSelfId
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293.3.1.8 RegisterReact
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293.3.1.9 UnregisterReact
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303.3.1.10 SendEvent
4
www.issivs.com
Programming GuideSecurOS
Contents
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303.3.1.10.1 Use the comment Parameter to Visualize Events
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313.3.1.11 DoReact
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313.3.1.12 GetObjectName
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 313.3.1.13 GetObjectState
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323.3.1.14 GetObjectParam
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323.3.1.15 GetObjectParentId
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323.3.1.16 GetObjectParentType
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323.3.1.17 GetObjectIds
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333.3.1.18 GetObjectChildIds
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333.3.1.19 IsObjectExists
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333.3.1.20 IsObjectDisabled
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333.3.1.21 IsObjectState
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.3.2 Script Object Methods
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.3.2.1 SetTimeout
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.3.2.2 ClearTimeout
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.3.2.3 SetInterval
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.3.2.4 ClearInterval
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353.3.3 Log Object Methods
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353.4 Checking Script Syntax
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363.5 Debugging Script
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383.6 Script Examples
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383.6.1 Stopped Vehicles Report
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383.6.2 Database Recording of Recognition Results for Wagon Numbers
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393.6.3 Vehicle Speed Measurement Report
4 Developing HTML Forms and HTML Dialogs 41
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414.1 Setting up HTML Forms within SecurOS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 414.2 _system.js File
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424.3 window.external.dispSOCoreProvider Object
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434.4 IMsgFilter Object Type
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444.5 ICoreMsg Object Type
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444.6 ISScustomAPI Object Type
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454.6.1 onSetup
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454.6.2 sendEvent
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 454.6.3 sendReact
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464.7 Sample HTML Form
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504.8 Sample HTML Dialog
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554.9 Sample HTML5 FrontEnd Form
5 Appendix A. VB/JScript Program Object Events 58
6 Appendix B. SecurOS Objects Events and Commands Reference 59
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596.1 Core Subsystem
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596.1.1 System
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596.1.2 User account
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 616.1.3 Computer
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 646.1.4 External Application
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656.2 Interface Subsystem
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656.2.1 Desktop
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 656.2.2 Map Window
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666.2.3 Event Viewer
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666.2.4 HTML Form
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666.2.5 HTML Dialog
5
www.issivs.com
Programming GuideSecurOS
Contents
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676.3 Video Subsystem
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676.3.1 Camera
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 676.3.1.1 Events
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686.3.1.1.1 ARMED
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686.3.1.1.2 ATTACH
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686.3.1.1.3 BLINDING
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686.3.1.1.4 DEFOCUSED
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686.3.1.1.5 DETACH
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696.3.1.1.6 DISARMED
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696.3.1.1.7 FOCUSED
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696.3.1.1.8 LIGHT_OFF_COMPLETED
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696.3.1.1.9 LIGHT_ON_COMPLETED
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696.3.1.1.10 MD_START
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696.3.1.1.11 MD_STOP
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706.3.1.1.12 PTZ_STATUS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 706.3.1.1.13 REC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716.3.1.1.14 REC_ERROR
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716.3.1.1.15 REC_STOP
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716.3.1.1.16 SPEAKER_STATE_ACQUIRED
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716.3.1.1.17 SPEAKER_STATE_READY
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 716.3.1.1.18 TELEMETRY_BUSY
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726.3.1.1.19 TELEMETRY_RELEASED
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 726.3.1.1.20 UNBLINDING
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736.3.1.1.21 VCA_EVENT
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 736.3.1.2 Commands
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746.3.1.2.1 Working with video
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746.3.1.2.1.1 ADD_SUBTITLES
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 746.3.1.2.1.2 ARM
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 756.3.1.2.1.3 CLEAR_SUBTITLES
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 756.3.1.2.1.4 DISARM
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 756.3.1.2.1.5 REC
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 766.3.1.2.1.6 REC_ROLLBACK
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 776.3.1.2.1.7 REC_STOP
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 776.3.1.2.1.8 REQUEST_MASK
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786.3.1.2.1.9 SET_MUX
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786.3.1.2.1.10 START_VIDEO
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786.3.1.2.1.11 STOP_VIDEO
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786.3.1.2.2 Controlling focal length of the camera
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796.3.1.2.2.1 FOCUS_AUTO_MODE
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796.3.1.2.2.2 FOCUS_AUTO_MODE_DISABLE
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796.3.1.2.2.3 FOCUS_IN
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 796.3.1.2.2.4 FOCUS_OUT
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806.3.1.2.2.5 FOCUS_STOP
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806.3.1.2.3 Controlling iris of the camera
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806.3.1.2.3.1 IRIS_AUTO_MODE
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 806.3.1.2.3.2 IRIS_CLOSE
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816.3.1.2.3.3 IRIS_OPEN
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816.3.1.2.3.4 IRIS_STOP
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 816.3.1.2.4 Controlling PTZ of the camera
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826.3.1.2.4.1 AREAZOOM
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826.3.1.2.4.2 CENTER
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826.3.1.2.4.3 HORIZONTAL_STOP
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 826.3.1.2.4.4 MOVE
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 836.3.1.2.4.5 MOVE_ABS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 836.3.1.2.4.6 MOVE_STOP
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 836.3.1.2.4.7 VERTICAL_STOP
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 846.3.1.2.5 Working with Presets and Tours
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 846.3.1.2.5.1 CREATE_PRESET
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 846.3.1.2.5.2 HOME
6
www.issivs.com
Programming GuideSecurOS
Contents
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 846.3.1.2.5.3 PATROL_PLAY
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856.3.1.2.5.4 PATROL_REMOVE
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856.3.1.2.5.5 PATROL_STOP
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 856.3.1.2.5.6 PRESET_RECALL
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 866.3.1.2.5.7 REMOVE_PRESET
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 866.3.1.2.5.8 RENAME_PRESET
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 866.3.1.2.5.9 UPDATE_PRESET
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 866.3.1.2.6 Telemetry device state
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 866.3.1.2.6.1 GET_PTZ_STATUS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 876.3.1.2.6.2 REQUEST_PTZ
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 876.3.1.2.6.3 TELEMETRY_ACQUIRE
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 876.3.1.2.6.4 TELEMETRY_RELEASE
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 876.3.1.2.7 Controlling additional camera's devices
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 886.3.1.2.7.1 LIGHT_OFF
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 886.3.1.2.7.2 LIGHT_ON
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 886.3.1.2.7.3 WIPER
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 886.3.1.2.7.4 WASHING
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 886.3.1.3 Working with Subtitles
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 906.3.2 Zone
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 916.3.3 Light Detector
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 916.3.4 Archive Converter
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 946.3.5 Archiver
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 976.3.6 Media Client
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1046.3.7 Image Processor
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1096.3.8 Edge Storage Sync
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1096.3.9 Video Wall Controller
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1096.4 Audio Subsystem
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1096.4.1 Microphone
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1116.5 I/O Subsystem
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1116.5.1 Sensor
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1136.5.2 Relay
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1146.6 Notification Subsystem
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1146.6.1 E-mail Message
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1156.6.2 Short Message
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1166.6.3 Audible Notification Service
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1166.6.4 Emergency service
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1176.7 Automation Subsystem
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1176.7.1 Schedule
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1176.7.2 Macro
7 Technical Support Information 119
Index 121
7
www.issivs.com
Programming GuideSecurOS
Preface
1 Preface
This section contains general information about this document, the means of its design and use, as wellas how to get additional technical support for the product.
1.1 Scope
This manual focuses on SecurOS security system programming in VBScript and JScript programminglanguages 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 specificVB/ 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 installedSecurOS software on all computers of this network.
1.2 Target Audience
We have designed this guide particularly for SecurOS programmers. It is assumed the user has practicalexperience with TCP/IP networking, VBScript/JScript programming and general CCTV knowledgeand overview.
1.3 Using This Manual
This document is organized as a book, so the user can print it or use the electronic version. In the lattercase one can use the Adobe Reader’s Bookmarks feature as well as cross-reference hyperlinks tonavigate through content. In several topics this manual refers to other SecurOS manuals (SecurOSAdministration Guide etc.). One can find these manuals as separate files on the SecurOS installationCD or download them from our website (www.issivs.com).
1.4 Getting Technical Support
If you have any questions after reading this manual, please address them to your system administratoror supervisor.
For any further information you can contact the Intelligent Security Systems Technical Support Team:
Note. To get a quick response to a request use the Technical Support Portal, which www address is listedbelow.
in USA:
phone: +1 732 855 1111 (Monday to Friday, 8:30am - 6pm EST);
e-mail: [email protected]
www: https:/ / support.issivs.com
8
www.issivs.com
Programming GuideSecurOS
Preface
in Russia:
phone: +7 (495) 645 21 21 (Monday to Thursday, 9am - 6pm MST; Friday 9am - 5pm MST);
www: https:/ /help.iss.ru
Note. See the https:/ / help.iss.ru/ user/ manual for the Portal User Guide.
in Brazil:
phone: +55 11 2262 2894 (Monday to Friday, 9am - 6pm BRT);
e-mail: [email protected]
www: https:/ / support.issivs.com
in Mexico:
phone: +52 1 551330 0181 (Monday to Friday, 9am - 6pm CDT);
e-mail: [email protected]
www: https:/ / support.issivs.com
in Colombia/Ecuador:
phone: +57 300 442 2808 (Monday to Friday, 9am - 6pm COT/ECT);
e-mail: [email protected]
www: https:/ / support.issivs.com
in Chile:
phone: +56 9 6573 2993 (Monday to Friday, 9am - 6pm CLT);
e-mail: [email protected]
www: https:/ / support.issivs.com
in Ukraine:
phone: +380 (44) 299 08 10 (Monday to Friday, 9am - 6pm EET);
e-mail: [email protected]
www: https:/ / support.issivs.com
in Peru/Bolivia:
phone: +51 997 111 678 (Monday to Friday, 9am - 6pm PET/BOT);
e-mail: [email protected]
www: https:/ / support.issivs.com
in Argentina:
phone: +54 91152528779 (Monday to Friday, 9am - 6pm ART);
e-mail: [email protected]
www: https:/ / support.issivs.com
To solve problems faster, we recommend preparing the service information described in the TechnicalSupport Information Section before addressing the Technical Support Team.
9
www.issivs.com
Programming GuideSecurOS
Preface
1.5 SecurOS Editions Naming Convention
This document represents a common manual for several editions of the "SecurOS integrated videomanagement platform" that differ in functional capabilities:
SecurOS Monitoring & Control Center;
SecurOS Enterprise;
SecurOS Premium;
SecurOS Prof essional;
SecurOS Xpress;
SecurOS Lite.
For product designation regardless of its edition the SecurOS general term is used in the framework ofthe given document.
Sections that describe the functionality available for some editions are marked by a special footnote asin the example below:
The functionality is available in the following editions: SecurOS Monitoring & Control Center,SecurOS Enterprise, SecurOS Premium, SecurOS Prof essional, SecurOS Xpress, SecurOS Lite.
1.6 Design Convention
For representation of various terms and titles the following fonts and formatting tools are used in thisdocument.
Font Description
bold typeUsed in writing workstation names, utilities or screens, windowsand dialog boxes as well as the names of their elements (GUIelements).
italic type Used to mark out the SecurOS objects.
bold italic type Used to mark out the elements of homogeneous lists.
monospaceUsed to mark out macro text and programming code, file names andtheir paths. Also it is used to specify the necessary options, to markout values specified by the user from the keyboard (manually).
greenUsed to mark out the cross-references within the document andlinks to the external available ones.
10
www.issivs.com
Programming GuideSecurOS
Preface
1.7 Design Elements
Warning! Serves to alert the user to information which is necessary for the correct perception of the text setout below. Typically, this information has a warning character.
Note. Note text in topic body.
Additional InformationUsed to display additional information. These type of elements contain, for example, the description of options forexecuting a task or reference to additional literature.
11
www.issivs.com
Programming GuideSecurOS
VB/JScript Module
2 VB/JScript Module
This section contains general description of the VB/JScript Module.
2.1 General Features
The VB/JScript Module (Module below) is intended for composition and functional configuration ofVBScript and JScript scripts within the SecurOS system.Module provides:
SecurOS event processing;
SecurOS object control;
SecurOS object configuration control means;
ActiveX components usage, including:
File system operations.
Database communication.
Sending HTTP requests etc.
User-friendly environment for working with scripts (developer’s studio).
For details on scenario programming languages see:
VBScript — VBScript Language Reference (http:/ /msdn.microsoft.com/en-us/ library/d1wf56tt.aspx)
JScript — JScript Language Reference (http:/ /msdn.microsoft.com/en-us/ library/yek4tbz0(VS.85).aspx)
Before you begin, it is recommended for novice users to get acquainted with the fundamentals of thelanguage JScript (see https:/ /msdn.microsoft.com/en-us/ library/6974wx4d(v=vs.94).aspx).
2.1.1 Supported JScript and VBScript Engines
VB/JScript Module is designed to work with Microsoft jscript.dll and vbscript.dll libraries ofversion 5.8, that are installed by operation systems supported by SecurOS (see SecurOSAdministration Guide).
To learn versions of the libraries installed in your operation system you can use the following scenarios:
Listing 1. Getting jscript.dll library version (JScript language)
function Init(){ Log.Trace("JScript version: "+ ScriptEngineMajorVersion() + "."
+ ScriptEngineMinorVersion() + "." + ScriptEngineBuildVersion());}
12
www.issivs.com
Programming GuideSecurOS
VB/JScript Module
Listing 2. Getting vbscript.dll library version (VBScript language)
Sub Init Log.Trace "VBScript version: "& ScriptEngineMajorVersion() & "."
& ScriptEngineMinorVersion() & "." & ScriptEngineBuildVersion()End Sub
2.2 Installing Module Software
Module software is installed automatically when installing SecurOS system software.
13
www.issivs.com
Programming GuideSecurOS
Working with Module
3 Working with Module
This section describes the procedures for configuring and working with the Module.
3.1 Module Configuration and Interface
This section provides a description of the Module interface and Module settings.
3.1.1 Module Working Principles
The Module work is determined by the VB/ JScript program object (see below). The Module objectsettings window is a text editor window containing script settings and VBScript or JScript languagesscript text. Configuring Module lies in selecting the Schedule to execute scenario in background. If anerror occurs during script execution, then the Module generates an event (see Appendix A. VB/ JScriptProgram Object Events).
3.1.2 Creating and Configuring VB/JScript programs object
This object has no configurable parameters and is used to group module objects.
Parent object — Computer/Integration and Automation group.
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. Create a VB/ JScript programs child object inIntegration and Automation group. Set required values in the Parameters of created object window(here and hereinafter is not presented).
3. Apply new settings.
3.1.3 Creating and Configuring VB/JScript program object
This object contains the script’s settings interface as well as the programmer developing interface forscripting.
Parent object — Computer/Integration and Automation group/VB/ JScript programs.
14
www.issivs.com
Programming GuideSecurOS
Working with Module
Figure 1. VB/ JScript program object settings window
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 programchild object. Set required values in the Parameters of created object window (here and hereinafter isnot presented).
3. In the object settings window set object parameters.
4. Create scenario (see Creating and Executing Scripts) and check its correctness (see Checking ScriptSyntax).
5. To exit the script configuration window click the Setup button on the administrator toolbar or OKbutton in the settings window.
Note. To close settings window with rejecting changes click the Cancel button.
15
www.issivs.com
Programming GuideSecurOS
Working with Module
3.2 Creating and Executing Scripts
All standard objects, functions and methods of the VBScript/JScript languages can be used within theModule scripts (see JavaScript Reference web-site to get detailed information).
To create a script and configure its execution do the following:
1. Create a VB/ JScript program object. Designate it by the future script name, as the object will containscript text.
2. Choose the script language (VBScript or JScript).
3. Type the script text within the Module window. Check script syntax, if necessary (see Checkingscripts).
4. Select Schedule from the list. Scenario executes only in accordance with selected Schedule.
3.2.1 JScript Fundamentals for Novice Users
Before you begin, it is recommended for novice users to get acquainted with the fundamentals of theJScript language (see https:/ /msdn.microsoft.com/en-us/ library/6974wx4d%28v=vs.94%29.aspx).
3.2.2 How Does Script Work
Scripts are designed to automate working with SecurOS events and objects. They can be used to processmessages and perform various actions within the system.
Depending on assigned task different methods of VB/JScript are invoked. Example below illustratesscenario, that automatically arms one of the cameras within the system according to schedule, specifiedin Schedule object settings.
Listing 3. Elemental JScript scenario
// initialize JScript scenariofunction Init(){
// register event handler function for// Schedule object with id=1.1 activation eventCore.RegisterEventHandler("TIME_ZONE", "1.1", "ACTIVATE",ArmCamera);
};// initialize event handler functionfunction ArmCamera(e){
// when schedule activation event occurs// save "Schedule activated." string into log fileLog.Info("Schedule activated.");// when schedule activation event occurs// arm Camera with ID 1Core.DoReact("CAM", "1", "ARM");
}
This example shows the basic structure of the program. Init() function is used to initialize scenarioand executes its code immediately after VBJScript program object settings are applied/object is enabled/SecurOS is started (see Script Initialization and Termination section).
16
www.issivs.com
Programming GuideSecurOS
Working with Module
RegisterEventHandler method of the Core object (see Event Handler Functions section) is used todeclare custom event handler function. This function will be called if event, specified by first threeparameters of the method, will occur within the system.
Custom event handler function invokes the Info method of the Log object, that is intended to recordcustom information into the log file/debug window (see Logging section). Log object methods help tomonitor 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 tospecified objects within the system Command and object are specified in method parameters. Inexample above an arm command is sent to the camera with ID 1.
3.2.2.1 Script Initialization and Termination
Standard Init() and Destroy() functions can be used in script texts.
Every VB/JScript scenario can contain the Init() function. This function is called immediately afterscenario is started. Scenario is started in the following cases:
User changed settings or code of the scenario and applied new settings (if Schedule specified inscenario settings is active);
When Schedule, specified in scenario setting, starts;
When SecurOS starts;
Init() function is used to initialize variables and call procedures, required to start working. Forexample, in function code one can register event handler functions and timer functions (see sectionsEvent Handler Functions and Delayed Code Execution).
Note. Script global variables are initialized repeatedly every time the schedule rules are reactivated or afterscript settings change.
Scenario terminates in the following cases:
User changed settings or code of the scenario and applied new settings. Before scenario will berestarted with new settings, scenario with old settings will be terminated;
Schedule selected for scenario ended;
Scenario is stopped when user temporarily disabled VB/ JScript program object with the Disablecommand (see SecurOS Administration Guide);
The VB/ JScript program object is deleted from the SecurOS Object Tree.
When scenario is terminated, then all resources, that were used in scenario, are automaticallydeallocated:
connections to the databases are closed (ADODB.Connection object);
files are closed (Scripting.FileSystemObject object);
scenario variables are destroyed.
In some cases it is necessary to perform specific actions to terminate scenario. For example, copy ordelete 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 scenariotermination.
17
www.issivs.com
Programming GuideSecurOS
Working with Module
Note. Use of Destroy() method in scenario is optional. In most cases all resources will be deallocated
automatically at scenario termination.
3.2.2.2 Script Special Objects
The following special objects can be used in scenario code:
Core — has a methods to execute the following operations (see Core Object Methods section):
receive information about SecurOS objects;
execute commands, predefined for the SecurOS objects;
subscribe for SecurOS object events;
configure task scheduler.
Script — has an additional methods used in scenarios (see Script Object Methods section).
Log — has a methods to output messages into the Module log file (see Log Object Methods section).
SecurOS object events and commands are described below (see Appendix 2. SecurOS Objects Eventsand Commands Reference).Sample scripts for some problem solving scenarios can be found in Script Examples.
3.2.2.3 Event Handler Functions
Event handler f unction — function, that will be called when some event will occured within SecurOSsystem. 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 SecurOSobject (i.e. source of the processed event), name (action) and all parameters of the SecurOS objectevent.
For example, to handle the CAR_IS_OUT_OF_LANES event, received from the SecurOS Auto Module'sLogic module (sourceType=LPR_LOGIC), whose id is 1 (sourceId=1), it is necessary to register thehandler function:
Core.RegisterEventHandler ("LPR_LOGIC", 1, "CAR_IS_OUT_OF_LANES",OnCarIsOutOfLanes);
where OnCarIsOutOfLanes — handler function of the CAR_IS_OUT_OF_LANES event (see SecurOSAuto User Guide).
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;var value2=f.recognizer_id;var value3=f.recognizer_name;var value4=f.number;var value5=f.logic_id;
18
www.issivs.com
Programming GuideSecurOS
Working with Module
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 bothinto the log-file of the VB/ JScript program object and debug window of the VB/ JScript program objectsettings interface window. Similarly to other SecurOS log files, this log file is created in the ISS\Logsfolder, path to which is defined by the %ProgramData% environment variable. File name is generatedautomatically in VbjScript.id.log format, where id — identifier of the appropriate VB/ JScriptprogram object in the SecurOS Object Tree.
Object has some methods to output data into the log file. All these methods are similar and differ onlyby 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/debugwindow.
Debug window is used when it is necessary to get script operation results operatively. When scriptsettings 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.
Example of the information displayed in the debug window is illustrated in Figure 2.
19
www.issivs.com
Programming GuideSecurOS
Working with Module
Figure 2. Output information in debug window
Warning! The information is displayed in the debug window only on the computer that is running the script.
In case if there are too many messages printing into log file, some of them may not be displayed indebug window. There will be a "break" displayed instead (see figure 3). Thus every single message willbe written into log file.
Figure 3. Missing messages in debug window
20
www.issivs.com
Programming GuideSecurOS
Working with Module
3.2.3 Working with Event Parameters
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. With RegisterObjectHandler method a handler for events with names CREATED (object created),
UPDATED (object changed) and DELETED (object deleted) can be registered.
Set of an optional parameters is defined by type of the SecurOS object.
Note. SecurOS object events are described below (see Appendix 2. SecurOS Objects Events and CommandsReference). Events of the objects of the intelligent Modules (SecurOS Auto, SecurOS Transit, etc.) aredescribed in appropriate Manuals.
Object of the SecurOS event is passed into event handler function as a parameter. To get eventparameter value use the property of the same name.
Example below illustrates script, that process an event of motion detection and export a frame, wheremoving object, framed with colored rectangle, is displayed.
Listing 4. Working with event parameters (JScript language)
function Init(){
// register event handler function to process EVENT// event generated by any camera within systemCore.RegisterEventHandler("CAM", "*", "EVENT", ExportFrame);
};// initialize event handler function,// that returns EVENT event parameter setfunction ExportFrame(e){
// once EVENT event is generated// export a frame for appropriate camera by sending// Image Processor with id 1 an EXPORT commandCore.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 theminto frame export command:
e.sourceId — identifier of the Camera object, for which an EVENT event is occurred (assigned camparameter of the EXPORT command);
21
www.issivs.com
Programming GuideSecurOS
Working with Module
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 IIModule.
3.2.3.1 Specifics of Event Parameters Processing
Normally, to get an object property (i.e. event parameter) the event.property_name syntax is used.However, if the property name includes "." (dot) character, then the property name should be enclosedin square brackets: event.[property_name] when using VBScript or event["property_name"] when using JScript.
If names of the optional parameters concur with the names of the mandatory parameters, one must usethe "@" prefix to get optional parameter value.
For example, if the following event appeared within the system:
Event: CAM|7|CUSTOM_EVENT|action<move_camera>,sourceId<number_one>,sourceType<camera_mover>
then to get it parameters you can use the following way:
Listing 5. Getting mandatory and optional event parameters
function onEventHandler(event){// *** Getting mandatory parameters// learn type of the event source object// will assign variable "CAM" valuevar objectType = event.sourceType;// learn identifier of the event source object// will assign variable "7" valuevar objectId = event.sourceId;// will assign variable "CUSTOM_EVENT" valuevar eventName = event.action;
// *** Getting optional parameters
// will assign variable "move_camera" valuevar actionFromEvent = event["@action"];// will assign variable "camera_mover" valuevar sourceTypeFromEvent = event["@sourceType"];// will assign variable "number_one" valuevar sourceIdFromEvent = event["@sourceId"];
}
3.2.4 Working with Arrays
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 isused 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 arenot. Checking results are output into the log file.
22
www.issivs.com
Programming GuideSecurOS
Working with Module
Listing 6. Working with arrays
function Init(){
Core.RegisterEventHandler("MACRO", "1.1", "RUN", CheckArmedCams);}
function CheckArmedCams() {// variables to access array elementsvar armedCams = [];var disarmedCams = [];// record all security system camera identifiers into arrayvar cams = Core.GetObjectIds("CAM").toArray();// iterate through an array to search armed camerasfor (var i = 0; i < cams.length; i++) {
if (Core.GetObjectState("CAM", cams[i]) == "ARMED")armedCams.push(cams[i]);
};
// iterate through an array in other way to search disarmed camerasfor (var cam in cams) {
if (Core.GetObjectState("CAM", cam) != "ARMED")disarmedCams.push(cam);
};
// output identifiers of armed cameras into log fileLog.Info("Armed cams: " + armedCams);// output identifiers of disarmed cameras into log fileLog.Info("Disarmed cams: " + disarmedCams);
}
In this example the toArray() method is used to convert initial VBArray array into standard JScriptarray. 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 camerastate: if camera is armed or disarmed. Then, the push method is used to populate user created arraywith camera identifiers. This array later is output into the log file as a message, that contains a list of thecamera identifiers.
3.2.5 Delayed Code Execution
To execute some code at specified time-intervals a timer functions are used. Timer function can callevent 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 Scriptobject (see Execution Delay and Periodical Actions section) are used, and also theRegisterTimerHandler method of the Core object (see Scheduled Actions).
23
www.issivs.com
Programming GuideSecurOS
Working with Module
3.2.5.1 Scheduled Actions
Timer function, that is called in accordance with specified schedule, is registered with theRegisterTimerHandler method of the Core object. The timer function programming code is placed intothe script main text. The timer function has no arguments.
Listing 7. 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.
3.2.5.2 Execution Delay and Periodical Actions
Script object methods call timer function after a specified once (see SetTimeout) or regularly(see SetInterval).
Listing 8. Delayed code execution
function Init(){
// arm camera with ID 1 command// is delayed for 1000 msScript.SetTimeout('Core.DoReact("CAM","1","ARM");', 1000);
};
In given example execution of the Core.DoReact("CAM","1","ARM") expression will be started in1000 ms after scenario starts.
3.2.6 Handler Function Definition Methods
Event handler functions (callback-functions) — functions, that are implemented in script body, but arecalled by VB/JScript Module when some event is occurred. Event handler functions are passed as aparameters into the following methods of the Core object:
RegisterObjectHandler;
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);
24
www.issivs.com
Programming GuideSecurOS
Working with Module
previously declared function (example 2);
javascript-expression (example 3).
Listing 9. Types of the event handler functions
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);
Script.SetTimeout("Log.Trace('3. Event handler function, represented by expression. n=', ++n)", 600);
}function callback() { Log.Trace("2. Calling previously declared
event handler function. n=", ++n);}
3.2.7 Working with ActiveX
An ActiveXObject object is used to embed ActiveX controls into the SecurOS's scripts. This object is usedto create instances of OLE Automation objects in Internet Explorer on Windows operating systems.
Note. For more information about ActiveXObject object see https://msdn.microsoft.com/library/ie/7sw4ddf8%28v=vs.94%29.aspx/.
3.2.7.1 Recording Data into Database
Example below illustrates how to record into the SecurOS database the vehicle license plate andcountry code, recognized by SecurOS Auto Module.
Listing 10. Recording into database
var DBConnection;var DBRecordset;function Init(){
//Create an ActiveX object to conect to DBDBConnection = 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 parametersDBConnection.Open();
//Create an ActiveX object to work with DBDBRecordset = new ActiveXObject("ADODB.Recordset");
25
www.issivs.com
Programming GuideSecurOS
Working with Module
//Open DB table for edit,//using DBConnectionDBRecordset.Open('select * from "table"', DBConnection, 3, 3); Core.RegisterEventHandler("LPR_CAM", "*", "CAR_LP_RECOGNIZED",OnCarRecognized);
}
function OnCarRecognized(e){
//Add new record into DB and make it currentDBRecordset.AddNew();//Add values into specified table fieldsDBRecordset.Fields("number") = e.number;DBRecordset.Fields("country") = e.template_country_name;//Save changes of the current table recordDBRecordset.Update();
}
SecurOS Auto Module data are received by custom event handler function, which also used to recordinformation into the database. Standard Microsoft ADODB library is used to connect to the databaseand save data into (see https://msdn.microsoft.com/en-us/library/windows/desktop/ms675532%28v=vs.85%29.aspx).
3.2.7.2 Sending HTTP Request
Example below illustrates sending streaming data into SecurOS. HTTP POST-request is used to senddata. Request body contains xml-file, that contains recognized vehicle license plate accompanied withdate and time of it best viewing, defined by SecurOS Auto Module. Data transferring into SecurOS isprovided by Http Event Gate object.
Note. Detailed description of the Http Event Gate object and custom HTTP-requests is represented in SecurOSAdministration Guide.
Listing 11. Sending HTTP-request
var url = "http://127.0.0.1:9050/event?id=777";
function Init(){
Core.RegisterEventHandler("LPR_CAM", "*", "CAR_LP_RECOGNIZED",postHttpRequest);
}
function postHttpRequest(e) {//Create ActiveX object to send XML using HTTPvar HTTP = new ActiveXObject("Msxml2.ServerXMLHTTP.3.0");//Create XML on the base of event parametersvar XML = "<root><node1>"+e.number+"</node1><node2>"+e.best_view_date_time+"</node2></root>"//Open specified url to transmit POST-requestHTTP.open("POST", url, false);//Send XMLHTTP.send(XML);//Request an answervar response = HTTP.responseXML;
26
www.issivs.com
Programming GuideSecurOS
Working with Module
Log.Trace(response);}
SecurOS Auto Module data are received by custom event handler function, which also used to createXML 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.
3.2.8 Destroy() Function
Example below illustrates use of Destroy() function, that contains the following commandsterminating 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 Logobject;
deleting previously created file using DeleteFile() method of theScripting.FileSystemObject object.
Listing 12. Using Destroy function
var fso;var path = "c:\\test.txt";function Init() {
//Create an ActiveX object to work with file systemfso = new ActiveXObject("Scripting.FileSystemObject");// Create filefile = fso.CreateTextFile(path, true);// Output string into the file
file.WriteLine("This is a test.");};
function Destroy() {Log.Info("Script destroying...");
fso.DeleteFile(path);};
Note. For more information about FileSystemObject object see https://msdn.microsoft.com/en-us/
library/aa242706%28v=vs.60%29.aspx.
3.3 SecurOS Object Methods
Methods of the SecurOS object accessible from the Module VB/JScript scenarios are described in thissection:
Core Object Methods;
Script Object Methods;
Log Object Methods.
27
www.issivs.com
Programming GuideSecurOS
Working with Module
3.3.1 Core Object Methods
Methods of the Core object accessible from the Module VB/JScript scenarios are described in thissection.
3.3.1.1 RegisterObjectHandler
Syntax: RegisterObjectHandler (sourceType, handler)
Description: Registers function that is being called when creating/deleting/updating objects ofspecified type.
Parameters:
sourceType SecurOS object type identifier
handler
Event handler function name.
Warning! A handler function has a single argument, that describes event
parameter set (see Working with Event Parameters).
3.3.1.2 UnregisterObjectHandler
Syntax: UnregisterObjectHandler (sourceType)
Description: Cancels subscription for events of creating/deleting/updating objects of specifiedtype.
Parameters:
sourceType Object type identifier.
3.3.1.3 RegisterEventHandler
Syntax: RegisterEventHandler (sourceType, sourceId, action, handler)
Description: Registers a function to be called when the specified event of the specified objectoccurs.
Parameters:
sourceType SecurOS object type identifier
sourceId SecurOS object identifier (number) with type type
action SecurOS event name with type type
handler
Event handler function name.
Warning! A handler function has a single argument, that describes event
parameter set (see Working with Event Parameters).
Return value:
28
www.issivs.com
Programming GuideSecurOS
Working with Module
Event identifier. Is used in UnregisterEventHandler method to cancelevent subscription.
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.4 UnregisterEventHandler
Syntax: UnregisterEventHandler (id)
Description: Cancels an event subscription specified by id identifier returned by theRegisterEventHandler function.
Parameters:
id Event identifier, returned by the RegisterEventHandler function.
3.3.1.5 RegisterTimerHandler
Syntax: RegisterTimerHandler (W, D, H, M, S, handler)
Description: Registers a schedule to call the handler function.
Parameters:
W Day of a week (0 — Monday,. . . , 6 — Sunday)
D Data with format DD-MM-YYYY
H Hours
M Minutes
S Seconds
handler Timer function name
Return value:
Schedule identifier. Is used in UnregisterTimerHandler method to cancelfunction call by schedule.
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 deprecated, not recommended to use and will be deleted in the next SecurOSreleases. Instead of method use it is recommended to create a schedule with the help of Schedule object and,further, subscribe for it events.
29
www.issivs.com
Programming GuideSecurOS
Working with Module
3.3.1.6 UnregisterTimerHandler
Syntax: UnregisterTimerHandler (id)
Description: Cancels an function call by schedule, specified by id identifier returned by theRegisterTimerHandler function.
Parameters:
id Schedule identifier, returned by the RegisterTimerHandler function.
3.3.1.7 GetSelfId
Syntax: GetSelfId
Description: Returns identifier of the current VB/ JScript program object.
Parameters: none
Return value:
Identifier of the current VB/ JScript program object in the SecurOS.
3.3.1.8 RegisterReact
Syntax: RegisterReact (action,handler)
Description: Registers an action command for the current VB/ JScript program object. Once acommand is registered it become accessible both from within a current script and other scripts andcan be called by using the Core.DoReact method.
Parameters:
action Command name
handler
Name of the event handler function to process an action command, thatwill be called if request to perform specified command will generated.
Warning! A handler function has a single argument, that describes command
parameter set similarly to event parameters set (see Working with EventParameters).
Return value:
Command identifier. Is used in UnregisterReact method to cancel thecommand registration.
3.3.1.9 UnregisterReact
Syntax: UnregisterReact (id)
30
www.issivs.com
Programming GuideSecurOS
Working with Module
Description: Cancels an command subscription specified by id identifier returned by theRegisterReact function.
Parameters:
id Command identifier, returned by the RegisterReact function.
3.3.1.10 SendEvent
Syntax: SendEvent (type, id, event[, param1, value1[, param2, value2[,. . .]]])
Description: Send the event with stated values of parameters into SecurOS system on behalf of agiven object.
Parameters:
type SecurOS object type identifier
id SecurOS object identifier (number) with type type
event SecurOS event name with type type
param1, param2, .. .
The event event parameter names (number of parameters is unlimited)
value1, value2, .. .
Values of corresponding parameters
3.3.1.10.1 Use the comment Parameter to Visualize Events
Any event can contain a special parameter — comment. When an event contains this parameter thenthe operator has additional capabilities to process such event. In different cases the parameter is addedinto the event parameter list either automatically, when the conditions specified in the code arefulfilled, or as a result of execution of the Macro or the VB/ JScript program, where this parameter isspecified in the object settings or is declared in the SendEvent method.
The list of possible values depends on the sending method and the type of parameter, which can getone of two values:
Text. In this case the value is a simple text, that is displayed in the comment window of the EventViewer (see SecurOS Quick User Guide).
Structure in JSON format that may contain the following parameters:
comment — comment to event. Displayed in the Event Viewer comment window (see SecurOSQuick User Guide).
visualization — set of parameters in the format of Image Processor module command. It isused to highlight a region of interest on the single video frame associated with analytics event inMedia Client when jumping from the Event Viewer.
Note. The Time stamp of the video frame must be equal to the time of the event. Otherwise visualizationframe won't be displayed in Media Client.
31
www.issivs.com
Programming GuideSecurOS
Working with Module
description — event description displayed in Event Viewer (Description field). If not set, thenthe standard description specified within the system is displayed.
cam_id — ID of the Camera object. Is used to link a Camera and an event. If the parameter ispresent in the event then an operator can open event video in Media Client from Event Viewer inthe same way, as if the event was sent from the Camera object. This parameter has higher prioritythan the CAM_ID parameter, specified in the event header.
cams — is used instead of cam_id parameter to link several Cameras and an event. If theparameter is present in the event then an operator can open event video from all specifiedCameras simultaneously in Media Client from Event Viewer in the same way, as if the event wassent by one of the Camera objects. Is specified in the {"cams": "id1,id2, . . .,idN"}format.
3.3.1.11 DoReact
Syntax: DoReact (type, id, action[, param1, value1[, param2, value2[,. . .]]])
Description: Send the SecurOS execution command with given parameters into the SecurOS systemon behalf of a given object.
Parameters:
type SecurOS object type identifier
id SecurOS object identifier (number) with type type
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.12 GetObjectName
Syntax: GetObjectName (type, id)
Description: Get the object name. Returned value type: String.
Parameters:
type SecurOS object type identifier
id SecurOS object identifier (number) with type type
3.3.1.13 GetObjectState
Syntax: GetObjectState (type, id)
Description: Get the object state on the Map. Returned value type: String.
Parameters:
32
www.issivs.com
Programming GuideSecurOS
Working with Module
type SecurOS object type identifier
id SecurOS object identifier (number) with type type
3.3.1.14 GetObjectParam
Syntax: GetObjectParam (type, id, param)
Description: Get the object parameter value. Returned value type: String.
Parameters:
type SecurOS object type identifier
id SecurOS object identifier (number) with type type
param Object parameter name with type type
3.3.1.15 GetObjectParentId
Syntax: GetObjectParentId (type, id, parent)
Description: Get an identifier of the parent object from the given object type and identifier. Ifparent parameter is absent then return first level parent object data (the given object is a childobject relative to returned one). Returned value type: String.
Parameters:
type SecurOS object type identifier
id SecurOS object identifier (number) with type type
parent Parent object type. Optional parameter
3.3.1.16 GetObjectParentType
Syntax: GetObjectParentType (type)
Description: Get first level parent object type from the given object type (the given object is a childobject relative to returned one). Returned value type: String.
Parameters:
type SecurOS object type identifier
3.3.1.17 GetObjectIds
Syntax: GetObjectIds (type)
Description: Get a list of all object identifiers with the given object type. Returned value type:String array (VBArray object).
Parameters:
33
www.issivs.com
Programming GuideSecurOS
Working with Module
type SecurOS object type identifier
3.3.1.18 GetObjectChildIds
Syntax: GetObjectChildIds (type, id, childtype)
Description: Get a list of identifiers of child objects with childtype type related to the givenobject. Returned value type: String array (VBArray object).
Parameters:
type SecurOS object type identifier
id SecurOS object identifier (number) with type type
childtype Child object type.
3.3.1.19 IsObjectExists
Syntax: IsObjectExists (type, id)
Description: Check if the object with the given name exists. Returned value type: Logical.
Parameters:
type SecurOS object type identifier
id SecurOS object identifier (number) with type type
3.3.1.20 IsObjectDisabled
Syntax: IsObjectDisabled (type, id)
Description: Check if the object is disabled. Returned value type: Logical.
Parameters:
type SecurOS object type identifier
id SecurOS object identifier (number) with type type
3.3.1.21 IsObjectState
Syntax: IsObjectState (type, id, state)
Description: Check if the object is in the given state. Returned value type: Logical.
Parameters:
type SecurOS object type identifier
id SecurOS object identifier (number) with type type
34
www.issivs.com
Programming GuideSecurOS
Working with Module
state Specified name of the object state with type type
3.3.2 Script Object Methods
Methods of the Script object accessible from the Module VB/JScript scenarios are described in thissection.
3.3.2.1 SetTimeout
Syntax: SetTimeout (expression, timeout)
Description: Evaluates an expression program string after timeout milliseconds. Return anidentifier.
Parameters:
expression Program string in the current script programming language
timeout Time (in milliseconds)
3.3.2.2 ClearTimeout
Syntax: ClearTimeout (id)
Description: Cancels a timeout of program string evaluation specified by id identifier returnedfrom the SetTimeout function.
Parameters:
id Identifier returned by SetTimeout
3.3.2.3 SetInterval
Syntax: SetInterval (expression, interval)
Description: Evaluates an expression program string every interval milliseconds. Return anidentifier.
Parameters:
expression Program string on the current script programming language
interval Time (in milliseconds)
3.3.2.4 ClearInterval
Syntax: ClearInterval (id)
Description: Cancels a periodical program string evaluation specified by id identifier returnedfrom the SetInterval function.
Parameters:
35
www.issivs.com
Programming GuideSecurOS
Working with Module
id Identifier returned by SetInterval
3.3.3 Log Object Methods
Methods of the Log object accessible from the Module scripts are described in this section. Log objectmethods are used to output messages, declared within VB/ JScript program program code, into theModule's log-file (see Logging). Using the methods of the object can improve the convenience ofdebugging scripts.
Generally, Log object methods call syntax is as follows:
Log.Method_Name(p1[,p2,p3,...]), where:
Method_Name — method name;
p1,p2,p3,... — method parameters. Method parameters can be represented by a string, array oranother jscript-object.
Object has the following methods:
Error — implements the output of the method parameters into log-file, if log level, specified in theLog object settings (see Logging), does not exceed Error.
Warn — implements the output of the method parameters into log-file, if log level, specified in theLog object settings (see Logging), does not exceed Warn.
Info — implements the output of the method parameters into log-file, if log level, specified in theLog object settings (see Logging), does not exceed Info.
Debug — implements the output of the method parameters into log-file, if log level, specified in theLog object settings (see Logging), does not exceed Debug.
Fatal — implements the output of the method parameters into log-file, if log level, specified in theLog object settings (see Logging), is Fatal.
3.4 Checking Script Syntax
The Module provides tools for checking script syntax.
To check script syntax do the following:
1. Click the Check syntax button in the Module window. The resulting message is displayed in thestate line on the bottom (see the bottom of the window in figure 4).
36
www.issivs.com
Programming GuideSecurOS
Working with Module
Figure 4. Module window with syntax error message
2. In case of an error, the standard message according to the script language will appear in the state lineand the source line of error will be highlighted in red in the script body (see figure 4). To continuesearching for other errors or to make sure there is no more errors, correct the error and repeat theprocedure.
The Module generates events in case of errors during script execution. Module event parameters arelisted in Appendix A. VB/ JScript Program Object Events). To view events, use the Event Viewerwindow (Event Viewer object).
3.5 Debugging Script
Configuring debuggerThe Microsoft Visual Studio IDE embedded debugger is convenient to debug scenario, implemented inJScript programming language. To use embedded debugger do the following (as example, when usingMicrosoft Visual Studio 2010):
1. Unistall any other script language debuggers, installed earlier on your computer.
2. Activate Just-in-time debugging mode. To do this select the HKEY_CURRENT_USER\Software\Microsoft\Windows Script\Settings system registry key and assign the JITDebug
37
www.issivs.com
Programming GuideSecurOS
Working with Module
REG_DWORD - parameter value 1.
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_TimeDebugging tab of the IDE settings window (see Figure 5).
Figure 5. Just-In-Time Debugging option settings window
Debugging ScriptDebugger is call from within script if script body contains the debugger key word (see Listing 13).
Listing 13. Calling debugger from within SecurOS JScript code
function Init(){Core.RegisterEventHandler("MACRO","1.3","RUN",function()
{debugger;var x = 1;var y = 0;var z = x*y;x = z + 5;Script.Echo("X =" + x);});
}
38
www.issivs.com
Programming GuideSecurOS
Working with Module
3.6 Script Examples
This section contains examples of the VBScript and JScript scenarios.
3.6.1 Stopped Vehicles Report
Example: To obtain a report regarding vehicle stops occurring on a certain lane of the road based on theresults 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);}
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();}
Stopped vehicle information contains an STOPPED_VEHICLE event of the SecurOS Traffic Module(TRAFFIC_CAM object with 3 identifier as an event source). Event parameters are transmitted into theOnStoppedVehicle handler function. File saving is processed by theScripting.FileSystemObject ActiveX object. Every line of the file contains a set of eventparameters (vehicle stop...), in the following order: time of the event, event name, traffic analyzercamera name and lane number of the event detection.
Execution results of this script are stored in the cars.txt file on the C drive.
3.6.2 Database Recording of Recognition Results for Wagon Numbers
Example: To record a list of recognized wagon numbers to the existing database based on the results ofthe SecurOS Transit Module.
Listing 15. Script for SecurOS Transit Module events export into a database (VBScript language).
Dim DBConnection, DBRecordset
Sub Init()Set DBConnection = CreateObject("ADODB.Connection")DBConnection.ConnectionString = "DRIVER={PostgreSQL Unicode};" & _"SERVER=localhost;port=5432;DATABASE=MyDatabase;UID=Me;PWD=MyPassword;"DBConnection.OpenSet DBRecordset = CreateObject("ADODB.Recordset")
39
www.issivs.com
Programming GuideSecurOS
Working with Module
DBRecordset.Open "select * from wagons", DBConnection, 3, 3Core.RegisterEventHandler "WAGON_RECOGNIZER", 1, "WAGNUM_RECOGN","OnWagonRecognized"
End Sub
Sub OnWagonRecognized(e)DBRecordset.AddNewDBRecordset.Fields("time") = e.Data_TimeDBRecordset.Fields("train") = e.Train_IDDBRecordset.Fields("wagon") = e.Recognition_ResultDBRecordset.Update
End Sub
Sub Destroy()DBRecordset.CloseDBConnection.Close
End Sub
Recognized wagon numbers are contained in the SecurOS Transit Module WAGNUM_RECOGN eventparameters (WAGON_RECOGNIZER object as an event source). Database recording is performed by theADODB.RecordSet ActiveX object. ConnectionString property of the ADODB.ConnectionActiveX object contains database connection parameters string. Data saves into the wagons table of theMyDatabase PostgreSQL database. The following table fields are filled with data: time — recognitiontime/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.
Execution of this script results in database records.
3.6.3 Vehicle Speed Measurement Report
Example: To get periodical graphic reports about vehicle speed measurements from the results of theSecurOS 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 Excelfile (VBScript language)
Dim currentLocalecurrentLocale = GetLocale
Dim nMaxVelocitynMaxVelocity = 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
40
www.issivs.com
Programming GuideSecurOS
Working with Module
velocities(nVelocity,0) = velocities(nVelocity,0) + 1End IfIf nVelocity > nMaxVelocity Then
nMaxVelocity = nVelocityEnd If
End Sub
Sub OnTimer()If nMaxVelocity <> 0 Then
Dim Rng, Wb, AppSet App = CreateObject("Excel.Application")Directory_For_Writing = "C:\"Set Wb = App.WorkBooks.AddSet Rng = Wb.ActiveSheet.Range("A1").Resize(nMaxVelocity, 1)Rng.Value = velocitiesWb.Charts.AddWb.ActiveChart.ChartType = 51Wb.ActiveChart.SetSourceData Rng, 2Wb.ActiveChart.Location 1, "Velocity"App.ActiveWorkBook.SaveAs Directory_For_Writing & _
Replace(FormatDateTime(Now), ":", ".") & ".xls"App.QuitFor i = 0 To nMaxVelocity
velocities(i,0) = 0NextnMaxVelocity = 0
End IfEnd Sub
The speed (velocity) value is a SecurOS Auto (License Plate Recognition) ModuleCAR_LP_RECOGNIZED event parameter (LPR_CAM object as an event source), which is transmitted intoOnCarRecognized handler function. According to script OnTimer timer function, registered eventsare saved to a file hourly. File is created by the Excel.Application ActiveX object and containsvehicle speed distribution diagram.
Execution of the script results in Microsoft Excel file saved on the C disk. Syntax of the file name is thefollowing: DD.MM.YYYY hh.mm.ss.xls where DD, MM, YYYY stands for the day, month and year, andhh, 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) Modulecalculates moving vehicle speeds correctly (see SecurOS Auto User Guide).
41
www.issivs.com
Programming GuideSecurOS
Developing HTML Forms and HTML Dialogs
4 Developing HTML Forms and HTMLDialogsSecurOS has a mechanism of creating custom user interface by means of HTML forms.
4.1 Setting up HTML Forms within SecurOS
SecurOS provides two types of HTML-based interface objects:
HTML Form — this interface object belongs to a Desktop object and, thus, appears on monitor whenthe corresponding Desktop is activated. This object is displayed unless Desktop is deactivated orSecurOS is shut down. Can be used to display PTZ control panel;
HTML Dialog — this object appears on monitor temporarily upon some external event or systembehavior. For example, it can be opened from SecurOS script when handling events. Objects of thiskind can be closed by users manually or automatically by system (and also with the help of scripts).
Before creating HTML Forms and HTML Dialogs, consider the following ideology behind HTMLForms 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 Formshould respond to these external events and commands;
Within event/command handlers write code that modifies the DHTML or otherwise responds toincoming events;
Define onClick event handlers for buttons or other interactive elements within HTML to sendcommands back to SecurOS.
4.2 _system.js File
SecurOS comes with _system.js file located in <SecurOS root_directory>\dialogscript\Data, which wraps calls to window.external.dispSOCoreProvider object (seewindow.external.dispSOCoreProvider Object) to be more easy-to-use and provides additional helperfunctions. It also creates a global io window.external.dispSOCoreProvider variable as a shortcut to thisobject. So you could use io.MethodName(...) syntax instead ofwindow.external.dispSOCoreProvider.MethodName(...).
Table 1. _system.js functions
Function Description
react(target_type,target_id,command,params_array)
Wraps DoReact(RawString), constructing raw stringautomatically from target_type, target_id, command andparams_array array of parameters and values. Example:
react("CAM","1","REC",["param1","value1","param2",
"value2"]);
42
www.issivs.com
Programming GuideSecurOS
Developing HTML Forms and HTML Dialogs
Function Description
event(command,params)
Wraps Send2Core(RawString), constructing raw stringautomatically from own type and ID, command command andparams array of parameters and values, thus sending event onbehalf on oneself. Example:
event("ALARMED",["param1","value1","param2","value2"]);
event_from(source_type,source_id,command,params)
Wraps Send2Core(RawString), constructing RawStringautomatically from source_type, source_id, commandcommand and params array of parameters and values, thussending event on behalf on arbitrary object. Example:
event_from("RAY","3","ALARMED","param1","value1","param2","value2"]);
react_raw(raw_string) Shortcut to io.DoReact(raw_string)
event_raw(raw_string) Shortcut to io.Send2Core(raw_string)
resize_win(x,y,minx,miny,maxx,maxy)
Resizes window to specified width and height, or content size,obeying optional min and max constraints. Example:
resize_win() — automatically resize window by its contents;
resize_win(x, y) — set window size to x, y;
resize_win(0, 0, maxx, maxy) — automatically resizewindow, but obey minimum size constraints;
resize_win(0, 0, 0, 0, minx, miny) — automaticallyresize window, but obey maximum size constraints;
resize_win(0, 0, minx, miny, maxx, maxy) —automatically resize window, but obey minimum/maximum sizeconstraints.
4.3 window.external.dispSOCoreProvider Object
Special window.external.dispSOCoreProvider object provides interfaces for subscribing to system events,enumerating and performing actions on security objects, checking their states, etc.This allows buildingfully customized interface solutions that integrate tightly into SecurOS.
Table 2. window.external.dispSOCoreProvider object properties
Property Type Description
bsType String
Type of an object this HTML document is loaded into. Read-only.Possible values:
SCREEN_FORM — object is an HTML Form;
DIALOG_POPUP — object is an HTML Dialog.
bsID String ID of an object this HTML document is loaded into. Read-only.
43
www.issivs.com
Programming GuideSecurOS
Developing HTML Forms and HTML Dialogs
Property Type Description
nID Integer Same as bsID, but returns an integer value. Read-only.
Table 3. window.external.dispSOCoreProvider object methods
Method Description
createFilter() Creates and returns a new IMsgFilter object.
Send2Core(RawString)
Sends raw event string to SecurOS. String syntax:
OBJ_TYPE|OBJ_ID|EVENT_TYPE|param1<value1>,param2<value2>,...,paramN<valueN>.
DoReact(RawString)
Sends raw react string to SecurOS. String syntax:
OBJ_TYPE|OBJ_ID|COMMAND|param1<value1>,param2<value2>,...,paramN<valueN>.
ResizeTo(Width,Height)
Resize window to specified width and height. Use this functioninstead of external window.resizeTo() function.
4.4 IMsgFilter Object Type
System object type constants (OBJ_TYPE) and command identifier constants (COMMAND) as well asevents identifier constants (EVENT_TYPE) are listed in Appendix 2. SecurOS Object Events andCommands Reference. In the following table, OBJ_ID means identifier (ID) of the given object typeOBJ_TYPE.
Table 4. IMsgFilter object methods
Method Description
addHandler(FunctionName)
Adds the handler for the to the given JavaScriptfunction. Upon event/command, the given javascriptfunction will receive an ICoreMsg object as aparameter. Returns event handler ID, which can bepassed to removeHandler method.
removeHandler(FunctionName) Removes the previously created handler.
clearHandlers() Clears all handlers.
addReact(COMMAND)Subscribes to specified commands. If the "*" wildcard isused, subscribes to all commands.
removeReact(COMMAND) Unsubscribes from the specified command.
clearReacts() Removes all commands from the filter.
addBlockReact(COMMAND)Excludes the specified command from being processedby filter. If the "*" wildcard is used, excludes allcommands.
44
www.issivs.com
Programming GuideSecurOS
Developing HTML Forms and HTML Dialogs
Method Description
removeBlockReact(COMMAND) Removes the specified command from block list.
clearBlockReacts() Removes all command exclusions from the filter.
addEvent(OBJ_TYPE,OBJ_ID,EVENT_TYPE)
Subscribes to all events that match provided objecttype, ID and event type. Any parameter can accept the"*" wildcard which means "any".
removeEvent(OBJ_TYPE,OBJ_ID,EVENT_TYPE)
Removes the previous subscription. Combination ofOBJ_TYPE, OBJ_ID and EVENT_TYPE should be thesame as in one of the previous calls to addEvent().
clearEvents() Removes all event subscriptions from the filter.
addBlockEvent(OBJ_TYPE,OBJ_ID,EVENT_TYPE)
Excludes all events that match provided object type, IDand event type from being processed by filter. Anyparameter can accept the "*" wildcard which means"any".
removeBlockEvent(OBJ_TYPE,OBJ_ID,EVENT_TYPE)
Removes the previously set combination of eventexclusions. Combination of OBJ_TYPE, OBJ_ID andEVENT_TYPE should be the same as in one of theprevious calls to addBlockEvent().
clearBlockEvents() Removes all event exclusions from the filter.
4.5 ICoreMsg Object Type
Object of this type is passed to event handling function as a parameter. It contains the data about eventor command. The event handlers must be processed as fast as possible, not to be blocked by dialogappearing procedures.
Table 5. ICoreMsg properties
Property Type Description
bsAction String Event or command identifier.
bsSourceType String Type of an object that fired event/command.
bsSourceID String ID of an object that fired event/command.
bsParam(Name)String Returns the string value of the specified named
parameter.
intParam(Name)Integer Returns the integer value of the specified named
parameter.
4.6 ISScustomAPI Object Type
Object of this type provides the following methods intended for the creation of the SecurOS customcontrol interface, that is called by the HTML5 FrontEnd object (see SecurOS Administration Guide):
45
www.issivs.com
Programming GuideSecurOS
Developing HTML Forms and HTML Dialogs
onSetup;
sendEvent;
sendReact.
An example of a custom user interface is provided in the Sample HTML5 FrontEnd Form section.
4.6.1 onSetup
Syntax: onSetup (callback_function)
Description: Adding the event handler function for the SETUP event of the SecurOS HTML5FrontEnd object (object settings changing event). The event handler function takes a stringargument with a list of parameters packed in JSON format.
Accepted parameters:
media_client_idIdentifier of the Media Client object selected in the HTML5 FrontEnd objectsettings
map_window_idIdentifier of the Map Window object selected in the HTML5 FrontEnd objectsettings
advancedA set of an additional parameters specified in the HTML5 FrontEnd objectsettings (Advanced field). Additional parameters are passed in the sameformat as they were specified in the object settings.
4.6.2 sendEvent
Syntax: sendEvent (type, id, action, params)
Description: Send the event with stated values of parameters into SecurOS system on behalf of agiven object.
Parameters:
type SecurOS object type identifier
id SecurOS object identifier (number) with type type
action SecurOS object event name with type type
paramsA set of event parameters, packed in JSON format (the number ofparameters is not limited)
4.6.3 sendReact
Syntax: sendReact (type, id, action, params)
Description: Send the SecurOS execution command with given parameters into the SecurOS systemon behalf of a given object.
46
www.issivs.com
Programming GuideSecurOS
Developing HTML Forms and HTML Dialogs
Parameters:
type SecurOS object type identifier
id SecurOS object identifier (number) with type type
action Name of the command that is sent to a SecurOS object with type type
paramsA set of command parameters, packed in JSON format (the number ofparameters is not limited)
4.7 Sample HTML Form
The HTML Form object is designed to integrate custom user control interface into SecurOS. Form isloaded when SecurOS starts or when appropriate object is activated in the Object tree. Example of theHTML Form is illustrated in Figure 6.
Figure 6. HTML Form
Note. 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 belaunched.
The following objects must be created and configured to provide integration and using custom controlinterface in SecurOS:
HTML document — html-file, that implements external control form and control algorithm;
HTML Form — SecurOS' object (see SecurOS Administration Guide) that provides integration ofthe custom control interface into SecurOS.
Below is an example of the creation and integration of the custom user interface to control SecurOS'Cameras.
HTML document
Let's create HTML document where appearance of the window, control elements and control algorithmare defined (see Listing 17). Within given example, the window will contain text box to enter cameraidentifier and 4 camera control buttons: on/off record, arm/disarm camera.
Listing 17. HTML document
<html><head>
47
www.issivs.com
Programming GuideSecurOS
Developing HTML Forms and HTML Dialogs
<meta http-equiv="MSThemeCompatible" content="Yes"><link rel="stylesheet" href="data/_system.css" type="text/css"><title>Example: group actions on cameras</title><script src="data/_system.js" type="text/javascript"language="JavaScript1.2" charset="utf-8"></script><script type="text/javascript" language="Javascript1.2">function camControl(){
resize_win();}
function clearCamNum(a){a.value="";}
function processCams(action){var obj = document.getElementById("id1");react('CAM', obj.value, action);}
</script></head>
<body onload="camControl()"><table class="outer" id="outertable" width="384" cellpadding="0"cellspacing="0"> <tr> <td class="header"> <table> <tr> <td class="title">Camera control</td> <td class="titlebuttons"><a href="javascript:window.close(); "title="Close">x</a></td> </tr> </table> </td> </tr> <tr> <td class="body"> <table cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="100%"><small>Specify Camera ID: </small><input id="id1" type="text"size= "30" onClick="clearCamNum(this)"><br>
</td> <td width="100" class="padleft"> <input type="button" class="button" value="ARM" onclick="processCams('ARM');">
<input style="margin-bottom: 20px" type="button" class="button" value="DISARM" onclick="processCams('DISARM');">
<input type="button" class="button" value="START REC" onclick="processCams('REC');">
<input style="margin-bottom: 20px" type="button" class="button" value="STOP REC" onclick="processCams('REC_STOP');"> </td> </tr> </table> </td> </tr></table></body></html>
48
www.issivs.com
Programming GuideSecurOS
Developing HTML Forms and HTML Dialogs
The header contains information that concerns HTML document in a whole (not discussed in thismanual), then the functions which will be activated at document loading are declared (see Listing 18).
Listing 18. HTML document Header. Declaring functions
function camControl(){resize_win();}
function clearCamNum(a){a.value="";}
function processCams(action){var obj = document.getElementById("id1");react('CAM', obj.value, action);}
The following actions are performed in the fragment of the code above:
The function to control window size is declared:
function camControl(){
resize_win();}
This function automatically set window size according to it's content.
Warning! Regardless of the function value, visible size of the form's window is set by it's W and H parameters(see SecurOS Administration Guide).
Function to clear current value of the input text box is declared:
function clearCamNum(a){
a.value="";}
This function receives the only a parameter and sets the "empty" value for the value attribute of thetext element (see description of the text element below).
Function which will be used to send camera an appropriate command is declared:
function processCams(action){
var obj = document.getElementById("id1");
react('CAM', obj.value, action);}
This function receives the only action parameter and pass the appropriate control command to thecamera that has the obj.value identifier. Details of how to receive camera ID see below.
Arrangement of the window elements, for which function calls are defined, are marked-up in the bodyof the html-document (see Listing 19).
Listing 19. HTML document Body
<body onload="camControl()"><table class="outer" id="outertable" width="384" cellpadding="0"cellspacing="0"> <tr> <td class="header"> <table> <tr> <td class="title">Camera control</td> <td class="titlebuttons"><a href="javascript:window.close();
49
www.issivs.com
Programming GuideSecurOS
Developing HTML Forms and HTML Dialogs
"title="Close">x</a></td> </tr> </table> </td> </tr> <tr> <td class="body"> <table cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="100%"><small>Specify Camera ID: </small><input id="id1" type="text"size= "30" onClick="clearCamNum(this)"><br>
</td> <td width="100" class="padleft"> <input type="button" class="button" value="ARM" onclick="processCams('ARM');">
<input style="margin-bottom: 20px" type="button" class="button" value="DISARM" onclick="processCams('DISARM');">
<input type="button" class="button" value="START REC" onclick="processCams('REC');">
<input style="margin-bottom: 20px" type="button" class="button" value="STOP REC" onclick="processCams('REC_STOP');"> </td> </tr> </table> </td> </tr></table></body>
The camControl() function is executed when window is loaded:
<body onload = "camControl()">
and other functions declared in the html-document body became available.
Further, the "input text box" element of the form is created. With the help of this element operator willbe able to enter camera ID:
<small>Specify Camera ID: </small><input id="id1" type="text" size="30" onClick="clearCamNum(this)"><br>
Attributes and Properties of this element contain values and describe actions that will be passed as aparameters to the clearCamNum(a) and processCams(action) functions:
value — text element property that passes an entered value. This value is further used in theprocessCams(action) function to specify camera ID. When element is declared this property isnot explicitly defined;
Note. For the detailed description of the HTML tag properties see, for example, http://www.w3schools.com/html/default.asp.
id="id1" — html-page element ID that is used to access attribute values of this element;
50
www.issivs.com
Programming GuideSecurOS
Developing HTML Forms and HTML Dialogs
onClick="clearCamNum(this)" — action that will be performed when clicking the element. Inour case the clearCamNum(a) function will be called, to which the this current object (i.e. inputtext box with all attributes) will be passed as an a parameter. Then the "" (empty) value will beassigned to the value property, i.e. text box will be cleared;
Further, the button elements, with the help of which a camera control commands will be send intoSecurOS, will be created:
<input type="button" class="button" value="ARM" onclick="processCams('ARM');">
<input style="margin-bottom: 20px" type="button" class="button"value="DISARM" onclick="processCams('DISARM');">
<input type="button" class="button" value="START REC"onclick="processCams('REC');">
<input style="margin-bottom: 20px" type="button" class="button"value="STOP REC" onclick="processCams('REC_STOP');">
For each button the action action is specified, which will be passed into processCams(action)function by clicking this button, for example:
<input type="button" class="button" value="ARM" onclick="processCams('ARM');">
When clicking this button the 'ARM' value (set camera to arm mode) will be passed as an actionparameter. When function is executed the obj.value camera ID, entered by operator in the text box,that has an "id1" identifier, will be passed into the react command:
var obj = document.getElementById("id1");
react('CAM', obj.value, action);}
Thus, if the 5 value was entered into the input text box and the START REC button was clicked, thefollowing event was generated within SecurOS
Event : CORE DO_REACTsource_type<CAM>,source_id<5>,slave_id<...>,action<REC>,params<0>,time<...>,date<...>
and the following command was send
React : CAM|5|REC|original_slave_id<...>,operator_name<root>,operator<root>
HTML Form
A HTML Form object is created as a child to the Desktop object. After object is created, specify the nameof the created html-document in it's settings, and also specify position and size of the form window.
HTML Form became available for the operator on the appropriate Desktop just after it is created.
4.8 Sample HTML Dialog
The HTML Dialog interface object is used to inform operator about system events in real-time mode.Informing is performed with the help of pop up window that contains information of interest (forexample, see Figure 7).
51
www.issivs.com
Programming GuideSecurOS
Developing HTML Forms and HTML Dialogs
Figure 7. Pop up window
To use such method of informing it is necessary to create and configure the following objects:
HTML Dialog — SecurOS object (see SecurOS Administration Guide) that implements pop upwindow;
VB/JScript program — SecurOS object that contains JScript scenario to control pop up window;
HTML document — html-file that specifies appearance of the pop up window and displayedinformation.
Below is an example of system configuration to inform operator if vehicle from "black" list isrecognized.
HTML DialogAt the first stage let's create a new SecurOS's HTML Dialog object. Identifier of the created object willfurther be used within a VB/ JScript program code and HTML document text.
Note. In examples below it is assumed this identifier is equal to 1.
When configuring object parameters it is necessary to specify the name of the appropriate HTMLdocument.
VB/JScript programRequired information (i.e. vehicle license plate and a sign of it belonging to the "black" list) is containedin the CAR_LPR_FOUND event of the LPR_LOGIC object. So, a pop up window should to appear whenthis event occurs. Event processing, pop up window call and automatic close are performed with thehelp of the VB/ JScript program object (see Listing 20).
Listing 20. Event processing, pop up window call and automatic close
var count = 0;
function Init(){
Core.RegisterEventHandler("LPR_LOGIC","*","CAR_LP_FOUND",onLPFound);
}
function onLPFound(e){
var recogn_id = e.recognizer_id;var vehicle_license_plate = e.number;var watchlist_type = e.database_type;Core.DoReact("DIALOG_POPUP","1","SHOW", "recognizer",e.recognizer_name + " [" + recogn_id + "]", "vehnum",vehicle_license_plate,"wltype",watchlist_type);
52
www.issivs.com
Programming GuideSecurOS
Developing HTML Forms and HTML Dialogs
Script.SetTimeout(HidePopup,10000);++count;
}
function HidePopup(){--count;if (count == 0)
Core.DoReact("DIALOG_POPUP","2","HIDE");}
When script is started the subscription for the CAR_LPR_FOUND event is performed. Within theonLPDFound handler of this event (see RegisterEventHandler) the following actions are performed:
variables that can be used to receive parameters of the CAR_LPR_FOUND event and pass them intothe html-document are declared;
SHOW command to display pop up window with received parameters of the CAR_LPR_FOUND eventis sending (see DoReact method description);
pop up window displaying time is specified (see SetTimeout method description); when specifiedtimeout elapsed pop up window will automatically closed.
Note. If some events of license plates recognizing occur during specified timeout, all license plates aredisplayed in the same instance of the pop up window. At the same time is possible the situation, when the lastof these license plates is recognized at the end of timeout. This license plate will be displayed on display for avery short time and can possibly be missed by operator. To avoid such situations the count event counter is
declared, which restarts window close timer for each new recognized license plate.
HTML documentNow let's create a HTML document where appearance of the pop up window and displayed informationare defined (see Listing 21).
Listing 21. HTML document
<html><head><meta http-equiv="MSThemeCompatible" content="Yes"><link rel="stylesheet" href="data/_system.css" type="text/css"><title>New notification</title><script src="data/_system.js" type="text/javascript" language="JavaScript1.2" charset="utf-8"></script>
<script type="text/javascript" language="Javascript1.2">
var filter;function displayWin(){
resize_win("400","150");filter = io.createFilter();filter.addReact("SHOW");filter.addHandler(onShow);}
function onShow(msg){var id = msg.bsParam("recognizer");var num = msg.bsParam("vehnum");
53
www.issivs.com
Programming GuideSecurOS
Developing HTML Forms and HTML Dialogs
var dbtype = msg.bsParam("wltype");if (dbtype == "blacklist"){document.getElementById("id1").innerHTML="Recognizer: " + id;document.getElementById("id2").innerHTML="License plate: " + num;}}</script></head>
<body onload="displayWin()"><table class="outer" id="outertable" width="400"cellpadding="0" cellspacing="0"> <tr> <td class="header"> <table> <tr> <td class="title">License Plate in Black List</td> <td class="titlebuttons"><a href="javascript:window.close();"
title="Close">X</a></td> </tr> </table> </td> </tr></table> <tr> <td class="body"> <p id = "id1" align="center"></p> <p id = "id2" align="center"></p> </td> </tr></table>
</body></html>
The header contains information that concerns HTML document in a whole (not discussed in thismanual), then the functions, which will be used to receive data from SecurOS and to process it aredeclared (see Listing 22).
Listing 22. HTML document Header. Declaring functions
var filter;function displayWin(){
resize_win("400","150");filter = io.createFilter();filter.addReact("SHOW");filter.addHandler(onShow);}
function onShow(msg){var id = msg.bsParam("recognizer");var num = msg.bsParam("vehnum");var dbtype = msg.bsParam("wltype");
if (dbtype == "blacklist"){document.getElementById("id1").innerHTML="Recognizer: " + id;document.getElementById("id2").innerHTML="License plate: " + num;}}
The following actions are performed in the fragment of the code above:
The displayWin() function with the help of which a pop up window and other objects, requiredto process necessary SecurOS event, are created:
54
www.issivs.com
Programming GuideSecurOS
Developing HTML Forms and HTML Dialogs
Size of the pop up window is specified:
resize_win("400","150")
Event filter is created (see window.external.dispSOCoreProvider Object):
filter = io.createFilter()
The SecurOS' command that will be processed by created filter (see IMsgFilter Object Type) isadded. In our case this is the SHOW command with license plate recognizing event parameters:
filter.addReact("SHOW")
The handler that passes parameters of the received SHOW command into the data processingfunction (see IMsgFilter Object Type) is created:
filter.addHandler(onShow)
Note. Parameters are passed into the data processing function with the help of ICoreMsg Object Type specialobject.
Function to process command parameters (see ICoreMsg Object Type) is declared:
function onShow(msg)
Function onShow(msg) contains three local variables, which are assigned the following values, thatwere passed to the SHOW command from the VB/ JScript program:
var id = msg.bsParam("recognizer") — identifier of the License plate recognizer whichrecognized the vehicle.
var num = msg.bsParam("vehnum") — recognized license plate.
var dbtype = msg.bsParam("wltype") — the sign that vehicle is in "black" list.
Further, the validation if recognized license plate belongs to the "black" list is performed:
if (dbtype == "blacklist"){
document.getElementById("id1").innerHTML="Recognizer: " + id;
document.getElementById("id2").innerHTML="License plate: " + num;}}
If license plate belongs to the "black" list, then pop up window will display appropriate strings, forexample:
Recognizer: 25
License plate: LR61XHG
Elements of the pop up window are marked-up in the html-document body (see Listing 23).
Listing 23. HTML document Body
<body onload="displayWin()"><table class="outer" id="outertable" width="400"cellpadding="0" cellspacing="0"> <tr> <td class="header"> <table> <tr> <td class="title">License Plate in Black List</td> <td class="titlebuttons"><a href="javascript:window.close();"
55
www.issivs.com
Programming GuideSecurOS
Developing HTML Forms and HTML Dialogs
title="Close">X</a></td> </tr> </table> </td> </tr></table> <tr>
<td class="body"><p id="id1" align = "center"></p><p id="id2" align = "center"></p>
</td> </tr></table>
</body>
Objects defined in the displayWin() function declaration are created when pop up window isloaded:
<body onload = "displayWin()">
and other functions declared in the html-document body became available.
Data received by onLPFound() function will be displayed in the pop up window in the centeredstrings that have appropriate identifiers:
<p id = "id1" align = "center"></p>
<p id = "id2" align = "center"></p>
Other elements of the pop up window markup are not discussed within this manual.
Save created HTML document in the arbitrary or standard <SecurOS_Folder>\Dialogscript\folder.
Warning! After HTML document is created it is necessary to specify it's name in the HTML Dialog objectsettings.
As a result of the performed operations the informational message which will contain the License platerecognizer ID and recognized license plate will pop up on the operator's monitor.
4.9 Sample HTML5 FrontEnd Form
To provide integration and implementation of the custom user interface in SecurOS it is necessary tocreate HTML document and configure the HTML5 FrontEnd object:
HTML document — html-file, that implements external control form and control algorithm;
HTML5 FrontEnd — SecurOS' object (see SecurOS Administration Guide) that providesintegration of the custom control interface into SecurOS.
Below is an example of the SecurOS custom control interface.
<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><script type="text/javascript">window.onload = function () {
56
www.issivs.com
Programming GuideSecurOS
Developing HTML Forms and HTML Dialogs
document.getElementById("IssMessageType").value = 2;
ISScustomAPI.onSetup(function (settings) {document.getElementById("settings").innerHTML = settings;let jsonSettings = JSON.parse(settings);document.getElementById("MediaClientId").value = jsonSettings.media_client_id;document.getElementById("ID").value = jsonSettings.media_client_id;document.getElementById("MapWindowId").value = jsonSettings.map_window_id; }); }</script><script language="JavaScript">function MakeLiveAddSequenceParams() {var cameras = document.getElementById("Cameras").value;var params = {seq: cameras.split(',').join('|') };return JSON.stringify(params); }function CamId() {var cameras = document.getElementById("Cameras").value;cameras = cameras.split(',').join('|');return cameras.split('|')[0]; }function SendMessage() {var issMsgType = document.getElementById("IssMessageType").value;var action = document.getElementById("Action").value;var type = document.getElementById("Type").value;var id = document.getElementById("ID").value;var params = document.getElementById("Params").value;if (issMsgType === 1) ISScustomAPI.sendEvent(type, id, action, params);else ISScustomAPI.sendReact(type, id, action, params); }function MakeFindLevelParams() {var params = {name: document.getElementById("LevelName").value };return JSON.stringify(params); }function MakeFindObjectParams() {var params = {type: document.getElementById("ObjectType").value,id: document.getElementById("ObjectId").value };return JSON.stringify(params); }</script><style type="text/css"> html {height: 100%;width: 100%; }
#settings {width: 500px;height: 300px; }</style></head><body><img src="https://issivs.com/wp-content/uploads/2018/09/1NEW-iss-logo3.png"
57
www.issivs.com
Programming GuideSecurOS
Developing HTML Forms and HTML Dialogs
alt="logo"><br /><textarea id="settings"></textarea><br /><br /><br /><br /><hr />ISS Message Type: <select id="IssMessageType"><option value="1">Event</option><option value="2">React</option></select>Action: <input id="Action" value="SEEK"></input><br /><br />Type: <input id="Type" value="MEDIA_CLIENT"></input>ID: <input id="ID" value="1"></input><br /><br />Params: <input id="Params" value='{"date":"18-09-19","time":"18:09:00:000","cam":"1"}'></input><br /><br /><input id="SendMessage" value="Send Message" type="button" onclick="SendMessage()"></input><br /><br /><hr />Media Client ID: <input id="MediaClientId" type="text" value="1"></input>Camera IDs: <input id="Cameras" type="text" value="1,2,3" , title="Use ',' or '|' as aseparator"></input><br /><br />Send React example: <input id="SendAddSequence" value="Show live cameras" type="button"onclick="ISScustomAPI.sendReact('MEDIA_CLIENT',document.getElementById('MediaClientId').value,'ADD_SEQUENCE',MakeLiveAddSequenceParams())"></input><br /><br />Send Event example: <input id="SendMdStart" value="Alarm camera" type="button"onclick="ISScustomAPI.sendEvent('CAM',CamId(),'MD_START','')"></input><br /><br /><hr />Map Window ID: <input id="MapWindowId" type="text" value="1"></input><br /><br />Level name: <input id="LevelName" type="text" value="Level 1"></input><input id="FindLevel" value="Find level" type="button" onclick="ISScustomAPI.sendReact('MAP3',document.getElementById('MapWindowId').value,'FIND_LEVEL',MakeFindLevelParams())"></input><br /><br />Object Type: <input id="ObjectType" type="text" value="CAM">Object ID: <input id="ObjectId" type="text" value="1"><input id="FindObject" value="Find object" type="button" onclick="ISScustomAPI.sendReact('MAP3',document.getElementById('MapWindowId').value,'FIND_OBJECT',MakeFindObjectParams())"></input></body></html>
58
www.issivs.com
Programming GuideSecurOS
Appendix A. VB/JScript Program Object Events
5 Appendix A. VB/JScript Program ObjectEventsObject type identifier: VBJSCRIPT.
Table 6. VBJSCRIPT events
Event identifier: ERROR
Event name in macro: none
Description: Error occurs during script execution.
Parameters:
line Script line number
description Error description
source Standard error type
code Standard error code
59
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
6 Appendix B. SecurOS Objects Eventsand Commands ReferenceThis section describes the events and actions of the SecurOS subsystem's objects.
6.1 Core Subsystem
This section describes the events and actions of core subsystem's objects.
6.1.1 System
Object type identifier: ARCHITECT.
Warning! When calling command from DoReact method leave ARCHITECT object ID empty.
Table 7. ARCHITECT Commands
Command identifier: SAVE_CONFIG
Name used in Map/Macros: none
Description: Save current SecurOS configuration to a xml-file
Parameters:
filenameName of the saved file. Only file name, not full path, is specified. File issaved in <SecurOS_installation_folder>\Sys_config. Mandatoryparameter
overwrite
Option that allows to overwrite file when file names are concurrent.Possible values:
0 — do not overwrite file;
1 — overwrite file.
6.1.2 User account
Object type identifier: PERSON.
Table 8. PERSON Events
Event identifier: CARD_DUPLICATED
Event name in macro: Person card duplicated
Description: Duplication of person card
60
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Parameters: none
Event identifier: REGISTERED
Event name in macro: Registered
Description: Person registered
Parameters:
comment
A structure that contains the following information:
DNS name of the computer from which the connection was established, in theClient: <Name> format;
DNS name of the computer to which the connection was established, in theServer: <Name> format.
Event identifier: UNREGISTERED
Event name in macro: Unregistered
Description: Person finished session
Parameters:
comment
A structure that contains the following information:
DNS name of the computer from which the connection was established, in theClient: <Name> format;
DNS name of the computer to which the connection was established, in theServer: <Name> format.
Event identifier: NEW_TICKET
Event name in macro: The Ticket was sent
Description: Emergency ticket was created and sent
Parameters:
time Time when an Emergency ticket was sent by operator
owner Identifier of the Computer from which the Emergency ticket was sent
cam ID of the Camera with the help of which an event was detected
61
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
comment
A structure that contains the following information:
ID of the Emergency ticket within SecurOS
ID and name of the Event Viewer or Media Client with the help of which anEmergency ticket was sent;
date and time of the event (for the Event Viewer) or frame (for the Media Client) onthe base of which an Emergency ticket was created;
incident address (represented as an ID and name of the Camera with the help ofwhich an incident was detected);
incident type;
a sign of danger for people;
additional information (comment to an event).
date An Emergency ticket sent date
incident_time
date and time of the event (for the Event Viewer) or frame (for the Media Client) onthe base of which an Emergency ticket was created
incident_type Type of an incident (in accordance with Emergency ticket classifier)
slave_id Identifier of the Computer from which the Emergency ticket was sent
uuid ID of the Emergency ticket within SecurOS
Commands: none.
6.1.3 Computer
Object type identifier: SLAVE.
Table 9. SLAVE Events
Event identifier: CONNECTED
Event name in macro: Connected
Description: Connected
Parameters: none
Event identifier: CONN_OVERLOAD (alarm)
Event name in macro: Core connection blocked
Description: Core connection blocked
Parameters: none
Event identifier: DB_OVERLOAD (alarm)
Event name in macro: Database overload
62
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Description: Database overload
Parameters: none
Event identifier: DISCONNECTED (alarm)
Event name in macro: Disconnected
Description: Disconnected
Parameters: none
Event identifier: PROGRAM
Event name in macro: Program changed
Description: Program changed
Parameters: none
Event identifier: PROTOCOL_RCVD
Event name in macro: Protocol received
Description: Protocol received
Parameters: none
Event identifier: QUEUE_CRITICAL (alarm)
Event name in macro: Workload is critical
Description: Workload is critical
Parameters: none
Event identifier: QUEUE_NORMAL
Event name in macro: Workload is normal
Description: Workload is normal
Parameters: none
Event identifier: QUEUE_WARNING
Event name in macro: Workload is too high
Description: Workload is too high
Parameters: none
Event identifier: REGISTER_ERROR
Event name in macro: Register error
Description: Register error
Parameters: none
63
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Event identifier: SHOW_INFO_MESSAGE
Event name in macro: Display a window with an information or error message
Description: Display a window with an information or error message
Parameters: none
Table 10. SLAVE Commands
Command identifier: CONNECT_ONE
Name used in Map/Macros: Connect
Description: Connect to computer
Parameters: none
Command identifier: CONNECT_OTHER
Name used in Map/Macros: Connect all
Description: Connect to core
Parameters: none
Command identifier: DISCONNECT_ONE
Name used in Map/Macros: Disconnect
Description: Disconnect from computer
Parameters: none
Command identifier: SHOW_INFO_MESSAGE
Name used in Map/Macros: none
Description: Display a splash window with an information or error message
Parameters::
text Text of the displayed message
error
Type of the displayed window. Possible values:
true — error window is displayed;
false — informational window is displayed.
Command identifier: SYNC_PROTOCOL
Name used in Map/Macros: Get protocol
Description: Receive protocol
Parameters: none
64
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
6.1.4 External Application
Object type identifier: EXT_APP.
Table 11. EXT_APP Events
Event identifier: APPLICATION_STARTED
Event name in macro: Application started
Description: External application was successfully started
Parameters:
slave_id ID of computer, on which the external application was started
date Event date (in DD-MM-YY format)
time Event time (in HH:MM:SS.FFF format)
Event identifier: APPLICATION_STOPPED
Event name in macro: Application stopped
Description: External application stopped
Parameters:
commentComment for Event Viewer interface object (in Returncode:<return_code> format)
slave_id ID of computer, on which the external application was started
date Event date (in DD-MM-YY format)
time Event time (in HH:MM:SS.FFF format)
Event identifier: APPLICATION_FAILED
Event name in macro: Failed to start application
Description: Error while starting application
Parameters:
commentComment for Event Viewer interface object (in Returncode:<return_code> format)
slave_id ID of computer, on which the external application was started
date Event date (in DD-MM-YY format)
time Event time (in HH:MM:SS.FFF format)
Commands: none.
65
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
6.2 Interface Subsystem
This section describes the events and actions of interface subsystem's objects.
6.2.1 Desktop
Object type identifier: DISPLAY.
Events: none.
Table 12. DISPLAY Commands
Command identifier: ACTIVATE
Name used in Map/Macros: Show
Description: Activate Desktop with specified ID
Warning! When specifying the Desktop's ID it is necessary to take into account ID of the Security Zone, that isparent for the given Desktop. For example, DISPLAY|1.4|ACTIVATE.
Parameters: none
Command identifier: DEACTIVATE
Name used in Map/Macros: Hide
Description: Hide Desktop with specified ID
Warning! When specifying the Desktop's ID it is necessary to take into account ID of the Security Zone, that isparent for the given Desktop. For example, DISPLAY|1.4|DEACTIVATE.
Parameters: none
6.2.2 Map Window
Object type identifier: MAP3.
Events: none.
Table 13. MAP3 Commands
Command identifier: FIND_OBJECT
Name used in Map/Macros: none
Description: Jump to the object located on Map — displaying level where object is located andbacklighting object
Parameters:
type Type of the object that has to be found
id ID of the object that has to be found
66
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
6.2.3 Event Viewer
Object type identifier: EVENT_VIEWER.
Table 14. EVENT_VIEWER Events
Event identifier: ACTIVATE_OBJECT
Event name in macro: none
Description: Generated when a line is double clicked in the Event Viewer
Parameters:
event_objid ID of the object that is displayed in the Event Viewer line
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.
6.2.4 HTML Form
Object type identifier: SCREEN_FORM.
Events: none.
Table 15. SCREEN_FORM Commands
Command identifier: SHOW
Name used in Map/Macros: Show
Description: Show HTML form
Parameters: none
Command identifier: HIDE
Name used in Map/Macros: Hide
Description: Hide HTML form
Parameters: none
6.2.5 HTML Dialog
Object type identifier: DIALOG_POPUP.
Events: none.
67
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Table 16. DIALOG_POPUP Commands
Command identifier: SHOW
Name used in Map/Macros: Show
Description: Show HTML dialog
Parameters: none
Command identifier: HIDE
Name used in Map/Macros: Hide
Description: Hide HTML dialog
Parameters: none
6.3 Video Subsystem
This section describes the events and actions of video subsystem's objects.
6.3.1 Camera
Object type identifier: CAM.
6.3.1.1 Events
This section describes following events of the Camera:
ARMED.
ATTACH.
BLINDING.
DEFOCUSED.
DETACH.
DISARMED.
FOCUSED.
LIGHT_OFF_COMPLETED.
LIGHT_ON_COMPLETED.
MD_START.
MD_STOP.
PTZ_STATUS.
REC.
REC_ERROR.
REC_STOP.
SPEAKER_STATE_ACQUIRED.
SPEAKER_STATE_READY.
68
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
TELEMETRY_BUSY.
TELEMETRY_RELEASED.
UNBLINDING.
VCA_EVENT.
6.3.1.1.1 ARMED
Description: Camera was armed by the ARM command from a Zone object.
Note. On arming camera by means of a Media Client (the Arm/ Disarm button) all corresponding zones arearming too, the ARMED event takes place.
Event name in macro: Camera was armed
Parameters: none
6.3.1.1.2 ATTACH
Description: Camera signal has been detected
Event name in macro: Attached
Parameters: none
6.3.1.1.3 BLINDING
Description: Camera has been blinding
Event name in macro: Blinding
Parameters: none
6.3.1.1.4 DEFOCUSED
Description: Camera is out-of-focus, focus is lost
Event name in macro: Defocused
Parameters: none
6.3.1.1.5 DETACH
Description: Camera signal has been disrupted
Event name in macro: Detached
Parameters: none
69
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
6.3.1.1.6 DISARMED
Description: Camera was disarmed by the DISARM command from a Zone object.
Note. On disarming camera by means of a Media Client (the Arm/ Disarm button) all corresponding zonesare disarming too, the DISARMED event takes place.
Event name in macro: Camera was disarmed
Parameters: none
6.3.1.1.7 FOCUSED
Description: Camera is focused, image is normalized
Event name in macro: Focused
Parameters: none
6.3.1.1.8 LIGHT_OFF_COMPLETED
Description: Built-in camera's light is off
Event name in macro: Light is off
Parameters: none
6.3.1.1.9 LIGHT_ON_COMPLETED
Description: Built-in camera's light is on
Event name in macro: Light is on
Parameters: none
6.3.1.1.10 MD_START
Description: Generated at the moment of motion detection in the frame of the armed camera
Event name in macro: Alarm
Parameters: none
6.3.1.1.11 MD_STOP
Description: Motion has stopped
Event name in macro: Alarm end
70
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Parameters: none
6.3.1.1.12 PTZ_STATUS
Description: Current PAN, TILT, ZOOM coordinates of the camera (received as response forGET_PTZ_STATUS command)
Name used in Macros: none
Parameters:
error
Possible values:
1 — coordinate request failed (current PTZ-coordinates of the camera could notbe received);
0 — coordinate request completed successfully (current PTZ-coordinates of thecamera received).
Note. If set to true there are no parameters.
pan_position Current pan-coordinate of the camera.
tilt_position Current tilt-coordinate of the camera.
zoom_position Current zoom-coordinate of the camera.
pan_position_norm
Current normalized pan-coordinate of the camera within SecurOS coordinatesystem.
tilt_position_norm
Current normalized tilt-coordinate of the camera within SecurOS coordinatesystem.
zoom_position_norm
Current normalized zoom-coordinate of the camera within SecurOS coordinatesystem.
Note. Normalized coordinates may be used as parameters for MOVE_ABS action.
6.3.1.1.13 REC
Description: Camera signal has begun recording onto hard disk
Event name in macro: Record start
Parameters: none
71
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
6.3.1.1.14 REC_ERROR
Description: Error recording to hard disk
Event name in macro: Record error
Parameters: none
6.3.1.1.15 REC_STOP
Description: Camera signal has stopped recording
Event name in macro: Record stop
Parameters: none
6.3.1.1.16 SPEAKER_STATE_ACQUIRED
Description: Camera's speaker is turned on
Event name in macro: Broadcasting audio to speaker is turned on
Parameters:
commentReference to the Computer, operator of which turned the Camera's speaker on(clicked the Turn speaker on button), in the following format: Computer<whitespace><Object_ID_within_SecurOS>
6.3.1.1.17 SPEAKER_STATE_READY
Description: Camera's speaker is turned off
Event name in macro: Broadcasting audio to speaker is turned off
Parameters:
commentReference to the Computer, operator of which turned the Camera's speaker off(clicked the Turn speaker off button), in the following format: Computer<whitespace><Object_ID_within_SecurOS>
6.3.1.1.18 TELEMETRY_BUSY
Description: Telemetry control of this Camera is blocked
Event name in macro: none
Parameters:
SLAVE_IDIdentifier of the Computer from which the PTZ control command that blockedtelemetry control was sent.
72
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
owner_idName of the User account that blocked telemetry control (Name field of the Useraccount object).
priority Priority of the User account that blocked PTZ control.
permanently
Method that was used to capture PTZ control (long-term PTZ hold/automaticrelease). Possible values:
true — PTZ control was captured by TELEMETRY_ACQUIRE commandwhen activating long-term PTZ hold mode.
false — PTZ control was captured by any command other thanTELEMETRY_ACQUIRE when activating exclusive telemetry control withautomatic release mode.
time Telemetry blocking time in HH:MM:SS.FFF format.
date Telemetry blocking date in DD-MM-YY format.
6.3.1.1.19 TELEMETRY_RELEASED
Description: Telemetry control of this Camera is unblocked
Event name in macro: none
Parameters:
slave_idIdentifier of the Computer from which the telemetry control unblock commandwas sent.
permanently
Method that was used to release PTZ control (telemetry control released fromlong-term PTZ hold mode/from exclusive telemetry control with automaticrelease mode). Possible values:
true — PTZ control was released by TELEMETRY_RELEASE commandwhen deactivating long-term PTZ hold mode.
false — PTZ control was released by any command other thanTELEMETRY_RELEASE in exclusive telemetry control with automatic releasemode.
time Telemetry unblocking time in HH:MM:SS.FFF format.
date Telemetry unblocking date in DD-MM-YY format.
6.3.1.1.20 UNBLINDING
Description: Camera has been unblinded
Event name in macro: Unblinding
Parameters: none
73
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
6.3.1.1.21 VCA_EVENT
Description: Video analytics event
Event name in macro: Video analytics event
Parameters:
comment
The structure in the JSON format, which may contain parameters that allowoperator to jump to viewing the event on the Camera using the graphical operatorinterface. The detected object can be highlighted in the frame with the help ofgraphic primitives. For the details see Use the comment Parameter to VisualizeEvents.
Note. Example of VCA_EVENT is presented below.
Listing 24. Example of VCA_EVENT
CAM|6|VCA_EVENT|comment<{"comment": "Object 3 entered zone 1","description": "Intrusion detector","visualization": "color:77,255,77,255;bgcolor:77,255,77,255;font:15;reltext:68.125,21.6667,1;color:77,255,77,204;penwidth:1;bgcolor:77,255,77,51;polygon:47.5,0,47.5,43.3333,88.75,43.3333,88.75,0;color:255,0,0,220;bgcolor:255,0,0,220;reltext:68.75,21.875,3;penwidth:2;bgcolor:0,0,0,0;rect:68.75,22.0833,5.70313,13.4375;bgcolor:255,0,0,220;penwidth:1;polyline:50.9375,26.25,51.25,25.4167,51.25,25.4167,50.9375,25.8333,51.875,24.5833,54.0625,26.25,55.625,28.3333,53.125,27.0833,55,27.0833,57.5,27.0833,59.375,28.3333,61.5625,27.9167,63.4375,28.75,65.3125,27.9167,67.1875,28.75,69.0625,28.3333,70.9375,28.3333;polyline:71.5625,28.75,74.375,28.4375;polyline:74.375,28.4375,74.0625,28.4375;polyline:74.375,28.4375,74.1406,28.5417;"}>,commentText<Object 3 entered zone 1>,date<31-05-18>,description<Intrusion detector>,object_id<3>,source_id<1>,source_type<TRACKINGKIT3>,time<15:39:17.610>,type<intrusion>,visualization<color:77,255,77,255;bgcolor:77,255,77,255;font:15;reltext:68.125,21.6667,1;color:77,255,77,204;penwidth:1;bgcolor:77,255,77,51;polygon:47.5,0,47.5,43.3333,88.75,43.3333,88.75,0;color:255,0,0,220;bgcolor:255,0,0,220;reltext:68.75,21.875,3;penwidth:2;bgcolor:0,0,0,0;rect:68.75,22.0833,5.70313,13.4375;bgcolor:255,0,0,220;penwidth:1;polyline:50.9375,26.25,51.25,25.4167,51.25,25.4167,50.9375,25.8333,51.875,24.5833,54.0625,26.25,55.625,28.3333,53.125,27.0833,55,27.0833,57.5,27.0833,59.375,28.3333,61.5625,27.9167,63.4375,28.75,65.3125,27.9167,67.1875,28.75,69.0625,28.3333,70.9375,28.3333;polyline:71.5625,28.75,74.375,28.4375;polyline:74.375,28.4375,74.0625,28.4375;polyline:74.375,28.4375,74.1406,28.5417;>,zone_id<1>
6.3.1.2 Commands
For convenience, Camera control commands are classified into the following groups:
Working with video.
Controlling focal length of the camera.
Controlling iris of the camera.
Controlling PTZ of the camera.
74
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Working with Presets and Tours.
Telemetry device state.
Controlling additional camera's devices.
Warning! Set of supported commands depends on Type and Model of the Camera.
6.3.1.2.1 Working with video
This section describes following commands of working with video:
ADD_SUBTITLES.
ARM.
CLEAR_SUBTITLES.
DISARM.
REC.
REC_ROLLBACK.
REC_STOP.
REQUEST_MASK.
SET_MUX.
START_VIDEO.
STOP_VIDEO.
6.3.1.2.1.1 ADD_SUBTITLES
Description: Add subtitles into the video stream
Name used in Macros: none
Parameters:
command
Subtitles text string.
Note. HTML tags can be used straight in the script if necessary to change theview of the titles (font, color, etc.). Special Unicode characters can also beused in subtitle body. To read more see Working with Subtitles section.
Warning! To display subtitles in the Live/ Archive modes select the Showsubtitles checkbox on the Cameras tab of the the Media Client object settings
window (see SecurOS Administration Guide). Otherwise subtitles will notbe displayed (this setting does not affect subtitles recording into the videostream). Formatting parameters specified in this command have a priority whendisplaying subtitles.
6.3.1.2.1.2 ARM
Description: Arm camera
Name used in Map/Macros: Arm
75
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Parameters: none
6.3.1.2.1.3 CLEAR_SUBTITLES
Description: Delete subtitles from the video stream
Note. To read more about deleting subtitles see Working with Subtitles section.
Name used in Macros: none
Parameters: none
6.3.1.2.1.4 DISARM
Description: Disarm camera
Name used in Map/Macros: Disarm
Parameters: none
6.3.1.2.1.5 REC
Description: Start recording
Warning! Command will be ignored if Camera's current recording mode is Do not record (see SecurOSAdministration Guide).
Name used in Map/Macros: Start record
Parameters:
hot_rec_timeTime period, during which the video is being recorded with the originalFPS of the video stream, in milliseconds
priority
Command priority. Possible values:
0 — recording is not restored after system rebooting; during systemoperation recording can be stopped by command that has both 1 and0 priority.
1 — recording is restored after system rebooting; during systemoperation recording can be stopped only by command that has 1priority. Parameter is used when command is sent by operator fromMedia Client window, Map Window or Macro (with specified priority).
If parameter is not specified when command is sent from the VB/ JScriptprogram, it is considered that camera is switched to recording mode withpriority of 0.
76
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
6.3.1.2.1.6 REC_ROLLBACK
Description: Start record and add pre-recorded video from pre-recording buffer before beginningof this record
Note. Duration of pre-recording is specified in the Camera object settings, see SecurOS AdministrationGuide.
Warning! Command will be ignored if Camera's current recording mode is Do not record (see SecurOSAdministration Guide).
Name used in Map/Macros: Start record with prealarm
Parameters:
rollback_time_abs
Absolute time on the time scale, in the HH:MM:SS.FFF format, forcurrent date. Defines the part of the pre-recording buffer to be added orindicates the time of the saved frame depending on the mode of thecommand (see description of the start_rec parameter). Full size ofthe pre-recording buffer is specified in the Camera object settings,see SecurOS Administration Guide.
hot_rec_timeTime period, during which the video is being recorded with the originalFPS of the video stream, in milliseconds
start_rec
Recording mode — frame or video fragment.
1 or not set — a video fragment will be saved.
if rollback_time_abs parameter is not set or specified value isabove the right border of the pre-recording time interval then thebuffer won't be added to the main record;
if specified value of the rollback_time_abs parameter is insidethe pre-recording time interval then the part of the buffer startingfrom the specified time will be added to the main record;
if specified value of the rollback_time_abs parameter is belowthe left border of the pre-recording time interval then the bufferwill be added completely.
0 — a frame will be saved.
if rollback_time_abs parameter is not set or specified value isabove the right border of the pre-recording time interval then thecurrent frame will be saved;
if specified value of the rollback_time_abs parameter is insidethe pre-recording time interval then a frame with time stampcorresponding to specified rollback_time_abs value will besaved;
if specified value of the rollback_time_abs parameter is belowthe left border of the pre-recording time interval then no frame willbe saved.
77
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
priority
Command priority. Possible values:
0 — recording is not restored after system rebooting; during systemoperation recording can be stopped by command that has both 1 and0 priority.
1 — recording is restored after system rebooting; during systemoperation recording can be stopped only by command that has 1priority. Parameter is used when command is sent by operator fromMedia Client window, Map Window or Macro (with specified priority).
If parameter is not specified when command is sent from the VB/ JScriptprogram, it is considered that camera is switched to recording mode withpriority of 0.
6.3.1.2.1.7 REC_STOP
Description: End recording
Warning! Command will be ignored if Camera's current recording mode is Continuous (see SecurOSAdministration Guide).
Name used in Map/Macros: Stop record
Parameters:
priority
Command priority. Possible values:
0 or not specified — recording will be stopped if camera wasswitched to recording mode by command with priority of 0;
1 — recording will be stopped regardless of priority of commandthat switched camera to the recording mode. Parameter is used whencommand is sent by operator from Media Client window, MapWindow or Macro.
If parameter is not specified when command is sent from the VB/ JScriptprogram, it is considered that camera is switched to recording mode withpriority of 0.
6.3.1.2.1.8 REQUEST_MASK
Description: Request of the mask
Name used in Macros: none
Parameters:
mask Mask
78
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
6.3.1.2.1.9 SET_MUX
Description: Toggle playback video on the specified channel.
Warning! Is used only for Player AVI type Video Capture Device.
Name used in Macros: none
Parameters:
mux Channel number
6.3.1.2.1.10 START_VIDEO
Description: Turn on video stream for current camera
Name used in Macros: none
Parameters:
slave_id Name of computer to which the camera is attached to
compressCompression enabling (0 — do not use compression, the compressionparameter will be ignored; 1 — enable)
compressionCompression (0 — no compression, 1 — max quality, . . . , 5 — minquality)
speed Video feed speed (fps)
codecCodec profile's XML file full name (including file name extension). Ifspecified file not exists or specified nothing, then current camera profilefrom the server will be used (for example, "codec","mjpeg.xml")
6.3.1.2.1.11 STOP_VIDEO
Description: Turn off video stream for current camera
Name used in Macros: none
Parameters:
slave_id Name of computer to which the camera is attached to
6.3.1.2.2 Controlling focal length of the camera
This section describes following commands of controlling focal length of the camera:
FOCUS_AUTO_MODE.
FOCUS_AUTO_MODE_DISABLE.
FOCUS_IN.
FOCUS_OUT.
FOCUS_STOP.
79
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
6.3.1.2.2.1 FOCUS_AUTO_MODE
Description: Auto focus
Name used in Macros: none
Parameters:
user_id User name. Optional parameter
priorityPTZ control priority specified for given user. Possible values: [1; 10].Default value is 1.
6.3.1.2.2.2 FOCUS_AUTO_MODE_DISABLE
Description: Disable auto focus
Name used in Macros: none
Parameters:
user_id User name. Optional parameter
priorityPTZ control priority specified for given user. Possible values: [1; 10].Default value is 1.
6.3.1.2.2.3 FOCUS_IN
Description: Increase lens focal distance
Note. Lens focal distance is changed continuously till FOCUS_STOP command is received.
Name used in Macros: none
Parameters:
speed Speed of focal length change. Possible values: [1; 10]. Optional parameter
user_id User name. Optional parameter
priorityPTZ control priority specified for given user. Possible values: [1; 10].Default value is 1.
6.3.1.2.2.4 FOCUS_OUT
Description: Decrease lens focal distance
Note. Lens focal distance is changed continuously till FOCUS_STOP command is received.
Name used in Macros: none
Parameters:
80
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
speed Speed of focal length change. Possible values: [1; 10]. Optional parameter
user_id User name. Optional parameter
priorityPTZ control priority specified for given user. Possible values: [1; 10].Default value is 1.
6.3.1.2.2.5 FOCUS_STOP
Description: Stop changing lens focal distance
Name used in Macros: none
Parameters:
user_id User name. Optional parameter
priorityPTZ control priority specified for given user. Possible values: [1; 10].Default value is 1.
6.3.1.2.3 Controlling iris of the camera
This section describes following commands of controlling iris of the camera:
IRIS_AUTO_MODE.
IRIS_CLOSE.
IRIS_OPEN.
IRIS_STOP.
6.3.1.2.3.1 IRIS_AUTO_MODE
Description: Auto iris
Name used in Macros: none
Parameters:
user_id User name. Optional parameter
priorityPTZ control priority specified for given user. Possible values: [1; 10].Default value is 1.
6.3.1.2.3.2 IRIS_CLOSE
Description: Close iris
Note. Iris is closed continuously till IRIS_STOP command is received.
Name used in Macros: none
Parameters:
81
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
speed Speed of iris closing. Possible values: [1; 10]. Default value is 1.
user_id User name. Optional parameter
priorityPTZ control priority specified for given user. Possible values: [1; 10].Default value is 1.
6.3.1.2.3.3 IRIS_OPEN
Description: Open iris
Note. Iris is opened continuously till IRIS_STOP command is received.
Name used in Macros: none
Parameters:
speed Speed of iris opening. Possible values: [1; 10]. Default value is 1.
user_id User name. Optional parameter
priorityPTZ control priority specified for given user. Possible values: [1; 10].Default value is 1.
6.3.1.2.3.4 IRIS_STOP
Description: Stop changing iris
Name used in Macros: none
Parameters:
user_id User name. Optional parameter
priorityPTZ control priority specified for given user. Possible values: [1; 10].Default value is 1.
6.3.1.2.4 Controlling PTZ of the camera
This section describes following commands of controlling PTZ of the camera:
AREAZOOM.
CENTER.
HORIZONTAL_STOP.
MOVE.
MOVE_ABS.
MOVE_STOP.
VERTICAL_STOP.
82
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
6.3.1.2.4.1 AREAZOOM
Description: Zoom selected area of the frame to full frame size
Name used in Macros: none
Parameters:
x1, y1
Coordinates of the upper left corner of the selected area (in parts of framesize). Range of possible values: [0; 10].
Note. The origin (0,0) is located in the upper left corner of the frame.
x2, y2
Coordinates of the lower right corner of the selected area (in parts of framesize). Range of possible values: [0; 10].
Note. The origin (0,0) is located in the upper left corner of the frame.
6.3.1.2.4.2 CENTER
Description: Set camera center into the point with specified coordinates
Name used in Macros: none
Parameters:
x, y
New coordinates of the camera center (in parts of frame size). Range ofpossible values: [0; 10].
Note. The origin (0,0) is located in the upper left corner of the frame.
6.3.1.2.4.3 HORIZONTAL_STOP
Description: Stop camera moving horizontally
Name used in Macros: none
Parameters: none
6.3.1.2.4.4 MOVE
Description: Move camera in specified direction and/or zoom camera
Note: Moving in the specified direction or zooming is performed continuously until:1. the MOVE_STOP command is received.2. the MOVE command with zero parameter values (pan_speed<0>, tilt_speed<0>,
zoom_speed<0>) is received.
3. the thresholds of the camera's tilt angle or zoom have been reached. In this case camera's moving orzooming will stop automatically.
83
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Name used in Macros: none
Parameters:
pan_speedMove camera horizontally with specified speed ("-X" — to the left, "X" — tothe right)
tilt_speed Move camera vertically with specified speed ("-Y" — up, "Y" — down)
zoom_speed Zoom camera with specified speed ("-Z" — zoom in, "Z" — zoom out)
durationTimeout (in milliseconds). If it has expired, then camera's rotating/zooming will be automatically stopped. If not specified, then camera'srotating/zooming will be executed continuously.
user_id User name. Optional parameter
priorityPTZ control priority specified for given user. Possible values: [1; 10].Default value is 1.
6.3.1.2.4.5 MOVE_ABS
Description: Move camera to specific position and/or zoom it
Name used in Macros: none
Parameters:
pan Horizontal rotation. Possible values: [-10800; 10800]
tilt Vertical rotation. Possible values: [-5400; 5400]
zoom Zoom. Possible values: [0; 1000]
6.3.1.2.4.6 MOVE_STOP
Description: Stop zoom changing or moving the camera vertically or horizontally
Name used in Macros: none
Parameters: none
6.3.1.2.4.7 VERTICAL_STOP
Description: Stop camera moving vertically
Name used in Macros: none
Parameters: none
84
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
6.3.1.2.5 Working with Presets and Tours
This section describes following commands of working with Presets and Tours:
CREATE_PRESET.
HOME.
PATROL_PLAY.
PATROL_REMOVE.
PATROL_STOP.
PRESET_RECALL.
REMOVE_PRESET.
RENAME_PRESET.
UPDATE_PRESET.
6.3.1.2.5.1 CREATE_PRESET
Description: Create preset
Name used in Macros: none
Parameters:
name Preset name.
6.3.1.2.5.2 HOME
Description: Turn camera to the home position
Name used in Macros: none
Parameters:
user_id User name. Optional parameter
priorityPTZ control priority specified for given user. Possible values: [1; 10].Default value is 1.
6.3.1.2.5.3 PATROL_PLAY
Description: Start tour
Name used in Macros: none
Parameters:
patrol
Identifier, that was assigned to the tour by SecurOS ([ID] value of the fulltour name displayed in the camera's tour list in the Media Client window inthe <Name><[ID]> format).
Note. If not set the first tour from the camera's tour list is activated.
85
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
user_id User name. Optional parameter
priorityPTZ control priority specified for given user. Possible values: [1; 10].Default value is 1.
6.3.1.2.5.4 PATROL_REMOVE
Description: Remove recorded tour
Name used in Macros: none
Parameters:
patrolIdentifier, that was assigned to the tour by SecurOS ([ID] value of the fulltour name displayed in the camera's tour list in the Media Client window inthe <Name><[ID]> format).
6.3.1.2.5.5 PATROL_STOP
Description: Stop tour
Name used in Macros: none
Parameters:
user_id User name. Optional parameter
priorityPTZ control priority specified for given user. Possible values: [1; 10].Default value is 1.
6.3.1.2.5.6 PRESET_RECALL
Description: Move to specified preset
Name used in Macros: none
Parameters:
presetIdentifier, that was assigned to the preset by the SecurOS ([ID] value ofthe full preset name displayed in the camera's preposition list in the MediaClient window in the <Name><[ID]> format).
pt_speedSpeed of moving camera into the specified preset. Possible values: [1; 10].Default value is 1.
user_id User name. Optional parameter
priorityPTZ control priority specified for given user. Possible values: [1; 10].Default value is 1.
86
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
6.3.1.2.5.7 REMOVE_PRESET
Description: Remove preset
Name used in Macros: none
Parameters:
idIdentifier, that was assigned to the preset by the SecurOS ([ID] value ofthe full preset name displayed in the camera's preposition list in the MediaClient window in the <Name><[ID]> format).
6.3.1.2.5.8 RENAME_PRESET
Description: Rename preset
Name used in Macros: none
Parameters:
idIdentifier, that was assigned to the preset by the SecurOS ([ID] value ofthe full preset name displayed in the camera's preposition list in the MediaClient window in the <Name><[ID]> format).
name New name of the preset.
6.3.1.2.5.9 UPDATE_PRESET
Description: Update preset (assign current coordinates)
Name used in Macros: none
Parameters:
idIdentifier, that was assigned to the preset by the SecurOS ([ID] value ofthe full preset name displayed in the camera's preposition list in the MediaClient window in the <Name><[ID]> format).
6.3.1.2.6 Telemetry device state
This section describes following commands of controlling telemetry device state:
GET_PTZ_STATUS.
REQUEST_PTZ.
TELEMETRY_ACQUIRE.
TELEMETRY_RELEASE.
6.3.1.2.6.1 GET_PTZ_STATUS
Description: Get PTZ status
Name used in Macros: none
87
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Parameters: none
6.3.1.2.6.2 REQUEST_PTZ
Description: Send request to disable telemetry hold to the specified Computer
Name used in Macros: none
Parameters:
user_idIdentifier of the user to whom the request to disable telemetry hold will besent
user_host Name of the Computer to which request will be sent
priorityPTZ control priority specified for given user. Possible values: [1; 10].Default value is 1.
6.3.1.2.6.3 TELEMETRY_ACQUIRE
Description: Turn long-term PTZ hold mode on
Name used in Macros: none
Parameters:
user_id Identifier of the user, in behalf of which telemetry hold will be turned on
priorityPTZ control priority specified for given user. Possible values: [1; 10].Default value is 1.
6.3.1.2.6.4 TELEMETRY_RELEASE
Description: Turn long-term PTZ hold mode off
Name used in Macros: none
Parameters:
user_id Identifier of the user, in behalf of which telemetry hold will be turned off
priorityPTZ control priority specified for given user. Possible values: [1; 10].Default value is 1.
6.3.1.2.7 Controlling additional camera's devices
This section describes following commands of controlling additional camera's devices:
LIGHT_OFF.
LIGHT_ON.
WIPER.
WASHING.
88
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
6.3.1.2.7.1 LIGHT_OFF
Description: Turn off the camera's built-in light
Warning! Command is processed only if the Light parameter in the Camera object settings window is set toBuilt-in.
Name used in Map/Macros: Turn off light
Parameters: none
6.3.1.2.7.2 LIGHT_ON
Description: Turn on the camera's built-in light
Warning! Command is processed only if the Light parameter in the Camera object settings window is set toBuilt-in.
Name used in Map/Macros: Turn on light
Parameters: none
6.3.1.2.7.3 WIPER
Description: Switch wiper on
Name used in Macros: none
Parameters: none
6.3.1.2.7.4 WASHING
Description: Start the camera washing procedure
Name used in Macros: none
Parameters: none
6.3.1.3 Working with Subtitles
Text that is imposed on the displayed video is called subtitles. In the SecurOS subtitles are displayedwithin Camera's cell in the area that is located inside the frame. Size of this area is limited by thefollowing margins: 10% (top/bottom) and 15% (left/right) of the frame size. Values of these marginsare hard-coded and can not be modified by user. Subtitles can not be displayed outside this area.
Two command are intended for working with subtitles:
ADD_SUBTITLES — this command is used to add subtitles to the video stream (see AddingSubtitles);
CLEAR_SUBTITLES — this command is used to remove subtitles from the video stream(see Removing Subtitles).
89
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Adding Subtitles
Warning! To display subtitles in the Live/ Archive modes select the Show subtitles checkbox on the Camerastab of the the Media Client object settings window (see SecurOS Administration Guide). Otherwise subtitleswill not be displayed.
Listing 25 displays an example of subtitles adding command when recognizing vehicle which licenseplate number belongs to black list. For each event of recognition, subtitles are displayed in the sameposition. To provide this the old text is removed automatically before adding the new one.
Listing 25. Adding subtitles
function Init(){Core.RegisterEventHandler("LPR_LOGIC","1","CAR_LP_FOUND",AddSub);
};
function AddSub(e){var db = e.database_type;if (db == "blacklist")
Core.DoReact("CAM","1","CLEAR_SUBTITLES");Core.DoReact("CAM","1","ADD_SUBTITLES","command",
"<p style = margin-left:320px;color:red;>Black list "+ e.number +"<br></p>");
};
Character set, available for using in subtitles text, is defined by the Windows' Current language for
non-Unicode programs system parameter (Control Panel Region and Language Region and
Language Administrative Tab). The characters of the Basic Latin (ASCII) are always available.Within the command parameter the following actions with the subtitles string are allowed:
Formatting Text;
String Positioning;
Using Unicode Characters.
Formatting textTo format the text any attributes of the <font> HTML tag can be used (color, face, size).
Warning! Values of the face and size attributes affect the number of characters in the line.
String PositioningIn Camera cell subtitles are displayed in terminal mode, i.e. output area are populated with the linesfrom the top of the cell to its bottom. When reaching the bottom border of the output area, then the toplines are substituted with new ones, which are displayed below. Text of the subtitle is displayed interminal string "character by character", depending on specified Minimum font size and Symbols perline parameter values (see SecurOS Administration Guide, Media Client settings, the Cameras tab)until it is not redefined in command.
By default, the beginning of the subtitle line is located in the upper left corner of the output area. Thisvalue can not be changed by the user. Offset of the beginning of the line relative to the starting pointcan be set in the following way:
horizontally — with the help of the margin-left/margin-right CSS-attributes or alignHTML-attribute inside the <p> or <div> tags. For example:
<p style = margin-left:150px;color:cyan>Subtitle test string</p>
90
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
vertically — vertical alignment of the subtitle line is not provided. If necessary, you can force a linebrake with an <br> element.
Using Unicode CharactersSpecial and other symbols are most completely represented in the Unicode character tables. To insertany Unicode character into the subtitle text use its decimal (&#DDDD;) or hexadecimal (&#xHHHH;)code value or its entity (&entity). For example, to add an "euro" character, use the "€","€" or "&euro" value. See the https://unicode-table.com web-page for full list of the Unicode-characters.
Removing SubtitlesSubtitles can be removed automatically (see Listing 25), or by operator in manual mode each time whenhe need to clear a frame.
The easiest way to remove subtitles is the launch of the empty macro. Listing 26 displays an example ofremoving subtitles.
Listing 26. Removing subtitles from the frame
function Init(){Core.RegisterEventHandler("MACRO","1.1","RUN",ClrSub);
};
function ClrSub(){Core.DoReact("CAM","1","CLEAR_SUBTITLES");
};
To provide correct command execution, the Macro object (with no parameters) must be created before.Each time when operator will click the button of this Macro on the Control Panel subtitles will beremoved from the frame.
6.3.2 Zone
Object type identifier: CAM_ZONE.
Table 17. CAM_ZONE Events
Event identifier Event name in macro Description
ARM Arm
DISARM Disarm
MD_START Alarm
MD_STOP Alarm end
Table 18. CAM_ZONE Commands
Command identifier Name used in Map/Macro Description
ARM Arm
91
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Command identifier Name used in Map/Macro Description
DISARM Disarm
6.3.3 Light Detector
Object type identifier: LD.
Table 19. LD Events
Event identifier Event name in macro Description
LIGHT_ON Light on
LIGHT_OFF Light off
Commands: none.
6.3.4 Archive Converter
Object type identifier: ARCH_CNV.
Table 20. ARCH_CNV Events
Event identifier: TASK_STARTED
Name used in Map/Macros: New video/audio export session
Description: Task is in process
Parameters:
task_id Task ID (in queue)
session_magic Session ID received from query
Event identifier: TASK_FINISHED
Name used in Map/Macros: Video/audio export completed
Description: Task was performed successfully
Parameters:
task_id Task ID (in queue)
session_magic Session ID received from query
output_filesList of created files with full path. File names are listed using semicolon(;)
actual_start_time
Date and time of the actual start of the video in exported file (in YYYY-MM-DD HH:MM:SS.FFF format)
Note. When converting archives of several cameras into the Evidence formatthis value is not displayed.
92
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
actual_stop_time
Date and time of the actual stop of the video in exported file (in YYYY-MM-DD HH:MM:SS.FFF format)
Note. When converting archives of several cameras into the Evidence formatthis value is not displayed.
Event identifier: TASK_INCOMPLETE
Event name in Macro: Task incomplete
Description: Event is generated in the following cases:
1. When converting the archive of several cameras into the Evidence format, the archives of somecameras could not be exported.
2. Failed to receive information about the Long-term archive.
Parameters:
task_id Task ID (in queue)
session_magic Session ID received from query
output_files List of created file with full path
comment
Depending on the reasons for generation (see Description), it may containthe following data:
1. Information about Cameras, for which an archive export is failed.
2. The Long-term archive is not available message.
Event identifier: TASK_CANCELLED
Event name in Macro: Video/audio export canceled
Description: Archive export task was canceled by operator
Parameters:
session_magic Session ID received from query
operator_name Name of the operator, who canceled the task
operator ID of the operator, who canceled the task
Event identifier: TASK_FAILED
Name used in Map/Macros: Video/audio export failed
Description: Task was failed
Parameters:
task_id Task ID (in queue)
problem Problem description
session_magic Session ID received from query
93
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Table 21. ARCH_CNV Commands
Command identifier: ARCH_EXPORT
Name used in Map/Macros: none
Description: Archive export
Parameters:
channel_id(mandatory)
Requested channel ID. Identifier of the camera to convert archive for
time_start(mandatory)
Left edge of the requested time interval (start search time) in DD-MMYYYY HH:MM:SS.FFF format
time_end (mandatory)Right edge of the requested time interval (stop search time) in DD-MMYYYY HH:MM:SS.FFF format
mic_idIdentifier of the free microphone when converting audio only. Ifspecified, then the channel_id parameter is skipped
session_magic(optional)
Will be included in converter answer
operator (optional) Name of the user (operator), who started conversion process
comment (optional) Any comment on the conversion process
client_type(optional)
Type of the query source object. Is used to address notificationsabout conversion results. If exists, value will be transferred insideanswer notification without change
client_id (optional)ID of the query source object. Is used to address notifications aboutconversion results. If exists, value will be transferred inside answernotification without change
dir (optional)
Directory to save converted file (export directory). The absolute pathmust be specified. If not set then value specified in the Archiveconverter object settings will be used. When specifying directoryname template it is possible to use macro substitutions (see SecurOSAdministration Guide)
file_name (optional)
Name of the converted file. Only name (not path) must be specified.If not set then value specified in the Archive converter object settingswill be used. When specifying file name template it is possible to usemacro substitutions (see SecurOS Administration Guide)
arch_id (optional)
Name of Computer parent to Archiver. Is used when converting long-term archive files. Must be set in the following format: <ComputerName.Archiver ID>.
If not set or is incorrect only files from primary archive can beconverted
arch_port (optional)Port to communicate with Archiver. Possible value — 901. If not setor is incorrect only files from primary archive can be converted
94
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
password (optional)
Is used for file encryption when converting into the Evidence format.If set and not empty the file will be encrypted using the algorithmselected in the Archive converter settings and protected with thespecified password. Otherwise encryption will not be implemented.
Warning! Only Latin characters and numerals can be used for thepassword.
password_not_encoded(optional)
Flag for password encryption when transferring through thenetwork. Possible values:
0 (by default) or not defined — password will be transferredwith encryption.
1 — password will be transferred as is.
Warning! If the export procedure is initiated by a script this value must be1.
6.3.5 Archiver
Object type identifier: ARCHIVER.
Table 22. ARCHIVER Events
Event identifier: TASK_ADDED
Event name in Macro: Task is added in queue
Description: Copy archive task is added to the task queue
Parameters:
task_id Task ID (in queue)
operatorID of the operator, on whose behalf this command has been executed.Optional parameter. Is present, if it was specified when the task wasqueued
Event identifier: ADD_TASK_FAILED
Event name in Macro: Failed to add task
Description: Error while adding task to the task queue
Parameters:
task_id Task ID (in queue)
operatorID of the operator, on whose behalf this command has been executed.Optional parameter. Is present, if it was specified when the task wasqueued
Event identifier: TASK_STARTED
Event name in Macro: New archiving session
95
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Description: Copy task started
Parameters:
task_id Task ID (in queue)
operatorID of the operator, on whose behalf this command has been executed.Optional parameter. Is present, if it was specified when the task wasqueued
Event identifier: TASK_FINISHED
Event name in Macro: Archiving completed
Description: Copy task was performed successfully
Parameters:
task_id Task ID (in queue)
operatorID of the operator, on whose behalf this command has been executed.Optional parameter. Is present, if it was specified when the task wasqueued
Event identifier: TASK_FAILED
Name used in Macro: Archiving failed
Description: Copy task was failed
Parameters:
task_id Task ID (in queue)
operatorID of the operator, on whose behalf this command has been executed.Optional parameter. Is present, if it was specified when the task wasqueued
Event identifier: TASK_CANCELLED
Event name in Macro: Archiving canceled
Description: Copy task canceled
Parameters:
task_id Task ID (in queue)
operatorID of the operator, on whose behalf this command has been executed.Optional parameter. Is present, if it was specified when the task wasqueued
Event identifier: TASK_NOT_FOUND
Event name in Macro: Task not found
Description: Specified task not found in the task queue
Parameters:
96
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
task_idTask ID (in queue). Optional parameter. Is presented within an event, ifthe CANCEL_TASK command has been executed
cam_idCamera ID. Optional parameter. Is presented within an event, if theCANCEL_CAM_TASK command has been executed
operatorID of the operator, on whose behalf this command has been executed.Optional parameter. Is present, if it was specified when the task wasqueued
Table 23. ARCHIVER Commands
Command identifier: ADD_TASK
Name used in Macro: Add task
Description: Add a new copy task to the task queue
Parameters:
cam_id ID of the Camera, archive of which must be copied
begin_timeDate and time of the beginning of the fragment to be copied (in YYYY-MM-DD HH:MM:SS.FFF format)
end_timeDate and time of the end of the fragment to be copied (in YYYY-MM-DDHH:MM:SS.FFF format). Optional parameter. If not specified, thencommand execution time will be used as the fragment end time
task_id
Task ID, unique within the Archiver session. Mandatory parameter. Valuemust be specified as follows:
in the Macro object settings — in manual mode;
in theVB/ JScript program object settings — with the help of an arbitraryalgorithm (sequence, generator).
operatorID of the operator, on whose behalf this command has been executed.Optional parameter
Command identifier: CANCEL_TASK
Name used in Macro: Cancel task
Description: Stop copying and remove task from the task queue
Parameters:
task_id ID of the task to be canceled
Command identifier: CANCEL_CAM_TASKS
Name used in Macro: Cancel Camera tasks
Description: Stop copying and remove all copy tasks for the specified camera from task queue
Parameters:
97
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
cam_id ID of the Camera, for which it is necessary to cancel all copy tasks
Command identifier: CANCEL_ALL_TASKS
Name used in Macro: Cancel all tasks
Description: Stop copying and remove all copy tasks for the given Archiver from task queue
Parameters: none
6.3.6 Media Client
Object type identifier: MEDIA_CLIENT.
Events: none.
Table 24. MEDIA_CLIENT Commands
Command identifier: SEEK
Name used in Map/Macros: none
Description: Jump to the specified time of the specified video archive file
Parameters:
date Date (in DD-MM-YY format)
time Time (in HH:MM:SS:XXX format)
cam(optional)
Camera ID, which must be set to archive. If not specified, the number of camerasthat are in archive mode will not change
Command identifier: CAM_MODE
Warning! This command is ignored if Media Client is operated in Alarming or Live only mode
(see SecurOS Administration Guide).
Name used in Map/Macros: none
Description: Set camera operation mode
Parameters:
cams Comma separated camera IDs.
mode
Camera operation modes. Possible values:
live — live video mode;
arch — archive mode.
Warning! This parameter affect only cameras placed on the current video page of theMedia Client. All other cameras of the given Media Client, that are in archive mode, willturn to the live video mode.
Command identifier: ACTIVATE_CAM
98
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Name used in Map/Macros: none
Description: Activate camera
Parameters:
camID of the camera to activate. After command execution the video page thatcontains activated camera is displayed. Current layout of the Media Client is notchanged
Command identifier: ACTIVATE_NAMED_MARKUP
Note. The command will be ignored if one of the following conditions is met:1. Working with Views is prohibited in the settings of the given Media Client.2. Working with the specified View is prohibited in the settings of the given Media Client or the
specified View does not exist.3. Working with all Cameras located on the specified View is prohibited in the settings of the given
Media Client.4. At the moment when the Media Client receives the command the Views editor is opened in it.
Name used in Map/Macros: none
Description: Activate View
Parameters:
id
ID of the View that must be activated in the Media Client.
Note. If the '*' (asterisk) value is specified the All devices View will be activated.
Command identifier: HARD_FILTER
Name used in Map/Macros: none
Description: Set a filter that lists the Cameras that are allowed/not allowed to be displayed on theMedia Client. This filter is an additional and is applied to the current Media Client object settings,that are relevant to working with Cameras
Parameters:
cams
The list of camera IDs, separated by a "," character (comma).
The following rules are applied to the specified list of cameras when executingcommand:
All Cameras specified in the list are displayed if their IDs exist and theseCameras are selected in the Media Client object settings;
If a non-existent identifier is specified, which is the only item in the list:
no one Camera is displayed if the parameter forbid = 0;
all the Cameras, are displayed if the parameter forbid = 1.
If the list is empty, then all Cameras, selected in the current settings of theMedia Client, are displayed.
99
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
forbid
Enable/Disable flag for displaying cameras listed in the cams parameter.Possible values:
0 — displaying of the listed Cameras on the Media Client is permitted;
1 — displaying of the listed Cameras on the Media Client is prohibited.
Command identifier: PLAY
Name used in Map/Macros: none
Description: Start playing archive
Parameters: none
Command identifier: STOP
Name used in Map/Macros: none
Description: Stop playing archive
Parameters: none
Command identifier: NEXT_FRAME
Name used in Map/Macros: none
Description: Jump specified camera to the next frame of the archive
Parameters:
cam Camera ID
Command identifier: PREV_FRAME
Name used in Map/Macros: none
Description: Jump specified camera to the previous frame of the archive
Parameters:
cam Camera ID
Command identifier: NEXT_RECORD
Name used in Map/Macros: none
Description: Jump specified camera to the next record of the archive
Parameters:
cam Camera ID
Command identifier: PREV_RECORD
Name used in Map/Macros: none
Description: Jump specified camera to the previous record of the archive
Parameters:
100
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
cam Camera ID
Command identifier: ADD_SEQUENCE
Name used in Map/Macros: none
Description: Set Media Client's layout (with specifying cameras and their positions)
Warning! This command is ignored if Media Client is operated in Alarming or Active mode (see SecurOS
Administration Guide). If Live only mode is on, then current layout is switched over; all cameras remain
in live video mode.
Parameters:
mode
Media Client's layout ID. Possible values:
standard and wide layouts IDs:
"1x1" — 1x1 layout;
"2x2" — 2x2 layout;
"1w5" — 1+5 layout;
"4w3" — 4+3 layout, etc.
ID of the custom Layout object.
cams_per_page
Number of cameras displayed in one Media Client's video page.
Warning! If mode and cams_per_page parameters are not specified, layout is selected by the system
automatically based on the total number of the cameras, specified in the seq parameter.
seq
The list of camera IDs, separated by a "|" character. Position in the listcorresponds to the number of the cell, where camera will be placed.
Note. Cameras are placed into a cells left to right from top to bottom. If the list containsan empty, incorrectly specified or non-existent camera's identifiers, then cellscorresponding to the positions of such identifiers remain empty.
arch
The list of camera IDs in archive mode, separated by a "," character (comma).When command is executed, only cameras from previous list are considered.
Warning! All other cameras of the given Media Client, that are in archive mode, will turnto the live video mode.
Command identifier: SET_MARKUP
Name used in Map/Macros: none
Description: Set Media Client's layout (without specifying cameras and their positions)
Warning! This command is ignored if Media Client is operated in Alarming or Active mode (see SecurOS
Administration Guide).
Parameters:
101
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
mode
Media Client's layout ID. Possible values:
standard and wide layouts IDs:
"1x1" — 1x1 layout;
"2x2" — 2x2 layout;
"1w5" — 1+5 layout;
"4w3" — 4+3 layout, etc.
ID of the custom Layout object.
Command identifier: EXPORT_FRAME_FROM_ACTIVE_CAM
Name used in Map/Macros: none
Description: Export a frame from active camera to a file
Note. A frame that is displayed in a camera cell at the moment of command execution will be exported.
Parameters: none
Command identifier: ADD_BOOKMARK_TO_ACTIVE_CAM
Name used in Map/Macros: none
Description: Add bookmark on the currently displayed frame of the active camera. Command isavailable when recording video in live mode and viewing video in archive mode.
Note. Bookmark is associated with the frame, that is displayed in a camera cell at the moment of commandexecution.
Parameters: none
Command identifier: JOYSTICK
Name used in Map/Macros: none
Description: Active camera PTZ control
Parameters:
pan Panning
tilt Tilting
zoom Zooming
Command identifier: MAXIMIZE_OR_RESTORE
Name used in Map/Macros: none
Description: Active camera cell size control: expand to full screen/collaps to previous size
Parameters: none
Command identifier: SWITCH_PAGE_TO_ARCHIVE
102
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Name used in Map/Macros: none
Description: Switch all cameras of an active video page to archive mode
Parameters: none
Command identifier: SWITCH_ALL_CAMERAS_TO_LIVE
Name used in Map/Macros: none
Description: Switch all cameras to live mode
Parameters: none
Command identifier: KEY_PRESSED
Name used in Map/Macros: none
Description: Commands to control Media Client and objects
Note. Camera control commands are used only for active camera.
Parameters:
key
Possible values:
ARM — arm camera;
DISARM — disarm camera;
REC — turn recording on;
REC — turn recording off;
LEFT — move left;
RIGHT — move right;
UP — move up;
DOWN — move down;
NEXT_PAGE — switch to next video page;
NEXT_PAGE — switch to previous video page;
FF — move to next archive frame;
REW — move to previous archive frame;
PLAY — start playback archive record;
STOP — start playback archive record;
MODE_ARCH — switch camera to archive mode;
MODE_VIDEO — switch camera to live mode.
Command identifier: LAYOUT_AUTOSCROLL
103
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Name used in Map/Macros: none
Description: start/stop auto scrolling of the Views or video pages of the All objects View. Viewsthat are placed on the Views quick access bar are scrolled through. If less than two Views are placedon the Views quick access bar, then all Views from the Views List are scrolled through. If the Allobjects View is active when command is executed, the video pages of this View are scrolledthrough.
Parameters:
enable
Possible values:
0 — stop auto scrolling;
1 — start auto scrolling.
Command identifier: PLACE_CAMERA
Name used in Map/Macros: none
Description: Move Camera to the specified cell of the layout
Parameters:
camID of the Camera to be moved.
Warning! If value is not set the Camera is removed from the specified cell of the layout.
cell Number of the cell (in current layout) where Camera must be moved to
Command identifier: SWITCH_LAYOUT
Name used in Map/Macros: none
Description: switch to the next/previous View. Views that are placed on the Views quick access barare scrolled through. If less than two Views are placed on the Views quick access bar, then all Viewsfrom the Views List are scrolled through. All objects View is ignored.
Parameters:
relative
Possible values:
<=0 — switch to the previous View;
>0 — switch to the next View.
Command identifier: TELEMETRY_STATE
Name used in Map/Macros: none
Description: Block telemetry control. When receiving a command a PTZ control priority of the userthat sent a command is analyzed. A command that was sent by user with the greatest telemetrycontrol priority will be executed. PTZ control will be locked for all other users.
Parameters:
104
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
TELEMETRY_BUSY
A sign that telemetry control is blocked. Possible values:
0 — control is blocked;
1 — control is unblocked.
SLAVE_ID Identifier of the Computer from which the telemetry control command was sent.
my_obj_slave Identifier of the Computer where controlled Camera is located.
owner_idName of the User account that sent control command (Name field of the Useraccount object).
priority
PTZ control priority specified for given User account. Possible values for eachparameter: [0; 2147483647]. Default value is 0.
Note. In first turn will be executed a command that was sent by user with the greaterpriority value.
cam_id Identifier of the Camera controlled by the given User account.
time Command sent time in HH:MM:SS.FFF format.
date Command sent date in DD-MM-YY format.
ADD_SEQUENCE command usage example is represented below.
Listing 27. ADD_SEQUENCE command example.
"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
6.3.7 Image Processor
Object type identifier: IMAGE_EXPORT.
Table 25. IMAGE_EXPORT Events
Event identifier: TASK_QUEUE_OVERLOADED
Event name in macro: none
Description: Task queue of the Image Processor is overloaded. A new tasks are not queued untilqueue is underloaded (see TASK_QUEUE_UNDERLOADED notification below)
Parameters: none
Event identifier: TASK_QUEUE_UNDERLOADED
105
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Event name in macro: none
Description: Task queue of the Image Processor is underloaded
Parameters: none
Event identifier: EXPORT_FAILED
Event name in macro: none
Description: Export failed
Parameters:
request_id Query ID
Event identifier: EXPORT_DONE
Event name in macro: none
Description: Export successful
Parameters:
request_id Request ID specified in the image export query
Table 26. IMAGE_EXPORT Commands
Command identifier: EXPORT
Name used in Map/Macros: none
Description: Process and export an image (frame) into file or database
Parameters:
request_idQuery ID. Specified value will be returned in the answer event(see Table 26).
import
Parameters of the queried image:
cam — id of the camera, for which it is necessary to export a frame;
time — date and time of the frame.
When exporting archive video frame
May be specified in one of the following formats:
DD-MM-YY HH:MM:SS.XXX;
YYYY-MM-DD HH:MM:SS.XXX.
Note. Milliseconds are optional (any number of characters).
106
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Frame search is performed within one second interval to the left and rightfrom 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), thensystem 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 onthe given video server, then command fails.
When exporting live video frame
The live value is used when exporting live video frame. Example:
. . . , "import","cam$7;time$live", . . .
As a result of command execution the nearest key-frame (i-frame) will beexported.
export_engine
Frame saving type. Possible values:
sql — into the database;
file — into the file.
export
Export parameters.
When exporting into a f ile:
filename — name of the saved file. File name extension is optional. If notspecified or set incorrect, system automatically changes extensiondepending of the type of original file (see export_image parameter);
dir — full path to the file. You can define both existing and createddirectory.
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.
When exporting into a database:
external database id — id of the external database, specified withinSecurOS;
query — SQL-query to save image into the database.
export_image(optional)
Parameters of the result file:
format — format of the saved file. Possible values: jpeg, jpg, png.Default value — jpg;
quality — image quality. Possible values: [-1; 0 — 100]. Defaultvalue is -1, that correspond to the quality, specified inside used imageexport library.
Note. The higher a parameter value, the better image quality and greater file size.
107
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
process(optional)
Image processing parameters (cropping initial image, drawing a figures,inserting text etc.):
color — color of the figure to be drawn. A name or code of the color (inRGB format, see http://www.w3.org/TR/SVG/types.html#ColorKeywords) must be specified. Default value is green;
penwidth:N — line width. Possible N values (in pixels): [0;100]. Defaultvalue is 2;
rect:x,y,w,h — draw a rectangle with x, y coordinates of the upperleft corner, width w and height h (in percent of image size). Possible valuesfor each parameter: [0; 100];
Note. If linear dimensions of the specified rectangle exceed image size, thenexceeding part of the rectangle is cropped.
crop:x,y,w,h — crop an image to the w, h (width, height) lineardimensions, beginning from the upper left corner x, y (in percent of theimage size). Possible values for each parameter: [0; 100];
default — set default values for the color and penwidth parameters;
font:N — font size (in pixels). Possible values: [1; 100]. Default value is11;
Note. Depending on used library, can be specified in relative units.
polygon:x1,y1,x2,y2, . . . ,xn,yn — draw a closed polygonwith x1,y1,x2,y2, . . . ,xn,yn vertex coordinates (in percent ofthe image size). The vertexes are connected in series, with straight lines,the last vertex is connected with the first one;
polyline:x1,y1,x2,y2, . . . ,xn,yn — draw a polyline withx1,y1,x2,y2, . . . ,xn,yn vertex coordinates (in percent of theimage size). The vertexes are connected in series, with the straight lines;
text:x,y,text — draw text on image. Text insertion start point is x,y(the lower left border of the first character, in pixels);
reltext:x,y,text — draw text on image. Text insertion start point isx,y (the lower left border of the first character, in % of image size);
scale:w,h — scale the initial image to the w, h size (width, heights, inpixels). Image scaling procedure complies with the following rules:
If only one of two arguments is specified, then scaling is done up tospecified size with preserving the initial image aspect ratio;
If both arguments are specified, then scaling is done up to specifiedsizes without preserving the initial image aspect ratio.
Notes:1. If the input string contains a ";" character (semicolon), all text must be
screened with "$$. . .$$" characters, for example, "$$one;two$$".
108
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
2. If string length or font size exceeds frame size, only part of the inscriptionthat fits frame size is drawn.
3. The collection of fonts and languages depends on installed operationsystem.
Warning! You can specify random number of the image processing parametersinside the same export command. Specified parameters are processed sequentially,i.e. each following specified parameter is applied to the image, that is a result ofexecution of the command with previous specified parameter.
caption
text_size:text — add a black area under result image, obtained afterexecution of the process operation, and output within it a text string inwhite with text_size font size (optional parameter, if not specified thendefault value is used).
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 ofinitial string.
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 singleword does not fit on one line, the system truncates the word characters forthe 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-partyintegrations.
EXPORT command usage example is represented below.
Listing 28. EXPORT usage example
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","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.pngfile 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
109
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
6.3.8 Edge Storage Sync
Object type identifier: EDGE_STORAGE.
Events: none
Table 27. EDGE_STORAGE Commands
Command identifier: SYNC_NOW
Name used in Map/Macros: none
Description: Launch archive synchronization
Parameters: none
6.3.9 Video Wall Controller
Object type identifier: VW_CONTROLLER.
Table 28. VW_CONTROLLER Events
Event identifier: LAYOUT_ACTIVATED
Event name in macro: Active layout has been changed
Description: Active video wall layout has been changed
Parameters:
id Name of the activated layout
user_idID of the SecurOS user or Windows user (if Active Directory is used,see SecurOS Administration Guide), who changed active layout
user_nameName of the SecurOS user Windows user (if Active Directory is used,see SecurOS Administration Guide), who changed active layout
6.4 Audio Subsystem
This section describes the events and actions of audio subsystem's objects.
6.4.1 Microphone
Object type identifier: AUDIO_LINE.
Table 29. AUDIO_LINE Events
Event identifier: ARM
Event name in macro: Arm
Description: Audio sensor is turned on
110
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Parameters: none
Event identifier: DISARM
Event name in macro: Disarm
Description: Audio sensor is turned off
Parameters: none
Event identifier: REC
Event name in macro: Record start
Description: Recording of signal has occurred
Parameters: none
Event identifier: REC_STOP
Event name in macro: Record stop
Description: Record stop
Parameters: none
Event identifier: RESET
Event name in macro: Reset line
Description: Microphone attached
Parameters: none
Event identifier: VOX_OFF
Event name in macro: Accu stop
Description: Voice operated control is off
Parameters: none
Event identifier: VOX_ON
Event name in macro: Accu start
Description: Voice operated control is on
Parameters: none
Table 30. AUDIO_LINE Commands
Command identifier: ARM
Name used in Map/Macros: Arm
111
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Description: Start recording
Note. If Bound parameter (see SecurOS Administration Guide) is specified in the Microphone objectsettings, then recording will start only when specified sound threshold is reached. Otherwise, the recordingwill start immediately after this command is executed.
Parameters: none
Command identifier: DISARM
Name used in Map/Macros: Disarm
Description: Stop recording
Parameters: none
6.5 I/O Subsystem
This section describes the events and actions of i/o subsystem's objects.
6.5.1 Sensor
Object type identifier: GRAY.
Table 31. GRAY Events
Event identifier: ALARM
Event name in macro: Alarm
Description: Alarm detected
Parameters:
commentContains ID of the Cameras (cams) selected in the Sensor object settings. For thedetails see Use the comment Parameter to Visualize Events.
Event identifier: ARM
Event name in macro: Arm
Description: Armed
Parameters:
commentContains ID of the Cameras (cams) selected in the Sensor object settings. For thedetails see Use the comment Parameter to Visualize Events.
Event identifier: CONFIRM
Event name in macro: Confirm
Description: Alarm confirmed
Parameters:
112
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
commentContains ID of the Cameras (cams) selected in the Sensor object settings. For thedetails see Use the comment Parameter to Visualize Events.
Event identifier: DISARM
Event name in macro: Disarm
Description: Disarmed
Parameters:
commentContains ID of the Cameras (cams) selected in the Sensor object settings. For thedetails see Use the comment Parameter to Visualize Events.
Event identifier: NOT_VALID_STATE
Event name in macro: Not valid state
Description: Zone is not valid
Parameters:
commentContains ID of the Cameras (cams) selected in the Sensor object settings. For thedetails see Use the comment Parameter to Visualize Events.
Event identifier: OPEN
Event name in macro: Open
Description: Open
Parameters:
commentContains ID of the Cameras (cams) selected in the Sensor object settings. For thedetails see Use the comment Parameter to Visualize Events.
Event identifier: NORM
Event name in macro: Normal
Description: Zone is normal
Parameters:
commentContains ID of the Cameras (cams) selected in the Sensor object settings. For thedetails see Use the comment Parameter to Visualize Events.
Event identifier: SHORT_CIRCUIT
Event name in macro: Short circuit
Description: Short circuit
Parameters:
commentContains ID of the Cameras (cams) selected in the Sensor object settings. For thedetails see Use the comment Parameter to Visualize Events.
Event identifier: SABOTAGE
113
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Name used in Map/Macros: Sabotage
Description: Sabotage
Parameters:
commentContains ID of the Cameras (cams) selected in the Sensor object settings. For thedetails see Use the comment Parameter to Visualize Events.
Table 32. GRAY Commands
Command identifier: DISABLE_RAY
Name used in Map/Macros: Disable sensor
Description: Disable sensor object
Parameters:
parent_id Parent video capture device ID
Command identifier: ARM
Name used in Map/Macros: Arm
Description: Arm
Parameters: none
Command identifier: CONFIRM
Name used in Map/Macros: Confirm
Description: Confirm alarm
Parameters: none
Command identifier: DISARM
Name used in Map/Macros: Disarm
Description: Disarm
Parameters: none
6.5.2 Relay
Object type identifier: GRELE.
Table 33. GRELE Events
Event identifier: OFF
Event name in macro: Relay off
Description: Relay off
114
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Parameters: none
Event identifier: ON
Event name in macro: Relay on
Description: Relay on
Parameters: none
Table 34. GRELE Commands
Command identifier: OFF
Name used in Map/Macros: Switch off
Description: Switch relay off
Parameters: none
Command identifier: ON
Name used in Map/Macros: Switch on
Description: Switch relay on
Parameters:
timeout
Command identifier: DISABLE_RELE
Name used in Map/Macros: Disable relay
Description: Disable relay object
Parameters:
parent_id Parent video capture device ID
6.6 Notification Subsystem
This section describes the events and actions of notification subsystem's objects.
6.6.1 E-mail Message
Object type identifier: MAIL_MESSAGE.
Table 35. MAIL_MESSAGE Events
Event identifier: SEND_ERROR (alarm)
Event name in macro: Message sending error
Description: Message sending error
115
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Parameters: none
Event identifier: SENT
Event name in macro: Message sent
Description: Message sent
Parameters: none
Table 36. MAIL_MESSAGE Commands
Command identifier: SEND
Name used in Map/Macro: Send message
Description: Sending a message with specified template
Parameters:
param_name_1,param_name_2, ..., param_name_N
Arbitrary variables of the message, specified in the Subject and/or Messagef ield. Optional parameters
attachmentsRedefinable parameter of the command, specified in the Attachment textbox of the mail message template. Optional parameter
6.6.2 Short Message
Object type identifier: SHORT_MESSAGE.
Table 37. SHORT_MESSAGE Events
Event identifier: SEND_ERROR (alarm)
Event name in macro: Message sending error
Description: Message sending error
Parameters: none
Event identifier: SENT
Event name in macro: Message sent
Description: Message sent
Parameters: none
Table 38. SHORT_MESSAGE Commands
Command identifier: SEND
Name used in Map/Macro: Send message
116
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Description: Send message
Parameters:
text
Arbitrary text other than the one specified in the message template (theMessage parameter in the Short Message object settings). Max messagelengths — 70 characters (Latin). Possible values:
<user_text> — the message with user specified text will be sent;
<NULL (value_isn't_set)> — the empty message will be sent;
Warning! If the parameter is not specified, a message will be sent with the templatetext.
6.6.3 Audible Notification Service
Object type identifier: VNS.
Events: none.
Table 39. VNS Commands
Command identifier: PLAY_WAV
Name used in Map/Macro: Play wave file
Description: Play WAV-file
Parameters:
filePath to WAV file (with extension) relative to SecurOS folder (e. g. file<\wav\cam_alarm_1.wav>)
6.6.4 Emergency service
Object type identifier: EMERGENCY.
Table 40. EMERGENCY Events
Event identifier: SUCCESS
Event name in macro: Emergency ticket is sent successfully
Description: Emergency ticket was sent successfully
Parameters:
comment
A structure that contains the following information:
Emergency ticket identifier;
response of the http server (internal identifier of the Emergency ticket).
117
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Event identifier: FAILED
Event name in macro: Failed to send Ticket
Description: Failed to send Emergency ticket
Parameters:
comment
A structure that contains the following information:
Emergency ticket identifier;
response code and response of the http server (or other description of thefault);
incident data (in JSON format).
Commands: none
6.7 Automation Subsystem
This section describes the events and actions of automation subsystem's objects.
6.7.1 Schedule
Object type identifier: TIME_ZONE.
Table 41. TIME_ZONE Events
Event identifier: ACTIVATE
Event name in macro: Begin
Description: Start of schedule operation
Parameters: none
Event identifier: DEACTIVATE
Event name in macro: End
Description: End of schedule operation
Parameters: none
Commands: none.
6.7.2 Macro
Object type identifier: MACRO.
118
www.issivs.com
Programming GuideSecurOS
Appendix B. SecurOS Objects Events and Commands Reference
Table 42. MACRO Events
Event identifier: RUN
Event name in macro: Execute
Description: Macro has been executed
Parameters: none
Table 43. MACRO Commands
Command identifier: RUN
Name used in Map/Macro: Execute
Description: Execute macro
Parameters: none
119
www.issivs.com
Programming GuideSecurOS
Technical Support Information
7 Technical Support Information
Current section contains service information that is necessary on addressing to Intelligent SecuritySystems Technical Support.
Note. Collected data have to be send to the Intelligent Security Systems Technical Support Team (see GettingTechnical Support).
To ensure quick technical support, prepare the following technical information:
Warning! Data in items marked by "*'' are necessary to report.
1. (*) User (customer) name to address to.
2. (*) Organization name.
3. (*) User (or organization) contacts: phone, e-mail.
4. Name of a personal Intelligent Security Systems manager (on Intelligent Security Systems authorizedpartner case). Otherwise, give the following data:
Company where the hardware and software components were purchased.
Actions proposed to solve the problems announced by a partner from whom the product waspurchased.
5. (*) Problem description.
6. (*) Actions results in the problem.
7. List of changes which result to the problem in case of applying after some changes in systemsettings/configuration.
8. System and diagnostic information on computer and SecurOS system configuration obtained fromthe SystemInfo utility (see SecurOS Administration Guide for detailed information about utility).
If it is impossible to run the utility provide the following information:
(*) Guardant keys identifier and Dallas code;
Note. Equipment Dallas code can be found by the ISS Hardware Report utility (see SecurOS AdministrationGuide for detailed information about utility).
(*) name and version of the installed Intelligent Security Systems company software.
total number of video servers 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.
120
www.issivs.com
Programming GuideSecurOS
Technical Support Information
network load.
network and network neighborhood configuration.
121
www.issivs.com
Programming GuideSecurOS
Index
Index
_ _system.js file, 41
A ACTIVATE command,
Desktop, 65
ACTIVATE, event,
Schedule, 117
ACTIVATE_CAM command, 97
ACTIVATE_NAMED_MARKUP command, 98
ACTIVATE_OBJECT event, 66
ADD_BOOKMARK_TO_ACTIVE_CAM command,
Media Client, 101
ADD_SEQUENCE command,
Media Client, 100
ADD_SUBTITLES command, 74
ADD_TASK command,
Archiver, 96
ADD_TASK_FAILED event,
Archiver, 94
ALARM event, 111
APPLICATION_FAILED event, 64
APPLICATION_STARTED event, 64
APPLICATION_STOPPED event, 64
ARCH_EXPORT command, 93
Archive Converter object, 91
Archiver object, 94
AREAZOOM command,
Camera, 82
ARM command,
Camera, 74
Microphone, 110
Sensor, 113
Zone, 90
ARM event,
Microphone, 109
Sensor, 111
Zone, 90
ARMED event, 68
ATTACH event, 68
Audible Notification Service object, 116
B BLINDING event, 68
C CAM_MODE command, 97
Camera object, 67
CANCEL_ALL_TASKS command,
Archiver, 97
CANCEL_CAM_TASKS command,
Archiver, 96
CANCEL_TASK command,
Archiver, 96
CARD_DUPLICATED event, 59
CENTER command,
Camera, 82
CLEAR_SUBTITLES command, 75
ClearInterval function, 34
ClearTimeout function, 34
Computer object, 61
CONFIRM command, 113
CONFIRM event, 111
CONN_OVERLOAD event, 61
CONNECT_ONE command, 63
CONNECT_OTHER command, 63
CONNECTED event, 61
CREATE_PRESET command, 84
D DB_OVERLOAD event, 61
DEACTIVATE command,
Desktop, 65
DEACTIVATE, event,
Schedule, 117
DEFOCUSED event, 68
Desktop object, 65
DETACH event, 68
DISABLE_RAY command, 113
DISABLE_RELE command, 114
DISARM command,
Camera, 75
Microphone, 111
Sensor, 113
Zone, 91
DISARM event,
Microphone, 110
Sensor, 112
Zone, 90
DISARMED event, 69
DISCONNECT_ONE command, 63
DISCONNECTED event, 62
DoReact, function, 31
122
www.issivs.com
Programming GuideSecurOS
Index
E Edge Storage Sync object, 109
E-mail Message object, 114
Emergency service object, 116
ERROR event,
VB/JScript program, 58
Event handlers functions, 17
Event Viewer object, 66
EXPORT command, 105
EXPORT_DONE event, 105
EXPORT_FAILED event, 105
EXPORT_FRAME_FROM_ACTIVE_CAM command, 101
External application object, 64
F FAILED event,
Emergency service, 117
FIND_OBJECT command,
Map Window, 65
FOCUS_AUTO_MODE command, 79
FOCUS_AUTO_MODE_DISABLE command, 79
FOCUS_IN command, 79
FOCUS_OUT command, 79
FOCUS_STOP command, 80
FOCUSED event, 69
G GET_PTZ_STATUS command,
Camera, 86
GetObjectChildIds, function, 33
GetObjectIds, function, 32
GetObjectName, function, 31
GetObjectParam, function, 32
GetObjectParentId, function, 32
GetObjectParentType, function, 32
GetObjectState, function, 31
GetSelfId, function, 29
H HARD_FILTER command, 98
HIDE command,
HTML Dialog, 67
HTML Form, 66
HOME command, 84
HORIZONTAL_STOP command,
Camera, 82
HTML Dialog object, 66
HTML Form object, 66
I ICoreMsg object, 44
Image Processor object, 104
IMsgFilter object, 43
IRIS_AUTO_MODE command, 80
IRIS_CLOSE command, 80
IRIS_OPEN command, 81
IRIS_STOP command, 81
IsObjectDisabled, function, 33
IsObjectExists, function, 33
IsObjectState, function, 33
J JOYSTICK command, 101
K KEY_PRESSED command, 102
L LAYOUT_ACTIVATED event, 109
LAYOUT_AUTOSCROLL command, 102
Light Detector object, 91
LIGHT_OFF command, 88
LIGHT_OFF event, 91
LIGHT_OFF_COMPLETED event,
Camera, 69
LIGHT_ON command, 88
LIGHT_ON event, 91
LIGHT_ON_COMPLETED event,
Camera, 69
M Macro object, 117
Map Window object, 65
MAXIMIZE_OR_RESTORE command, 101
MD_START event,
Camera, 69
Zone, 90
MD_STOP event,
Camera, 69
Zone, 90
Media Client object, 97
Microphone object, 109
MOVE command, 82, 83
MOVE_STOP command,
Camera, 83
N NEW_TICKET event, 60
123
www.issivs.com
Programming GuideSecurOS
Index
NEXT_FRAME command, 99
NEXT_RECORD command, 99
NORM event, 112
NOT_VALID_STATE event, 112
O OFF command, 114
OFF event, 113
ON command, 114
ON event, 114
onSetup, ISScustomAPI function, 45
OPEN event, 112
P PATROL_PLAY command, 84
PATROL_REMOVE command, 85
PATROL_STOP command, 85
PLACE_CAMERA command, 103
PLAY command, 99
PLAY_WAV command, 116
PRESET_RECALL command, 85
PREV_FRAME command, 99
PREV_RECORD command, 99
PROGRAM event, 62
PROTOCOL_RCVD event, 62
PTZ_STATUS event,
Camera, 70
Q QUEUE_CRITICAL event, 62
QUEUE_NORMAL event, 62
QUEUE_WARNING event, 62
R REC command, 75
REC event,
Camera, 70
Microphone, 110
REC_ERROR event,
Camera, 71
REC_ROLLBACK command, 76
REC_STOP command, 77
REC_STOP event,
Camera, 71
Microphone, 110
REGISTER_ERROR event, 62
REGISTERED event, 60
RegisterEventHandler, function, 27
RegisterObjectHandler, function, 27
RegisterReact, function, 29
RegisterTimerHandler, function, 28
Relay object, 113
REMOVE_PRESET command, 86
RENAME_PRESET command, 86
REQUEST_MASK command, 77
REQUEST_PTZ command, 87
RESET event,
Microphone, 110
RUN command,
Macro, 118
RUN event,
Macro, 118
S SABOTAGE event, 112
SAVE_CONFIG command, 59
Schedule, object, 117
SEEK command, 97
SEND command,
E-mail Message, 115
SEND event,
Short Message, 115
SEND_ERROR event,
E-mail Message, 114
Short Message, 115
SendEvent, function, 30
sendEvent, ISScustomAPI function, 45
sendReact, ISScustomAPI function, 45
Sensor object, 111
SENT event,
E-mail Message, 115
Short Message, 115
SET_MARKUP command,
Media Client, 100
SET_MUX command, 78
SetInterval function, 34
SetTimeout function, 34
Short Message object, 115
SHORT_CIRCUIT event, 112
SHOW command,
HTML Dialog, 67
HTML Form, 66
SHOW_INFO_MESSAGE command, 63
SHOW_INFO_MESSAGE event, 63
SPEAKER_STATE_ACQUIRED event,
Camera, 71
SPEAKER_STATE_READY event,
Camera, 71
START_VIDEO command,
Camera, 78
STOP command,
Media Client, 99
STOP_VIDEO command, 78
124
www.issivs.com
Programming GuideSecurOS
Index
SUCCESS event,
Emergency service, 116
SWITCH_ALL_CAMERAS_TO_LIVE command, 102
SWITCH_LAYOUT command, 103
SWITCH_PAGE_TO_ARCHIVE command, 101
SYNC_NOW command,
Edge Storage Sync, 109
SYNC_PROTOCOL command, 63
System object, 59
T TASK_ADDED event,
Archiver, 94
TASK_CANCELLED event, 92
Archiver, 95
TASK_FAILED event, 92
Archiver, 95
TASK_FINISHED event, 91
Archiver, 95
TASK_INCOMPLETE event, 92
TASK_NOT_FOUND event,
Archiver, 95
TASK_QUEUE_OVERLOADED event, 104
TASK_QUEUE_UNDERLOADED event, 104
TASK_STARTED event, 91
Archiver, 94
technical support,
how to get, 7
how to prepare service information, 119
TELEMETRY_ACQUIRE command, 87
TELEMETRY_BUSY event,
Camera, 71
TELEMETRY_RELEASE command, 87
TELEMETRY_RELEASED event,
Camera, 72
TELEMETRY_STATE command,
Media Client, 103
Timer functions, 22
U UNBLINDING event, 72
UNREGISTERED event, 60
UnregisterEventHandler, function, 28
UnregisterObjectHandler, function, 27
UnregisterReact, function, 29
UnregisterTimerHandler, function, 29
UPDATE_PRESET command, 86
User account object, 59
V VB/JScript program object description, 13
VCA_EVENT event,
Camera, 73
VERTICAL_STOP command,
Camera, 83
Video Wall Controller object, 109
VOX_OFF event, 110
VOX_ON event, 110
W WASHING command, 88
window.external.dispSOCoreProvider object, 42
WIPER command, 88
Z Zone object, 90