com.sun.electric.tool.simulation
Class Analysis<S extends Signal>

java.lang.Object
  extended by com.sun.electric.tool.simulation.Analysis<S>
Direct Known Subclasses:
AnalogAnalysis, DigitalAnalysis

public abstract class Analysis<S extends Signal>
extends java.lang.Object

Class to define a set of simulation data. This class encapsulates all of the simulation data that is displayed in a waveform window. It includes the labels and values. It can handle digital, analog, and many variations (intervals, sweeps).


Nested Class Summary
static class Analysis.AnalysisType
           
 
Field Summary
static Analysis.AnalysisType ANALYSIS_AC
          indicates AC analysis
static Analysis.AnalysisType ANALYSIS_DC
          indicates DC analysis
static Analysis.AnalysisType ANALYSIS_MEAS
          indicates Measurement data
static Analysis.AnalysisType ANALYSIS_SIGNALS
          indicates general signals
static Analysis.AnalysisType ANALYSIS_TRANS
          indicates transient analysis
 
Constructor Summary
Analysis(Stimuli sd, Analysis.AnalysisType type)
           
 
Method Summary
 void addSignal(S ws)
          Method to add a new signal to this Simulation Data object.
 S findSignalForNetwork(java.lang.String netName)
          Method to return the signal that corresponds to a given Network name.
 S findSignalForNetworkQuickly(java.lang.String netName)
          Method to quickly return the signal that corresponds to a given Network name.
 void finished()
          Free allocated resources before closing.
 Analysis.AnalysisType getAnalysisType()
          Method to return the type of data currently being manipulated.
 java.awt.geom.Rectangle2D getBounds()
          Method to compute the time and value bounds of this simulation data.
 double getLeftEdge()
          Method to return the leftmost X coordinate of this Analysis.
 double getRightEdge()
          Method to return the rightmost X coordinate of this Analysis.
 java.util.List<S> getSignals()
          Method to get the list of signals in this Simulation Data object.
 Stimuli getStimuli()
          Method to return the Stimuli in which this Analysis resides.
abstract  boolean isAnalog()
          Method to tell whether this simulation data is analog or digital.
 void nameSignal(S ws, java.lang.String sigName)
           
 void setBoundsDirty()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANALYSIS_SIGNALS

public static final Analysis.AnalysisType ANALYSIS_SIGNALS
indicates general signals


ANALYSIS_TRANS

public static final Analysis.AnalysisType ANALYSIS_TRANS
indicates transient analysis


ANALYSIS_AC

public static final Analysis.AnalysisType ANALYSIS_AC
indicates AC analysis


ANALYSIS_DC

public static final Analysis.AnalysisType ANALYSIS_DC
indicates DC analysis


ANALYSIS_MEAS

public static final Analysis.AnalysisType ANALYSIS_MEAS
indicates Measurement data

Constructor Detail

Analysis

public Analysis(Stimuli sd,
                Analysis.AnalysisType type)
Method Detail

finished

public void finished()
Free allocated resources before closing.


getStimuli

public Stimuli getStimuli()
Method to return the Stimuli in which this Analysis resides.

Returns:
the Stimuli in which this Analysis resides.

getAnalysisType

public Analysis.AnalysisType getAnalysisType()
Method to return the type of data currently being manipulated. Possibilities are ANALYSIS_TRANS, ANALYSIS_AC, ANALYSIS_DC, or ANALYSIS_MEAS.

Returns:
the type of data currently being manipulated.

getSignals

public java.util.List<S> getSignals()
Method to get the list of signals in this Simulation Data object.

Returns:
a List of signals.

nameSignal

public void nameSignal(S ws,
                       java.lang.String sigName)

addSignal

public void addSignal(S ws)
Method to add a new signal to this Simulation Data object. Signals can be either digital or analog.

Parameters:
ws - the signal to add. Instead of a "Signal", use either DigitalSignal or AnalogSignal.

getBounds

public java.awt.geom.Rectangle2D getBounds()
Method to compute the time and value bounds of this simulation data.

Returns:
a Rectangle2D that has time bounds in the X part and value bounds in the Y part.

getLeftEdge

public double getLeftEdge()
Method to return the leftmost X coordinate of this Analysis. This value may not be the same as the minimum-x of the bounds, because the data may not be monotonically increasing (may run backwards, for example).

Returns:
the leftmost X coordinate of this Analysis.

getRightEdge

public double getRightEdge()
Method to return the rightmost X coordinate of this Analysis. This value may not be the same as the maximum-x of the bounds, because the data may not be monotonically increasing (may run backwards, for example).

Returns:
the rightmost X coordinate of this Analysis.

setBoundsDirty

public void setBoundsDirty()

isAnalog

public abstract boolean isAnalog()
Method to tell whether this simulation data is analog or digital.

Returns:
true if this simulation data is analog.

findSignalForNetworkQuickly

public S findSignalForNetworkQuickly(java.lang.String netName)
Method to quickly return the signal that corresponds to a given Network name. Not all names may be found (because of name mangling, which this method does not handle). But the lookup is faster than "findSignalForNetwork".

Parameters:
netName - the Network name to find.
Returns:
the Signal that corresponds with the Network. Returns null if none can be found.

findSignalForNetwork

public S findSignalForNetwork(java.lang.String netName)
Method to return the signal that corresponds to a given Network name.

Parameters:
netName - the Network name to find.
Returns:
the Signal that corresponds with the Network. Returns null if none can be found.