mainwindow.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3. #include <QMainWindow>
  4. #include <QtSerialPort/QtSerialPort>
  5. #include <stdint.h>
  6. #include <QGraphicsScene>
  7. #include <QtCore/QCoreApplication>
  8. #include <QDebug>
  9. #include <iostream>
  10. #include <QVector>
  11. #include <qcustomplot.h>
  12. namespace Ui {
  13. class MainWindow;
  14. }
  15. class MainWindow : public QMainWindow
  16. {
  17. Q_OBJECT
  18. public:
  19. explicit MainWindow(QWidget *parent = 0);
  20. ~MainWindow();
  21. QString motor_Send;
  22. QString Start_Data;
  23. QString Stop_Data;
  24. QTimer *timer;
  25. QTimer *timer_refresh;
  26. QGraphicsScene *scene;
  27. int step = 0, max_step = 4, Redraw_X=0;
  28. int Divider = 1;
  29. int Zero=0;
  30. private slots:
  31. void on_M_up_clicked();
  32. void on_M_up_pressed();
  33. void on_M_stop_pressed();
  34. void on_M_down_pressed();
  35. void on_F_up_pressed();
  36. void on_F_stop_pressed();
  37. void on_F_down_pressed();
  38. void on_Cycle_pressed();
  39. void on_Manual_pressed();
  40. void on_All_Stop_pressed();
  41. void on_ReadSerial();
  42. void on_Graph_pressed();
  43. void on_Graph_Start_pressed();
  44. void on_Graph_Stop_pressed();
  45. void Draw_Timestamp();
  46. void on_Graph_Clear_pressed();
  47. void GraphDraw();
  48. private:
  49. Ui::MainWindow *ui;
  50. QSerialPort *serial;
  51. void OpenSerial();
  52. void CloseSerial();
  53. QVector <double> ADC1_val, ADC1_count;
  54. // QCustomPlot *force_plot;
  55. };
  56. enum motors {
  57. M_UP = 11,
  58. M_DOWN = 12,
  59. M_STOP = 19,
  60. F_UP = 21,
  61. F_DOWN = 22,
  62. F_STOP=29
  63. };
  64. #endif // MAINWINDOW_H