Clear-Com
Eclipse Logic Maestro Instruction Manual
B - 2
ACTIVATE LED ON ALL KEYS TO DESTINATION
// When control LED1 is activated, any key on any panel to I2003 is illuminated red.
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()
{
// Fetch the elements we need.
ControlMacro LED1 = ControlMacro.GetControl("LED1");
PortObject I2003 = ControlMacro.GetPort("I2003");
// Set up LED indications.
Action fireLed1 = ControlActions.ActivateLED(I2003, Shared.Enums.LedRate.On,
Shared.Enums.LedIndication.Red);
// Activate LEDs on.
LED1.Triggers(fireLed1);
}
}
}
Clear-Com
Eclipse Logic Maestro Instruction Manual
B - 3
TRIGGER ACTION WHEN BOTH A AND B ARE SET
// When control AND1 is activated and control AND2 is activated, activate control FRLY1
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()
{
// Fetch the elements we need.
ControlMacro AND1 = ControlMacro.GetControl("AND1");
ControlMacro AND2 = ControlMacro.GetControl("AND2");
ControlMacro FRLY1 = ControlMacro.GetControl("FRLY1");
FRLY1.TriggersIf(AND1, Condition.AND, AND2);
}
}
}
Clear-Com
Eclipse Logic Maestro Instruction Manual
B - 4
TRIGGER ACTION WHEN ALL OF A AND B AND C
ARE SET
// When control A1 is activated AND control A2 is activated AND control A3 is activated, activate
control FRLY4
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()
{
// Fetch the elements we need.
ControlMacro A1 = ControlMacro.GetControl("A1");
ControlMacro A2 = ControlMacro.GetControl("A2");
ControlMacro A3 = ControlMacro.GetControl("A3");
ControlMacro FRLY4 = ControlMacro.GetControl("FRLY4");
// Note that each control can only have one TriggersIf, so create an intermediate control
// to test the first 2 inputs.
ControlMacro intermediate = ControlMacro.CreateControl("IMDTE", true);
intermediate.TriggersIf(A1, Condition.AND, A2);
FRLY4.TriggersIf(intermediate, Condition.AND, A3);
}
}
}
Clear-Com
Eclipse Logic Maestro Instruction Manual
B - 5
CUT TALK TO STUDIO
// When control ST-CT is activated, prevents all panels 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)
{
Action rOff1 = ControlActions.RouteOff(station.PortNumber, STUD1.PortNumber, 0);
STCT.Triggers(rOff1);
}
}
}
}
Clear-Com
Eclipse Logic Maestro Instruction Manual
B - 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;
}
}
}
Dostları ilə paylaş: |