/**
  * Sets the accelerator sequence
  *
  * @param accSeq The new accelSeq value
  */
 public void setAccelSeq(AcceleratorSeq accSeq) {
   java.util.List<AcceleratorNode> accNodes = accSeq.getNodesOfType(Electromagnet.s_strType);
   java.util.Iterator<AcceleratorNode> itr = accNodes.iterator();
   while (itr.hasNext()) {
     Electromagnet emg = (Electromagnet) itr.next();
     if (emg.getStatus()) {
       emg.setUseFieldReadback(false);
     }
   }
   ringFoilPosCorr.setAccelSeq(accSeq);
 }
Example #2
0
  // getNodes() could not be cast to a type so the conversion could not be checked
  @SuppressWarnings("unchecked")
  private static boolean sharesMainSupply(final Electromagnet magnet) {
    final Collection<Electromagnet> nodes = magnet.getMainSupply().getNodes();
    final Iterator<Electromagnet> nodeIter = nodes.iterator();

    while (nodeIter.hasNext()) {
      final Electromagnet node = nodeIter.next();
      if (!node.getId().equals(magnet.getId())) {
        return true;
      }
    }

    return false;
  }
Example #3
0
 /** Use setpoints for electromagnets. */
 public void useSetpoints(final AcceleratorSeq sequence) {
   if (sequence != null) {
     final List<AcceleratorNode> magnets = sequence.getNodesOfType(Electromagnet.s_strType, true);
     for (AcceleratorNode node : magnets) {
       ((Electromagnet) node).setUseFieldReadback(false);
     }
   }
 }