Versions Compared

Key

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

...

Code Block
languagejs
function GetReleStateMsg(type, id, action, card)
{
  var state = GetObjectState("GRELE","1");
  var msg = CreateMsg();
  msg.SourceType = type;
  msg.SourceId = id;
  msg.Action = action;
  msg.SetParam("state",(state=="OFF")?"DISARMED":"ARMED");
  msg.SetParam("card",card);
  return msg;
}

if(Event.SourceType=="VIDEOSRV_C_ATM" && Event.SourceId=="1" && Event.Action=="GET_OBJECT_STATE")
{
  NotifyEvent(GetReleStateMsg(Event.SourceType, Event.SourceId,"OBJECT_STATE_INFO",""));
}
else if(Event.SourceType=="GRELE" && (Event.Action=="ON" || Event.Action=="OFF"))
{
  NotifyEvent(GetReleStateMsg("VIDEOSRV_C_ATM", "1","OBJECT_STATE_INFO",""));
} 

...