Question
I want to trigger a control using a control macro and also a HCI command. How do I find the card/pin GPSF information for a control in EHX?
Solution
EHX shows the three control pins used for each control under Global Options for each control. We also provide a macro script, written in C#. It will open a dialog window but can easily be modified to write these values into a text file.
Import and enable the attached script (control macro) as part of your map and it will display the GPSF card/pin info when you make a download
Once you have the card/pin info you can disable the macro from your map.
Macro for showing Cards / Pins in any version of EHX:
StringBuilder sBuilder = new StringBuilder();
sBuilder.AppendLine("Control Name | Card | Pin");
foreach(EntityObject currentEntity in ControlMacro.GetAllEntities(true))
{
if(currentEntity.CC_ADV_TYPE == Shared.Enums.DestinationType.Control)
{
ControlMacro currentControl = ControlMacro.GetControl(currentEntity.EntityID);
sBuilder.AppendLine(currentEntity.CombinedLabel.PadRight(20) + " | " +currentControl.ControlObject.GetGPSF().Card.ToString() +" | " + currentControl.ControlObject.GetGPSF().Pin.ToString());
}
}
The string can either be shown as a dialog window:
System.Windows.Forms.MessageBox.Show(sBuilder.ToString());
Or written to file:
System.IO.File.WriteAllText(@"C:\TextFile.txt", sBuilder.ToString());
Attachments | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|