congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
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

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • addToBackStack (FragmentTransaction)
  • onCreateOptionsMenu (Activity)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • JOptionPane (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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