18
Problem. Use macros 1 to enable telemetry control using mouse on the camera 4 displayed in the monitor 10. Use macros 2 to disable it.
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>");
}
The DoReact method
The DoReact method generates actions for the objects. It sends the action to the specified object. The action is transferred directly to the kernel where the object belongs, and not to
the whole system. The action is specified using the MsgObject object.
Method call syntax
function DoReact(msgevent : MsgObject)
Method arguments:
msgevent - Required argument. The action sent to the specified object. It takes the following values: MsgObject objects created earlier in the script.
Usage examples
Note
Two types of system messages are available in the Intellect system: events and actions.
The events usually contain some information and are used as notifications sent to all Intellect kernels connected to each other during the system setup.
The actions are the control commands sent to specific objects. An action is transmitted only to the kernel where the related object belongs, and not to the whole system.
The
and
methods are used to generate actions. The
and
methods are used to generate events.
DoReactStr
DoReact
NotifyEventStr
NotifyEvent
19
1.
2.
3.
Problem. When Relay 1 closes, close Relays 2 and 3. When Relay 1 opens, open Relay 2.
if (Event.SourceType == "GRELE" && Event.SourceId == "1")
{
var msgevent = Event.Clone();
if(Event.Action == "ON")
{
msgevent.SourceId = "2";
DoReact(msgevent);
msgevent.SourceId = "3";
DoReact(msgevent);
}
if(Event.Action == "OFF")
{
msgevent.SourceId = "2";
DoReact(msgevent);
}
}
The DoReactSetupCore method
The DoReactSetupCore method is used for changing the parameters of the object. It changes only the specified parameters, leaving other parameters intact.
Method call syntax
function DoReactSetupCore(objtype : String, id : String, param
[, param] : String )
Method arguments
objtype - Required argument. The type of the object whose parameters are to be changed. 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 object of the specified type.
param - Required argument. Several arguments of this type can be specified. The parameters of the action.
One parameter has the following syntax:
“param”, where
param – name of the parameter;