Class XYScope

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, PortablePlaceable, TypedActor, Changeable, Configurable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class XYScope
    extends XYPlotter

    An X-Y plotter that plots with finite persistence. This plotter contains an instance of the Plot class from the Ptolemy plot package as a public member. Data at inputX and inputY are plotted on this instance. Both inputX and inputY are multiports that take a DoubleToken. When plotted, the first channel of inputX and the first channel of inputY are together considered the first signal, then the second channel of inputX and the second channel of inputY are considered the second signal, and so on. This requires that inputX and inputY have the same width.

    This actor assumes that there is at least one token available on each channel when it fires. The horizontal axis is given by the value of the input from inputX and vertical axis is given by inputY.

    If the persistence parameter is positive, then it specifies the number of points that are shown. It defaults to 100, so any point older than 100 samples is erased and forgotten.

    Since:
    Ptolemy II 1.0
    Version:
    $Id$
    Author:
    Edward A. Lee
    Pt.AcceptedRating:
    Yellow (neuendor)
    Pt.ProposedRating:
    Yellow (eal)
    • Field Detail

      • persistence

        public Parameter persistence
        The number of samples from each input channel displayed at any one time (an integer).
    • Method Detail

      • attributeChanged

        public void attributeChanged​(Attribute attribute)
                              throws IllegalActionException
        Notify this that an attribute has changed. If either parameter is changed, then this actor updates the configuration of the visible plot.
        Overrides:
        attributeChanged in class Plotter
        Parameters:
        attribute - The attribute that changed.
        Throws:
        IllegalActionException - If the expression of the attribute cannot be parsed or cannot be evaluated.
      • postfire

        public boolean postfire()
                         throws IllegalActionException
        Call the base class postfire() method, then yield this thread so that the event thread gets a chance. This is necessary, because otherwise the swing thread may be starved and accumulate a large number of points waiting to be plotted.
        Specified by:
        postfire in interface Executable
        Overrides:
        postfire in class XYPlotter
        Returns:
        True if it is OK to continue.
        Throws:
        IllegalActionException - If there is no director, or if the base class throws it.