Package de.desy.tine.server.properties

Source Code of de.desy.tine.server.properties.TExportProperty

/*
* Created on Nov 5, 2004
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package de.desy.tine.server.properties;

import java.util.ArrayList;
import java.util.LinkedList;

import de.desy.tine.dataUtils.TDataType;
import de.desy.tine.definitions.TAccess;
import de.desy.tine.definitions.TArrayType;
import de.desy.tine.definitions.TErrorList;
import de.desy.tine.definitions.TFormat;
import de.desy.tine.definitions.TStrings;
import de.desy.tine.server.connections.TClient;
import de.desy.tine.server.equipment.TEquipmentModuleFactory;
import de.desy.tine.server.logger.TFecLog;
import de.desy.tine.stringUtils.StringToName;
import de.desy.tine.types.NAME16;

/**
* Device servers must export the properties they wish to handle.
*
* @author duval
*/
public class TExportProperty
{
  private String name = ""; // property name
  private String alias = ""; // property alias name
  private int id = -1; // assigned property id
  private int outputSize = 0; // maxValue output data size
  private int inputSize = 0; // maxValue input data size
  private short outputFormat = (short) 0; // from TFormat
  private short inputFormat = (short) 0; // from TFormat
  private short accessMode = (short) 0; // from TAccess
  private boolean isbusy = false;
  public void setBusy(boolean value) { isbusy = value; }
  public boolean isBusy() { return isbusy; }
  public boolean isBusy(int milliseconds)
  {
    if (!isbusy) return false;
    int ms = milliseconds;
    int delta_t = 0;
    long t = System.currentTimeMillis();
    while (delta_t < ms)
    {
      try { wait(ms); } catch (Exception ignore) {};
      if (!isbusy) break;
      delta_t = (int)(System.currentTimeMillis()-t);
      ms -= delta_t;
    }
    return isbusy;
  }
  public boolean hasExclusiveRead = false;
  public boolean hasUnlockedExclusiveRead = false;
  public boolean isStatic = false;
  public boolean isSaveAndRestore = false;
  public boolean isEnforceOutput = false;
  public boolean isMultiChannelArray()
  {
    if (description == null) return false;
    if ((description.getArrayType() & TArrayType.AT_CHANNEL) == TArrayType.AT_CHANNEL)
      return true;
    return false;
  }
  public boolean isTraceArray()
  {
    if (description == null) return false;
    if ((description.getArrayType() & TArrayType.AT_TRACE) == TArrayType.AT_TRACE)
      return true;
    return false;
  }
  public boolean isDoubleArray()
  {
    if (description == null) return false;
    if ((description.getArrayType() & TArrayType.AT_DOUBLE) == TArrayType.AT_DOUBLE)
      return true;
    return false;
  }
  private TDataType srData = null;
  public TDataType getSaveRestoreData() { return srData; }
  public void setSaveRestoreData(TDataType dtype) { srData = dtype; }
  private int minAccessDeadband = 0;
  public int getAccessDeadband() { return minAccessDeadband; }
  public void setAccessDeadband(int deadbandInMilliseconds) { minAccessDeadband = deadbandInMilliseconds; }
  private int mcaValidFloor = 0;
  public int getMcaValidFloor() { return mcaValidFloor; }
  public void setMcaValidFloor(long timeInMillisec) { mcaValidFloor = (int)(timeInMillisec/1000); }
  public void setMcaValidFloor(int timeInSeconds) { mcaValidFloor = timeInSeconds; }
  private String outputTag = ""; // output data structure tag if non zero-length
  private String inputTag = ""; // input data structure tag if non zero-length
  private TPropertyDescription description = null;
  public String getUnits()
  {
    if (description == null) return "";
    return description.getYRange().getUnits();
  }
  public void setUnits(String value)
  {
    if (description == null) description = new TPropertyDescription();
    TPropertyEGU egu = description.getYRange();
    if (egu != null) egu.setUnits(value);   
  }
  public float getMaximumValue()
  {
    if (description == null) return (float)0.0;
    TPropertyEGU egu = description.getYRange();
    if (egu == null) return (float)0.0;
    return egu.getMaxValue();
  }
  public void setMaximumValue(float value)
  {
    if (description == null) description = new TPropertyDescription();
    TPropertyEGU egu = description.getYRange();
    if (egu != null) egu.setMaxValue(value);
  }
  public float getMinimumValue()
  {
    if (description == null) return (float)0.0;
    TPropertyEGU egu = description.getYRange();
    if (egu == null) return (float)0.0;
    return egu.getMinValue();
  }
  public void setMinimumValue(float value)
  {
    if (description == null) description = new TPropertyDescription();
    TPropertyEGU egu = description.getYRange();
    if (egu != null) egu.setMinValue(value);
  }
  public String getXUnits()
  {
    if (description == null) return "";
    return description.getXRange().getUnits();
  }
  public void setXUnits(String value)
  {
    if (description == null) description = new TPropertyDescription();
    TPropertyEGU egu = description.getXRange();
    if (egu != null) egu.setUnits(value);   
  }
  public float getMaximumXValue()
  {
    if (description == null) return (float)0.0;
    TPropertyEGU egu = description.getXRange();
    if (egu == null) return (float)0.0;
    return egu.getMaxValue();
  }
  public void setMaximumXValue(float value)
  {
    if (description == null) description = new TPropertyDescription();
    TPropertyEGU egu = description.getXRange();
    if (egu != null) egu.setMaxValue(value);
  }
  public float getMinimumXValue()
  {
    if (description == null) return (float)0.0;
    TPropertyEGU egu = description.getXRange();
    if (egu == null) return (float)0.0;
    return egu.getMinValue();
  }
  public void setMinimumXValue(float value)
  {
    if (description == null) description = new TPropertyDescription();
    TPropertyEGU egu = description.getXRange();
    if (egu != null) egu.setMinValue(value);
  }
  public boolean assertRangeValid(TDataType din,boolean enforceLimits)
  {
    if (din == null) return false;
    if (description == null) return true;
    TPropertyEGU egu = description.getYRange();
    if (egu == null) return true;
    float[] fval = new float[1];
    float v;
    if (din.getData(fval) != 0) return false;
    if (fval[0] < (v=egu.getMinValue()))
    {
      if (enforceLimits) din.putData(v); else return false;
    }
    else if (fval[0] > (v=egu.getMaxValue()))
    {
      if (enforceLimits) din.putData(v); else return false;
    }
    return true;
  }
  private ArrayList<String> prpDeviceList = null;
  /** Sets the property's device list to the ArrayList given */
  public void setDeviceList(ArrayList<String> deviceList) { prpDeviceList = deviceList; }
  /** Returns the property's device list */
  public ArrayList<String> getDeviceList() { return prpDeviceList; }
  protected LinkedList<String> gRegisteredUsersList = new LinkedList<String>();
  protected LinkedList<String> gRegisteredGroupsList = new LinkedList<String>();
  protected LinkedList<String> gRegisteredNetsList = new LinkedList<String>();
  public int getNumberRegisteredUsers() { return gRegisteredUsersList.size(); }
  public int getNumberRegisteredNets() { return gRegisteredNetsList.size(); }
  public NAME16[] getRegisteredUsers() { return StringToName.stringSetToName16(gRegisteredUsersList); }
  public int addRegisteredUser(String newUser)
  {
    if (newUser == null) return TErrorList.argument_list_error;
    newUser = newUser.toUpperCase();
    synchronized (gRegisteredUsersList)
    {
      if (gRegisteredUsersList.contains(newUser)) return TErrorList.already_assigned;
      gRegisteredUsersList.add(newUser);
    }
    return 0;
  }
  public int removeRegisteredUser(String oldUser)
  {
    if (oldUser == null) return TErrorList.argument_list_error;
    oldUser = oldUser.toUpperCase();
    synchronized (gRegisteredUsersList)
    {
      if (!gRegisteredUsersList.contains(oldUser)) return TErrorList.invalid_name;   
      gRegisteredUsersList.remove(oldUser);   
    }
    return 0;
  }
  public void removeAllRegisteredUsers()
  {
    synchronized (gRegisteredUsersList)
    {
      gRegisteredUsersList.clear();
    }
  }
  public boolean isMemberUsersList(TClient tc)
  {
    TEquipmentModuleFactory eqmf = TEquipmentModuleFactory.getInstance();
    if (tc.isMemberUsersList(gRegisteredUsersList)) return true;
    if (eqmf.isMemberGroupsList(gRegisteredGroupsList, tc.userName)) return true;
    return false;
  }
  public NAME16[] getRegisteredNets() { return StringToName.stringSetToName16(gRegisteredNetsList); }
  public int addRegisteredNet(String newNet)
  {
    if (newNet == null) return TErrorList.argument_list_error;
    synchronized (gRegisteredNetsList)
    {
      if (gRegisteredNetsList.contains(newNet)) return TErrorList.already_assigned;
      gRegisteredNetsList.add(newNet);
    }
    return 0;
  }
  public int removeRegisteredNet(String oldNet)
  {
    if (oldNet == null) return TErrorList.argument_list_error;
    synchronized (gRegisteredNetsList)
    {
      if (!gRegisteredNetsList.contains(oldNet)) return TErrorList.invalid_name;   
      gRegisteredNetsList.remove(oldNet);
    }
    return 0;
  }
  public void removeAllRegisteredNets()
  {
    synchronized (gRegisteredNetsList)
    {
      gRegisteredNetsList.clear();
    }
  }
  public boolean isMemberControlNets(TClient tc)
  {
    return tc.isMemberControlNets(gRegisteredNetsList);
  }
  public TExportProperty()
  {
    //TODO initialize defaults
  }
  /**
   * Constructor. Creates a property with an ID.
   *
   * @param prpId The property identifier
   * @param prpName The property name.
   * @param accessMode The access mode associating with the property (CA_READ and/or CA_WRITE).
   * @param din Specifies input format information
   * @param dout Specifies output format information
   * @param prpDscr gives a property description.
   */
  public TExportProperty(int prpId, String prpName, short accessMode, TDataType din, TDataType dout,
      String prpDescription)
  {
    TStrings.validatePropertyName(prpName);
    this.name = prpName;
    this.outputFormat = dout.dFormat;
    this.outputSize = dout.dArrayLength;
    this.outputTag = dout.getTag();
    this.inputFormat = din.dFormat;
    this.inputSize = din.dArrayLength;
    this.inputTag = din.getTag();
    this.accessMode = accessMode;
    this.description = new TPropertyDescription(prpDescription);
    this.id = prpId;
  }
  /**
   * Constructor. Creates a property with the given settings.
   *
   * @param prpName The property name.
   * @param accessMode The access mode associating with the property (CA_READ and/or CA_WRITE).
   * @param din Specifies input format information
   * @param dout Specifies output format information
   * @param prpDscr gives a property description.
   */
  public TExportProperty(String prpName, short accessMode, TDataType din, TDataType dout,
      String prpDescription)
  {
    TStrings.validatePropertyName(prpName);
    this.name = prpName;
    this.outputFormat = dout.dFormat;
    this.outputSize = dout.dArrayLength;
    this.outputTag = dout.getTag();
    this.inputFormat = din.dFormat;
    this.inputSize = din.dArrayLength;
    this.inputTag = din.getTag();
    this.accessMode = accessMode;
    this.description = new TPropertyDescription(prpDescription);
    this.id = 0;
  }
  /**
   * Constructor. Creates a TExportProperty for read access.
   *
   * @param prpName
   * @param outputSize
   * @param outputFormat
   */
  public TExportProperty(String prpName, int outputSize, short outputFormat)
  {
    initialize(prpName, TAccess.CA_READ, outputSize, outputFormat, 0, TFormat.CF_NULL);
  }
  /**
   * Constructor. Creates a TExportProperty for read/write access.
   *
   * @param prpName
   * @param outputSize
   * @param outputFormat
   * @param inputSize
   * @param inputFormat
   */
  public TExportProperty(String prpName, int outputSize, short outputFormat, int inputSize, short inputFormat)
  {
    initialize(prpName, (short)(TAccess.CA_READ|TAccess.CA_WRITE), outputSize, outputFormat, inputSize, inputFormat);
  }
  /**
   * Constructor. Creates a property with an ID.
   *
   * @param prpId The property identifier
   * @param prpName The property name.
   * @param accessMode The access mode associating with the property (CA_READ and/or CA_WRITE).
   * @param din Specifies input format information
   * @param dout Specifies output format information
   */
  public TExportProperty(int prpId, String prpName, short accessMode, TDataType din, TDataType dout)
  {
    this(prpId, prpName, accessMode, din, dout, "");
  }
  private void initialize(String prpName, short accessMode, int outputSize, short outputFormat,
      int inputSize, short inputFormat)
  {
    initialize(0,prpName,new TPropertyDescription(""),outputSize,outputFormat,"",inputSize,inputFormat,"",accessMode);
  }
  /**
   * A Copy Constructor. NOTE: This implementation SIMULATES a copy constructor.
   * It does not copy everything. Useful only for TStockProperty, alias properties !!!.
   *
   * @param source
   *
   */
  public TExportProperty(TExportProperty source)
  {
    initialize(source.id,source.name,new TPropertyDescription(source.description.getText()),
        source.outputSize,source.outputFormat,source.outputTag,source.inputSize,
        source.inputFormat,source.inputTag,source.accessMode);
  }
  private void initialize(int prpId, String prpName, TPropertyDescription prpDescription, int prpSizeOut,
      short prpFormatOut, String prpTagOut, int prpSizeIn, short prpFormatIn, String prpTagIn,short access)
  {
    TStrings.validatePropertyName(prpName);
    if ((access & TAccess.CA_SAVERESTORE) == TAccess.CA_SAVERESTORE)
    {
      if (TAccess.isWrite((byte)access))
      {
        isSaveAndRestore = true;
      }
      else
      {
        access &= ~(TAccess.CA_SAVERESTORE);
      }
    }
    if ((access & TAccess.CA_FORCEOUTPUT) == TAccess.CA_FORCEOUTPUT)
    {
      isEnforceOutput = true;
      access &= ~(TAccess.CA_FORCEOUTPUT); // remove this bit here
    }
    if ((access & TAccess.CA_XREAD) == TAccess.CA_XREAD)
    {
      hasExclusiveRead = true;
      if (!TAccess.isRead((byte)access)) hasUnlockedExclusiveRead = true;
      access &= ~(TAccess.CA_XREAD); // remove this bit here
    }
    if ((access & TAccess.CA_STATIC) == TAccess.CA_STATIC)
    {
      isStatic = true;
    }
    this.id = prpId;
    this.name = prpName;
    this.description = prpDescription;
    this.outputFormat = prpFormatOut;
    this.inputFormat = prpFormatIn;
    this.outputSize = prpSizeOut;
    this.inputSize = prpSizeIn;
    this.outputTag = prpTagOut;
    this.inputTag = prpTagIn;
    this.accessMode = access;

    if (description != null)
    {
      float max = description.getXRange().getMaxValue();
      float min = description.getXRange().getMinValue();
      if (min > max) TFecLog.log("TExportProperty","x min > x max for property "+prpName);
      max = description.getYRange().getMaxValue();
      min = description.getYRange().getMinValue();
      if (min > max) TFecLog.log("TExportProperty","min > max for property "+prpName);
    }
  }
  /**
   * Constructor. Creates a property with an ID.
   *
   * @param prpId The property identifier
   * @param prpName The property name.
   * @param prpDescription gives a property description string.
   * @param prpSizeOut gives the property's output size
   * @param prpFormatOut gives the property's output format
   * @param prpTagOut gives the property's output data tag
   * @param prpSizeIn gives the property's input size
   * @param prpFormatIn gives the property's input format
   * @param prpTagIn gives the property's input data tag
   * @param access gives the property's access mode
   */
  public TExportProperty(int prpId, String prpName, String prpDescription, int prpSizeOut,
      short prpFormatOut, String prpTagOut, int prpSizeIn, short prpFormatIn, String prpTagIn,short access)
  {
    initialize(prpId, prpName, new TPropertyDescription(prpDescription), prpSizeOut, prpFormatOut, prpTagOut, prpSizeIn, prpFormatIn,
        prpTagIn,access);
  }
  public TExportProperty(int prpId, String prpName, String prpDescription, int prpSizeOut,
      short prpFormatOut, String prpTagOut, int prpSizeIn, short prpFormatIn, String prpTagIn)
  {
    initialize(prpId, prpName, new TPropertyDescription(prpDescription), prpSizeOut, prpFormatOut, prpTagOut, prpSizeIn, prpFormatIn,
        prpTagIn,(short)(TAccess.CA_READ|TAccess.CA_WRITE));
  }
  /**
   * Constructor. Creates a property with given settings.
   *
   * @param prpName The property name.
   * @param prpDescription gives a property description string.
   * @param prpSizeOut gives the property's output size
   * @param prpFormatOut gives the property's output format
   * @param prpTagOut gives the property's output data tag
   * @param prpSizeIn gives the property's input size
   * @param prpFormatIn gives the property's input format
   * @param prpTagIn gives the property's input data tag
   * @param access gives the property's access mode
   */
  public TExportProperty(String prpName, String prpDescription, int prpSizeOut,
      short prpFormatOut, String prpTagOut, int prpSizeIn, short prpFormatIn, String prpTagIn,short access)
  {
    initialize(0, prpName, new TPropertyDescription(prpDescription), prpSizeOut, prpFormatOut, prpTagOut, prpSizeIn, prpFormatIn,
        prpTagIn,access);
  }
  /**
   * Constructor. Creates a property with an ID.
   *
   * @param prpId The property identifier
   * @param prpName The property name.
   * @param prpDescription gives a property description object.
   * @param prpSizeOut gives the property's output size
   * @param prpFormatOut gives the property's output format
   * @param prpTagOut gives the property's output data tag
   * @param prpSizeIn gives the property's input size
   * @param prpFormatIn gives the property's input format
   * @param prpTagIn gives the property's input data tag
   * @param access gives the property's access mode
   */
  public TExportProperty(int prpId, String prpName, TPropertyDescription prpDescription, int prpSizeOut,
      short prpFormatOut, String prpTagOut, int prpSizeIn, short prpFormatIn, String prpTagIn,short access)
  {
    initialize(prpId, prpName, prpDescription, prpSizeOut, prpFormatOut, prpTagOut, prpSizeIn, prpFormatIn,
        prpTagIn,access);
  }
  public TExportProperty(int prpId, String prpName, TPropertyDescription prpDescription, int prpSizeOut,
      short prpFormatOut, String prpTagOut, int prpSizeIn, short prpFormatIn, String prpTagIn)
  {
    initialize(prpId, prpName, prpDescription, prpSizeOut, prpFormatOut, prpTagOut, prpSizeIn, prpFormatIn,
        prpTagIn,(short)(TAccess.CA_READ|TAccess.CA_WRITE));
  }
  /**
   * Constructor. Creates a property with given settings.
   *
   * @param prpName The property name.
   * @param prpDescription gives a property description object.
   * @param prpSizeOut gives the property's output size
   * @param prpFormatOut gives the property's output format
   * @param prpTagOut gives the property's output data tag
   * @param prpSizeIn gives the property's input size
   * @param prpFormatIn gives the property's input format
   * @param prpTagIn gives the property's input data tag
   * @param access gives the property's access mode
   */
  public TExportProperty(String prpName, TPropertyDescription prpDescription, int prpSizeOut,
      short prpFormatOut, String prpTagOut, int prpSizeIn, short prpFormatIn, String prpTagIn,short access)
  {
    initialize(0, prpName, prpDescription, prpSizeOut, prpFormatOut, prpTagOut, prpSizeIn, prpFormatIn,
        prpTagIn,access);
  }
  /**
   * Constructor. Creates a property with an ID.
   *
   * @param prpId The property identifier
   * @param prpName The property name.
   * @param prpDescription gives a property description.
   * @param prpSizeOut gives the property's output size
   * @param prpFormatOut gives the property's output format
   * @param prpSizeIn gives the property's input size
   * @param prpFormatIn gives the property's input format
   * @param access gives the property's access mode
   */
  public TExportProperty(int prpId, String prpName, String prpDescription, int prpSizeOut,
      short prpFormatOut, int prpSizeIn, short prpFormatIn,short access)
  {
    initialize(prpId, prpName, new TPropertyDescription(prpDescription), prpSizeOut, prpFormatOut, "", prpSizeIn, prpFormatIn, "",access);
  }
  public TExportProperty(int prpId, String prpName, String prpDescription, int prpSizeOut,
      short prpFormatOut, int prpSizeIn, short prpFormatIn)
  {
    initialize(prpId, prpName, new TPropertyDescription(prpDescription), prpSizeOut, prpFormatOut, "", prpSizeIn, prpFormatIn, "",(short)(TAccess.CA_READ|TAccess.CA_WRITE));
  }
  /**
   * Constructor. Creates a property with given settings.
   *
   * @param prpName The property name.
   * @param prpDescription gives a property description.
   * @param prpSizeOut gives the property's output size
   * @param prpFormatOut gives the property's output format
   * @param prpSizeIn gives the property's input size
   * @param prpFormatIn gives the property's input format
   * @param access gives the property's access mode
   */
  public TExportProperty(String prpName, String prpDescription, int prpSizeOut,
      short prpFormatOut, int prpSizeIn, short prpFormatIn,short access)
  {
    initialize(0, prpName, new TPropertyDescription(prpDescription), prpSizeOut, prpFormatOut, "", prpSizeIn, prpFormatIn, "",access);
  }
  /**
   * Constructor. Creates a property with an ID.
   *
   * @param prpId The property identifier
   * @param prpName The property name.
   * @param prpDescription gives a property description.
   * @param prpSizeOut gives the property's output size
   * @param prpFormatOut gives the property's output format
   */
  public TExportProperty(int prpId, String prpName, String prpDescription, int prpSizeOut, short prpFormatOut)
  {
    initialize(prpId, prpName, new TPropertyDescription(prpDescription), prpSizeOut, prpFormatOut, "", 0, TFormat.CF_NULL, "",TAccess.CA_READ);
  }
  /**
   * @return Returns the accessMode.
   */
  public short getAccessMode()
  {
    return accessMode;
  }
  /**
   * @param accessMode
   *          The accessMode to set.
   */
  public void setAccessMode(short accessMode)
  {
    if ((accessMode & TAccess.CA_XREAD) == TAccess.CA_XREAD)
    {
      hasExclusiveRead = true;
      if (!TAccess.isRead((byte)accessMode)) hasUnlockedExclusiveRead = true;
      accessMode &= ~(TAccess.CA_XREAD); // remove this bit here
    }
    if ((accessMode & TAccess.CA_FORCEOUTPUT) == TAccess.CA_FORCEOUTPUT)
    {
      isEnforceOutput = true;
      accessMode &= ~(TAccess.CA_FORCEOUTPUT); // remove this bit here
    }
    if ((accessMode & TAccess.CA_SAVERESTORE) == TAccess.CA_SAVERESTORE)
    {
      if (!TAccess.isWrite((byte)accessMode))
      { // must also have WRITE access
        accessMode &= ~(TAccess.CA_SAVERESTORE);       
      }
      else
      { // looks okay !
        isSaveAndRestore = true;
      }
    }
    this.accessMode = accessMode;
  }
  /**
   * @return Returns the alias.
   */
  public String getAlias()
  {
    return alias;
  }
  /**
   * @param alias
   *          The alias to set.
   */
  public void setAlias(String alias)
  {
    this.alias = alias;
  }
  /**
   * @return Returns the id.
   */
  public int getId()
  {
    return id;
  }
  /**
   * @param id
   *          The id to set.
   */
  public void setId(int id)
  {
    this.id = id;
  }
  /**
   * @return Returns the inputFormat.
   */
  public short getInputFormat()
  {
    return inputFormat;
  }
  /**
   * @param inputFormat
   *          The inputFormat to set.
   */
  public void setInputFormat(short inputFormat)
  {
    this.inputFormat = inputFormat;
  }
  /**
   * @return Returns the inputSize.
   */
  public int getInputSize()
  {
    return inputSize;
  }
  /**
   * @param inputSize
   *          The inputSize to set.
   */
  public void setInputSize(int inputSize)
  {
    this.inputSize = inputSize;
  }
  /**
   * @return Returns the inputTag.
   */
  public String getInputTag()
  {
    return inputTag;
  }
  /**
   * @param inputTag
   *          The inputTag to set.
   */
  public void setInputTag(String inputTag)
  {
    this.inputTag = inputTag;
  }
  /**
   * @return Returns the name.
   */
  public String getName()
  {
    return name;
  }
  /**
   * @param name
   *          The name to set.
   */
  public void setName(String name)
  {
    this.name = name;
  }
  /**
   * @return Returns the numOverloads.
   */
  //public int getNumOverloads() {
  //  return numOverloads;
  //}
  /**
   * @param numOverloads
   *          The numOverloads to set.
   */
  //public void setNumOverloads(int numOverloads) {
  //  this.numOverloads = numOverloads;
  //}
  /**
   * @return Returns the outputFormat.
   */
  public short getOutputFormat()
  {
    return outputFormat;
  }
  /**
   * @param outputFormat
   *          The outputFormat to set.
   */
  public void setOutputFormat(short outputFormat)
  {
    this.outputFormat = outputFormat;
  }
  /**
   * @return Returns the outputSize.
   */
  public int getOutputSize()
  {
    return outputSize;
  }
  /**
   * @param outputSize
   *          The outputSize to set.
   */
  public void setOutputSize(int outputSize)
  {
    this.outputSize = outputSize;
  }
  /**
   * @return Returns the outputTag.
   */
  public String getOutputTag()
  {
    return outputTag;
  }
  /**
   * @param outputTag
   *          The outputTag to set.
   */
  public void setOutputTag(String outputTag)
  {
    this.outputTag = outputTag;
  }
  /**
   * @return Returns the description.
   */
  public TPropertyDescription getDescription()
  {
    return description;
  }
  /**
   * @param description
   *          The description to set.
   */
  public void setDescription(TPropertyDescription description)
  {
    TPropertyEGU rng = new TPropertyEGU();
    TPropertyEGU xrng = new TPropertyEGU("",0,0);
    if (description != null)
    {
      if (description.getText() == null) description.setText("description unavailable");
      if (description.getYRange() == null) description.setYRange(rng);
      if (description.getXRange() == null) description.setXRange(xrng);
      if (description.getArrayNumRows() == 0) description.setArrayNumRows(1);
      if (outputSize == 1 && description.getArrayType() == 0)
      { // can only be a scalar ...
        description.setArrayType(TArrayType.AT_SCALAR);
      }
    }
    this.description = description;
  }
}
TOP

Related Classes of de.desy.tine.server.properties.TExportProperty

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.