ControlMacros book



Yüklə 7,32 Mb.
Pdf görüntüsü
səhifə15/33
tarix28.06.2018
ölçüsü7,32 Mb.
#52153
1   ...   11   12   13   14   15   16   17   18   ...   33

Clear-Com
Eclipse Logic Maestro Instruction Manual
A - 2
• Assign named macro functions to controls
Note: Control Macros are only available to ECS V4.0 or later.
The Control Macro Application is a stand-alone application 
requiring a license key.
ECS then imports the macros for use within the ECS 
environment.
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#


Clear-Com
Eclipse Logic Maestro Instruction Manual
A - 3
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
               }
       }
}


Clear-Com
Eclipse Logic Maestro Instruction Manual
A - 4
CONTROL MACRO EDITOR
To create and edit the Control Macro, a control macro editor is 
provided. This consists of:
• A main control macro editor window
• An object browser
• A message window
An illustration of the control macro editor is shown below.
Figure A-1: Control Macro Editor Screen
CONTROL MACRO EDITOR WINDOW
The control macro editor window provides full access for editing the 
control macro scripts while also providing assistance to the user in the 
form of coloured syntax, ‘intellisense’ (offering context sensitive coding 
options) and code completion.
OBJECT BROWSER
The Object Browser gives a complete display of the objects and logic 
available to be used to construct control macros. This gives a detailed 
view of all the contained objects, their constructors, methods and 
properties. This view will be generated using the powerful reflection 
capability that is part of the .NET Framework.


Clear-Com
Eclipse Logic Maestro Instruction Manual
A - 5
MESSAGE WINDOW
The Message Window will provide feedback to the user of any 
validation issues when parsing the control macro. These issues will be 
flagged as either warnings or errors.
RUNNING CONTROL MACROS
Control macros are run at download time and follow a two stage 
approach of validation and building of the control macro.
The validation stage checks the control macro for warnings or errors 
which will be reported back to the user. Any errors will prevent the 
control macro from being compiled.
When the control macro has passed the validation stage, the control 
macro will be compiled into an Assembly using the Microsoft .NET 
Framework code compiler. This Assembly is then cached and will only 
be refreshed if the control macro itself is changed. It is then run at 
download time, with the output (usually the addition of rack-specific 
map objects) being sent to the frame together with the ECS-derived 
configuration.
STARTING THE CONTROL MACRO EDITOR
The control macro editor is accessed from Logic Maestro by clicking 
on the ‘New’ button and selecting ‘Control Macro’ from the drop-down 
‘Type’ menu.
Figure A-2: Control Macro Editor from Logic Maestro
After entering the required fields click on the ‘OK’ button to open the 
control macro editor. 
Saved control macro files have the same file extension of .ccm as logic 
maestro files and will be listed with logic maestro files.  If the ‘Edit 


Clear-Com
Eclipse Logic Maestro Instruction Manual
A - 6
Logic’ link is selected for a control macro file the control macro editor 
will be started automatically rather than the logic diagram editor.
The control macro editor can also be started using a desktop shortcut 
to the executable if required but this useage is not recommended.
The Eclipse Macro facility is a licensable option and a license key is 
required to use the editor to create new control macros.  When the 
editor is first started it will request a license key if one has not already 
been input.
Figure A-3: License Key Request
Enter the license key obtained from the supplier or distributor and click 
on the ‘OK’ button to continue and start the control macro editor.  If a 
valid license key is not entered the control macro editor will exit 
immediately.
Note: When running under Windows Vista the user must have 
administrator rights in order to enter the control macro editor 
license key.
When the editor is started from Logic Maestro it will display the three 
windows ready to start a new control macro (if started using the ‘New’ 
button) or load an existing macro.


Yüklə 7,32 Mb.

Dostları ilə paylaş:
1   ...   11   12   13   14   15   16   17   18   ...   33




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©www.genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə