Esempio n. 1
0
  public void addExternalDelayInfo(HashMap<String, Integer> delays) {
    for (int i = 0; i < conCnt; i++) {
      UnboundConnection c = connections[i];
      for (int j = 0; j < c.trainCount; ++j) {
        Train t = c.getTrain(j);
        if (delays.containsKey(t.number)) {
          delayInfo = true;

          int arr = t.arrtime.intValue();
          int mindel = delays.get(t.number);
          int hrs = mindel / 60;
          arr += hrs * 100;
          mindel -= hrs * 60;
          arr += mindel;

          PLNTimestamp real = new PLNTimestamp(arr);
          real.normalize();

          saveShort(t.changeOffset + 2, real.intValue());

          int dep = t.deptime.intValue();
          dep += hrs * 100;
          dep += mindel;

          real = new PLNTimestamp(dep);
          real.normalize();

          saveShort(t.changeOffset, real.intValue());

          // Ew. opoznienie polaczenia
          if (j == 0) saveShort(c.changeOffset + 2, mindel);
        }
      }
    }
  }
Esempio n. 2
0
 public int connectionCount() {
   if (totalConCnt == -1) {
     ++totalConCnt;
     for (UnboundConnection c : connections) totalConCnt += c.getAvailability().daysCount();
   }
   return totalConCnt;
 }