ControlMacros book



Yüklə 7,32 Mb.
Pdf görüntüsü
səhifə29/33
tarix28.06.2018
ölçüsü7,32 Mb.
#52153
1   ...   25   26   27   28   29   30   31   32   33

Clear-Com
Eclipse Logic Maestro Instruction Manual
B - 7
TRIGGER ACTION WHEN BOTH A IS SET AND A 
CROSSPOINT IS MADE
// When control AND1 is activated AND ISTA talks to D4222, activate control FRLY2
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 FRLY2 = ControlMacro.GetControl("FRLY2");
            // Fetch the panels we wish to get the crosspoint between.
            PortObject ISTA = ControlMacro.GetPort("ISTA");
            PortObject D4222 = ControlMacro.GetPort("D4222");
            // Create the control that will be triggered on the crosspoint.
            CrosspointControl crosspointControl = new CrosspointControl(ISTA, D4222);
            FRLY2.TriggersIf(crosspointControl, Condition.AND, AND1);
        }
    }
}


Clear-Com
Eclipse Logic Maestro Instruction Manual
B - 8
TRIGGER ACTION WHEN GROUP 1 MEMBER TALKS 
TO GROUP 2 MEMBER
// If any panel in group 1 talks to a panel in group 2, control "FRLY3" is activated
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()
        {            
            PortObject[] allStations = ControlMacro.GetAllStations();
            ControlMacro FRLY3 = ControlMacro.GetControl("FRLY3");
            // Test each panel to see if it is in group 1
            foreach (PortObject possibleGroup1Station in allStations)
            {
                if (!IsInGroup1(possibleGroup1Station))
                    continue;
                // Test each panel to see if it is in group 2
                foreach (PortObject possibleGroup2Station in allStations)
                {
                    if (!IsInGroup2(possibleGroup2Station))
                        continue;
                    // We have a pair of panels, one from group1, one from group2
                    // Create the control that will be triggered on the crosspoint.
                    CrosspointControl crosspointControl = new CrosspointControl(possibleGroup1Station, 
possibleGroup2Station);
                    crosspointControl.Triggers(FRLY3);
                }
            }
        }
        private bool IsInGroup1(PortObject station)
        {
            if (station.ListenAlias.Contains("*"))
                return true;
            return false;
        }
        private bool IsInGroup2(PortObject station)
        {
            if (station.ListenAlias.Contains("#"))
                return true;
            return false;
        }
    }
}
 


Clear-Com
Eclipse Logic Maestro Instruction Manual
B - 9
HEADSET-SELECT ON
// When control HS-ON is activated forces headset-select on for panel D4222
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()
        {
            // When control HS-ON is activated forces headset-select on for panel D4222
            // Fetch the elements we need.
            ControlMacro HSON = ControlMacro.GetControl("HS-ON");
            PortObject D4222 = ControlMacro.GetPort("D4222");
            HSON.Triggers(ControlActions.HeadsetSelect(D4222));
        }
    }
}


Clear-Com
Eclipse Logic Maestro Instruction Manual
B - 1 0
HEADSET-SELECT ON ALWAYS
// Forces headset-select on for panel D4222
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()
        {            
            PortObject D4222 = ControlMacro.GetPort("D4222");
            // Create dummy crosspoint, and turn it on
            CrosspointControl crosspointControl = new CrosspointControl(1022, 1022);
            crosspointControl.On = true;
            // Make the always-on crosspoint trigger the headset-select action
            crosspointControl.Triggers(ControlActions.HeadsetSelect(D4222));
        }
    }
}


Clear-Com
Eclipse Logic Maestro Instruction Manual
B - 1 1
LOUDSPEAKER-CUT ON
// When control LS-CT is activated forces loudspeaker cut on for panel D4222
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 HSON = ControlMacro.GetControl("LS-CT");
            PortObject D4222 = ControlMacro.GetPort("D4222");
            HSON.Triggers(ControlActions.CutLoudspeaker(D4222));
        }
    }
}


Yüklə 7,32 Mb.

Dostları ilə paylaş:
1   ...   25   26   27   28   29   30   31   32   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ə