NDEVR
API Documentation
DeploymentReport.h
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;
26 enum class DeploymentReportType
27 {
28 e_best_fit
29 , e_vertical
30 , e_horizontal
31 };
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 };
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 };
75 class DeploymentReport : public QWidget
76 {
77 public:
80 DeploymentReport(QWidget* parent = nullptr);
81 ~DeploymentReport();
82 void setReportType(DeploymentReportType report_type);
83 void setAutoIncludePlanned(bool include_planned);
84 void setDeployment(const DynamicPointer<QTDesignObject>& deployment);
85 void setDeployments(const Buffer<Deployment>& deployments);
86 void setStation(const StationModel& station);
87 void setCalibration(const Calibration& station);
88 void setProject(const Project& project);
89 void clearStation();
90 void clearCalibration();
91 void resizeEvent(QResizeEvent* event);
92 protected:
93 void updateName();
94 void updateUI();
95 protected:
96 String m_station_name;
97 String m_deployment_name;
98 String m_row_name;
99 Time m_survey_time;
100 TopDownDeploymentChart* m_top_down_chart;
101 SideViewDeploymentChart* m_front_chart;
102 SideViewDeploymentChart* m_side_chart;
103 Ui::DeploymentReportUI* ui;
104 Vertex<3, fltp08> m_average_hole_bottom;
105 Vertex<3, fltp08> m_planned_hole_bottom;
106 Vertex<3, fltp08> m_collar_location;
107 fltp08 m_average_length;
108 fltp08 m_planned_length;
109 DeploymentReportType m_report_type = DeploymentReportType::e_best_fit;
110 bool m_auto_include_planned = false;
111 };
112}
113#endif
A Model which represents a user-project.
Definition Project.h:41
A compact way to present a list of options to the user.
Handles creating a report page from some given data.
The primary namespace for the NDEVR SDK.
double fltp08
Defines an alias representing an 8 byte floating-point number.