Examples of TDataType


Examples of de.desy.tine.dataUtils.TDataType

    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

Examples of de.desy.tine.dataUtils.TDataType

      }
      catch (Exception ignore) {};
    }
    if (ts.numblks == 1)
    { // just this one ...
      TDataType tdt;
      tdt = new TDataType(sizeIn, ts.contract.dataFormatIn);
      tdt.setTag(tagIn);
      return tdt;
    }
    if (debugLevel > 1) DbgLog.log("getInputDataTypeRepository","in-coming long datagram ...");
    clnInputData cip = null;
    for (int i = 0; i < clnInputDataTable.size(); i++)
    {
      cip = (clnInputData) clnInputDataTable.get(i);
      if (!cip.tc.IPaddress.equals(tc.IPaddress)) continue;
      if (cip.id != ts.id) continue;
      if (cip.starttime != ts.starttime) continue;
      if (debugLevel > 1) DbgLog.log("getInputDataTypeRepository","found it in list ...");
      return cip.din;
    }
    cip = new clnInputData();
    cip.id = ts.id;
    cip.starttime = ts.starttime;
    cip.tc = tc;
    cip.din = new TDataType(sizeIn, ts.contract.dataFormatIn,ts.numblks);
    cip.din.setTag(tagIn);
    clnInputDataTable.add(cip);
    if (debugLevel > 1) DbgLog.log("getInputDataTypeRepository","add it to list ...");
    return cip.din;
  }
View Full Code Here

Examples of de.desy.tine.dataUtils.TDataType

  public boolean getSendSingleDelivery() { return canSendSingleDelivery; }
  private void getRequest(TClient tcaller, byte[] data)
  {
    Arrays.fill(requestBytes,(byte)0);
    byte[] d = requestBytes;
    TDataType din = null;
    int offset = 0, datasize = 0;
    int renewalMultiplier;
    int cc = 0, nreqs = 0;
    short bmode;
    boolean isTrueMCast = false;
    boolean isLegacy = false;
    boolean sendSingleDelivery = false;
    boolean chkResendData = false;
    boolean resendCurrentData = false;
    TClientEntry tce = null;
    TClient tc = tcaller;
    String astr = null;
    if (srvCycleTime < rejectEarlierThan) return;
    // peel off the header
    TReqHdr hdr = new TReqHdr(data, 0, TReqHdr.hdrSizeInBytes);
    tc.userName = hdr.getUserName();
    int tineProtocol = hdr.getProtocol();   
    if (tineProtocol < 5)
    {
      SendMessageToCaller(tc, null, TErrorList.illegal_protocol,null);
    }
    tc.tineProtocol = (short)tineProtocol;
    tc.revisionId = hdr.getRevisionId();
    if (tineProtocol < 6) isLegacy = true;
    int totalsize = hdr.getTotalSizeInBytes();
    int hdrSize = isLegacy ? TSubscription.hdrSizeInBytesLegacy : TSubscription.hdrSizeInBytes;
    int conSize = isLegacy ? TContractP5.hdrSizeInBytes : TContract.hdrSizeInBytes;
    offset += TReqHdr.hdrSizeInBytes;
    if (debugLevel > 3) DbgLog.log("getRequest",hdr.toString());
    TContractTable tct = null;
    long t_now = System.currentTimeMillis();
    while (offset < totalsize)
    { // peel off the TSubscription
      nreqs++; resendCurrentData = false;
      TSubscription sub = new TSubscription(tineProtocol, data, offset, hdrSize);
      tc = tcaller; // reset this in case of packed network requests
      bmode = TMode.getBaseMode(sub.mode);
      // Is the caller using alias names ?
      if ((astr=getNameFromAlias(sub.contract.eqmDeviceName)) != null) sub.contract.eqmDeviceName = astr;
      if ((astr=getNameFromAlias(sub.contract.eqmProperty)) != null) sub.contract.eqmProperty = astr;
      offset += hdrSize + conSize + sub.contract.extStringSize;
      if (debugLevel > 0 && sub.numblks == sub.blknum)
      {
        if (debugLevel > 2)
          DbgLog.log("getRequest",sub.toString());
        else
        {
          String msg = sub.contract.eqmName+" "+sub.contract.eqmDeviceName+" "+
            sub.contract.eqmProperty+" "+sub.pollingInterval+" msec "+
            "("+sub.numblks+" blks) "+TMode.toString(sub.mode);
          DbgLog.log("getRequest", msg);
        }
      }
      // prepare incoming data ...
      if ((datasize = sub.getInputDataSize()) > 0)
      {
        din = getInputDataTypeRepository(tc, sub);
        if (din.update(data, offset, datasize, sub.blknum, sub.blkid))
        {
          din.bytesin += datasize;
        }
        offset += datasize + (datasize % 2);
        if (din.blksin < din.numblks)
        {
          if (debugLevel > 2)
            DbgLog.log("getRequest","input data set "+din.blksin+" of "+din.numblks);
          continue;
        }
        if (din.numblks > 1 && debugLevel > 1)
          DbgLog.log("getRequest","long input data set ("+din.numblks+" blocks) complete");
        // when finished ...
        din.resetBuffersReady();
        din.getData();
        if (debugLevel > 3) DbgLog.log("getRequest","input data : \n" + din.toString());
      }
      // requested output data ...
      if ((cc=fixOutputDataTypeAndSize(sub)) != 0)
      { // default format ?
        SendMessageToCaller(tc, sub, cc, null);
View Full Code Here

Examples of de.desy.tine.dataUtils.TDataType

    // prepare it and send it out ...
    // devAddr-- + FecAddr + FecInfo
    byte[] expAddr = new byte[SrvAddr.sizeInBytes + FECInfo.getSizeInBytes()];
    System.arraycopy(da.toByteArray(), 0, expAddr, 0, SrvAddr.sizeInBytes);
    System.arraycopy(inf.toByteArray(), 0, expAddr, SrvAddr.sizeInBytes, FECInfo.getSizeInBytes());
    TDataType din = new TDataType(expAddr, "");
    TDataType dout = new TDataType(expAddr, "");
    if (debugLevel > 0)
    {
      DbgLog.log("SendRegisteredExportToENS","fec -> " + gFecAddr.toString());
      DbgLog.log("SendRegisteredExportToENS","dev -> " + da.toString());
      DbgLog.log("SendRegisteredExportToENS","fec info -> " + inf.toString());
View Full Code Here

Examples of de.desy.tine.dataUtils.TDataType

    n32[2] = new NAME32(cnt);
    n32[3] = new NAME32(String.valueOf(eqm.getGroupIndex()));
    n32[4] = new NAME32(sub);
    n32[5] = new NAME32(prefix);
    n32[6] = new NAME32(postfix);
    TDataType din = new TDataType(n32);
    TDataType dout = new TDataType();
    if (debugLevel > 0)
    {
      String dbgstr = "/"+cnt+"/"+exp+" -> ";
      DbgLog.log("joinEnsGroup",dbgstr+"joining group "+grp+" (index "+eqm.getGroupIndex()+")");
      if (prefix.length() > 0) DbgLog.log("joinEnsGroup","device prefix: "+prefix);
View Full Code Here

Examples of de.desy.tine.dataUtils.TDataType

    if (gCyclerNumberKey == null)
    {
      gCyclerNumberKey = "/"+gFecContext+"/CYCLER/CycleNumber";
    }
    if (!assertCycleTriggerExists()) return TErrorList.non_existent;
    TDataType sdt = new TDataType(gCycleNumber);
    String[] parts = gCyclerNumberKey.split("/");
    String cn = parts[1];
    String sn = parts[2];
    String kn = parts[3];
    String srv = "/"+cn+"/"+sn;
View Full Code Here

Examples of de.desy.tine.dataUtils.TDataType

   
    n16in[0] = new NAME16(context);
    n16in[1] = new NAME16(eqmName);
    n16in[2] = new NAME16(exportName);
   
    TDataType dout = new TDataType(n16out);
    TDataType din = new TDataType(n16in);

    TLink tl = new TLink(SRVEXP_NAME,"SRVADDR",dout,din,TAccess.CA_READ);
    cc = tl.execute(TLink.defaultTimeout, true);
    if (cc == 0)
    {
View Full Code Here

Examples of de.desy.tine.dataUtils.TDataType

    if (failoverType != TEquipmentModuleFactory.FAILOVER_SLAVE) return TErrorList.not_allowed;
    String mstr = getSlaveMaster();
    if (mstr == null || mstr.length() == 0) return TErrorList.not_allowed;
    String tgt = "/"+getContext()+"/"+mstr;
    int[] lval = new int[1];
    TDataType dout = new TDataType(lval);
    TLink lnk = new TLink(tgt,"SRVSTARTTIME",dout,null,TAccess.CA_READ);
    int id = lnk.attach(TMode.CM_TIMER, new FailOverCallback(), foPollingInterval);
    foMonitorStarted = true;
    TFecLog.log("failover slave link to "+tgt+" : "+(id < 0 ? lnk.getLastError() : "success"));
    return ( id < 0) ? -id : 0;
View Full Code Here

Examples of de.desy.tine.dataUtils.TDataType

  {
    if (!hasInitialized) return;
    long thisCycleTime = System.currentTimeMillis();
    THistoryRecord hst = null;
    THistorySpecification spc = null;
    TDataType dout = null;
    TDataType din = new TDataType();
    TAccess access = new TAccess(TAccess.CA_HIST + TAccess.CA_READ);
    int cc = 0;
    boolean skip;
    if (!isScheduled && thisCycleTime-lastHistoryCycleTime < historyCycleInterval) return;
    lastHistoryCycleTime = thisCycleTime;
    int nHistoryRecords = gLclHstList.size();
    if (nHistoryRecords == 0) return;
    TEquipmentModuleFactory f = getEquipmentModuleFactory();
    f.setCurrentContractEntry(f.hstcon);
    for (int i=0; i<nHistoryRecords; i++)
    {
      hst = (THistoryRecord)gLclHstList.get(i);
      spc = hst.getHspec();
      if (spc.getDepthShort() <= 0) continue;
      if (hst.needsToFillSTS) hst.fillSTS();
      hst.setArchiveFileName(thisCycleTime); // will also remove outdated files if necessary
      skip = (thisCycleTime-hst.getTimestamp()) < spc.getPollngRate();
      if (hst.isScheduled()) skip = false;
      hst.setScheduled(false);
      if (skip) continue;
      dout = new TDataType(hst.getArraySize(),hst.getFmt());
      dout.setDataTimeStamp(TDataTime.getDataTimeStamp());
      dout.setSystemDataStamp(TEquipmentModuleFactory.getSystemStamp());
      cc = callProperty(hst.getPrp(),hst.getDev(),dout,din,access);
      if (cc != 0) continue;
      synchronized (hst)
View Full Code Here

Examples of de.desy.tine.dataUtils.TDataType

  protected void checkAlarmsInWatchTable()
  {
    long thisCycleTime = System.currentTimeMillis();
    if (thisCycleTime-lastAlarmCycleTime < alarmCycleInterval) return;
    lastAlarmCycleTime = thisCycleTime;
    TDataType dout = null;
    TDataType din = new TDataType();
    TAccess access = new TAccess(TAccess.CA_ALARM + TAccess.CA_READ);
    TAlarmWatchEntry awe = null;
    TAlarmDefinition adef = null;
    TAlarm alm = null;
    TDevice dev = null;
    int cc = 0, cnt = 0, siz = 0, sev = 0, devNr, code = 0, asys = 0;
    String tag = null;
    float fvals[] = null;
    int ivals[] = null;
    byte[] abytes = null;
    synchronized (gAlarmWatchList)
    {
      TEquipmentModuleFactory f = getEquipmentModuleFactory();
      f.setCurrentContractEntry(f.awtcon);
      int awlength = gAlarmWatchList.size();
      for (int i=0; i<awlength; i++)
      {
        awe = (TAlarmWatchEntry)gAlarmWatchList.get(i);
        int chk = awe.checkNormal();
        if (chk != 0)
        {
          ivals = new int[awe.getSiz()];
          dout = new TDataType(ivals);
          cc = callProperty(awe.getPrp(),awe.getDev(),dout,din,access);
        }
        else
        {
          fvals = new float[awe.getSiz()];
          dout = new TDataType(fvals);
          cc = callProperty(awe.getPrp(),awe.getDev(),dout,din,access);
        }
        if (cc != 0) continue;
        boolean hasAlarm = false;
        devNr = deviceList.getDeviceNumber(awe.getDev());
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.