Go to documentation repository
The StringToMsg method transforms converts a String variable into an a MsgObject object.
Method call syntax
Syntax for method invocation:
| Code Block |
|---|
function StringToMsg(msg : String) : MsgObject |
Method arguments:
...
...
...
...
...
"objtype|id|action|param1<value1>,param2<value2>…", where
...
...
...
...
...
...
...
...
...
Usage examples
Problem. Upon an alarm in Example. On alarm from Sensor 1 or and 3, start recording audio from Microphone 1. Upon an On alarm in from Sensor 2 or 4, start recording audio from Microphone 2.
| Code Block | ||
|---|---|---|
| ||
if (Event.SourceType == "GRAY" && Event.Action == "ALARM")
{
var audioid;
if (Event.SourceId == "1" || Event.SourceId == "3")
{
audioid = "1";
}
if (Event.SourceId == "2" || Event.SourceId == "4")
{
audioid = "2";
}
var str = "OLXA_LINE|"+audioid+"|ARM|";
var msg = CreateMsg();
msg.StringToMsg(str);
NotifyEvent(msg);
} |