qpidctrl  0.7.1
Public Slots | Public Member Functions | Private Attributes | List of all members
QPidPlot Class Reference

#include <qpidplot.h>

Inheritance diagram for QPidPlot:
Inheritance graph

Public Slots

void autoScale ()
 

Public Member Functions

 QPidPlot (QWidget *parent=0)
 
void init (QPidControllerWPtr ctl)
 
void contextMenuEvent (QContextMenuEvent *event)
 

Private Attributes

QwtPlotZoomer * m_Zoomer
 
QwtPlotPanner * m_Panner
 
QwtPlotMagnifier * m_Magnifier
 
QPidControllerWPtr m_Controller
 

Detailed Description

Definition at line 10 of file qpidplot.h.

Constructor & Destructor Documentation

QPidPlot::QPidPlot ( QWidget *  parent = 0)
explicit

Definition at line 22 of file qpidplot.cpp.

References m_Magnifier, m_Panner, and m_Zoomer.

22  :
23  QwtPlot(parent),
24 // m_Legend(NULL),
25  m_Zoomer(NULL),
26  m_Panner(NULL),
27  m_Magnifier(NULL)/*,
28  m_Measurer(NULL)*/,
29  m_Controller()
30 {
31  m_Zoomer = new QPidPlotZoomer(canvas());
32 // m_Zoomer -> setSelectionFlags(QwtPicker::DragSelection | QwtPicker::CornerToCorner);
33  m_Zoomer -> setStateMachine(new QwtPickerDragRectMachine);
34  m_Zoomer -> setTrackerMode(QwtPicker::AlwaysOn);
35  m_Zoomer -> setRubberBand(QwtPicker::RectRubberBand);
36 
37  m_Zoomer -> setMousePattern(QwtEventPattern::MouseSelect2,
38  Qt::LeftButton, Qt::ControlModifier | Qt::ShiftModifier);
39  m_Zoomer -> setMousePattern(QwtEventPattern::MouseSelect3,
40  Qt::LeftButton, Qt::ControlModifier);
41 
42  m_Zoomer -> setEnabled(true);
43 
44  m_Panner = new QwtPlotPanner(canvas());
45  m_Panner -> setEnabled(true);
46  m_Panner -> setMouseButton(Qt::MidButton);
47  m_Panner -> setAxisEnabled(QwtPlot::yRight, false);
48 
49  m_Magnifier = new QwtPlotMagnifier(canvas());
50  m_Magnifier -> setEnabled(true);
51  m_Magnifier -> setMouseButton(Qt::NoButton);
52  m_Magnifier -> setAxisEnabled(QwtPlot::yRight, false);
53 
54  setAxisScaleDraw(QwtPlot::xBottom,
55  new TimeScaleDraw());
56 }
QwtPlotMagnifier * m_Magnifier
Definition: qpidplot.h:27
QPidControllerWPtr m_Controller
Definition: qpidplot.h:28
QwtPlotZoomer * m_Zoomer
Definition: qpidplot.h:25
QwtPlotPanner * m_Panner
Definition: qpidplot.h:26

Member Function Documentation

void QPidPlot::autoScale ( )
slot

Definition at line 63 of file qpidplot.cpp.

References m_Zoomer.

Referenced by contextMenuEvent().

64 {
65  setAxisAutoScale(QwtPlot::yLeft);
66 
67 // QPidControllerPtr ctl(m_Controller);
68 
69 // if (ctl) {
70 // setAxisScale(QwtPlot::xBottom, 0, ctl->get_HistoryLength());
71 // } else {
72  setAxisAutoScale(QwtPlot::xBottom);
73 // }
74 
75  m_Zoomer -> setZoomBase();
76 }
QwtPlotZoomer * m_Zoomer
Definition: qpidplot.h:25
void QPidPlot::contextMenuEvent ( QContextMenuEvent *  event)

Definition at line 78 of file qpidplot.cpp.

References autoScale().

79 {
80  autoScale();
81 }
void autoScale()
Definition: qpidplot.cpp:63
void QPidPlot::init ( QPidControllerWPtr  ctl)

Definition at line 58 of file qpidplot.cpp.

References m_Controller.

59 {
60  m_Controller = ctl;
61 }
QPidControllerWPtr m_Controller
Definition: qpidplot.h:28

Member Data Documentation

QPidControllerWPtr QPidPlot::m_Controller
private

Definition at line 28 of file qpidplot.h.

Referenced by init().

QwtPlotMagnifier* QPidPlot::m_Magnifier
private

Definition at line 27 of file qpidplot.h.

Referenced by QPidPlot().

QwtPlotPanner* QPidPlot::m_Panner
private

Definition at line 26 of file qpidplot.h.

Referenced by QPidPlot().

QwtPlotZoomer* QPidPlot::m_Zoomer
private

Definition at line 25 of file qpidplot.h.

Referenced by autoScale(), and QPidPlot().


The documentation for this class was generated from the following files: