Exemple #1
0
 @Override
 public String getFullName() {
   if (toAllCBs) {
     return "[ALL] " + getName();
   }
   return parent.getId() + "/" + parent.getType() + ":" + getName();
 }
Exemple #2
0
 @Override
 public int getParentID() {
   if (toAllCBs) {
     return 0xff;
   }
   return parent.getId();
 }
  @Override
  public CBConfigText calculate(Element cb) throws Exception {
    CBConfigText ct = new CBConfigText(cb);

    GridAttribute ga = cb.getGridAttribute("Functions");

    // build one line for each row in the grid

    boolean hasATAI = ga.getColumnSpecs().size() > 4;
    int rows = ga.getNumRows();
    for (int row = 0; row < rows; row++) {
      GridRowData rd = ga.getRow(row);
      // get data from the row
      int event = rd.getInt(0);
      int fnVal = rd.decodeInt(1);
      // function has arg.type.fn (each 8 bits).
      int type = (fnVal >> 8) & 0xff;
      int argv = (fnVal >> 16) & 0xff;
      int arg = rd.getInt(2, 0) + argv;
      int target = 0;
      int adopt_tickref = 0;
      int adopt_instr = 0;
      if (hasATAI) {
        adopt_tickref = rd.getInt(3, 0);
        adopt_instr = rd.getInt(4, 0);
        target = rd.getInt(5, 0);
      } else {
        target = rd.getInt(3, 0);
      }
      int fn = fnVal & 0xff;
      int channel = row + 1; // 1..4
      if (target == 0) {
        target = MatElementDefs.EL_ID_ALL;
      }
      StringBuffer line = new StringBuffer();
      line.append("Ip" + channel + ",");
      if (event != 0) {
        switch (event) {
          case 1:
            line.append("F: ");
            break;
          case 2:
            line.append("T: ");
            break;
          case 3:
            line.append("A: ");
            break;
        }
        line.append(getFn(type, fn, arg));
        if (adopt_tickref == 1) {
          line.append("T");
        }
        if (adopt_instr == 1) {
          line.append("I");
        }
        if (target != MatElementDefs.EL_ID_ALL) {
          line.append(" ->CB" + target);
        }
        ct.addLine(line.toString());
      }
    }
    return ct;
  }