69
6.
7.
8.
In the
window,
open the
list and select the
object.
Editor-Debugger
Script Debug/Edit
Script 2
Enter the following in the
field:
Script
if (Event.SourceType == "MACRO" && Event.SourceId == "1" &&
Event.Action == "RUN")
{
var ;
for(i=1; i<=4; i=i+1)
{
SetObjectParam("CAM",i,"hot_rec_time","10");
}
DebugLogString ("Hello world");
}
70
8.
9.
10.
11.
12.
In the
menu, select
to save the script.
File
Save to database
Create a test event to run the script in debug mode – “MACRO|1|RUN|”. To achieve this, in the
menu,
select
; the
window will
Debug and edit
Edit test event
Test message
open. Fill in the fields in the
window as shown in figure.
Test message
To run the script with the test event, select
in the
menu.
Test run
Debug and edit
Open the
list and select
. The debugger window will open at the right side.
Script Messages
Script 1
73
20.
21.
In
the debugger window of the
system, check that the macro and the script have run successfully.
Intellect
Check the accuracy of the script result. The
in the
to
object settings panels should read “10”.
Hot recording field
Camera 1
Camera 4
Script creation and debugging is now complete.
Script debugging
Script debugging features
Note
The
in the
settings panel is empty by default
Hot recording field
Camera
74
1.
2.
3.
4.
1.
The
utility allows debugging scripts using the built-in tools for checking script syntax, script interpreting and script execution with test events generated by the utility.
Editor-Debugger
The messages about the debugging results are displayed in the corresponding debugger windows.
The
utility provides the following debugging functionality:
Editor-Debugger
A separate debugger window is assigned to each Script object, where the test and system events, error messages, success messages and user
information messages are
displayed. The messages in the debugger windows can be filtered.
Special Information window debugger windows are available for displaying the messages related to the script being debugged.
Test events generated by the
utility, which are not registered by the Intellect system, are used for checking script accuracy.
Editor-Debugger
Third-party debugger programs can be used for step-by-step execution, viewing script variables during execution, and other functionality.
Creating and using test events
Creating test events
The
utility is capable of generating test events chosen by the user to help debug the scripts. Test events are not registered by the video surveillance system, i. e. they
Editor-Debugger
are not listed in the events log and not saved to the database.
No more than one test event can be created for each script.
To create a test event, do the following:
In the
menu, select
, or click the
button in the toolbar.
Debug and edit
Edit test event