예제 #1
0
 /** Dispose of this model's resources */
 public void dispose() {
   setSequence(null);
   _orbitSources = null;
   MESSAGE_CENTER.removeSource(this, OrbitModelListener.class);
   _bpmAgents = null;
   AVAILABLE_BPM_AGENTS.clear();
   _correctorAgents = null;
 }
예제 #2
0
  /** Load the bpms from the selected sequence and construct the BPM agents. */
  public void loadBPMs() {
    if (_sequence == null) {
      AVAILABLE_BPM_AGENTS.clear();
      _bpmAgents = new ArrayList<BpmAgent>();
      BEAM_EXCURSION_ORBIT_ADAPTOR.setBPMAgents(_bpmAgents);
    } else {
      final List<BPM> allBPMs = _sequence.getAllNodesOfType(BPM.s_strType);
      final List<BPM> bpms = AcceleratorSeq.filterNodesByStatus(allBPMs, true);
      final Iterator<BPM> bpmIter = bpms.iterator();
      final List<BpmAgent> bpmAgents = new ArrayList<BpmAgent>(bpms.size());
      while (bpmIter.hasNext()) {
        final BPM bpm = bpmIter.next();
        if (bpm.getValid()) {
          bpmAgents.add(new BpmAgent(bpm));
        }
      }
      Collections.sort(bpmAgents, new BPMComparator(_sequence));
      BEAM_EXCURSION_ORBIT_ADAPTOR.setBPMAgents(bpmAgents);

      AVAILABLE_BPM_AGENTS.clear();
      AVAILABLE_BPM_AGENTS.addAll(bpmAgents);
      refreshEnabledBPMs(false);
    }
  }