Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note
titleAttention!

The configuration guide for the Rovalant (A6, A16) integration module is available only in the Russian documentation for ACFA IntellectPSIM. This script can be modified for any other integration module that supports user entry into the controller.

...

Info
titleNote

For details, see Configuring the special mode of Monitoring PSIM PSIM operation with ACFA PSIM.

...

Code Block
languagejs
function SetPersons(srcDepartment, destTable, destTableSize, msg)
{
	var users = CreateMsg();
	users.StringToMsg(GetObjectIds("PERSON"));
	var userCount = users.GetParam("id.count");
	var i;
	var index;
	for(i = 0, index = 1; (index <= destTableSize) && (i < userCount); ++i)
	{
		var user = users.GetParam("id." + i);
		if(GetObjectParentId("PERSON", user, "DEPARTMENT") == srcDepartment)
		{
			msg.SetParam("USERS.user_id." + ItvAxxonSoft_var("counter"), user);
			msg.SetParam("USERS.number." + ItvAxxonSoft_var("counter"), index);
			msg.SetParam("USERS.key_type." + ItvAxxonSoft_var("counter"), destTable);
			index++;
			Lock();
			ItvAxxonSoft_var("counter")++;
			Unlock();
		}
	}
}
if(Event.SourceType == "VIDEOSRV_C" && Event.Action == "SPR_DATA_UPDATED")
{
	var ROVALANT_TYPE = "ROVALANT_DEVICE";
	var ROVALANT_ID = "1.1";
	var WRITE_CONFIG_REACT = "WRITE_CONFIG";
	ItvAxxonSoft_var("counter") = 0;
	var msg = CreateMsg();
	msg.SourceType = "CORE";
	msg.SourceId = "";
	msg.Action = "UPDATE_OBJECT";
	msg.SetParam("objtype", ROVALANT_TYPE);
	msg.SetParam("objid", ROVALANT_ID);
	var type = GetObjectParam(ROVALANT_TYPE, ROVALANT_ID, "type");
	if(type == "A6")
	{
		SetPersons("1", "USER", 79, msg);
	}
	else
	{
		SetPersons("1", "USER", 255, msg);
	}
	SetPersons("2", "POLICE", 15, msg);
	SetPersons("3", "ELECTRIC", 15, msg);

	msg.SetParam("USERS.user_id.count", ItvAxxonSoft_var("counter"));
	msg.SetParam("USERS.number.count",  ItvAxxonSoft_var("counter"));
	msg.SetParam("USERS.key_type.count",  ItvAxxonSoft_var("counter"));
	NotifyEvent(msg);
	NotifyEventStr(ROVALANT_TYPE, ROVALANT_ID, WRITE_CONFIG_REACT, "");
}

...