예제 #1
1
파일: Main.java 프로젝트: nologic/nabs
  // Communications
  public void updateStatus(InputStream in) throws IOException {
    DataInputStream din = new DataInputStream(in);
    if (builder.length() != 0) {
      builder.delete(0, builder.length());
    }

    eventTotal.setText(form.format(new Long(din.readLong())));
    dataTotal.setText(Util.convertBytes(builder, din.readLong(), true).toString());
    builder.delete(0, builder.length());
    dataRate.setText(Util.convertBytesRate(builder, din.readDouble(), true).toString());
    eventRate.setText(form.format(new Integer((int) din.readDouble())) + "e/s");
  }
예제 #2
0
  public void run() {
    while (true) {
      int rate = receptor.getRefreshRate();
      if (rate < 200) {
        rate = 200;
      }

      Util.threadSleep(rate);

      Iterator mods = getModules();
      while (mods.hasNext()) {
        Object o = mods.next();
        FrontendModule mod = (FrontendModule) o;
        updateModule(mod);
      }
    }
  }