Ejemplo n.º 1
0
 @Override
 public void configure() throws FactoryException {
   String intensityRec = null, xPosRec = null, yPosRec = null;
   if (!configured) {
     if (getDeviceName() != null) {
       BpmType bpmConfig;
       try {
         bpmConfig =
             Configurator.getConfiguration(getDeviceName(), gda.epics.interfaces.BpmType.class);
         intensityRec = bpmConfig.getINTENSITY().getPv();
         xPosRec = bpmConfig.getXPOS().getPv();
         yPosRec = bpmConfig.getYPOS().getPv();
         createChannelAccess(intensityRec, xPosRec, yPosRec);
         channelManager.tryInitialize(100);
       } catch (ConfigurationNotFoundException e) {
         logger.error("Can NOT find EPICS configuration for BPM " + getDeviceName(), e);
       }
     } else {
       logger.error("Missing EPICS interface configuration for the BPM " + getName());
       throw new FactoryException(
           "Missing EPICS interface configuration for the BPM " + getName());
     }
     configured = true;
   } // end of if (!configured)
 }
 /**
  * Configures the class with the PV information from the gda-interface.xml file. Vendor and model
  * are available through EPICS but are currently not supported in GDA.
  *
  * @see gda.device.DeviceBase#configure()
  */
 @Override
 public void configure() throws FactoryException {
   if (!configured) {
     if (getDeviceName() != null) {
       CurrAmpQuadType currAmpConfig;
       try {
         currAmpConfig =
             Configurator.getConfiguration(
                 getDeviceName(), gda.epics.interfaces.CurrAmpQuadType.class);
         createChannelAccess(
             currAmpConfig.getI1().getPv(),
             currAmpConfig.getI2().getPv(),
             currAmpConfig.getI3().getPv(),
             currAmpConfig.getI4().getPv(),
             currAmpConfig.getRANGE().getPv(),
             currAmpConfig.getRANGE_READBACK().getPv());
         //					channelManager.tryInitialize(100);
       } catch (ConfigurationNotFoundException e) {
         logger.error(
             "Can NOT find EPICS configuration for current amplifier quad " + getDeviceName(), e);
       }
     } else {
       logger.error(
           "Missing EPICS interface configuration for the current amplifier quad " + getName());
       throw new FactoryException(
           "Missing EPICS interface configuration for the current amplifier quad " + getName());
     }
     configured = true;
   }
 }
Ejemplo n.º 3
0
  @Override
  public void configure() throws FactoryException {
    if (!configured) {
      SimplePvType enable;
      SimpleBinaryType speed;
      if (getSpeedName() != null) {
        try {
          enable =
              Configurator.getConfiguration(
                  getSpeedName(), gda.epics.interfaces.SimplePvType.class);
        } catch (ConfigurationNotFoundException e) {
          logger.error("Can NOT find EPICS configuration for sample spin " + getSpeedName(), e);
          throw new FactoryException("Epics sample spin " + getSpeedName() + " not found");
        }
      } else {
        logger.error("Missing EPICS configuration for sample spin {}", getName());
        throw new FactoryException("Missing EPICS configuration for sample spin " + getName());
      }
      if (getEnableName() != null) {
        try {
          speed =
              Configurator.getConfiguration(
                  getEnableName(), gda.epics.interfaces.SimpleBinaryType.class);

        } catch (ConfigurationNotFoundException e) {
          logger.error("Can NOT find EPICS configuration for sample spin " + getEnableName(), e);
          throw new FactoryException("Epics sample spin " + getEnableName() + " not found");
        }
      } else {
        logger.error("Missing EPICS configuration for sample spin {}", getName());
        throw new FactoryException("Missing EPICS configuration for sample spin " + getName());
      }
      createChannelAccess(enable, speed);
      configured = true;
    }
  }