ImagingTools Core SDK
IInspectionReportBuilder.h
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ImtCore-Commercial
2#pragma once
3
4
5// Qt includes
6#include <QtCore/QtCore>
7
8// ACF includes
9#include <istd/IInformationProvider.h>
10#include <iprm/IParamsSet.h>
11
12
13namespace imtreport
14{
15
16
17class IReportDocument;
18
19
22class IInspectionReportBuilder: virtual public istd::IPolymorphic
23{
24public:
25 enum ErrorClass
26 {
27 EC_NONE,
28 EC_GLUE_GAP,
29 EC_GLUE_NARROW,
30 EC_GLUE_WIDE,
31 EC_GLUE_BEYOND_AREA
32 };
33
34 enum ResultFlags
35 {
36 RF_NONE = 0x0,
37 RF_SHOW_IN_SUMMARY = 0x1
38 };
39
40 struct InspectionRegionResult
41 {
42 QString inspectionName;
43 QString regionName;
44 ErrorClass errorClass;
45 istd::IInformationProvider::InformationCategory status;
46 double length;
47 double value;
48 double tolerance;
49 double diff;
50 int flags;
51 };
52
53 typedef QVector<InspectionRegionResult> Results;
54
55 struct InspectionRegion
56 {
57 QString name;
58 Results results;
59 };
60
61 typedef QVector<InspectionRegion> Regions;
62
63 struct Inspection
64 {
65 QString name;
66 QString imagePath;
67 istd::IInformationProvider::InformationCategory status;
68 Regions regions;
69 };
70
71 typedef QVector<Inspection> Inspections;
72
73 struct ReportInputData
74 {
75 QString companyName;
76 QString appVersion;
77 QString productName;
78 QDateTime time;
79 QString imagePath;
80 QString partSerialNumber;
81 istd::IInformationProvider::InformationCategory partStatus;
82 Inspections inspections;
83 };
84
85 virtual bool CreateReport(const ReportInputData& inputData, IReportDocument& reportDocument, const iprm::IParamsSet* paramsPtr = nullptr) const = 0;
86};
87
88
89} // namespace imtreport
90
91