mainwindow.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3. #include <QMainWindow>
  4. #include <QtCharts>
  5. #include <QLineSeries>
  6. #include "ivchartproc.h"
  7. #include "dialogselect.h"
  8. #include "dialogsetaxisx.h"
  9. #include "dialogivctocsv.h"
  10. QT_BEGIN_NAMESPACE
  11. namespace Ui { class MainWindow; }
  12. QT_END_NAMESPACE
  13. struct CUShow
  14. {
  15. public:
  16. std::string mstrname;
  17. QLineSeries * mlineseries;
  18. QValueAxis * mpaxisY;
  19. QColor mcolor;
  20. double mfRangeMin = 0.0;
  21. double mfRangeMax = 1.0;
  22. };
  23. class MainWindow : public QMainWindow
  24. {
  25. Q_OBJECT
  26. public:
  27. MainWindow(QWidget *parent = nullptr);
  28. ~MainWindow();
  29. private slots:
  30. void onTimer();
  31. private:
  32. Ui::MainWindow *ui;
  33. QChart * m_chart;
  34. QChartView * mchartview;
  35. ivchartproc * mpivchartproc;
  36. std::vector<std::string> mvectorused;
  37. std::vector<CUShow> mvectorCUShow;
  38. QValueAxis * mpAxisX;
  39. QSet<int> mPressKeys;
  40. bool mbViewPause = false;
  41. double AXIS_X_SEL[6] = {1,5,10,30,60,300};
  42. int mnDefAxisXIndex = 2;
  43. std::string mstrTitle = "ADC IV Char View ";
  44. int mnTitleMode = 0;
  45. private:
  46. QColor GetRandColor();
  47. public:
  48. void resizeEvent(QResizeEvent *event);
  49. void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
  50. void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
  51. private slots:
  52. void on_actionSelect_Data_triggered();
  53. void on_actionSet_AxisX_triggered();
  54. void on_actionivc_to_csv_triggered();
  55. void on_actionHelp_triggered();
  56. };
  57. #endif // MAINWINDOW_H