Examples of TLink


Examples of de.desy.tine.client.TLink

  {
    if (fullServerName == null) return null;
    TClientStruct[] tcs = new TClientStruct[100];
    for (int i=0; i<100; i++) tcs[i] = new TClientStruct();
    TDataType tcsd = new TDataType(tcs);
    TLink tl = new TLink(fullServerName,"CLIENTS",tcsd,null,TAccess.CA_READ);
    if (tl.executeAndClose(TLink.defaultTimeout) == 0)
    {
      int len;
      for (len=0; len<100 && tcs[len].getProtocol()[0] != (short)0; len++);
      if (len < 100)
      {
View Full Code Here

Examples of de.desy.tine.client.TLink

  {
    if (fullServerName == null) return null;
    TContractStruct[] tcs = new TContractStruct[100];
    for (int i=0; i<100; i++) tcs[i] = new TContractStruct();
    TDataType tcsd = new TDataType(tcs);
    TLink tl = new TLink(fullServerName,"CONTRACTS",tcsd,null,TAccess.CA_READ);
    if (tl.executeAndClose(TLink.defaultTimeout) == 0)
    {
      int len;
      for (len=0; len<100 && tcs[len].getEqpProperty()[0] != (char)0; len++);
      if (len < 100)
      {
View Full Code Here

Examples of de.desy.tine.client.TLink

  {
    if (fullServerName == null) return null;
    TServerSettings[] tss = new TServerSettings[1];
    tss[0] = new TServerSettings();
    TDataType tssd = new TDataType(tss);
    TLink tl = new TLink(fullServerName,"SRVSETTINGS",tssd,null,TAccess.CA_READ);
    if (tl.executeAndClose(TLink.defaultTimeout) == 0)
    {
      return tss[0];
    }
    DbgLog.log("getServerSettings","error : " + tl.linkStatus);
    return null;
View Full Code Here

Examples of de.desy.tine.client.TLink

  {
    if (fullServerName == null) return null;
    TWriteAccessInfo[] twai = new TWriteAccessInfo[100];
    for (int i=0; i<100; i++) twai[i] = new TWriteAccessInfo();
    TDataType d = new TDataType(twai);
    TLink tl = new TLink(fullServerName,"SRVCOMMANDS",d,null,TAccess.CA_READ);
    if (tl.executeAndClose(TLink.defaultTimeout) == 0)
    {
      int len = d.getCompletionLength();
      TWriteAccessInfo[] ra = (len < 100) ? Arrays.copyOf(twai, len) : twai;
      return ra;
    }
View Full Code Here

Examples of de.desy.tine.client.TLink

    }
    String os, desc, loc, hdw, ver, resp;
    char[] fi = new char[FECINFO_BASESIZE];
    TDataType fid = new TDataType(fi);
    if (frontEndComputer.startsWith("ENS#")) frontEndComputer = "ENS";
    TLink tl = new TLink("ENS/FEC.EXT",frontEndComputer,fid,null,TAccess.CA_READ);
    if (tl.executeAndClose(TLink.defaultTimeout) == 0)
    {
      int off = 0;
      os = new String(fi,off,TStrings.FEC_OS_SIZE); off += TStrings.FEC_OS_SIZE;
      desc = new String(fi,off,TStrings.FEC_DESC_SIZE); off += TStrings.FEC_DESC_SIZE;
      loc = new String(fi,off,TStrings.FEC_LOCATION_SIZE); off += TStrings.FEC_LOCATION_SIZE;
View Full Code Here

Examples of de.desy.tine.client.TLink

  }
  private static String[] getDeviceProperties16(String context,String server,String device,String property,int timeout) throws IOException
  {
    String tgt = getNamesQueryTarget(context,server,device);
    if (tgt == null) return null;
    TLink tl;
    TDataType dout;
    TDataType din;
    int cc = 0,n,i,j;
    NAME32[] properties;
    String[] strprops;

    n = getNumberOf("PROPS",tgt);
    if (n <= 0) return null;
    if (n*32 > maxQueryBufferSize) n = maxQueryBufferSize/32;
    properties = new NAME32[n];
    for (i=0; i<n; i++) properties[i] = new NAME32();
    if (properties.length <= 0) return null;
    dout = new TDataType(properties);
    if (property != null) din = new TDataType(property); else din = null;
    properties_have_query_function = false;
    try
    {
      tl = new TLink(tgt,"PROPS",dout,din,TAccess.CA_READ);
      cc = tl.execute(TLink.defaultTimeout,true);
      tl.close();
      if ((cc & TErrorList.CE_SENDDATA) == TErrorList.CE_SENDDATA)
      {
        if ((cc & TErrorList.has_query_function) == TErrorList.has_query_function)
        {
          properties_have_query_function = true;
        }
        cc = 0;
      }
    }
    catch (Exception e)
    {
      MsgLog.log("getDeviceProperties16", e.getMessage(),TErrorList.non_existent_elem,e,0);
      cc = TErrorList.host_not_resolved;
    }
    if (cc == 0)
    {
      for (i=0,n=0; i<properties.length; i++) if (properties[i].name.length() > 0) n++;
      strprops = new String[n];
      for (i=0,j=0; j<n && i<properties.length; i++)
      {
        if (properties[i].name.length() == 0) continue;
        strprops[j++] = properties[i].name;
      }
      return strprops;
    }
    else if (cc != TErrorList.link_not_open)
    {
      if (lastQueriedContext == context && lastQueriedServer == server &&
          lastQueriedDevice == device && lastQueriedServer != null)
      {
        cc = 0;
      }
      else
      {
        hLegacyByteBlob = new byte[n * PropertyQuery.sizeInBytes];
        dout = new TDataType(hLegacyByteBlob,"");
        tl = new TLink(tgt,"PROPS",dout,din,TAccess.CA_READ);
        cc = tl.execute(TLink.defaultTimeout,false);
        tl.close();
      }
      if (cc == 0)
      {
        lastQueriedContext = context;
        lastQueriedServer = server;
View Full Code Here

Examples of de.desy.tine.client.TLink

   */
  public static String[] getPropertiesWithPattern(String context,String server,String device,String propertyPattern,int timeout) throws IOException
  {
    String tgt = getNamesQueryTarget(context,server,device);
    if (tgt == null || propertyPattern == null) return null;
    TLink tl;
    TDataType dout;
    int cc = 0,n = 64,i,j;
    NAME64[] properties;
    String[] strprops;
    properties = new NAME64[n];
    for (i=0; i<n; i++) properties[i] = new NAME64();
    dout = new TDataType(properties);
    try
    {     
      tl = new TLink(tgt,propertyPattern,dout,null,TAccess.CA_READ);
      cc = tl.execute(timeout,true);
      tl.close();
      if ((cc & TErrorList.CE_SENDDATA) == TErrorList.CE_SENDDATA)
      {
        cc = 0;
      }
    }
View Full Code Here

Examples of de.desy.tine.client.TLink

  }
  private static String[] getDeviceProperties64(String context,String server,String device,String property,int timeout) throws IOException
  {
    String tgt = getNamesQueryTarget(context,server,device);
    if (tgt == null) return null;
    TLink tl;
    TDataType dout;
    TDataType din;
    int cc = 0,n,i,j;
    NAME64[] properties;
    String[] strprops;

    n = getNumberOf("PROPS",tgt);
    if (n == -TErrorList.illegal_device_number)
    { // a Steve special ...
      strprops = new String[1];
      strprops[0] = "INVALID";
      properties_have_query_function = true;
      return strprops;
    }
    if (n <= 0) return null;
    if (n < 128) n = 256; else n += 100; // room for aliases
    if (n*32 > maxQueryBufferSize) n = maxQueryBufferSize/64;
    properties = new NAME64[n];
    for (i=0; i<n; i++) properties[i] = new NAME64();
    if (properties.length <= 0) return null;
    dout = new TDataType(properties);
    if (property != null) din = new TDataType(property); else din = null;
    properties_have_query_function = false;
    try
    {
      tl = new TLink(tgt,"PROPS",dout,din,TAccess.CA_READ);
      cc = tl.execute(TLink.defaultTimeout,true);
      tl.close();
      if ((cc & TErrorList.CE_SENDDATA) == TErrorList.CE_SENDDATA)
      {
        if ((cc & TErrorList.has_query_function) == TErrorList.has_query_function)
        {
          properties_have_query_function = true;
View Full Code Here

Examples of de.desy.tine.client.TLink

    }
    throw new IOException("Could not acquire property information for " + server + " (" + TErrorList.getErrorString(cc) + ")");
  }
  private static String getTineStockString(String context,String server,String property,String text)
  {
    TLink tl;
    TDataType dout;
    String tgt;
    int cc = 0;
    StringBuffer ver = new StringBuffer(32);
 
    tgt = new String("/" + context + "/" + server + "/#0");
    dout = new TDataType(ver);
    try
    {
      tl = new TLink(tgt,property,dout,null,TAccess.CA_READ);
      cc = tl.execute(TLink.defaultTimeout,true);
      tl.close();
    }
    catch (Exception e)
    {
      MsgLog.log("getTineStockString", e.getMessage(),TErrorList.non_existent_elem,e,0);
      cc = TErrorList.non_existent_elem;
View Full Code Here

Examples of de.desy.tine.client.TLink

   * @return A string array containing a list of stock properties
   * as obtained from the given device server
   */
  public static String[] getStockProperties(String context,String server,String device,String property)
  {
    TLink tl;
    TDataType dout;
    TDataType din;
    String tgt;
    int cc = 0,n = 0,i,j;
    NAME32[] properties;
    String[] strprops;

    tgt = new String("/" + context + "/" + server + "/" + device);
    try
    {
      n = getNumberOf("STOCKPROPS",tgt);
    }
    catch (IOException e)
    {
      return null;
    }
    if (n <= 0) return null;
    if (n*32 > maxQueryBufferSize) n = maxQueryBufferSize/32;
    properties = new NAME32[n];
    for (i=0; i<n; i++) properties[i] = new NAME32();
    dout = new TDataType(properties);
    if (property != null) din = new TDataType(property); else din = null;
    properties_have_query_function = false;
    tl = new TLink(tgt,"STOCKPROPS",dout,din,TAccess.CA_READ);
    cc = tl.execute(TLink.defaultTimeout,true);
    if ((cc & TErrorList.CE_SENDDATA) == TErrorList.CE_SENDDATA)
    {
      if ((cc & TErrorList.has_query_function) == TErrorList.has_query_function)
      {
        properties_have_query_function = true;
      }
      cc = 0;
    }
    tl.close();
    if (cc == 0)
    {
      for (i=0,n=0; i<properties.length; i++) if (properties[i].name.length() > 0) n++;
      strprops = new String[n];
      for (i=0,j=0; j<n && i<properties.length; i++)
      {
        if (properties[i].name.length() == 0) continue;
        strprops[j++] = properties[i].name;
      }
      return strprops;
    }
    else if (cc != TErrorList.link_not_open)
    {
      if (lastQueriedContext == context && lastQueriedServer == server &&
          lastQueriedDevice == device && lastQueriedServer != null)
      {
        cc = 0;
      }
      else
      {
        hLegacyByteBlob = new byte[n * PropertyQuery.sizeInBytes];
        dout = new TDataType(hLegacyByteBlob,"");
        tl = new TLink(tgt,"STOCKPROPS",dout,din,TAccess.CA_READ);
        cc = tl.execute(TLink.defaultTimeout,false);
        tl.close();
      }
      if (cc == 0)
      {
        lastQueriedContext = context;
        lastQueriedServer = server;
View Full Code Here
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.