Package de.desy.tine.dataUtils

Examples of de.desy.tine.dataUtils.TDataType


    return getDevicePropertyInformationX("STOCKPROPS", context,server,device,property,TLink.defaultTimeout);
  }
  private static ServerQuery[] getXTagList(String context,String tagtype,String subsys,String importance,int timeout)
  {
    int cc,n,i;
    TDataType dout;
    TDataType din;
    TLink tl;
    StringBuffer host = new StringBuffer(32);
    StringBuffer query = new StringBuffer(32);
    short[] numout = new short[1];
    TDataType numoutData = new TDataType(numout);
    NAME16[] inplist = new NAME16[2];
    USTRING[] taglist;
    ServerQuery[] strlist;
    boolean isFecRequest = tagtype.compareToIgnoreCase("FECS") == 0;

    if (subsys == null || subsys.length() == 0)
    {
      inplist[0] = new NAME16("ALL");
    }
    else
    {
      inplist[0] = new NAME16(subsys);
    }
    if (importance == null || importance.length() == 0)
    {
      inplist[1] = new NAME16("ALL");   
    }
    else
    {
      inplist[1] = new NAME16(importance);
    }
    boolean allreq = false;
    if (inplist[0].name.compareToIgnoreCase("ALL") == 0 &&
        inplist[1].name.compareToIgnoreCase("ALL") == 0)
      allreq = true;
    din = new TDataType(inplist);
   
    host.delete(0,31); query.delete(0,31);
    if (context != null && context.length() != 0)
    {
      host.insert(0,"ENS/" + context);
    }
    else
    {
      host.insert(0,"ENS");
    }
    query.insert(0,"N" + tagtype);
    try
    {
      tl = new TLink(host.toString(),query.toString(),numoutData,din,TAccess.CA_READ);
      cc = tl.execute(timeout,true);
      srvAddr = tl.srvAddr;
      tl.close();
    }
    catch (Exception e)
    {
      MsgLog.log("getXTagList", e.getMessage(),TErrorList.non_existent_elem,e,0);
      cc = TErrorList.non_existent_elem;
    }
    if (cc != 0) return null;
    if (numout[0] == 0 && subsys != null && subsys.length() > 0) numout[0] = 100;
    // Get Tags from name server (synchronous call)
    query.delete(0,31);
    query.insert(0,tagtype);
    n = numout[0];
    taglist = new USTRING[n];
    for (i=0; i<n; i++) taglist[i] = new USTRING();
    if (taglist.length == 0) return null;
    if (numout[0] > taglist.length) numout[0] = (short)taglist.length; 
    dout = new TDataType(taglist);
    tl = new TLink(host.toString(),query.toString(),dout,din,TAccess.CA_READ);
    cc = tl.execute(TLink.defaultTimeout,true);
    tl.close();
    if (cc != 0) return null;
    strlist = new ServerQuery[n];
View Full Code Here


  private static int tryAccessLock(String context, String server, AccessLockType lockType)
  {
    short[] lvals = new short[2];
    lvals[0] = (short)lockType.ordinal();
    lvals[1] = (short)1;
    TDataType din = new TDataType(lvals);
    TLink lnk = new TLink("/"+context+"/"+server,"ACCESSLOCK",null,din,TAccess.CA_WRITE|TAccess.CA_RETRY);
    int rc = lnk.execute(TLink.defaultTimeout,true);
    lnk.close();
    return rc;
  }
View Full Code Here

   * @include eg_GetAccessLock.java
   */
  public static String[] getAccessLockInformation(String context, String server)
  {
    NAME32[] n32 = new NAME32[3];
    TDataType dout = new TDataType(n32);
    TLink lnk = new TLink("/"+context+"/"+server,"ACCESSLOCK",dout,null,TAccess.CA_READ);
    int rc = lnk.execute(TLink.defaultTimeout);
    lnk.close();
    if (rc != 0) return null;
    String[] rs = new String[3];
View Full Code Here

  }
  public static synchronized int getThresholds(String context,String server, String property,float[] tmax,float[] tmin)
  {
    if (tmax == null || tmin == null) return TErrorList.invalid_parameter;
    if (tmax.length == 0 || tmin.length == 0) return TErrorList.dimension_error;
    TDataType dt = new TDataType(tmax);
    TLink tl = new TLink("/"+context+"/"+server+"/#0",property+".TMAX",dt,null,TAccess.CA_READ);
    int cc = tl.execute();
    tl.close();
    int dlen = dt.getCompletionLength();
    boolean pifDone = false;
    TPropertyQuery[] tpq = null;
    switch (cc)
    {
      default:
        return cc;
      case TErrorList.link_blacklisted:
      case TErrorList.illegal_property:
        tpq = getPropertyInformation(context,server,"#0",property);
        if (tpq == null) return TErrorList.io_error;
        tmax[0] = tpq[0].prpMaxValue;
        tmin[0] = tpq[0].prpMinValue;
        cc = 0; dlen = 1;
        pifDone = true;
      case TErrorList.success:
        break;
    }
    if (dlen == 1)
    { // one threshold applies to all elements
      for (int i=1; i<tmax.length; i++)
      { // so fill them in ...
        tmax[i] = tmax[0];
      }
    }
    dt = new TDataType(tmin);
    tl = new TLink("/"+context+"/"+server+"/#0",property+".TMIN",dt,null,TAccess.CA_READ);
    cc = tl.execute();
    tl.close();
    dlen = dt.getCompletionLength();
    switch (cc)
    {
      default:
      case TErrorList.illegal_property:
        if (!pifDone)
View Full Code Here

    }
  }
  public static SelfTestItem[] getServerSelfTest(String context, String server)
  {
    char[] stChars = new char[32000];
    TDataType dout = new TDataType(stChars);
    TLink lnk = new TLink("/"+context+"/"+server,"SRVSELFTEST",dout,null,TAccess.CA_READ);
    int rc = lnk.executeAndClose(TLink.defaultTimeout);
    if (rc != 0) return null;
    int p = dout.getCompletionLength();
    String stString = new String(stChars,0,p);
   
    csvColumn[] stCols = new csvColumn[26];
    stRowHndlr stRows = new TQuery().new stRowHndlr();
    stCols[0] = new csvColumn("PROPERTY","",new TQuery().new prpHndlr(stRows));
View Full Code Here

              }
              if (lnk.hasDependencies())
              { // already has dependencies ? (a jDDD specialty)
                TLink xlnk;
                ConcurrentLinkedQueue<TLink> xlst = lnk.getDependencies();
                TDataType dout;
                Iterator<TLink> itr = xlst.iterator();
                while (itr.hasNext())                   
                {
                  if ((xlnk = itr.next()) == null) continue;
                  dout = xlnk.getOutputDataObject();
                  if (dout.dFormat != TFormat.CF_DEFAULT) continue;
                  int dlen = lnk.dOutput.dArrayLength;
                  if (xlnk.getMcaDevice() != null) dlen = 1;
                  if (lnk.dOutput.dFormat == TFormat.CF_MDA) dout.setTag(lnk.dOutput.getTag());
                  dout.setDataObject(dlen,lnk.dOutput.dFormat);
                  dout.dArrayLength = dlen;
                  dout.dFormat = lnk.dOutput.dFormat;
                  dout.dTimestamp = (long) dTimeStamp * 1000 + (long) (dTimeStampUSEC / 1000);
                  dout.timestamp = dTimeStamp;
                  dout.timestampMSEC = dTimeStampUSEC / 1000;
View Full Code Here

              if (skip)
              {
                buffer.append("variable length format string space unavailable\n");
                break;
              }
              TDataType dt = new TDataType(len,(short)fmt);
              dt.pushBytes(b);
              dt.dCompletionLength = len;
              dt.getData();
              buffer.append(dt.toString());
              break;
             
          } // Type Switch
        } // if len > 0
      } // for
View Full Code Here

    {
      case TFormat.CF_USTRING:
      case TFormat.CF_NAME16DBLDBL:
      case TFormat.CF_NAME32DBLDBL:
      case TFormat.CF_NAME64DBLDBL:
        TDataType d = wc.parent.getOutputDataObject();
        nfi = new NAME16FI[d.dArrayLength];
        for (i=0; i<wc.length && k<d.dArrayLength; i++)
        {
          //if (wc.links[i].linkStatus == TErrorList.illegal_format) continue;         
          if (wc.status[i] == TErrorList.illegal_format) continue;
          if (wc.status[i] == TErrorList.illegal_property) continue;
          if (wc.status[i] == TErrorList.link_blacklisted) continue;
          nfi[k] = new NAME16FI(wc.list[i],wc.status[i],((float[])wc.links[i].getOutputDataObject().getDataObject())[0]);
          k++;
        }
        d.putData(nfi);
        break;
      case TFormat.CF_NAME16FI:
        nfi = (NAME16FI[])wc.parent.getOutputDataObject().getDataObject();
        for (i=0; i<wc.length && k<wc.parent.dOutput.dArrayLength; i++)
        {
View Full Code Here

    stRowHndlr()
    {
    }
    public int process(int index)
    {
      SelfTestItem sti = new SelfTestItem(dev,prp,new TDataType(sizOut,(short)fmtOut),new TDataType(sizIn,(short)fmtIn),acc,0,0,req);
      sti.setTgt(tgt);
      sti.setMask(msk);
      sti.setInpt(inpt);
      lst.add(sti);
      return 0;
View Full Code Here

  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;
      }
    }
    catch (Exception e)
    {
      MsgLog.log("getPropertiesWithPattern", e.getMessage(),TErrorList.non_existent_elem,e,0);
      cc = TErrorList.non_existent_elem;
    }
    if (cc == TErrorList.illegal_format) return null; // legacy server
    if (cc == 0)
    {
      n = dout.getCompletionLength();
      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;
View Full Code Here

TOP

Related Classes of de.desy.tine.dataUtils.TDataType

Copyright © 2018 www.massapicom. 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.