mainwindow.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef MAINWINDOW_H
  2. #define MAINWINDOW_H
  3. #include <QMainWindow>
  4. #include "proto_tool.h"
  5. #include "velodyne_config.pb.h"
  6. #include <cmath>
  7. #include <QFileDialog> //文件对话框
  8. #include "plc/snap7_clamp.h"
  9. QT_BEGIN_NAMESPACE
  10. namespace Ui { class MainWindow; }
  11. QT_END_NAMESPACE
  12. class MainWindow : public QMainWindow
  13. {
  14. Q_OBJECT
  15. public:
  16. MainWindow(QWidget *parent = nullptr);
  17. ~MainWindow();
  18. private slots:
  19. void on_ComputeButton_clicked();
  20. void on_EntranceComboBox_currentTextChanged(const QString &arg1);
  21. void on_Forward_clicked();
  22. void on_Reverse_clicked();
  23. void on_RedoButton_clicked();
  24. void on_QuashButton_clicked();
  25. void onInputTriggered();
  26. void onOutputTriggered();
  27. void on_AutoGetDistance_clicked();
  28. private:
  29. struct WheelDistance {
  30. QString currentText;
  31. bool forward;
  32. double lf;
  33. double rf;
  34. double lr;
  35. double rr;
  36. double wheel_base;
  37. };
  38. bool init(const std::string &filename);
  39. bool initPLC();
  40. void showStatu();
  41. void saveRecord(const std::string &fileName);
  42. int findRegionIndex(const int &region_id);
  43. private:
  44. Ui::MainWindow *ui;
  45. int record_id = 0;
  46. int record_id_max = 0;
  47. velodyne::velodyneManagerParams velodyne_parameters;
  48. // std::map<int, velodyne::Region> m_ground_region_map; // 区域功能实例指针数组, 内存由本类管理
  49. std::map<int, WheelDistance> m_distance_map; // 区域功能实例指针数组, 内存由本类管理
  50. Snap7Clamp *m_snap7_client = nullptr;
  51. };
  52. #endif // MAINWINDOW_H