#ifndef DISPLAYWIDGET_H #define DISPLAYWIDGET_H #include #include #include #include #include #include "structures.h" /** */ struct PaintColors { QColor colA; QColor colB; QColor colT; explicit PaintColors () : colA(QColor(0,255,0,255)),colB(QColor(255,64,0,255)),colT(QColor(255,255,0,255)) {} }; class QSettings; class DisplayWidget : public QWidget { Q_OBJECT const PaintColors pcol; QVector ACopy; QVector BCopy; QMatrix m_forward; QMatrix m_inverse; QImage background; TrigerSettings * m_ts; QPolygonF ChA, ChB; MOVE_ITEMS m_items; int m_timeBase; int m_ChBase; int m_TrgSource; double x_lenght; struct MarkSetting { double a,b; } m_time, m_volt; struct ChScale { double a,b; } m_channels; struct ChOfset { double a,b; } m_offset; enum MARKER_ENUM { MARKER_TIME = 0, MARKER_VOLT_A, MARKER_VOLT_B, } marker_type; unsigned m_timeCount; public: explicit DisplayWidget (QWidget * p); virtual ~DisplayWidget (); void setTrigger (TrigerSettings * ts); void TriggerValues (int n); void TimeBaseRange (int n); void MarkerChanged (int n, bool b); void SendVoltage (int ch, int n); void reloadChRange (int a, int b); void saveSettings (QSettings & setting); void restSettings (QSettings & setting); void SendTrigerChan(int n); void resizeEvent (QResizeEvent * event) override; void paintEvent (QPaintEvent * event) override; void wheelEvent (QWheelEvent * event) override; void mousePressEvent(QMouseEvent * event) override; public slots: void DispChannels (QVector, QVector); signals: void SettingsChanged (int n); protected: void drawBackground (); void reloadData (); void reloadMatrix (const QSize & sz); }; #endif // DISPLAYWIDGET_H