mainwindow.h 1.6 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 <QTimer>
  11. #include "get_uart.h"
  12. struct GraphData;
  13. namespace Ui {
  14. class MainWindow;
  15. }
  16. class MainWindow : public QMainWindow
  17. {
  18. Q_OBJECT
  19. public:
  20. explicit MainWindow(QWidget *parent = 0);
  21. ~MainWindow();
  22. private:
  23. Ui::MainWindow *ui;
  24. QSerialPort *serial;
  25. void OpenSerial();
  26. void CloseSerial();
  27. QTimer *redraw_timer;
  28. uint8_t Speeds[11] = {64, 64, 48, 32, 24, 21, 15, 12, 9, 6, 3};
  29. GraphData *pGraphData;
  30. Get_Uart *my;
  31. public slots:
  32. void recv_graph_pointer(GraphData *);
  33. void Show_Errors(QString);
  34. private slots:
  35. void on_mode_manual_pressed();
  36. void on_mode_stop_clicked();
  37. void on_mode_auto_clicked();
  38. void on_force_up_clicked();
  39. void on_sensor_up_clicked();
  40. void on_sensor_down_clicked();
  41. void on_sensor_stop_clicked();
  42. void on_mode_manual_clicked();
  43. void on_force_down_clicked();
  44. void on_force_stop_clicked();
  45. void on_ConnSerial_clicked();
  46. void on_m_reset_clicked();
  47. void on_f_reset_clicked();
  48. void updateGraph();
  49. void on_GraphType_currentIndexChanged(int index);
  50. void on_P_Scale_currentIndexChanged(int index);
  51. void on_F_Scale_currentIndexChanged(int index);
  52. signals:
  53. void send_command(QString);
  54. void OpenSerial(QString);
  55. };
  56. enum motors {
  57. M_UP = 12,
  58. M_DOWN = 11,
  59. M_STOP = 19,
  60. F_UP = 21,
  61. F_DOWN = 22,
  62. F_STOP=29
  63. };
  64. #endif // MAINWINDOW_H