beautypg.com

Clear-Com Logic-Maestro User Manual

Page 136

background image

Clear-Com Communication Systems

Eclipse Logic Maestro Instruction Manual

3 - 8

TRIGGER ACTION WHEN GROUP 1 MEMBER TALKS
TO GROUP 2 MEMBER

// If any panel in group 1 talks to a panel in group 2, control "FRLY3" is activated

using System;
using ClearCom.ScriptHost;
using ClearCom.ScriptLibrary;
using ClearCom.Entities;
using EMS.MapClient;
using EMS.MapClient.Tables;
using EMS.MapClient.Tables.Actions;
using Shared.Enums;

namespace CustomControlMacros
{
public class CustomMacro : ScriptBase
{
public override void OnUserStart()
{
PortObject[] allStations = ControlMacro.GetAllStations();
ControlMacro FRLY3 = ControlMacro.GetControl("FRLY3");

// Test each panel to see if it is in group 1
foreach (PortObject possibleGroup1Station in allStations)
{
if (!IsInGroup1(possibleGroup1Station))
continue;

// Test each panel to see if it is in group 2
foreach (PortObject possibleGroup2Station in allStations)
{
if (!IsInGroup2(possibleGroup2Station))
continue;

// We have a pair of panels, one from group1, one from group2

// Create the control that will be triggered on the crosspoint.
CrosspointControl crosspointControl = new CrosspointControl(possibleGroup1Station,

possibleGroup2Station);
crosspointControl.Triggers(FRLY3);
}
}
}

private bool IsInGroup1(PortObject station)
{
if (station.ListenAlias.Contains("*"))
return true;

return false;
}

private bool IsInGroup2(PortObject station)
{
if (station.ListenAlias.Contains("#"))
return true;

return false;
}

}
}