Class TimedScope

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

    public class TimedScope
    extends TimedPlotter

    A signal plotter that plots in an oscilloscope style, meaning that the horizontal axis is wrapped and that there is finite persistence. This plotter contains an instance of the Plot class from the Ptolemy plot package as a public member. Data at the input, which can consist of any number of channels, are plotted on this instance. Each channel is plotted as a separate data set. The input is of type DoubleToken.

    The horizontal axis represents time. The width parameter is a double that gives the width of the plot. The horizontal axis will be labeled from 0.0 to width. It defaults to 10.0.

    If the persistence parameter is positive, then it specifies the amount of time into the past that points are shown. It also defaults to 10.0, so any point older than 10.0 time units 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

      • width

        public Parameter width
        The width of the X axis (a double).
      • persistence

        public Parameter persistence
        The amount of data displayed at any one time (a double). This has units of the X axis.
    • 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 TimedPlotter
        Returns:
        True if it is OK to continue.
        Throws:
        IllegalActionException - If there is no director, or if the base class throws it.