API Documentation
Loading...
Searching...
No Matches
DeploymentReport.h
Go to the documentation of this file.
1#pragma once
2#include "DLLInfo.h"
3#if NDEVR_DEPLOYMENT
4#include <NDEVR/ReportIterator.h>
5#include <NDEVR/QTDesignObject.h>
6#include <NDEVR/Deployment.h>
7#include <NDEVR/ApplicationOptions.h>
8#include <QMenu>
9namespace Ui
10{
11 class DeploymentReportUI;
12}
13namespace NDEVR
14{
15 class TopDownDeploymentChart;
16 class SideViewDeploymentChart;
17 class StationModel;
18 class Calibration;
19 class Project;
20 class DeploymentReport;
21 class QCustomComboBox;
22 /**--------------------------------------------------------------------------------------------------
23 \brief Describes the various types of Deployment report formats optimized for horizontal vs vertical
24 deployments.
25 **/
26 enum class DeploymentReportType
27 {
28 e_best_fit
31 };
32 /**--------------------------------------------------------------------------------------------------
33 \brief Special options for a deployment Report
34 **/
35 class DeploymentReportOptions : public QMenu
36 {
37 public:
38 DeploymentReportOptions(DeploymentReportType type, QWidget* parent = nullptr);
39 DeploymentReportType reportType() const;
40 protected:
41 QCustomComboBox* m_type_combo;
42 };
43 /**--------------------------------------------------------------------------------------------------
44 \brief A ReportHander that manages creating a multi-chart Deployment report.
45 **/
46 class NDEVR_CHARTS_API DeploymentReportHandler : public ReportHandler
47 {
48 public:
49 DeploymentReportHandler();
50 //Given a list of model objects, returns report IDs it requests to handle. Note report ID's can be Model IDs, or unique to this object.
51 //Returned IDs will be stored, then used with canHandle, getReport, and createReportJSON
52 virtual Buffer<UUID> defaultReportIDs(const Buffer<UUID>& objects_to_report, QTModelManager* manager) const override;
53
54 //Returns true if report can handle this ID
55 virtual bool canHandle(UUID id, QTModelManager* manager) const override;
56
57 //Can be nullptr if cannot generate report
58 virtual QWidget* getReport(const UUID& id, QTModelManager* manager, const QRect& requested_geometry) const override;
59
60 DeploymentReportType reportType() const;
61 bool autoIncludePlanned() const;
62 //Allowed to be no-op
63 virtual void createReportJSON(const UUID& id, JSONNode& parent, ReportJSONMaker& maker) const override;
64 virtual QMenu* popupOptions() const override;
65 protected:
66 mutable DeploymentReportOptions* m_report_options;
67 mutable DeploymentReport* m_report = nullptr;
68 static ApplicationOption<DeploymentReportType> s_report_type;
69 static ApplicationOption<bool> s_auto_include_planned;
70 };
71
72 class DeploymentReport : public QWidget
73 {
74 public:
75 DeploymentReport(QWidget* parent = nullptr);
76 ~DeploymentReport();
77 void setReportType(DeploymentReportType report_type);
78 void setAutoIncludePlanned(bool include_planned);
79 void setDeployment(const DynamicPointer<QTDesignObject>& deployment);
80 void setDeployments(const Buffer<Deployment>& deployments);
81 void setStation(const StationModel& station);
82 void setCalibration(const Calibration& station);
83 void setProject(const Project& project);
84 void clearStation();
85 void clearCalibration();
86 void resizeEvent(QResizeEvent* event);
87 protected:
88 void updateName();
89 void updateUI();
90 protected:
91 String m_station_name;
92 String m_deployment_name;
93 String m_row_name;
94 Time m_survey_time;
95 TopDownDeploymentChart* m_top_down_chart;
96 SideViewDeploymentChart* m_front_chart;
97 SideViewDeploymentChart* m_side_chart;
98 Ui::DeploymentReportUI* ui;
99 Vertex<3, fltp08> m_average_hole_bottom;
100 Vertex<3, fltp08> m_planned_hole_bottom;
101 Vertex<3, fltp08> m_collar_location;
102 fltp08 m_average_length;
103 fltp08 m_planned_length;
104 DeploymentReportType m_report_type = DeploymentReportType::e_best_fit;
105 bool m_auto_include_planned = false;
106 };
107}
108#endif
#define NDEVR_CHARTS_API
Definition DLLInfo.h:56
Definition ACIColor.h:37
@ e_horizontal
Definition RibbonLayoutMode.hpp:42
@ e_vertical
Definition RibbonLayoutMode.hpp:41
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
Definition FontEditor.h:6