Exemplo n.º 1
0
    public void setData(Run[] r) {
      if ((r == null) || (r.length <= 1)) {
        setText("");
        return;
      }

      Run one, two, last;

      one = two = last = r[r.length - 1];
      for (int ii = 0; ii < r.length; ii++) {
        if (r[ii] == null) continue;

        if (r[ii].getNetOrder() == 1) one = r[ii];
        else if (r[ii].getNetOrder() == 2) two = r[ii];

        // if (r[ii].iorder == 1)
        //	raw = r[ii];
      }

      double ndiff, rdiff;

      String txt = "<HTML>";
      if (last.run() != one.run()) {
        ndiff = last.getNet() - one.getNet();
        rdiff = last.getRaw() - one.getRaw();
        if (rdiff < 0) {
          txt +=
              "Run "
                  + last.run()
                  + " raw is "
                  + df.format(-rdiff)
                  + " faster than run "
                  + one.run();
          txt += "<br>However, net is " + df.format(ndiff) + " slower";
        } else {
          txt +=
              "Run " + last.run() + " raw is " + df.format(rdiff) + " slower than run " + one.run();
          if (ndiff != rdiff) txt += "<br>Net is " + df.format(ndiff) + " slower";
        }
      } else {
        ndiff = two.getNet() - last.getNet();
        rdiff = two.getRaw() - last.getRaw();
        if (rdiff < 0) {
          txt +=
              "Run "
                  + last.run()
                  + " raw is "
                  + df.format(-rdiff)
                  + " slower than run "
                  + two.run();
          txt += "<br>However, net is " + df.format(ndiff) + " faster";
        } else {
          txt +=
              "Run " + last.run() + " raw is " + df.format(rdiff) + " faster than run " + two.run();
          if (ndiff != rdiff) txt += "<br>Net is " + df.format(ndiff) + " faster";
        }
      }

      setText(txt);
    }
Exemplo n.º 2
0
    public Object getValueAt(int row, int col) {
      Run r = null;
      Run last = null;

      if (data == null) return "";
      r = data.getRun(row + 1);
      if (r == null) return "";

      if (row > 0) last = data.getRun(row);

      switch (col) {
        case 0:
          return df.format(r.getRaw());
        case 2:
          return new String("(" + r.getCones() + "," + r.getGates() + ")");
        case 3:
          return df.format(r.getNet());

        case 1:
          if (r.getRawOrder() == 1) return "*";
          else return "";

        case 4:
          if (r.getNetOrder() <= 2) return r.getNetOrder();
          else return "";
      }
      return null;
    }