Control macro language, Example control macro, Control macro language -3 – Clear-Com Logic-Maestro User Manual

Page 69: Example control macro -3

Advertising
background image

Clear-Com Communication Systems
Eclipse Logic Maestro Instruction Manual

2 - 3

CONTROL MACRO LANGUAGE

The Microsoft .NET Framework is used to provide the scripting facility
through the use of dynamic code generation (CodeDOM). This
provides the facility to compile control macro into a binary file (an
Assembly) rather than the more traditional ‘interpreted’ control macro
of other languages such as VBScript.

Using the .NET Framework as the scripting environment provides the
stability and support that the framework has, along with gaining from
the .NET Framework features of:

• Managed application environment

• Garbage collector memory management

• Control macros are written in C#

EXAMPLE CONTROL MACRO

The following is an example of a control macro created using the
control macro editor.

Control Macro

ExampleScript

using System;

// automatically generated

using ClearCom.ScriptHost;
using ClearCom.ScriptLibrary;
using ClearCom.Entities;
using EMS.MapClient;
using EMS.MapClient.Tables;
using EMS.MapClient.Tables.Actions;

namespace CustomControlMacros

{

public class

CustomMacro : ScriptBase

{

public override

void

OnUserStart()

{

// User Script entered here

Control redLightControl = ExistingControlFromLabel(“RDLT”);

// gets an already existing Control, set up from the Control Manager within the ECS client and
allows it to be programmed

redLightControl.Triggers(

new

InhibitRoute(5, 6));

// When the red light control is fired (studio moves into Live mode) the route between ports 5 and
6 is

// inhibited. The control editor prompts the script author for either a port number or port name

redLightControl.Triggers(

new

ChangeStatus(“DIR”, HardwareStatus.LoudspeakerCut);

// changes a large number of panel properties by selecting a panel by name and then triggering a
change

redLightControl.Triggers(

new

ChangeStatus(“DIR”, 5);

// Changes LED 5 on panel DIR

}

}

}

Advertising