Package de.desy.tine.bitfieldUtils

Examples of de.desy.tine.bitfieldUtils.TBitfield


    {
      lnk.linkStatus = cc;
      lnk.linkStale = true;
      return cc;
    }
    TBitfield bf = TBitfieldRegistry.getBitfield(tag);
    if (bf == null)
    {
      cc = lnk.linkStatus = TErrorList.invalid_structure_tag;
      lnk.linkStale = true;
      return cc;
    }
    boolean fieldKnown = false;
    String[] parts;
    String dev = lnk.devName;
    String prp = lnk.devProperty;
    String fld = null;
    if (!fieldKnown)
    {
      parts = lnk.devProperty.split("\\.");
      if (parts.length > 1 && bf.isField(parts[parts.length-1]))
      {
        prp = lnk.devProperty.substring(0, lnk.devProperty.indexOf(parts[parts.length-1])-1);
        fieldKnown = true;
        fld = parts[parts.length-1];
      }
    }
    if (!fieldKnown)
    {
      parts = lnk.devName.split("\\.");
      if (parts.length > 1 && bf.isField(parts[parts.length-1]))
      {
       dev = lnk.devName.substring(0, lnk.devName.indexOf(parts[parts.length-1])-1);
       fieldKnown = true;
       fld = parts[parts.length-1];
      }
      else
      { // not a single field -> the entire tagged bitfield ?
        if (tf.debugLevel > 0)
          DbgLog.log("mapSingleFieldToBitfield","mapped bitfield "+parts[parts.length-1]+" is not a field of "+tag);
        return 0;
      }
    }
    if (fieldKnown)
    {
      tf.addLinkToReLinkList(lnk, bf,fld);
      lnk.devName = dev;
      lnk.devProperty = prp;
    }
    else
    { // this should not happen if every thing goes well
      cc = lnk.linkStatus = TErrorList.invalid_field;
      // TODO: find a way of calling the callback with this status
      return cc;
    }
    lnk.dOutput.dFormat = bf.getFormat();
    lnk.dOutput.setBitField(bf);
    lnk.dOutput.setField(fld);
    return 0;     
  }
View Full Code Here


        return TErrorList.argument_list_error;
    }
    short cc = 0;
    String tag = din.toString();
    tag = tag.replace('\n', (char) 0).trim();
    TBitfield tbf = TBitfieldRegistry.getBitfield(tag);
    if (tbf == null) return TErrorList.invalid_structure_tag;
    TField[] tbff = tbf.getFields();
    NAME16I[] ni = new NAME16I[tbff.length+1];
    for (int i=0; i<tbff.length; i++)
      ni[i] = new NAME16I(tbff[i].getName(),tbff[i].getBitmask());
    ni[tbff.length] = new NAME16I(tag,tbf.getFormat());
    switch (dout.getFormat())
    {
      case TFormat.CF_NAME16I:
        cc = (short) dout.putData(ni);
        break;
View Full Code Here

        return TErrorList.argument_list_error;
    }
    short cc = 0;
    String tag = din.toString();
    tag = tag.replace('\n', (char) 0).trim();
    TBitfield tbf = TBitfieldRegistry.getBitfield(tag);
    if (tbf == null) return TErrorList.invalid_structure_tag;
    TField[] tbff = tbf.getFields();
    NAME16I[] ni = new NAME16I[tbff.length+1];
    for (int i=0; i<tbff.length; i++)
      ni[i] = new NAME16I(tbff[i].getName(),tbff[i].getBitmask());
    ni[tbff.length] = new NAME16I(tag,tbf.getFormat());
    switch (dout.getFormat())
    {
      case TFormat.CF_NAME16I:
        cc = (short) dout.putData(ni);
        break;
View Full Code Here

      case CF_BITFIELD16:
      case CF_BITFIELD32:
      case CF_BITFIELD64:
      {
        TBitfield[] tco = new TBitfield[arrayLength];
        for (int i=0; i<arrayLength; i++) tco[i] = new TBitfield(dataTag,dataFormat);
        return tco;
      }
      case CF_NAME64DBL:
      {
        NAME64DBL[] tco = new NAME64DBL[arrayLength];
View Full Code Here

    {
      lnk.linkStatus = cc;
      lnk.linkStale = true;
      return cc;
    }
    TBitfield bf = TBitfieldRegistry.getBitfield(tag);
    if (bf == null)
    {
      cc = lnk.linkStatus = TErrorList.invalid_structure_tag;
      lnk.linkStale = true;
      return cc;
    }
    boolean fieldKnown = false;
    String[] parts;
    String dev = lnk.devName;
    String prp = lnk.devProperty;
    String fld = null;
    if (!fieldKnown)
    {
      parts = lnk.devProperty.split("\\.");
      if (parts.length > 1 && bf.isField(parts[parts.length-1]))
      {
        prp = lnk.devProperty.substring(0, lnk.devProperty.indexOf(parts[parts.length-1])-1);
        fieldKnown = true;
        fld = parts[parts.length-1];
      }
    }
    if (!fieldKnown)
    {
      parts = lnk.devName.split("\\.");
      if (parts.length > 1 && bf.isField(parts[parts.length-1]))
      {
       dev = lnk.devName.substring(0, lnk.devName.indexOf(parts[parts.length-1])-1);
       fieldKnown = true;
       fld = parts[parts.length-1];
      }
    }
    if (fieldKnown)
    {
      tf.addLinkToReLinkList(lnk, bf,fld);
      lnk.devName = dev;
      lnk.devProperty = prp;
    }
    else
    { // this should not happen if every thing goes well
      cc = lnk.linkStatus = TErrorList.invalid_field;
      // TODO: find a way of calling the callback with this status
      return cc;
    }
    lnk.dOutput.dFormat = bf.getFormat();
    lnk.dOutput.setBitField(bf);
    lnk.dOutput.setField(fld);
    return 0;     
  }
View Full Code Here

      case CF_BITFIELD16:
      case CF_BITFIELD32:
      case CF_BITFIELD64:
      {
        TBitfield[] tco = new TBitfield[arrayLength];
        for (int i=0; i<arrayLength; i++) tco[i] = new TBitfield(dataTag,dataFormat);
        return tco;
      }
      case CF_NAME64DBL:
      {
        NAME64DBL[] tco = new NAME64DBL[arrayLength];
View Full Code Here

      case CF_BITFIELD16:
      case CF_BITFIELD32:
      case CF_BITFIELD64:
      {
        TBitfield[] tco = new TBitfield[arrayLength];
        for (int i=0; i<arrayLength; i++) tco[i] = new TBitfield(dataTag,dataFormat);
        return tco;
      }
      case CF_NAME64DBL:
      {
        NAME64DBL[] tco = new NAME64DBL[arrayLength];
View Full Code Here

    {
      lnk.linkStatus = cc;
      lnk.linkStale = true;
      return cc;
    }
    TBitfield bf = TBitfieldRegistry.getBitfield(tag);
    if (bf == null)
    {
      cc = lnk.linkStatus = TErrorList.invalid_structure_tag;
      lnk.linkStale = true;
      return cc;
    }
    if (!bf.hasFields())
    {
      cc = lnk.linkStatus = TErrorList.invalid_field;
      lnk.linkStale = true;
      return cc;
    }
    boolean fieldKnown = false;
    String[] parts;
    String dev = lnk.devName;
    String prp = lnk.devProperty;
    String fld = null;
    if (!fieldKnown)
    {
      parts = lnk.devProperty.split("\\.");
      if (parts.length > 1 && bf.isField(parts[parts.length-1]))
      {
        prp = lnk.devProperty.substring(0, lnk.devProperty.lastIndexOf(parts[parts.length-1])-1);
        fieldKnown = true;
        fld = parts[parts.length-1];
      }
    }
    if (!fieldKnown)
    {
      parts = lnk.devName.split("\\.");
      if (parts.length > 1 && bf.isField(parts[parts.length-1]))
      {
        dev = lnk.devName.substring(0, lnk.devName.lastIndexOf(parts[parts.length-1])-1);
        fieldKnown = true;
        fld = parts[parts.length-1];
        lnk.setCloseOnRelink(true);
      }
      else
      { // not a single field -> the entire tagged bitfield ?
        if (TLinkFactory.debugLevel > 0)
          DbgLog.log("mapSingleFieldToBitfield","mapped bitfield "+parts[parts.length-1]+" is not a field of "+tag);
        return 0;
      }
    }
    if (fieldKnown)
    {
      tf.addLinkToReLinkList(lnk, bf,fld);
      lnk.devName = dev;
      lnk.devProperty = prp;
    }
    else
    { // this should not happen if every thing goes well
      cc = lnk.linkStatus = TErrorList.invalid_field;
      // TODO: find a way of calling the callback with this status
      return cc;
    }
    lnk.dOutput.dFormat = bf.getFormat();
    lnk.dOutput.setBitField(new TBitfield[]{bf});
    lnk.dOutput.setField(fld);
    if (lnk.hasDependencies())
    { // just finished learning this, but I already have dependencies ?
      for (TLink xl : lnk.dependencies)
View Full Code Here

        return TErrorList.argument_list_error;
    }
    short cc = 0;
    String tag = din.toString();
    tag = tag.replace('\n', (char) 0).trim();
    TBitfield tbf = TBitfieldRegistry.getBitfield(tag);
    if (tbf == null) return TErrorList.invalid_structure_tag;
    TField[] tbff = tbf.getFields();
    NAME16I[] ni = new NAME16I[tbff.length+1];
    for (int i=0; i<tbff.length; i++)
      ni[i] = new NAME16I(tbff[i].getName(),tbff[i].getBitmask());
    ni[tbff.length] = new NAME16I(tag,tbf.getFormat());
    switch (dout.getFormat())
    {
      case TFormat.CF_NAME16I:
        cc = (short) dout.putData(ni);
        break;
View Full Code Here

TOP

Related Classes of de.desy.tine.bitfieldUtils.TBitfield

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.