/**
  * 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);
     }
   }
 }
Example #4
0
 /**
  * use the field setpoints for the online model analysis otherwise the model produces ridiculous
  * answers
  */
 protected void useFieldSetpoint() {
   final List<AcceleratorNode> magnets =
       RTBT_SEQUENCE.getNodesOfType(Electromagnet.s_strType, true);
   for (final AcceleratorNode magnet : magnets) {
     if (magnet instanceof Electromagnet) {
       ((Electromagnet) magnet).setUseFieldReadback(false);
     }
   }
 }
Example #5
0
 public double getMainFieldSetting(final Electromagnet magnet) {
   final Channel channel = magnet.getChannel(MagnetMainSupply.FIELD_SET_HANDLE);
   return _dataSource.getChannelSnapshotValue(channel.channelName())[0];
 }