示例#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()]);
  }
示例#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;
  }
示例#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;
  }
示例#4
0
 public static boolean existGroup(Pads cfg, String groupName) {
   for (PadGroup g : cfg.getPadGroup()) {
     if (groupName.equals(g.getName())) return true;
   }
   return false;
 }
示例#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;
 }
示例#6
0
  public static PadGroup getPadGroup(Pads cfg, String groupName) {

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

    return null;
  }