Class LinkTypeConfig

  • All Implemented Interfaces:
    LinkTypeConfigPlugin, Plugin

    public class LinkTypeConfig
    extends Object
    implements LinkTypeConfigPlugin
    A default LinkTypeConfig plugin. It reads link type configuration from an XML file. The file name is defined by VDCT_LINK_CONFIG_FILE filename located in user home directory (or in VDCT_CONFIG_DIR dir). Use VDCT_LINK_CONFIG_FILE_ENV environment variable to override this default setting. An example of XML file:
     
     <?xml version="1.0" encoding="UTF-8"?>
     
     <links>
        <link type="CONSTANT" pattern=".*" default="" description="CONSTANT" />
        <link type="PV_LINK" pattern=".*" default="" description="PV_LINK" />
        <link type="VME_IO" pattern="#C\d+ S\d+ @.*" default="#C0 S0( )*( @.*)?" description="VME_IO - #Ccard Ssignal @parm"  />
        <link type="CAMAC_IO" pattern="#B\d+ C\d+ N\d+ A\d+ F\d+( )*( @.*)?" default="CAMAC_IO - #B0 C0 N0 A0 F0 @" description="#Bbranch Ccrate Nstation Asubaddress Ffunction @parm" />
        <link type="AB_IO" pattern="#L\d+ A\d+ C\d+ S\d+( )*( @.*)?" default="#L0 A0 C0 S0 @" description="AB_IO - #Llink Aadapter Ccard Ssignal @parm" />
        <link type="GPIB_IO" pattern="#L\d+ A\d+( )*( @.*)?" default="#L0 A0 @" description="GPIB_IO - #Llink Aaddr @parm"  />
        <link type="BITBUS_IO" pattern="#L\d+ N\d+ P\d+ S\d+( )*( @.*)?" default="BITBUS_IO - @L0 N0 P0 S0 @" description="#Llink Nnode Pport Ssignal @parm"  />
        <link type="INST_IO" pattern="@.*" default="@" description="INST_IO - @"  />
        <link type="BBGPIB_IO" pattern="#L\d+ B\d+ G\d+( )*( @.*)?" default="#L0 B0 G0 @" description="BBGPIB_IO - #Llink Bbbaddr Ggpibaddr @parm"  />
        <link type="RF_IO" pattern="#R\d+ M\d+ D\d+ E\d+( )*( @.*)?" default="#R0 M0 D0 E0 @" description="RF_IO - #Rcryo Mmicro Ddataset Eelement"  />
        <link type="VXI_IO" pattern="#V\d+ (C\d+)?+  S\d+( )*( @.*)?" default="#V0 C0 S0 @" description="VXI_IO - #Vframe Cslot Ssignal @parm"  />
     </links>
     
     
    Author:
    Matej Sekoranja
    • Constructor Detail

      • LinkTypeConfig

        public LinkTypeConfig()
    • Method Detail

      • getLinkTypeConfig

        public Hashtable getLinkTypeConfig()
        Description copied from interface: LinkTypeConfigPlugin
        This method should return a table of different link type configurations. Each element of the list should have a key identifiying the link type (e.g. VME_IO) and have the value of type Object[3], where array consists of { java.util.regex.Pattern, java.lang.String, java.lang.String }. The array represents { link validation schema, default schema, description }. An example of default implementation:
         
                Hashtable linkTypeConfigTable = new Hashtable();
         
                linkTypeConfigTable.put("CONSTANT", new Object[] { Pattern.compile(".*"), "", "CONSTANT" });
                linkTypeConfigTable.put("PV_LINK", new Object[] { Pattern.compile(".*"), "", "PV_LINK" } );
                linkTypeConfigTable.put("VME_IO", new Object[] { Pattern.compile("#C\\d+ S\\d+ @.*"), "#C0 S0 @", "VME_IO - #Ccard Ssignal @parm" });
                linkTypeConfigTable.put("CAMAC_IO", new Object[] { Pattern.compile("#B\\d+ C\\d+ N\\d+ A\\d+ F\\d+ @.*"), "CAMAC_IO - #B0 C0 N0 A0 F0 @", "#Bbranch Ccrate Nstation Asubaddress Ffunction @parm" });
                linkTypeConfigTable.put("AB_IO", new Object[] { Pattern.compile("#L\\d+ A\\d+ C\\d+ S\\d+ @.*"), "#L0 A0 C0 S0 @", "AB_IO - #Llink Aadapter Ccard Ssignal @parm" });
                linkTypeConfigTable.put("GPIB_IO", new Object[] { Pattern.compile("#L\\d+ A\\d+ @.*"), "#L0 A0 @", "GPIB_IO - #Llink Aaddr @parm" });
                linkTypeConfigTable.put("BITBUS_IO", new Object[] { Pattern.compile("#L\\d+ N\\d+ P\\d+ S\\d+ @.*"), "BITBUS_IO - @L0 N0 P0 S0 @", "#Llink Nnode Pport Ssignal @parm" });
                linkTypeConfigTable.put("INST_IO", new Object[] { Pattern.compile("@.*"), "@", "INST_IO - @" });
                linkTypeConfigTable.put("RF_IO", new Object[] { Pattern.compile("#R\\d+ M\\d+ D\\d+ E\\d+ @.*"), "#R0 M0 D0 E0 @", "RF_IO - #Rcryo Mmicro Ddataset Eelement" });
                linkTypeConfigTable.put("VXI_IO", new Object[] { Pattern.compile("#V\\d+ (C\\d+)?+  S\\d+ @.*"), "#V0 C0 S0 @", "VXI_IO - #Vframe Cslot Ssignal @parm" });
         
        If null is returned, VisualDCT interprets this as 'failed to load' / 'no configuration found'. If all LinkTypeConfigPlugin plugins return null, VisualDCT loads default configuration. Plugins are loaded as defined in VisualDCT plugin configuration. Configurations are additive, i.e. if there are two configurations for the same link type, the last overrides the first. Creation date: (8.12.2001 12:45:31)
        Specified by:
        getLinkTypeConfig in interface LinkTypeConfigPlugin
        Returns:
        java.util.ArrayList
        See Also:
        LinkTypeConfigPlugin.getLinkTypeConfig()
      • destroy

        public void destroy()
        Description copied from interface: Plugin
        Insert the method's description here. Creation date: (6.12.2001 22:04:45)
        Specified by:
        destroy in interface Plugin
        See Also:
        Plugin.destroy()
      • getAuthor

        public String getAuthor()
        Description copied from interface: Plugin
        Insert the method's description here. Creation date: (6.12.2001 22:10:35)
        Specified by:
        getAuthor in interface Plugin
        Returns:
        java.lang.String
        See Also:
        Plugin.getAuthor()
      • getDescription

        public String getDescription()
        Description copied from interface: Plugin
        Insert the method's description here. Creation date: (6.12.2001 22:09:48)
        Specified by:
        getDescription in interface Plugin
        Returns:
        java.lang.String
        See Also:
        Plugin.getDescription()
      • getName

        public String getName()
        Description copied from interface: Plugin
        Insert the method's description here. Creation date: (6.12.2001 22:04:45)
        Specified by:
        getName in interface Plugin
        Returns:
        something
        See Also:
        Plugin.getName()
      • getVersion

        public String getVersion()
        Description copied from interface: Plugin
        Insert the method's description here. Creation date: (6.12.2001 22:10:05)
        Specified by:
        getVersion in interface Plugin
        Returns:
        java.lang.String
        See Also:
        Plugin.getVersion()
      • start

        public void start()
        Description copied from interface: Plugin
        Insert the method's description here. Creation date: (6.12.2001 22:04:45)
        Specified by:
        start in interface Plugin
        See Also:
        Plugin.start()
      • stop

        public void stop()
        Description copied from interface: Plugin
        Insert the method's description here. Creation date: (6.12.2001 22:04:45)
        Specified by:
        stop in interface Plugin
        See Also:
        Plugin.stop()