Пример #1
0
  /** refresh enabled BPMs */
  protected void refreshEnabledBPMs(final boolean postChange) {
    final List<BpmAgent> bpmAgents = new ArrayList<BpmAgent>(AVAILABLE_BPM_AGENTS.size());

    for (final BpmAgent bpmAgent : AVAILABLE_BPM_AGENTS) {
      if (bpmAgent.isEnabled()) {
        bpmAgents.add(bpmAgent);
      }
    }
    _bpmAgents = new ArrayList<BpmAgent>();
    _bpmAgents.addAll(bpmAgents);

    if (postChange) {
      for (final OrbitSource source : _orbitSources) {
        source.setSequence(_sequence, _bpmAgents);
      }
      EVENT_PROXY.enabledBPMsChanged(this, _bpmAgents);
    }
  }
Пример #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);
    }
  }