Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
ScanEntry.h
Go to the documentation of this file.
1#pragma once
2#include <QObject>
6
7namespace sf
8{
9
10class ProjectData;
11
12class ScanEntry : public QObject
13{
14 protected:
15 // Protected constructor to prevent creation by others then TProjectData
17
18 public:
19 // Destructor.
20 ~ScanEntry() override;
21 // Easy to use standard type definition.
23 typedef TPtrVector::iter_type TPtrIterator;
24
26 {
27 return FDataFileName;
28 }
29
30 // Return the pointer of the selected scan method.
32 {
33 return FScanMethod;
34 }
35
36 // Sets gets the name of the area scanned.
37 QString GetScanArea()
38 {
39 return FScanArea;
40 }
41
42 // Sets the scan method.
43 void SetScanMethodName(const QString& name);
44 // Returns the scan method name.
45 QString GetScanMethodName() const;
46 // Returns the last scan method command.
47 QString GetScanMethodCommand() const;
48 // Returns the calibration set name of the scan method.
50 // Returns the current scan state.
52 // Returns the current scan states name.
53 QString GetScanStateName() const;
54 // Sets the current scan inspection state and writes it to the inspection profile.
56 // Returns the current scan inspection state name.
57 QString GetInspectionStateName() const;
58 // Sets the current scan inspection comment and writes it to the inspection profile.
59 void SetInspectionComment(QString cmt);
60 // Returns the current scan inspection comment from the inspection profile.
61 QString GetInspectionComment() const;
62 // Returns the user who made this scan.
63 QString GetInspectionUserName() const;
64 // Returns the time and date the user made this scan.
65 QString GetInspectionDateTimeStr() const;
66 // Returns the current inspection data filename from the inspection profile.
67 void SetInspectionDataFileName(QString filename);
68 // Sets the inspection data filename in the inspection profile.
70 // Returns the current scan inspection state.
72 // Loads a new area scan file with a scan method.
73 void SetScanArea(const QString& name);
74
75 // Shows this single scan method frame and hides all others.
76 bool ShowFrame();
77 // Executes a dialog for modifying the inspection comment and state.
78 // Returns mrOK when a choice has been made and mrRetry for a rescan.
80 // Copy only the calibration parameters specified by this entry
81 // when it is a pre- or post-calibration scan.
82 bool CalibSettings(bool assign);
83 // Shows the calibrated settings of this entry.
85 // Writes the filter analysis information to the inspection database.
86 // Returns true if anything has been written.
88 // Opens the data file for this instance. When the index is -1 it opens the last one.
89 bool OpenDataFile(int fileindex = -1) const;
90 // Makes a copy of the other entry. Does not rename only settings are copied.
92 // Makes a copy of the settings passed scan ini file.
94 // Makes a copy of a template settings.
95 bool AssignSelected(bool templ);
96
97 protected:
98 // Saves the settings in the scan area file from the scan method.
100 // Loads the settings from the scan area file in to the scan method.
102 // Creates the scan frame in the project frame if possible and available.
104 // Writes all scan entry data to the profile and returns true on succes.
106 // Reads all scan entry data from the profile passed.
108 // Updates the inspection information fields or updates the inspection file.
109 void ReadWriteInspectionInfo(bool rd, bool force = false);
110 // Updates the cached version of the inspection information.
112
113 private:
114 // Holds name of the scan method
115 QString FScanMethodName;
116 // Holds the owner of this scan entry instance.
117 ProjectData* FProjectData;
118 // Holds the pointer to the scan method instance when it is created.
119 ScanMethod* FScanMethod;
120 // Holds the name of the area which is scanned.
121 QString FScanArea;
122 // Holds the last update scan state.
123 ScanMethod::EState FScanState;
124 // Holds the last updated inspection state.
125 EInspectionState FInspectionState;
126 // Special field for the scan binder to attach some additional data.
127 void* FBinderData;
128 // Holds the last data file name of the scan.
129 QString FDataFileName;
130 // Holds the cached version of the comment.
131 QString FInspectionComment;
132 // Holds the cached version of the inspector user name.
133 QString FInspectionUserName;
134 // Holds the cached version of inspected date time.
135 QString FInspectionDateTimeStr;
136
137 friend ProjectData;
138 friend ScanBinder;
139};
140
142{
143 return sf::GetInspectionStateName(FInspectionState);
144}
145
147{
148 return FInspectionState;
149}
150
151}// namespace sf
Class for reading and writing ini-profiles.
Definition IniProfile.h:17
Definition ProjectData.h:23
Abstract base class for implementing scan binders.
Definition ScanBinder.h:30
Definition ScanEntry.h:13
void SetInspectionComment(QString cmt)
QString GetInspectionComment() const
int EditInspectionState()
bool CreateScanFrame()
void ShowCalibSettings()
void SetInspectionState(EInspectionState is)
TPtrVector::iter_type TPtrIterator
Definition ScanEntry.h:23
QString GetInspectionUserName() const
bool UpdateInspectionInfo()
bool OpenDataFile(int fileindex=-1) const
QString GetScanMethodCalibrationSet() const
QString GetDataFileName()
Definition ScanEntry.h:25
QString GetInspectionStateName() const
Definition ScanEntry.h:141
void SetScanMethodName(const QString &name)
TVector< ScanEntry * > TPtrVector
Definition ScanEntry.h:22
~ScanEntry() override
ScanMethod::EState GetScanState() const
QString GetScanArea()
Definition ScanEntry.h:37
EInspectionState GetInspectionState() const
Definition ScanEntry.h:146
void SaveMethodSettings(IniEnvelope ini)
void SetInspectionDataFileName(QString filename)
QString GetInspectionDataFileName() const
ScanEntry(ProjectData *prj_data)
bool AssignSelected(bool templ)
bool ReadProfile(IniProfile &ini)
bool ShowFrame()
QString GetInspectionDateTimeStr() const
QString GetScanMethodName() const
QString GetScanStateName() const
bool CalibSettings(bool assign)
void AssignIni(IniEnvelope &ini)
bool WriteAnalysisInfo()
void SetScanArea(const QString &name)
QString GetScanMethodCommand() const
bool WriteProfile(IniProfile &ini)
void ReadWriteInspectionInfo(bool rd, bool force=false)
ScanMethod * GetScanMethod()
Definition ScanEntry.h:31
void AssignEntry(ScanEntry *se)
void LoadMethodSettings(IniEnvelope ini)
Definition ScanMethod.h:28
EState
States of operation.
Definition ScanMethod.h:403
Counted vector having additional methods and operators for ease of usage. This template class extends...
Definition TVector.h:20
Definition Application.h:10
_IPJ_FUNC QString GetInspectionStateName(EInspectionState)
Gets the passed inspection state as a name.
EInspectionState
States for results of an inspection.
Definition ipj/iface/Namespace.h:272