Locus No Pilotus
Project of four first grade MIPT DAFE/RSE students (for engineering practical work in the second semester) in Qt C++
Loading...
Searching...
No Matches
mainwindow.h
Go to the documentation of this file.
1#pragma once
2
3// Qt libs:
4#include <QMainWindow>
5
6// autogen libs:
7#include "./ui_mainwindow.h"
8
9// our code libs:
11#include "data_tools/_tools.h"
13
21
22constexpr double max_scale = lib::max_coord / 2;
23constexpr double min_scale = 10e-4;
24
26
27QT_BEGIN_NAMESPACE
28namespace Ui {
29class MainWindow;
30}
31
32QT_END_NAMESPACE
33
34class MainWindow : public QMainWindow {
35 Q_OBJECT
36
37 public:
38 MainWindow(QWidget* parent = nullptr);
40
41 private slots:
42 // Slots for files:
47
48 // Slots for interaction objects adding:
49 void mousePressObjectsButton(QMouseEvent* mouse_event);
50 void mousePressContextMenu(QMouseEvent* mouse_event);
52 void DisconnectObject(gui::ObjectType obj_type);
53 void closeEvent(QCloseEvent* event) override;
54 void keyPressEvent(QKeyEvent* key_event) override;
55
56 // Slots for Target:
59
60 // Slots for TrappyCircle:
63 void mousePressSetRadiusFromPlot(QMouseEvent* mouse_event);
64 void mouseMoveSetRadiusFromPlot(QMouseEvent* mouse_event);
65
66 // Slots for TrappyLine:
69 void mousePressSelectSecondTarget(QMouseEvent* mouse_event);
70
71 // Slots for Hill:
74 void mousePressAddVertice(QMouseEvent* mouse_event);
75 void mousePressDeleteLastVertice(QMouseEvent* mouse_event);
76 void mouseMoveAddVertice(QMouseEvent* mouse_event);
77
78 // Slots for Settings:
84
85 // Extra slots:
87
88 void on_xAxis_rangeChanged(QCPRange range);
89 void on_yAxis_rangeChanged(QCPRange range);
90
91 void moveRobot();
96
98
102
103 public slots:
104 void AddTrappyCircle(double x, double y, double radius);
105 void AddTarget(double x, double y);
106 void AddTrappyLine(double x1, double y1, double x2, double y2);
107 void AddHill(const std::vector<std::pair<double, double>>& points);
108
109 private:
110 Ui::MainWindow* ui;
111 QTimer* timer_{new QTimer(this)};
112
113 std::unique_ptr<data_tools::PlotArea> area_;
114 std::unique_ptr<data_tools::DataManager> manager_;
115 std::unique_ptr<data_tools::TablesConnection> t_connection_;
116
120
121 bool is_robot_flying_ = false;
123
124 bool OpenMessageWindow();
127
128 void CalcTrajectory();
129 void DeCalcTrajectory();
130
131 void StopRobot();
132 void FlyRobot();
133};
Этот файл включает в себя все формы по созданию объектов на полотне
Этот файл включает в себя все data_tools.
Definition gui_json_file.h:6
Definition mainwindow.h:34
bool OpenMessageWindow()
Вызов окна, которое сообщает об изменениях в файле
Definition menu_file_actions.cpp:8
QTimer * timer_
Definition mainwindow.h:111
void closeEvent(QCloseEvent *event) override
Проверяет при закрытии приложения, есть ли изменения в текущем файле
Definition menu_file_actions.cpp:35
void on_trappyCircleAddFromTablePushButton_clicked()
Definition other_connections.cpp:78
CursorType cursor_
Definition mainwindow.h:118
bool is_robot_flying_
Definition mainwindow.h:121
void DeCalcTrajectory()
Definition trajectory_and_robot.cpp:50
void mousePressRemoveObject()
Definition other_connections.cpp:126
WhatObjectAddition what_obj_addition_
Definition mainwindow.h:119
void mousePressContextMenu(QMouseEvent *mouse_event)
Definition other_connections.cpp:174
void mousePressObjectsButton(QMouseEvent *mouse_event)
Definition interaction_buttons.cpp:88
void on_targetAddFromTablePushButton_clicked()
Definition other_connections.cpp:70
void on_addTrappyCirclePushButton_clicked()
Definition other_connections.cpp:28
std::unique_ptr< data_tools::PlotArea > area_
Definition mainwindow.h:113
void on_robotsApplyAmountPushButton_clicked()
Definition other_connections.cpp:198
std::unique_ptr< data_tools::DataManager > manager_
Definition mainwindow.h:114
Ui::MainWindow * ui
Definition mainwindow.h:110
void on_hillAddFromTablePushButton_clicked()
Definition other_connections.cpp:74
void on_trappyLineAction_triggered()
Definition menu_add_actions.cpp:77
void on_editObjectsPushButton_clicked()
Definition other_connections.cpp:58
void StopRobot()
Definition trajectory_and_robot.cpp:4
void AddTarget(double x, double y)
Definition menu_add_actions.cpp:4
void mouseMoveSetRadiusFromPlot(QMouseEvent *mouse_event)
Definition interaction_buttons.cpp:190
void on_LowSpeedButton_clicked()
Definition other_connections.cpp:210
void DisconnectObject(gui::ObjectType obj_type)
Definition interaction_buttons.cpp:4
void on_yAxis_rangeChanged(QCPRange range)
Definition other_connections.cpp:106
void on_actionBeautify_triggered()
Definition other_connections.cpp:65
void on_actionHelp_triggered()
Definition other_connections.cpp:193
void on_xAxis_rangeChanged(QCPRange range)
Definition other_connections.cpp:86
GuiJsonFile json_file_
Definition mainwindow.h:117
void on_calcTrajectoryPushButton_clicked()
Definition trajectory_and_robot.cpp:62
void on_addHillPushButton_clicked()
Definition other_connections.cpp:48
void on_hillAction_triggered()
Definition menu_add_actions.cpp:86
void on_addTargetPushButton_clicked()
Definition other_connections.cpp:18
void on_flyRobotPushButton_clicked()
Definition trajectory_and_robot.cpp:71
void moveRobot()
Definition other_connections.cpp:191
void on_trappyCircleAction_triggered()
Definition menu_add_actions.cpp:68
void mousePressSelectSecondTarget(QMouseEvent *mouse_event)
Definition interaction_buttons.cpp:208
void keyPressEvent(QKeyEvent *key_event) override
Definition interaction_buttons.cpp:80
void mousePressSetRadiusFromPlot(QMouseEvent *mouse_event)
Definition interaction_buttons.cpp:178
void AddHill(const std::vector< std::pair< double, double > > &points)
Definition menu_add_actions.cpp:43
void mousePressDeleteLastVertice(QMouseEvent *mouse_event)
Definition interaction_buttons.cpp:281
MainWindow(QWidget *parent=nullptr)
Definition mainwindow.cpp:4
void on_trappyLineAddFromTablePushButton_clicked()
Definition other_connections.cpp:82
bool on_saveAsFileAction_triggered()
Кнопка "Save as".
Definition menu_file_actions.cpp:139
bool is_drown_trajectory_
Definition mainwindow.h:122
void on_targetAction_triggered()
Definition menu_add_actions.cpp:60
void FlyRobot()
Definition trajectory_and_robot.cpp:20
void DeleteLastAddedObject()
Удаляет последний добавленный объект с помощью кнопок слева, причем его добавление не закончилось....
Definition interaction_buttons.cpp:49
void CalcTrajectory()
Definition trajectory_and_robot.cpp:39
bool on_saveFileAction_triggered()
Кнопка "Save".
Definition menu_file_actions.cpp:124
void on_addTrappyLinePushButton_clicked()
Definition other_connections.cpp:38
void mousePressAddVertice(QMouseEvent *mouse_event)
Definition interaction_buttons.cpp:235
void on_MediumSpeedButton_clicked()
Definition other_connections.cpp:214
void on_newFileAction_triggered()
Кнопка "New".
Definition menu_file_actions.cpp:57
~MainWindow()
Definition mainwindow.cpp:51
std::unique_ptr< data_tools::TablesConnection > t_connection_
Definition mainwindow.h:115
void AddTrappyLine(double x1, double y1, double x2, double y2)
Definition menu_add_actions.cpp:26
gui::ObjectType GetObjType() const
Definition other_connections.cpp:5
void on_openFileAction_triggered()
Кнопка "Open".
Definition menu_file_actions.cpp:80
void AddTrappyCircle(double x, double y, double radius)
Definition menu_add_actions.cpp:15
void mouseMoveAddVertice(QMouseEvent *mouse_event)
Definition interaction_buttons.cpp:302
void on_HighSpeedButton_clicked()
Definition other_connections.cpp:218
void on_homeScalePushButton_clicked()
Definition interaction_buttons.cpp:319
constexpr double max_scale
Definition mainwindow.h:22
constexpr double min_scale
Definition mainwindow.h:23
WhatObjectAddition
Definition mainwindow.h:25
CursorType
Definition mainwindow.h:14
Definition add_hill_form.h:18
ObjectType
Типы объектов по категориям
Definition base.h:21
constexpr double max_coord
Definition base.h:12