Esempio n. 1
0
  public static Pad[] getPadsOfGroup(Pads cfg, String groupName) {
    ArrayList<Pad> res = new ArrayList<Pad>();

    for (Pad g : cfg.getPad())
      if (groupName == null && g.getGroup() == null
          || groupName != null && groupName.equals(g.getGroup())) res.add(g);

    return (Pad[]) res.toArray(new Pad[res.size()]);
  }
Esempio n. 2
0
  public static Pad getPad(Pads cfg, String groupName, String instName) {
    if (cfg == null) return null;

    for (Pad g : cfg.getPad())
      if ((groupName == null && g.getGroup() == null
              || groupName != null && groupName.equals(g.getGroup()))
          && (instName.equals(g.getInstanceName()))) return g;

    return null;
  }
Esempio n. 3
0
  public Pads clone(Pads pads) {

    if (pads == null) return null;

    Pads newPads = new Pads();

    if (pads.getInstanceName() != null) newPads.setInstanceName(pads.getInstanceName());

    for (PadGroup pg : pads.getPadGroup()) newPads.getPadGroup().add(clone(pg));

    for (Pad p : pads.getPad()) newPads.getPad().add(clone(p));

    return newPads;
  }
Esempio n. 4
0
 public static boolean existGroup(Pads cfg, String groupName) {
   for (PadGroup g : cfg.getPadGroup()) {
     if (groupName.equals(g.getName())) return true;
   }
   return false;
 }
Esempio n. 5
0
 /**
  * checks if a padData object still exists in the memory specification
  *
  * @param cfg
  * @param padData
  * @return
  */
 public static boolean existPadDataObject(Pads cfg, Pad padData) {
   for (Pad g : cfg.getPad()) {
     if (g == padData) return true;
   }
   return false;
 }
Esempio n. 6
0
  public static PadGroup getPadGroup(Pads cfg, String groupName) {

    for (PadGroup g : cfg.getPadGroup()) if (groupName.equals(g.getName())) return g;

    return null;
  }