ExportDialogController.h
Go to the documentation of this file.
1 #ifndef EXPORTDIALOGCONTROLLER_H
2 #define EXPORTDIALOGCONTROLLER_H
3 #include "AbstractController.h"
4 #include <QDialog>
5 #include "../View/ui_ExportDialog.h"
6 #include "../Model/DesignerTrajectory.h"
7 #include <QErrorMessage>
8 #include <QString>
9 #include <QFileDialog>
10 #include <QFile>
11 #include "../ImportExport/MMMExporter.h"
12 #include "../Environment.h"
13 
14 namespace armarx
15 {
16  /**
17  * @class ExportDialogController
18  * @brief Subcontroller which handles all user interaction with the export
19  * dialog in the GUI, communicates with other controllers
20  * via signals and slots
21  */
23  {
24  Q_OBJECT
25 
26  public:
27  /**
28  * @brief @see AbstractController
29  */
30  void onInitComponent() override;
31 
32  /**
33  * @brief @see AbstractController
34  */
35  void onConnectComponent() override;
36 
37  /**
38  * @brief @see AbstractController
39  */
40  void onDisconnectComponent() override;
41 
42  /**
43  * @brief @see AbstractController
44  */
45  void onExitComponent() override;
46 
47  /**
48  * @brief Creates a new ExportDialogController and assigns a designer
49  * exporter to handle
50  */
52 
53  public slots:
54  /**
55  * @brief Opens an export dialog
56  */
57  void open();
58 
59  /**
60  * @brief Sets the timed distribution of automatically generated waypoints
61  * by assigning how many waypoints there are per second
62  * @param value Number of waypoints per second
63  */
64  void setFPS(int fps);
65 
66  /**
67  * @brief Exports the trajectory
68  * @param trajectory DesignerTrajectory fpr export
69  */
70  void exportTrajectory(std::vector<DesignerTrajectoryPtr> trajectories);
71 
72  /**
73  * @brief Start export to MMM
74  */
75  void exportMMM();
76 
77  /**
78  * @brief Start export to trajectory
79  */
80  void exportTrajectory();
81 
82  /**
83  * @brief Set the enviroment
84  * @param The new enviroment
85  */
86  void environmentChanged(EnvironmentPtr environment);
87 
88  signals:
89  /*
90  * Changed method name because 'export' is a keyword
91  */
92  /**
93  * @brief Requests a designer trajectory to a given index to export
94  * @param index Index of the trajectory
95  */
96  void exportDesignerTrajectory(int fps);
97 
98  /**
99  * @brief Requests a designer trajectory to a given index to export
100  */
102 
103  private:
104  QString saveToFile();
105  EnvironmentPtr environment;
106  //DesignerExporterPtr exporter;
107  QDialog* exportDialog;
108  Ui::ExportDialog ui;
109  std::vector<armarx::DesignerTrajectoryPtr> trajectories;
110  int fps;
111  };
112 
113  using ExportDialogControllerPtr = std::shared_ptr<ExportDialogController>;
114 }
115 
116 #endif // EXPORTDIALOGCONTROLLER_H
armarx::ExportDialogController::environmentChanged
void environmentChanged(EnvironmentPtr environment)
Set the enviroment.
Definition: ExportDialogController.cpp:123
armarx::ExportDialogController::onConnectComponent
void onConnectComponent() override
Definition: ExportDialogController.cpp:14
armarx::ExportDialogController::exportMMM
void exportMMM()
Start export to MMM.
Definition: ExportDialogController.cpp:55
armarx::ExportDialogController::setFPS
void setFPS(int fps)
Sets the timed distribution of automatically generated waypoints by assigning how many waypoints ther...
Definition: ExportDialogController.cpp:45
armarx::ExportDialogController::ExportDialogController
ExportDialogController()
Creates a new ExportDialogController and assigns a designer exporter to handle.
Definition: ExportDialogController.cpp:32
armarx::ExportDialogController::open
void open()
Opens an export dialog.
Definition: ExportDialogController.cpp:38
armarx::ExportDialogController::exportDesignerTrajectory
void exportDesignerTrajectory()
Requests a designer trajectory to a given index to export.
armarx::ExportDialogController::onDisconnectComponent
void onDisconnectComponent() override
Definition: ExportDialogController.cpp:22
armarx::EnvironmentPtr
std::shared_ptr< Environment > EnvironmentPtr
Definition: Environment.h:29
armarx::ExportDialogControllerPtr
std::shared_ptr< ExportDialogController > ExportDialogControllerPtr
Definition: ExportDialogController.h:113
AbstractController.h
armarx::ExportDialogController::onInitComponent
void onInitComponent() override
Definition: ExportDialogController.cpp:6
armarx::ExportDialogController::onExitComponent
void onExitComponent() override
Definition: ExportDialogController.cpp:27
armarx::ExportDialogController::exportTrajectory
void exportTrajectory()
Start export to trajectory.
Definition: ExportDialogController.cpp:88
armarx::ExportDialogController
Subcontroller which handles all user interaction with the export dialog in the GUI,...
Definition: ExportDialogController.h:22
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::AbstractController
Abstract controller providing a set of methods which must be implemented by every controller.
Definition: AbstractController.h:35