Ejemplo n.º 1
0
  static Element storeTrain(Warrant warrant, String type) {
    Element elem = new Element(type);
    String str = warrant.getTrainId();
    if (str == null) str = "";
    elem.setAttribute("trainId", str);

    DccLocoAddress addr = warrant.getDccAddress();
    if (addr != null) {
      elem.setAttribute("dccAddress", "" + addr.getNumber());
      elem.setAttribute("dccType", "" + (addr.isLongAddress() ? "L" : "S"));
    }
    elem.setAttribute("runBlind", warrant.getRunBlind() ? "true" : "false");

    str = warrant.getTrainName();
    if (str == null) str = "";
    elem.setAttribute("trainName", str);

    return elem;
  }
Ejemplo n.º 2
0
 boolean requestThrottle(DccLocoAddress loco) {
   return jmri.InstanceManager.throttleManagerInstance()
       .requestThrottle(loco.getNumber(), loco.isLongAddress(), this);
 }