Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Engineering

Addins In TTY

  • Last UpdatedJun 02, 2022
  • 1 minute read

TeleTypewriter (TTY) addins that implement the IAddinTty interface can also be defined in the <module>Addins.xml and will be loaded when the application starts. In graphics only those addins which implement the IAddin interface will be loaded and started as before. Addins can implement both interfaces but may need refactoring so that no User Interface (UI) elements are started in TTY mode. User Defined Attributes (UDAs) implemented as pseudo attributes can now be implemented in this way; refer to example implementation of IAddinTty interface below.

using System;

using System.IO;

using System.Windows.Forms;

using Aveva.ApplicationFramework;

using Aveva.ApplicationFramework.Presentation;

using Aveva.Core.Database;

using Ps = Aveva.Core.Database.DbPseudoAttribute;

using NOUN = Aveva.Core.Database.DbElementTypeInstance;

namespace Aveva.Core.Tests.AddinTty

    /// <summary>

    /// Summary description for AddinTtyTest

    /// </summary>

    public class AddinTty : IAddinTty, IAddin

    {

        /// <summary>

        /// Start the Addin

        /// </summary>

        /// <param name="serviceManager"></param>

        void IAddinTty.Start(ServiceManager serviceManager)

        {

            // get uda attribute

            DbAttribute uda = DbAttribute.GetDbAttribute(":UDADDIN");

            if (uda != null)

            {

                // Create instance of delegate containing method to evaluate

                // pseudo attribute

                Ps.GetStringDelegate dele =

new Ps.GetStringDelegate(AddinTtyValue);

                // and pass delegate instance to core.

                Ps.AddGetStringAttribute(uda, NOUN.EQUIPMENT, dele);

            }

        }

        void IAddinTty.Stop()

        {

        }

        String IAddinTty.Name

        {

            get { return "AddinTty"; }

        }

        get { return "AddinTty"; }IAddinTty.Description

        {

           get { return "AddinTty"; }

        }

        // String delegate for UDA

        static private string AddinTtyValue(DbElement ele, DbAttribute att, DbQualifier qualifier)

        {

            return "AddinTty";

        }

    }

}

TitleResults for “How to create a CRG?”Also Available in