Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Reverted from v. 1

...

Code Block
languagejavascript
//Считается количество реле в тревоге
var i = Number(0);
if (Event.SourceType == "MACRO" && Event.SourceId== "1" && Event.Action == "RUN")
{
	var msg = CreateMsg();
	msg.StringToMsg(GetObjectIds("GRELE"));
	var objCount = msg.GetParam("id.count");
	var k;
	for(k= 0; k < objCount; k++)
		if(GetObjectState("GRELE", msg.GetParam("id." + k))== "ALARM"){
			Lock();
			i = ITVItv_var("counter");
			i++;
			ITVItv_var("counter")=i;
			Unlock();
		}
}

...

Code Block
languagejavascript
//Считается количество лучей в тревоге
var i = Number(0);
if (Event.SourceType == "MACRO" && Event.SourceId== "1" && Event.Action == "RUN")
{
	var msg = CreateMsg();
	msg.StringToMsg(GetObjectIds("GRAY"));
	var objCount = msg.GetParam("id.count");
	var k;
	for(k = 0; k < objCount; k++)
		if(GetObjectState("GRAY", msg.GetParam("id." + k))== "ALARMED"){
			Lock();
			i = ITVItv_var("counter");
			i++;
			ITVItv_var("counter")=i;
			Unlock();
	}
}

...