Cut talk to studio, excluding some panels, Cut talk to studio, excluding some panels -6 – Clear-Com Logic-Maestro User Manual
Page 134
Clear-Com Communication Systems
Eclipse Logic Maestro Instruction Manual
3 - 6
CUT TALK TO STUDIO, EXCLUDING SOME PANELS
// When control ST-CT is activated, prevents all panels apart from ISTA and I2003 from talking to
port I2003
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()
{
ControlMacro STCT = ControlMacro.GetControl("ST-CT");
PortObject[] stationsToCut = ControlMacro.GetAllStations();
PortObject STUD1 = ControlMacro.GetPort("I2003");
foreach (PortObject station in stationsToCut)
{
if (Exclude(station))
continue;
Action rOff1 = ControlActions.RouteOff(station.PortNumber, STUD1.PortNumber, 0);
STCT.Triggers(rOff1);
}
}
private bool Exclude(PortObject station)
{
if (station.TalkLabel.Trim() == "ISTA")
return true;
if (station.TalkLabel.Trim() == "I2003")
return true;
return false;
}
}
}