Go to documentation repository
Page History
The DoReactStr method generates the response actions for reactions of the system objects. It The method sends the action reaction to the specified object. The action reaction is transferred directly to the kernel where on which the object belongsis registered, and not to the whole entire system. The action In the DoReactStr method, the reaction is specified as by a group of String arguments.
Method call syntaxSyntax for method invocation:
Code Block | ||
---|---|---|
| ||
function DoReactStr(objtype : String, id : String, action : String, param<value> [, param<value>] : String) |
Method arguments:
- objtype - Required is a required argument. The It corresponds to the type of the object that the action should be generated for. It takes the following values: Type – String, range – existing object types.
- id - Required argument. Identification number of the object of the type set in the objtype argument. It takes the following values: Type – String, range – existing identification numbers of the objects of the specified type.
- system object for which you want to generate a reaction. Possible values: String type, range is limited by object types registered in the system.
- id is a required argument. It corresponds to the identification (registration) number of the object specified by the objtype argument. Possible values: String type, range is limited by the identification numbers of objects of the specified type registered in the system.
- action is a required argument. It specifies the reaction that you want to generate. Possible values: String type, range is limited by the reactions available for the object action - Required argument. The action to be generated. It takes the following values: Type – String, range – available actions for the objects of the specified type.
- param<value> - Required is a required argument. Several You can specify several arguments of this type can be specified. The parameters of the action.. It corresponds to the parameter(s) of the system object reaction.
Syntax for setting a value to a parameter corresponds to a stringOne parameter has the following syntax:
"param<value>", where
param – is a name of the parameter;
value – is a value of the parameter.
Several parameters have the following syntaxSyntax for setting a value to several parameters corresponds to a string:
"param1<value1>,param2<value2>…"
Elements of the list are separated by commas with no white spacewithout spaces. If no parameters need parameter needs to be specified, an empty string is used:
Code Block | ||
---|---|---|
| ||
DoReactStr("CAM","1","REC",""); |
The Possible values of the param argument can take the following values: Type – String type, range – is limited by the available parameters of the specified action. The reaction. Possible values of the value argument can take the following values: Type – String type, range – depends on the parameter that you want to set.
For all reactions it is possible to you can specify delay of reaction performing execution using the delay<> parameter. Delay is specified in seconds.
Info | ||
---|---|---|
| ||
Two types of system messages are available in the Intellect system: events and actionsreactions.The The events usually contain some information and are used as notifications sent to all Intellect kernels connected to each other during the system setuparchitecture configuration. The actions reactions are the control commands sent to specific objects. An action A reaction is transmitted only to the kernel where on which the related required object belongsis registered, and not to the whole entire system.The The DoReactStr and DoReact methods are used to generate actionsreactions. The NotifyEventStr and NotifyEvent methods are used to generate events. |
Usage examples
ProblemExample 1. When an alarm is received from a camera, switch Monitor 1 to single Surveillance window mode (one-fold) and show the video from the alarmed camera in this window.
Code Block | ||
---|---|---|
| ||
if (Event.SourceType == "CAM" && Event.Action == "MD_START") { var camid = Event.SourceId; DoReactStr("MONITOR","1","ACTIVATE_CAM","cam<"+ camid +">"); DoReactStr("MONITOR","1","KEY_PRESSED","key<SCREEN.1>"); } |
ProblemExample 2. When alarm by some from a camera is completed the record is to be continued for 5 , the recording must continue for five second and after this time the record will be stopped recording must stop (analogue of Post-record mode).
Code Block | ||
---|---|---|
| ||
if (Event.SourceType == "CAM" && Event.Action == "MD_STOP") { var camid = Event.SourceId; DoReactStr("CAM",camid,"REC_STOP","delay<5>"); } |
ProblemExample 3. Use On macros 1 to , enable telemetry control using mouse on the camera 4 displayed in the monitor 10. Use On macros 2 to , disable it.
Code Block |
---|
if (Event.SourceType == "MACRO" && Event.Action == "RUN" && Event.SourceId == "1")
{
DoReactStr("MONITOR","10","CONTROL_TELEMETRY","cam<4>,on<1>");
}
if (Event.SourceType == "MACRO" && Event.Action == "RUN" && Event.SourceId == "2")
{
DoReactStr("MONITOR","10","CONTROL_TELEMETRY","cam<4>,on<0>");
}
|