1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- #ifndef MAINWINDOW_H
- #define MAINWINDOW_H
- #include <QMainWindow>
- #include "proto_tool.h"
- #include "velodyne_config.pb.h"
- #include <cmath>
- #include <QFileDialog> //文件对话框
- #include "plc/snap7_clamp.h"
- QT_BEGIN_NAMESPACE
- namespace Ui { class MainWindow; }
- QT_END_NAMESPACE
- class MainWindow : public QMainWindow
- {
- Q_OBJECT
- public:
- MainWindow(QWidget *parent = nullptr);
- ~MainWindow();
- private slots:
- void on_ComputeButton_clicked();
- void on_EntranceComboBox_currentTextChanged(const QString &arg1);
- void on_Forward_clicked();
- void on_Reverse_clicked();
- void on_RedoButton_clicked();
- void on_QuashButton_clicked();
- void onInputTriggered();
- void onOutputTriggered();
- void on_AutoGetDistance_clicked();
- private:
- struct WheelDistance {
- QString currentText;
- bool forward;
- double lf;
- double rf;
- double lr;
- double rr;
- double wheel_base;
- };
- bool init(const std::string &filename);
- bool initPLC();
- void showStatu();
- void saveRecord(const std::string &fileName);
- int findRegionIndex(const int ®ion_id);
- private:
- Ui::MainWindow *ui;
- int record_id = 0;
- int record_id_max = 0;
- velodyne::velodyneManagerParams velodyne_parameters;
- // std::map<int, velodyne::Region> m_ground_region_map; // 区域功能实例指针数组, 内存由本类管理
- std::map<int, WheelDistance> m_distance_map; // 区域功能实例指针数组, 内存由本类管理
- Snap7Clamp *m_snap7_client = nullptr;
- };
- #endif // MAINWINDOW_H
|