ControlMacros book



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

Clear-Com
Eclipse Logic Maestro Instruction Manual
A - 2 6
LEDs at various frequencies may work on some panels but not on 
others.  Generally a 1Hz flash is likely to work.
Macros may also reference keys on panels but it should be noted that 
the key numbering is different on different panels so any control macro 
will need to take account of this if there is more than one type of panel 
on a system.  The key numbering on the various panel types is given in 
Appendix C.
Figure A-26: Control Macro with Port Commands
In this way commands to create instances of configuration objects can 
be created.  These instances can then to referenced by other 
commands to modify the source system configuration.
The user may also create control macros manually using a text editor 
such as Notepad but this is not normally recommended as the error 
checking facilities of the control macro editor will not be available.
When a control macro is dragged and dropped into the control macro 
editor window a configuration window is opened to request the 
parameters that are required for that control macro.  Where there are a 
number of predetermined values for a parameter such as TRUE or 
FALSE a drop-down menu allows a parameter to be selected.  
Alternatively a parameter name can be entered manually.


Clear-Com
Eclipse Logic Maestro Instruction Manual
A - 2 7
Figure A-27: Macro Parameter Entry Window
When the parameters have been input clicking on ‘OK’ writes the new 
line into the control macro editor window at the current cursor position.  
Any errors in the command for example as a result of an incorrect 
parameter will be reported in the compilation messages window below 
the control macro editor window.
ELEMENTS OF A CONTROL MACRO
There are three basic steps to create a control function using the 
control macro facility.  These are:
1. Set the objects the macros are to operate on.  These may be ports 
or entities such as groups or conferences.  For example, to create a 
port object that references a specific port select the ‘Configuration 
Entities’ tab in the object browser window and open the ‘Port’ item to 
display a list of ports in the current configuration.  Double click on 
the required port to create the macro in the control macro editor 
window e.g.
PortObject var_myPortt = ControlMacro.GetPort(“MyPort”);
where ‘MyPort’ is the name of the port defined in ECS.  Alternatively 
port objects can be created by selecting the ‘Available Modules’ tab 
in the object browser and opening the Scriptlibrary.ControlMacro 
menu and selecting the ‘Getport (string)’ macro.  Ports may be 
selected by port name (string parameter), port number (integer 
parameter) or by global identifier (Guid).


Clear-Com
Eclipse Logic Maestro Instruction Manual
A - 2 8
2. Create an action to perform.  Select the ‘Available Modules’ tab in 
the object browser window and open the Scriptlibrary ControlActions 
menu.  Actions which use the objects previously created can be 
dragged and dropped into the control macro.  For example the 
action to activate an LED can be created using a port object created 
in step 1.
LEDDisplayAction MyLED = 
ControlAction.ActivateLED(MyPortObject,1);
will create an action ‘MyLED’ to activate the LED on key 1 on a 
panel attached to port ‘MyPort’.
3. Create a control object which will be used to trigger the action set up 
in step 2.  For example a control action could be created using a 
general purpose I/O port by selecting the ‘Configuration Entities’ tab 
and opening the ‘GPSF’ item to display a list of GPSF items.  
Double click on the required item to create the control macro in the 
control macro editor window e.g.
ControlMacro MyControl = ControlMacro.GetControl(“MyGPSF”);
4. Trigger the action.  To do this a control must be created which 
connects an event on the system with the action that has been 
created.  For example, a control can be created for another port e.g.
MyControl.Triggers(MyLED);
so that an event on the GPSF ‘MyGPSF’ will trigger the LED on key 
1 of the panel attached to ‘MyPort’.


Clear-Com
Eclipse Logic Maestro Instruction Manual
A - 2 9
MACRO REFERENCE
The objects from the Available Modules are described in this section.  
These macros are used to construct control macros using the control 
macro editor.  The meanings of the parameters used by the macros 
are:
• () - required parameter(s)
• [] - type of argument returned
• object - the name of the object being tested, normally an object 
created by a control macro such as ‘GetPort’
• bool - boolean operator, set to True or False
• int - integer value in the range 0 - 32767
• string - alphanumeric string parameter
• Guid - an ECS internal global identifier. Every entity has a unique 
internal identifier and while these may be used as input parameters 
for some control macros they are not generally used.
ATTACHMENTOBJECT MACROS
These macros are accessed by expanding the ‘Clearcom’ > ‘Entities’ > 
‘AttachmentObject’ entry in the Available Modules menu. 
Macro
Description
Equals (object) [bool]
Tests the equivalence of two objects and returns True or 
False. e.g.
bool = .equals<(object2)>;
GetHashCode () [int]
Returns the hash code of an object previously created 
by a control as an integer.  e.g.
int  = .GetHashCode();
GetType () [Type]
Returns the type of an object previously created by a 
control macro.  e.g.
Type = .GetType();
ToString () [string]
Returns the string value of an object previously created 
by a control macro. e.g.
string  = .ToString();
ActivateWithListen [bool]
Either returns the listen status of an object created by a 
control macro as a boolean True or False or sets the lis-
ten status of an object  to a boolean True or False e.g.
AttachmentObject = .ActivateWith-
Listen;
or
.ActivateWithListen = ;


Yüklə 7,32 Mb.

Dostları ilə paylaş:
1   ...   14   15   16   17   18   19   20   21   ...   33




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

    Ana səhifə