Example #1
0
    /** set a new channel whose limits we wish to monitor */
    public void setChannel(final Channel channel) {
      synchronized (this) {
        if (_lowerChannel != null) {
          _lowerChannel.removeConnectionListener(this);
          if (_lowerMonitor != null) {
            _lowerMonitor.clear();
            _lowerMonitor = null;
          }
        }

        final String lowerLimitPV = channel.channelName() + ".LOPR";
        _lowerChannel = ChannelFactory.defaultFactory().getChannel(lowerLimitPV);
        _lowerChannel.addConnectionListener(this);
        _lowerChannel.requestConnection();

        if (_upperChannel != null) {
          _upperChannel.removeConnectionListener(this);
          if (_upperMonitor != null) {
            _upperMonitor.clear();
            _upperMonitor = null;
          }
        }

        final String upperLimitPV = channel.channelName() + ".HOPR";
        _upperChannel = ChannelFactory.defaultFactory().getChannel(upperLimitPV);
        _upperChannel.addConnectionListener(this);
        _upperChannel.requestConnection();
      }
    }
Example #2
0
 /** Request a connection to the book channel. */
 protected void requestBookConnection() {
   try {
     final Channel bookChannel = getNode().getChannel(MagnetMainSupply.FIELD_BOOK_HANDLE);
     bookChannel.requestConnection();
   } catch (NoSuchChannelException exception) {
   } // not important at this point
 }
Example #3
0
  /** Creates new BpmAgent */
  public BpmAgent(AcceleratorSeq aSequence, BPM newBpmNode) {

    bpmNode = newBpmNode;
    sequence = aSequence;

    xavgch = bpmNode.getChannel(BPM.X_TBT_HANDLE);
    yavgch = bpmNode.getChannel(BPM.Y_TBT_HANDLE);
    xavgch.requestConnection();
    yavgch.requestConnection();
    bpmNode.getChannel(BPM.X_AVG_HANDLE).requestConnection();
    bpmNode.getChannel(BPM.Y_AVG_HANDLE).requestConnection();
    // xavgch.setSyncRequest(true);
    // yavgch.setSyncRequest(true);
    // xavgch.connect();
    // yavgch.connect();
    // xavgch.pendIO(5);
    // yavgch.pendIO(5);
    // xavgch.setSyncRequest(false);
    // yavgch.setSyncRequest(false);
  }