Example #1
0
 /** get the live value if use live model and there is one */
 public double getLiveValue() {
   double[] liveValueArray = new double[channelMonitors.length];
   for (int monitorIndex = 0; monitorIndex < channelMonitors.length; monitorIndex++) {
     liveValueArray[monitorIndex] = channelMonitors[monitorIndex].getLatestValue();
   }
   return NODE.getLivePropertyValue(PROPERTY_NAME, liveValueArray);
 }
Example #2
0
 /** Constructor */
 public NodePropertyRecord(
     final AcceleratorNode node, final String propertyName, final double loggedValue) {
   NODE = node;
   PROPERTY_NAME = propertyName;
   this.loggedValue = loggedValue;
   Channel[] channels = NODE.getLivePropertyChannels(PROPERTY_NAME);
   channelMonitors = createMonitors(channels);
   MODEL_INPUT = new ModelInput(node, PROPERTY_NAME, Double.NaN);
 }
Example #3
0
 /** Instructs the receiver to write its data to the adaptor for external storage. */
 @Override
 public void write(DataAdaptor adaptor) {
   adaptor.setValue("nodeId", NODE.getId());
   adaptor.setValue("propertyName", PROPERTY_NAME);
   adaptor.setValue("testValue", MODEL_INPUT.getDoubleValue());
   adaptor.setValue("checkState", checkState);
   adaptor.setValue("scanStartValue", scanStartValue);
   adaptor.setValue("scanEndValue", scanEndValue);
   adaptor.setValue("scanSteps", scanSteps);
 }
Example #4
0
 /** Constructor with adaptor */
 public NodePropertyRecord(
     final AcceleratorNode node,
     final String propertyName,
     final double loggedValue,
     final DataAdaptor adaptor) {
   NODE = node;
   PROPERTY_NAME = propertyName;
   this.loggedValue = loggedValue;
   Channel[] channels = NODE.getLivePropertyChannels(PROPERTY_NAME);
   channelMonitors = createMonitors(channels);
   double testValue =
       (adaptor.hasAttribute("testValue")) ? adaptor.doubleValue("testValue") : Double.NaN;
   MODEL_INPUT = new ModelInput(node, PROPERTY_NAME, testValue);
   if (adaptor.hasAttribute("checkState")) checkState = adaptor.booleanValue("checkState");
   if (adaptor.hasAttribute("scanStartValue"))
     scanStartValue = adaptor.doubleValue("scanStartValue");
   if (adaptor.hasAttribute("scanEndValue")) scanEndValue = adaptor.doubleValue("scanEndValue");
   if (adaptor.hasAttribute("scanSteps")) scanSteps = adaptor.intValue("scanSteps");
 }
Example #5
0
 /** get design value */
 public double getDesignValue() {
   return NODE.getDesignPropertyValue(PROPERTY_NAME);
 }
Example #6
0
 public void refresh(final double loggedValue) {
   Channel[] channels = NODE.getLivePropertyChannels(PROPERTY_NAME);
   channelMonitors = createMonitors(channels);
   this.loggedValue = loggedValue;
 }
Example #7
0
 /** Set the attribute bucket containing the machine magnet info */
 public void setMagBucket(MagnetBucket buc) {
   m_bucMagnet = buc;
   super.addBucket(buc);
 };
Example #8
0
  /** Override AcceleratorNode implementation to check for a MultipoleBucket */
  public void addBucket(AttributeBucket buc) {

    if (buc.getClass().equals(MagnetBucket.class)) setMagBucket((MagnetBucket) buc);

    super.addBucket(buc);
  };