C# Class Plasma.SignalPlotter

Inheritance: Qyoto.QGraphicsWidget, IDisposable
Afficher le fichier Open project: 0xd34df00d/Qross

Private Properties

Свойство Type Description
Paint void
SetGeometry void

Méthodes publiques

Méthode Description
AddPlot ( QColor color ) : void Add a new line to the graph plotter, with the specified color. Note that the order you add the plots must be the same order that the same data is given in (unless you reorder the plots). name="color" the color to use for this plot
AddSample ( List samples ) : void Add data to the graph, and advance the graph by one time period. The data must be given as a list in the same order that the plots were added (or consequently reordered). name="samples" a list with the new value for each plot
Dispose ( ) : void
GetSnapshotImage ( uint width, uint height ) : QPixmap Render the graph to the specified width and height, and return it as an image. This is useful, for example, if you draw a small version of the graph, but then want to show a large version in a tooltip etc name="width" the width of the snapshot name="height" the height of the snapshot
LastValue ( uint i ) : double Return the last value that we have for plot i. Returns 0 if not known. name="i" the plot we like to have the last value from
LastValueAsString ( uint i ) : string Return a translated string like: "34 %" or "100 KB" for plot i name="i" the plot we like to have the value as string from
PlotColors ( ) : List Return the list of plot colors, in the order that the plots were added (or later reordered).
RemovePlot ( uint pos ) : void Removes the plot at the specified index. name="pos" the index of the plot to be removed
ReorderPlots ( List newOrder ) : void Reorder the plots into the order given. For example:
 KSignalPlotter s = KSignalPlotter(parent); s.AddPlot(Qt.Blue); s.AddPlot(Qt.Green); QList neworder; neworder << 1 << 0; reorderPlots(newOrder); //Now the order is Green then Blue 
name="newOrder" a list with the new position of each plot
SetVerticalRange ( double min, double max ) : void Change the minimum and maximum values drawn on the graph. Note that these values are sanitised. For example, if you set the minimum as 3, and the maximum as 97, then the graph would be drawn between 0 and 100. The algorithm to determine this "nice range" attempts to minimize the number of non-zero digits. Use setAutoRange instead to determine the range automatically from the data. name="min" the minimum value to use for the vertical axis name="max" the maximum value to use for the vertical axis
SignalPlotter ( ) : System
SignalPlotter ( IQGraphicsItem parent ) : System
VerticalMaxValue ( ) : double Get the max value of the vertical axis. @see changeRange
VerticalMinValue ( ) : double Get the min value of the vertical axis. @see changeRange

Méthodes protégées

Méthode Description
CalculateNiceRange ( ) : void
CreateProxy ( ) : void
DrawAxisText ( QPainter p, int top, int h ) : void
DrawBackground ( QPainter p, int w, int h ) : void
DrawHorizontalLines ( QPainter p, int top, int w, int h ) : void
DrawPlots ( QPainter p, int top, int w, int h, int horizontalScale ) : void
DrawThinFrame ( QPainter p, int w, int h ) : void
DrawTopBarContents ( QPainter p, int x, int width, int height ) : void
DrawTopBarFrame ( QPainter p, int separatorX, int height ) : void
DrawVerticalLines ( QPainter p, int top, int w, int h ) : void
DrawWidget ( QPainter p, uint w, uint height, int horizontalScale ) : void
SignalPlotter ( Type dummy ) : System
UpdateDataBuffers ( ) : void

Private Methods

Méthode Description
Paint ( QPainter painter, QStyleOptionGraphicsItem option, QWidget widget ) : void
SetGeometry ( Qyoto.QRectF geometry ) : void

Method Details

AddPlot() public méthode

Add a new line to the graph plotter, with the specified color. Note that the order you add the plots must be the same order that the same data is given in (unless you reorder the plots). name="color" the color to use for this plot
public AddPlot ( QColor color ) : void
color Qyoto.QColor
Résultat void

AddSample() public méthode

Add data to the graph, and advance the graph by one time period. The data must be given as a list in the same order that the plots were added (or consequently reordered). name="samples" a list with the new value for each plot
public AddSample ( List samples ) : void
samples List
Résultat void

CalculateNiceRange() protected méthode

protected CalculateNiceRange ( ) : void
Résultat void

CreateProxy() protected méthode

protected CreateProxy ( ) : void
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

DrawAxisText() protected méthode

protected DrawAxisText ( QPainter p, int top, int h ) : void
p Qyoto.QPainter
top int
h int
Résultat void

DrawBackground() protected méthode

protected DrawBackground ( QPainter p, int w, int h ) : void
p Qyoto.QPainter
w int
h int
Résultat void

DrawHorizontalLines() protected méthode

protected DrawHorizontalLines ( QPainter p, int top, int w, int h ) : void
p Qyoto.QPainter
top int
w int
h int
Résultat void

DrawPlots() protected méthode

protected DrawPlots ( QPainter p, int top, int w, int h, int horizontalScale ) : void
p Qyoto.QPainter
top int
w int
h int
horizontalScale int
Résultat void

DrawThinFrame() protected méthode

protected DrawThinFrame ( QPainter p, int w, int h ) : void
p Qyoto.QPainter
w int
h int
Résultat void

DrawTopBarContents() protected méthode

protected DrawTopBarContents ( QPainter p, int x, int width, int height ) : void
p Qyoto.QPainter
x int
width int
height int
Résultat void

DrawTopBarFrame() protected méthode

protected DrawTopBarFrame ( QPainter p, int separatorX, int height ) : void
p Qyoto.QPainter
separatorX int
height int
Résultat void

DrawVerticalLines() protected méthode

protected DrawVerticalLines ( QPainter p, int top, int w, int h ) : void
p Qyoto.QPainter
top int
w int
h int
Résultat void

DrawWidget() protected méthode

protected DrawWidget ( QPainter p, uint w, uint height, int horizontalScale ) : void
p Qyoto.QPainter
w uint
height uint
horizontalScale int
Résultat void

GetSnapshotImage() public méthode

Render the graph to the specified width and height, and return it as an image. This is useful, for example, if you draw a small version of the graph, but then want to show a large version in a tooltip etc name="width" the width of the snapshot name="height" the height of the snapshot
public GetSnapshotImage ( uint width, uint height ) : QPixmap
width uint
height uint
Résultat Qyoto.QPixmap

LastValue() public méthode

Return the last value that we have for plot i. Returns 0 if not known. name="i" the plot we like to have the last value from
public LastValue ( uint i ) : double
i uint
Résultat double

LastValueAsString() public méthode

Return a translated string like: "34 %" or "100 KB" for plot i name="i" the plot we like to have the value as string from
public LastValueAsString ( uint i ) : string
i uint
Résultat string

PlotColors() public méthode

Return the list of plot colors, in the order that the plots were added (or later reordered).
public PlotColors ( ) : List
Résultat List

RemovePlot() public méthode

Removes the plot at the specified index. name="pos" the index of the plot to be removed
public RemovePlot ( uint pos ) : void
pos uint
Résultat void

ReorderPlots() public méthode

Reorder the plots into the order given. For example:
 KSignalPlotter s = KSignalPlotter(parent); s.AddPlot(Qt.Blue); s.AddPlot(Qt.Green); QList neworder; neworder << 1 << 0; reorderPlots(newOrder); //Now the order is Green then Blue 
name="newOrder" a list with the new position of each plot
public ReorderPlots ( List newOrder ) : void
newOrder List
Résultat void

SetVerticalRange() public méthode

Change the minimum and maximum values drawn on the graph. Note that these values are sanitised. For example, if you set the minimum as 3, and the maximum as 97, then the graph would be drawn between 0 and 100. The algorithm to determine this "nice range" attempts to minimize the number of non-zero digits. Use setAutoRange instead to determine the range automatically from the data. name="min" the minimum value to use for the vertical axis name="max" the maximum value to use for the vertical axis
public SetVerticalRange ( double min, double max ) : void
min double
max double
Résultat void

SignalPlotter() public méthode

public SignalPlotter ( ) : System
Résultat System

SignalPlotter() public méthode

public SignalPlotter ( IQGraphicsItem parent ) : System
parent IQGraphicsItem
Résultat System

SignalPlotter() protected méthode

protected SignalPlotter ( Type dummy ) : System
dummy System.Type
Résultat System

UpdateDataBuffers() protected méthode

protected UpdateDataBuffers ( ) : void
Résultat void

VerticalMaxValue() public méthode

Get the max value of the vertical axis. @see changeRange
public VerticalMaxValue ( ) : double
Résultat double

VerticalMinValue() public méthode

Get the min value of the vertical axis. @see changeRange
public VerticalMinValue ( ) : double
Résultat double