Package com.cosylab.vdct.plugins
Class LinkTypeConfig
- java.lang.Object
-
- com.cosylab.vdct.plugins.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
-
-
Field Summary
Fields Modifier and Type Field Description static StringVDCT_LINK_CONFIG_FILEstatic StringVDCT_LINK_CONFIG_FILE_ENV
-
Constructor Summary
Constructors Constructor Description LinkTypeConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Insert the method's description here.StringgetAuthor()Insert the method's description here.StringgetDescription()Insert the method's description here.HashtablegetLinkTypeConfig()This method should return a table of different link type configurations.StringgetName()Insert the method's description here.StringgetVersion()Insert the method's description here.voidinit(Properties properties, PluginContext context)Insert the method's description here.voidstart()Insert the method's description here.voidstop()Insert the method's description here.
-
-
-
Field Detail
-
VDCT_LINK_CONFIG_FILE
public static final String VDCT_LINK_CONFIG_FILE
- See Also:
- Constant Field Values
-
VDCT_LINK_CONFIG_FILE_ENV
public static final String VDCT_LINK_CONFIG_FILE_ENV
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLinkTypeConfig
public Hashtable getLinkTypeConfig()
Description copied from interface:LinkTypeConfigPluginThis 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" });Ifnullis returned, VisualDCT interprets this as 'failed to load' / 'no configuration found'. If allLinkTypeConfigPluginplugins returnnull, 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:
getLinkTypeConfigin interfaceLinkTypeConfigPlugin- Returns:
- java.util.ArrayList
- See Also:
LinkTypeConfigPlugin.getLinkTypeConfig()
-
destroy
public void destroy()
Description copied from interface:PluginInsert the method's description here. Creation date: (6.12.2001 22:04:45)- Specified by:
destroyin interfacePlugin- See Also:
Plugin.destroy()
-
getAuthor
public String getAuthor()
Description copied from interface:PluginInsert the method's description here. Creation date: (6.12.2001 22:10:35)- Specified by:
getAuthorin interfacePlugin- Returns:
- java.lang.String
- See Also:
Plugin.getAuthor()
-
getDescription
public String getDescription()
Description copied from interface:PluginInsert the method's description here. Creation date: (6.12.2001 22:09:48)- Specified by:
getDescriptionin interfacePlugin- Returns:
- java.lang.String
- See Also:
Plugin.getDescription()
-
getName
public String getName()
Description copied from interface:PluginInsert the method's description here. Creation date: (6.12.2001 22:04:45)- Specified by:
getNamein interfacePlugin- Returns:
- something
- See Also:
Plugin.getName()
-
getVersion
public String getVersion()
Description copied from interface:PluginInsert the method's description here. Creation date: (6.12.2001 22:10:05)- Specified by:
getVersionin interfacePlugin- Returns:
- java.lang.String
- See Also:
Plugin.getVersion()
-
init
public void init(Properties properties, PluginContext context)
Description copied from interface:PluginInsert the method's description here. Creation date: (6.12.2001 22:04:45)- Specified by:
initin interfacePlugin- Parameters:
properties- propertiescontext- context- See Also:
Plugin.init(Properties, PluginContext)
-
start
public void start()
Description copied from interface:PluginInsert the method's description here. Creation date: (6.12.2001 22:04:45)- Specified by:
startin interfacePlugin- See Also:
Plugin.start()
-
stop
public void stop()
Description copied from interface:PluginInsert the method's description here. Creation date: (6.12.2001 22:04:45)- Specified by:
stopin interfacePlugin- See Also:
Plugin.stop()
-
-