Beispiel #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;
 }
Beispiel #2
0
  /** Constructor */
  public CorrectorSupply(final MagnetMainSupply powerSupply) {
    PUT_HANDLER = new PutHandler();

    _powerSupply = powerSupply;

    _correctors = new ArrayList<CorrectorAgent>();
    _latestField = Double.NaN;
    _lowerFieldLimit = Double.NaN;
    _upperFieldLimit = Double.NaN;

    MESSAGE_CENTER = new MessageCenter();
    EVENT_PROXY = MESSAGE_CENTER.registerSource(this, CorrectorSupplyListener.class);

    wrapChannels();
    LIMITS_HANDLER = new LimitsHandler(powerSupply.getChannel(MagnetMainSupply.FIELD_SET_HANDLE));
  }
Beispiel #3
0
  /**
   * Primary OrbitModel Constructor
   *
   * @param modificationStore the modification store
   * @param sequence the sequence to model
   */
  public OrbitModel(final ModificationStore modificationStore, final AcceleratorSeq sequence) {
    MESSAGE_CENTER = new MessageCenter("Orbit Model");
    EVENT_PROXY = MESSAGE_CENTER.registerSource(this, OrbitModelListener.class);

    BEAM_EXCURSION_ORBIT_ADAPTOR =
        new BeamExcursionOrbitAdaptor(sequence, new ArrayList<BpmAgent>());

    _baseProbe = null;
    _modificationStore = modificationStore;

    AVAILABLE_BPM_AGENTS = new ArrayList<BpmAgent>();

    createOrbitSources();

    setUseBeamEventTrigger(true);
    setSequence(sequence);
  }
Beispiel #4
0
 /**
  * Remove the listener from receiving OrbitModelListener events from this model.
  *
  * @param listener the listener to remove from receiving events.
  */
 public void removeOrbitModelListener(final OrbitModelListener listener) {
   MESSAGE_CENTER.removeTarget(listener, this, OrbitModelListener.class);
 }
Beispiel #5
0
 /**
  * Add the listener as a receiver of OrbitModelListener events from this model.
  *
  * @param listener the listener to register for receiving events.
  */
 public void addOrbitModelListener(final OrbitModelListener listener) {
   MESSAGE_CENTER.registerTarget(listener, this, OrbitModelListener.class);
 }
Beispiel #6
0
 /**
  * Remove the specified listener from receiving corrector supply events from this agent.
  *
  * @param listener The listener to be removed from receiving corrector supply events.
  */
 public void removeCorrectorEventListener(final CorrectorSupplyListener listener) {
   MESSAGE_CENTER.removeTarget(listener, this, CorrectorSupplyListener.class);
 }