00001 #ifndef SIMPLEGRAPHCONTROLLER_H 00002 #define SIMPLEGRAPHCONTROLLER_H 00003 00004 #include <QObject> 00005 #include <QPen> 00006 #include <QPoint> 00007 #include <QList> 00008 00009 class QAction; 00010 class QwtPlot; 00011 class QwtPlotZoomer; 00012 class QwtPlotPanner; 00013 class QwtPlotItem; 00014 class QwtLegend; 00015 class QTableWidget; 00016 class QseDataSet; 00017 class QseScan; 00018 class QseAveragerRole; 00019 00020 class SimpleGraphController : public QObject 00021 { 00022 Q_OBJECT; 00023 00024 public: 00025 SimpleGraphController 00026 (QseDataSet *ds, 00027 QwtPlot *qp, 00028 QTableWidget *scans, 00029 QTableWidget *cols, 00030 QseAveragerRole *rl, 00031 QObject *parent=0); 00032 ~SimpleGraphController(); 00033 00034 void setDataSet(QseDataSet *ds); 00035 void addContextMenuAction(QAction *action); 00036 00037 public slots: 00038 void printGraph(); 00039 void setAutoScale(); 00040 void legendChecked(QwtPlotItem *pi, bool checked); 00041 void updateScansTable(); 00042 void updateColumnsTable(); 00043 void updateGraph(); 00044 00045 void scansTableContextMenu(const QPoint &pos); 00046 void columnsTableContextMenu(const QPoint &pos); 00047 void graphContextMenu(const QPoint &pos); 00048 00049 void setCurrentScan(int n); 00050 00051 void showLegend(); 00052 void hideLegend(); 00053 00054 void saveSelectedScans(); 00055 00056 signals: 00057 void columnRangeRolesChanged(int scan0, int scan1, int col0, int col1); 00058 00059 private: 00060 QseScan* currentScan(); 00061 /* void writeSelectedScans(const QString &name); */ 00062 void removeSelectedScans(); 00063 00064 private: 00065 static const int NPENS = 12; 00066 QPen m_Pens[NPENS]; 00067 00068 QseDataSet *m_DataSet; 00069 int m_CurrentScan; 00070 QwtPlot *m_Plot; 00071 QTableWidget *m_ScansTable; 00072 QTableWidget *m_ColumnsTable; 00073 QseAveragerRole *m_Role; 00074 QwtPlotZoomer *m_Zoomer; 00075 QwtPlotPanner *m_Panner; 00076 QwtLegend *m_Legend; 00077 bool m_LegendShown; 00078 QList<QAction*> m_Actions; 00079 }; 00080 00081 #endif
1.5.5