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 enum class DeploymentReportType
23 {
24 e_best_fit
27 };
28 class DeploymentReportOptions : public QMenu
29 {
30 public:
31 DeploymentReportOptions(DeploymentReportType type, QWidget* parent = nullptr);
32 DeploymentReportType reportType() const;
33 protected:
34 QCustomComboBox* m_type_combo;
35 };
36 //This class Handles creating a report. If
37 class NDEVR_CHARTS_API DeploymentReportHandler : public ReportHandler
38 {
39 public:
40 DeploymentReportHandler();
41 //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.
42 //Returned IDs will be stored, then used with canHandle, getReport, and createReportJSON
43 virtual Buffer<UUID> defaultReportIDs(const Buffer<UUID>& objects_to_report, QTModelManager* manager) const override;
44
45 //Returns true if report can handle this ID
46 virtual bool canHandle(UUID id, QTModelManager* manager) const override;
47
48 //Can be nullptr if cannot generate report
49 virtual QWidget* getReport(const UUID& id, QTModelManager* manager, const QRect& requested_geometry) const override;
50
51 DeploymentReportType reportType() const;
52 bool autoIncludePlanned() const;
53 //Allowed to be no-op
54 virtual void createReportJSON(const UUID& id, JSONNode& parent, ReportJSONMaker& maker) const override;
55 virtual QMenu* popupOptions() const override;
56 protected:
57 mutable DeploymentReportOptions* m_report_options;
58 mutable DeploymentReport* m_report = nullptr;
59 static ApplicationOption<DeploymentReportType> s_report_type;
60 static ApplicationOption<bool> s_auto_include_planned;
61 };
62
63 class DeploymentReport : public QWidget
64 {
65 public:
66 DeploymentReport(QWidget* parent = nullptr);
67 ~DeploymentReport();
68 void setReportType(DeploymentReportType report_type);
69 void setAutoIncludePlanned(bool include_planned);
70 void setDeployment(const DynamicPointer<QTDesignObject>& deployment);
71 void setDeployments(const Buffer<Deployment>& deployments);
72 void setStation(const StationModel& station);
73 void setCalibration(const Calibration& station);
74 void setProject(const Project& project);
75 void clearStation();
76 void clearCalibration();
77 void resizeEvent(QResizeEvent* event);
78 protected:
79 void updateName();
80 void updateUI();
81 protected:
82 String m_station_name;
83 String m_deployment_name;
84 String m_row_name;
85 Time m_survey_time;
86 TopDownDeploymentChart* m_top_down_chart;
87 SideViewDeploymentChart* m_front_chart;
88 SideViewDeploymentChart* m_side_chart;
89 Ui::DeploymentReportUI* ui;
90 Vertex<3, fltp08> m_average_hole_bottom;
91 Vertex<3, fltp08> m_planned_hole_bottom;
92 Vertex<3, fltp08> m_collar_location;
93 fltp08 m_average_length;
94 fltp08 m_planned_length;
95 DeploymentReportType m_report_type = DeploymentReportType::e_best_fit;
96 bool m_auto_include_planned = false;
97 };
98}
99#endif
#define NDEVR_CHARTS_API
Definition DLLInfo.h:74
Definition ACIColor.h:37
@ e_horizontal
Definition RibbonLayoutMode.hpp:39
@ e_vertical
Definition RibbonLayoutMode.hpp:38
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:176
Definition FontEditor.h:6