/** 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); }
/** 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); }
/** 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); }
/** 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"); }
/** get design value */ public double getDesignValue() { return NODE.getDesignPropertyValue(PROPERTY_NAME); }
public void refresh(final double loggedValue) { Channel[] channels = NODE.getLivePropertyChannels(PROPERTY_NAME); channelMonitors = createMonitors(channels); this.loggedValue = loggedValue; }
/** Set the attribute bucket containing the machine magnet info */ public void setMagBucket(MagnetBucket buc) { m_bucMagnet = buc; super.addBucket(buc); };
/** 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); };