congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ExpressionLanguage.newValuesOf
Code IndexAdd Tabnine to your IDE (free)

How to use
newValuesOf
method
in
org.diirt.datasource.ExpressionLanguage

Best Java code snippets using org.diirt.datasource.ExpressionLanguage.newValuesOf (Showing top 6 results out of 315)

origin: org.diirt/datasource

/**
 * Returns up to 1,000 new values generated by the expression source rate.
 * <p>
 * You are strongly encouraged to use {@link #newValuesOf(org.diirt.datasource.expression.SourceRateExpression, int) }
 * to set a limit that is appropriate for your application.
 *
 * @param <T> type being read
 * @param expression source rate expression
 * @return a new expression
 */
public static <T> DesiredRateExpression<List<T>>
    newValuesOf(SourceRateExpression<T> expression) {
  return newValuesOf(expression, 1000);
}
origin: org.diirt/datasource

/**
 * Returns all the new values generated by the expression source rate.
 *
 * @param <T> type being read
 * @param expressions source rate expressions
 * @return a new expression
 */
public static <T> DesiredRateExpressionList<List<T>>
    newValuesOf(SourceRateExpressionList<T> expressions) {
  DesiredRateExpressionList<List<T>> list = new DesiredRateExpressionListImpl<List<T>>();
  for (SourceRateExpression<T> expression : expressions.getSourceRateExpressions()) {
    list.and(newValuesOf(expression));
  }
  return list;
}
origin: org.diirt/datasource-sample

PVReader<List<VNumber>> reader = PVManager.read(ExpressionLanguage.newValuesOf(vNumber("ramp()")))
    .readListener(new PVReaderListener<List<VNumber>>() {
      @Override
origin: org.diirt/datasource-sample

public void b2_readAllValues() {
  // Read channel "channelName" up to every 100 ms, and get all
  // the new values from the last notification.
  PVReader<List<Object>> pvReader = PVManager
    .read(newValuesOf(channel("channelName")))
    .readListener(new PVReaderListener<List<Object>>() {
      @Override
      public void pvChanged(PVReaderEvent<List<Object>> event) {
        // Do something with each value
        for (Object newValue : event.getPvReader().getValue()) {
          System.out.println(newValue);
        }
      }
    })
    .maxRate(ofMillis(100));
  // Remember to close
  pvReader.close();
  // newValuesOf limits the values in the queue, to protect memory
  // consumption in problematic circumstances. The default is 1000 elements,
  // which you can override. See all options in the ExpressionLanguage class.
}
origin: org.diirt/datasource-vtype

/**
 * Aggregates the sample at the scan rate and takes the average.
 *
 * @param doublePv the expression to take the average of; can't be null
 * @return an expression representing the average of the expression
 */
public static DesiredRateExpression<VDouble> averageOf(SourceRateExpression<VDouble> doublePv) {
  DesiredRateExpression<List<VDouble>> queue = newValuesOf(doublePv);
  return new DesiredRateExpressionImpl<VDouble>(queue,
      new AverageAggregator(queue.getFunction()), "avg(" + doublePv.getName() + ")");
}
origin: org.diirt/datasource-vtype

/**
 * Aggregates the sample at the scan rate and calculates statistical information.
 *
 * @param doublePv the expression to calculate the statistics information on; can't be null
 * @return an expression representing the statistical information of the expression
 */
public static DesiredRateExpression<VStatistics> statisticsOf(SourceRateExpression<VDouble> doublePv) {
  DesiredRateExpression<List<VDouble>> queue = newValuesOf(doublePv);
  return new DesiredRateExpressionImpl<VStatistics>(queue,
      new StatisticsDoubleAggregator(queue.getFunction()), "stats(" + doublePv.getName() + ")");
}
org.diirt.datasourceExpressionLanguagenewValuesOf

Javadoc

Returns up to 1,000 new values generated by the expression source rate.

You are strongly encouraged to use #newValuesOf(org.diirt.datasource.expression.SourceRateExpression,int)to set a limit that is appropriate for your application.

Popular methods of ExpressionLanguage

  • channel
    A channel with the given name and type. This expression can be used both in a read and a write expre
  • channels
    A list of channels with the given names of any type. This expression can be used both in a read and
  • constant
    Creates a constant expression that always return that object, with the given name for the expression
  • latestValueOf
    For reads, returns (only) the latest value computed from a SourceRateReadWriteExpression; for writes
  • listOf
    Converts a list of expressions to an expression that returns the list of results.
  • mapOf
    An expression that expects a key/value map where the key is the expression name and the value is the
  • resultOf
    An expression that represents the result of a user provided function.

Popular in Java

  • Reading from database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • findViewById (Activity)
  • putExtra (Intent)
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now