#include <display/Display.h>
Classes | |
struct | S_STATE |
State of plot elements (visibility, zoom, position) in specific mode. More... | |
Public Types | |
enum | E_DISPLAY_MODE { MODE_OSCILLOSCOPE = 0, MODE_SPECTRUM, MODE_RECORDER } |
Display mode. More... | |
enum | E_UPDATE_LEVEL { UPDATE_ALL = 0, UPDATE_DATA, UPDATE_CURSOR, UPDATE_REPAINT } |
Required level of graph update. More... | |
enum | E_CURSOR { CURSOR1, CURSOR2, CURSOR_LIMIT } |
Cursor identifiers. | |
enum | E_OFFSET_ACTION { OFFSET_LEAVE = -2, OFFSET_CLEAR = -1 } |
Special values for SetZoom function passed as X or Y offset value. More... | |
Public Member Functions | |
virtual void | SetDiv (float fX) |
Set time between samples. | |
virtual void | SetMode (const enum E_DISPLAY_MODE m)=0 |
Switch between plot modes (time graph/FFT/...). | |
virtual enum E_DISPLAY_MODE | GetMode (void) |
Get type of current display mode. | |
virtual void | Update (enum E_UPDATE_LEVEL level)=0 |
Update displayed content. | |
virtual void | ChangeSize (int w, int h)=0 |
Resize viewport (visible area of plot). | |
virtual void | SetRange (float range) |
Set expected range of input data to -range...+range. | |
virtual void | SetCursor1 (int x, int y)=0 |
Set position of cursor #1. | |
virtual void | SetCursor2 (int x, int y)=0 |
Set position of cursor #2. | |
virtual void | SetZoom (int iCenterX, int iCenterY, float fZoomX, float fZoomY)=0 |
Set viewport offset and zoom. | |
virtual void | SetOffsetY (float fVal)=0 |
Set Y-axis offset. | |
virtual void | Move (int iStartX, int iStartY, int iStopX, int iStopY)=0 |
Move viewport. | |
virtual void | PosToPhysical (int x, int y, float &fValX, float &fValY)=0 |
Transform screen coordinates to physical values. | |
virtual int | GetCursorPhysical (enum E_CURSOR cursor, float &fValX, float &fValY)=0 |
Get physical (voltage/time or freq/time) coordinates of cursor. | |
virtual void | SetVisibility (enum E_DISPLAY_MODE mode, bool bGridX, bool bGridY, bool bGridLabels) |
virtual std::auto_ptr < Graphics::TBitmap > | CreateBitmap (void)=0 |
Create plot bitmap. | |
Public Attributes | |
std::vector< float > * | data |
Data to plot. | |
Protected Member Functions | |
struct S_STATE & | State (void) |
Get current plot state/zoom/offset/visibility. | |
struct S_STATE & | State (enum E_DISPLAY_MODE mode) |
Get plot state for specified mode. | |
unsigned int | NearestPowerOfTwo (unsigned int count) |
Get padded data count for FFT mode. | |
Protected Attributes | |
float | fRange |
vertical range (range is from -fRange to fRange) | |
float | fDivX |
time difference between samples | |
enum E_DISPLAY_MODE | mode |
current display mode type | |
struct S_STATE | scope |
display state for scope mode | |
struct S_STATE | spectrum |
display state for spectrum analyzer state | |
struct S_STATE | recorder |
display state for slow changing signal recorder |
Display mode.
Required level of graph update.
Drawing is time-consuming. Display object can hold partial graph drawings (i.e. graph background + graph grid) and reuse them when they do not need to be updated.
virtual std::auto_ptr<Graphics::TBitmap> Display::CreateBitmap | ( | void | ) | [pure virtual] |
virtual int Display::GetCursorPhysical | ( | enum E_CURSOR | cursor, | |
float & | fValX, | |||
float & | fValY | |||
) | [pure virtual] |
Get physical (voltage/time or freq/time) coordinates of cursor.
Implemented in DisplayOpenGL.
virtual void Display::SetOffsetY | ( | float | fVal | ) | [pure virtual] |
Set Y-axis offset.
fVal | requested value at center position |
Implemented in DisplayOpenGL.
virtual void Display::SetZoom | ( | int | iCenterX, | |
int | iCenterY, | |||
float | fZoomX, | |||
float | fZoomY | |||
) | [pure virtual] |
Set viewport offset and zoom.
iCenterX | requested center of viewport (i.e. zoom click coordinate) or enum E_OFFSET_ACTION | |
iCenterY | requested center of viewport (i.e. zoom click coordinate) or enum E_OFFSET_ACTION | |
fZoomX | X-axis scale | |
fZoomY | Y-axis scale |
Implemented in DisplayOpenGL.
virtual void Display::Update | ( | enum E_UPDATE_LEVEL | level | ) | [pure virtual] |
Update displayed content.
level | Used to specify parts of graph that must be updated. |
Implemented in DisplayOpenGL.