Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
PartInspection.h
Go to the documentation of this file.
1#pragma once
2#include <QDateTime>
3#include <QString>
4#include <ipj/iface/global.h>
5#include <misc/gen/TClosure.h>
6
7namespace sf
8{
9
11{
12 public:
13 // Default constructor.
15
16 // Virtual destructor.
17 virtual ~TPartInspection() = default;
18
19 // Manipulates the part.
20 QString GetPart() const
21 {
22 return FPart;
23 }
24
25 // Manipulates the serial.
26 QString GetSerial() const
27 {
28 return FSerial;
29 }
30
31 // Manipulates the date time.
32 QString GetDateTimeStr() const
33 {
34 return FDateTimeStr;
35 }
36
37 //
38 QString GetRefName() const
39 {
40 return GetPartInspection();
41 }
42
43 // Holds the handler for notifying a change of this class.
45
46 // Clears the part and project member.
47 void Clear();
48 // Overloaded from base class.
49 virtual void Assign(const TPartInspection*);
50 // Returns the part and project in one string separated by a separator character.
51 QString GetPartInspection() const;
52 // Property handlers.
53 void SetPartInspection(const QString&);
54 void SetPart(const QString&);
55 void SetSerial(const QString&);
56 void SetDateTimeStr(const QString&);
57 void SetDateTime(const QDateTime& dt);
58 // Returns true if the project part combination exists.
59 bool GetExists() const;
60 // Returns true the instance is empty.
61 bool IsEmpty() const;
62 // Returns the file path of the project.
63 QString GetFilePath() const;
64 // Returns the data time as formatted a string.
65 QDateTime GetDateTime() const;
66
67 private:
68 // Holds the current part.
69 QString FPart;
70 // Holds the current serial number of the part.
71 QString FSerial;
72 // Holds the data time of the inspection.
73 QString FDateTimeStr;
74 // When FOnChange is hooked the function is called.
75 void DoChange();
76};
77
78}// namespace sf
Encapsulates the std::function() template.
Definition TClosure.h:14
Definition PartInspection.h:11
QString GetFilePath() const
void SetPartInspection(const QString &)
void SetDateTimeStr(const QString &)
bool GetExists() const
QString GetSerial() const
Definition PartInspection.h:26
QString GetDateTimeStr() const
Definition PartInspection.h:32
QString GetRefName() const
Definition PartInspection.h:38
QString GetPartInspection() const
TClosure< void, const TPartInspection * > OnChange
Definition PartInspection.h:44
virtual void Assign(const TPartInspection *)
void SetDateTime(const QDateTime &dt)
void SetSerial(const QString &)
QDateTime GetDateTime() const
QString GetPart() const
Definition PartInspection.h:20
void SetPart(const QString &)
bool IsEmpty() const
virtual ~TPartInspection()=default
#define _IPJ_CLASS
Definition ipj/iface/global.h:35
Definition Application.h:10