Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
ipj/iface/Namespace.h
Go to the documentation of this file.
1#pragma once
2#include <ipj/iface/global.h>
8
9namespace sf
10{
11class ProjectModule;
12
14
15//
16// Tool and element default sections.
17//
18constexpr std::string_view SEC_TE_SELECTED("Selected");
19constexpr std::string_view SEC_TE_SERIALS("Serial Numbers");
20constexpr std::string_view SEC_TE_INFO("Information");
21
22//
23// Material default sections and keys.
24//
25constexpr std::string_view SEC_MAT_SOUNDVEL("Sound Velocity");
26constexpr std::string_view KEY_MAT_INFO("Information");
27constexpr std::string_view KEY_MAT_LONGITUDINAL("Longitudinal");
28constexpr std::string_view KEY_MAT_SHEAR("Shear");
29constexpr std::string_view KEY_MAT_FORM("Form");
30constexpr std::string_view SUBDIR_PART("Part");
31constexpr std::string_view SUBDIR_TOOL("Tool");
32constexpr std::string_view SUBDIR_ELEMENT("Element");
33constexpr std::string_view SUBDIR_MATERIAL("Material");
34constexpr std::string_view SUBDIR_SETTINGS("Settings");
35constexpr std::string_view SUBDIR_TEMPLATE("Template");
36
38constexpr std::string_view EXT_PROJECT(".iprj");
40constexpr std::string_view EXT_AREASCAN(".ascn");
42constexpr std::string_view EXT_AREASTATE(".ascns");
44constexpr std::string_view EXT_ELEMENT(".elem");
46constexpr std::string_view EXT_MATERIAL(".mater");
48constexpr std::string_view EXT_SETTINGS(".gisf");
50constexpr std::string_view EXT_FILTERS(".fltr");
52constexpr std::string_view EXT_TOOL(".tool");
54constexpr std::string_view FILE_PICTURE("picture.jpg");
56constexpr std::string_view EXT_INSPECTION(".insp");
58constexpr std::string_view FILE_INSPECTION("Inspection");
60constexpr std::string_view FILE_PARTSTATE("PartState");
62constexpr std::string_view EXT_CALIB(".calib");
64constexpr std::string_view HLPCTX_SETUPFAIL("fail_setup_change");
65// Special separator delimiters for project and inspection names.
66constexpr std::string_view PROJECT_NAME_DELIM("@");
67constexpr std::string_view PROJECT_FULL_DELIM("|");
68constexpr std::string_view INSPECT_SERIAL_DELIM(">");
69constexpr std::string_view INSPECT_DATETIME_DELIM("<");
70
71//
72// Inspection ini file sections and keys.
73//
74constexpr std::string_view SEC_INSP_GENERAL("General");
75constexpr std::string_view SEC_INSP_CUSTOM("Custom");
76constexpr std::string_view SEC_INSP_ANALYSIS("Analysis");
77constexpr std::string_view SEC_INSP_AREA_PREFIX("ScanArea,");
78constexpr std::string_view SEC_INSP_CALIB("Calibration,");
79constexpr std::string_view KEY_INSP_SYSNAME("System Name");
80constexpr std::string_view KEY_INSP_SYSUSER("System User");
81constexpr std::string_view KEY_INSP_APPUSER("Application User");
82constexpr std::string_view KEY_INSP_SCANUSER("User Name");
83constexpr std::string_view KEY_INSP_DATETIME("Date Time");
84constexpr std::string_view KEY_INSP_PART("Part");
85constexpr std::string_view KEY_INSP_PROJECT("Project");
86constexpr std::string_view KEY_INSP_SERIAL("Serial");
87constexpr std::string_view KEY_INSP_STATE("State");
88constexpr std::string_view KEY_INSP_CALTYPE("CalType");
89constexpr std::string_view KEY_INSP_COMMENT("Comment");
90constexpr std::string_view KEY_INSP_DATAFILE("DataFile");
91constexpr std::string_view KEY_INSP_FINALIZED("Finalized");
92constexpr std::string_view KEY_INSP_FINALIZEDATE("Finalize Date");
93constexpr std::string_view KEY_INSP_FINALIZEUSER("Finalize User");
94
96constexpr std::string_view SEC_CFG_GENERAL("General");
98constexpr std::string_view KEY_CFG_DESIG_PREFIX("Designation_");
100constexpr std::string_view KEY_CFG_SETTINGSGLOBAL("Settings Global");
102constexpr std::string_view KEY_CFG_FILTERLISTGLOBAL("Filter List Global");
104constexpr std::string_view SEC_MOD_SYSPOS("System Positions");
105
106constexpr std::string_view STR_VERSION("0.0");
107constexpr std::string_view SEC_GENERAL("General");
108constexpr std::string_view KEY_VERSION("Version");
109constexpr std::string_view KEY_CREATED("Created At");
110constexpr std::string_view KEY_CREATOR("Created By");
111constexpr std::string_view KEY_MODIFIED("Modify Date");
112constexpr std::string_view KEY_MODIFIER("Modify By");
113constexpr std::string_view SEC_SCANS("Scans");
114constexpr std::string_view KEY_SCANCOUNT("Scan Count");
115constexpr std::string_view KEY_SCANAREA("Scan Area");
116constexpr std::string_view KEY_SCANMETHOD("Scan Method");
117constexpr std::string_view KEY_SCANBINDER("Scan Binder");
118constexpr std::string_view SEC_REPORT("Report");
119constexpr std::string_view KEY_OPTIONS("Options");
120constexpr std::string_view KEY_TEMPLATE("Template");
121
124
131QString GetFilteredString(const QString& str, const QString& filter);
132
139typedef bool (*TAddProjectPropertyPage)(PropertySheetDialog* sheet, const QString& ref_name);
140
141// Forward declaration.
142class ProjectData;
143
150typedef bool (*GenerateReportEvent)(ProjectData* data, QStringList* templates);
151
166
171
177
181EMaterialType _IPJ_FUNC GetMaterialType(const QString& mat_type);
182
195
197constexpr int ctCAL_LASTENTRY(ctCAL_POST + 1);
198
203
208
221
223constexpr int isLASTENTRY(isREJECTED + 1);
224
229
234
249
252
257
262
267
284
288typedef QFlags<EReportOption> ReportOptions;
289
294
299
304
308_IPJ_FUNC void GetReportOptionDescriptions(QStringList& strings);
309
313_IPJ_FUNC QString DateTimeToInspectStr(const QDateTime& dt);
314
318_IPJ_FUNC QDateTime InspectStrToDateTime(const QString& str);
319
324
328_IPJ_FUNC std::string compatCommaSepString(const std::string& str, bool no_empty = false);
329
330}// namespace sf
331
332#include "mockup.h"
std::unordered_map< std::string, std::string > KeyValueMap
Type for retrieving key and values.
Definition IniProfile.h:274
Keeps the project and all scan areas to inspect.
Definition ProjectData.h:25
Singleton.
Definition ProjectModule.h:27
Dialog containing multiple property pages.
Definition qt/PropertySheetDialog.h:15
Envelope-letter type of smart pointers.
Definition TEnvelope.h:27
String list with optional object association and sorting.
Definition TStringList.h:12
#define _IPJ_FUNC
Definition ipj/iface/global.h:34
Definition Application.h:10
constexpr std::string_view KEY_MAT_SHEAR("Shear")
constexpr std::string_view KEY_INSP_DATETIME("Date Time")
constexpr std::string_view KEY_MODIFIER("Modify By")
constexpr std::string_view KEY_SCANBINDER("Scan Binder")
_IPJ_FUNC std::string compatCommaSepString(const std::string &str, bool no_empty=false)
Gets a '(' and ')' wrapped string when the given string is not.
constexpr std::string_view SEC_TE_SERIALS("Serial Numbers")
constexpr std::string_view KEY_INSP_DATAFILE("DataFile")
constexpr std::string_view KEY_INSP_SYSUSER("System User")
constexpr std::string_view KEY_CFG_DESIG_PREFIX("Designation_")
Designation key prefix.
_IPJ_FUNC QString GetInspectionStateName(EInspectionState)
Gets the passed inspection state as a name.
constexpr std::string_view KEY_MAT_FORM("Form")
QString _IPJ_FUNC GetMaterialTypeName(EMaterialType)
Gets the passed material type as a name.
constexpr std::string_view SEC_MAT_SOUNDVEL("Sound Velocity")
constexpr std::string_view KEY_INSP_SYSNAME("System Name")
constexpr std::string_view PROJECT_FULL_DELIM("|")
constexpr std::string_view SEC_MOD_SYSPOS("System Positions")
System positions profile section.
_IPJ_FUNC QString GetSystemPositionName(ESystemPosition sp)
Gets the passed system position name.
_IPJ_FUNC const char * GetProjectNameFilter()
Returns characters that are not allowed to appear in the names.
constexpr std::string_view KEY_INSP_FINALIZEUSER("Finalize User")
constexpr std::string_view SEC_INSP_CUSTOM("Custom")
TStringList< std::string > StringList
Definition ipj/iface/Namespace.h:13
constexpr std::string_view SEC_TE_INFO("Information")
_IPJ_FUNC ECalibrationType GetCalibrationType(const QString &cal_type)
Returns the passed calibration type name as enumerate value.
constexpr std::string_view SEC_INSP_GENERAL("General")
constexpr std::string_view SEC_INSP_CALIB("Calibration,")
constexpr std::string_view KEY_INSP_CALTYPE("CalType")
constexpr std::string_view KEY_OPTIONS("Options")
constexpr std::string_view INSPECT_SERIAL_DELIM(">")
constexpr std::string_view KEY_INSP_COMMENT("Comment")
constexpr std::string_view FILE_PICTURE("picture.jpg")
File name used for pictures of parts.
constexpr std::string_view KEY_INSP_SERIAL("Serial")
QString GetFilteredString(const QString &str, const QString &filter)
Filters a string removing all characters from the given filter string.
constexpr int spSYSPOS_LASTENTRY(spSYSPOS_TOOL+1)
Used as size and as last value to iterate towards.
_IPJ_FUNC void GetReportOptionDescriptions(QStringList &strings)
Gets the description in a string list of the passed options.
constexpr std::string_view SEC_REPORT("Report")
constexpr std::string_view KEY_CFG_SETTINGSGLOBAL("Settings Global")
Global settings key.
EReportOption
Final reporting options.
Definition ipj/iface/Namespace.h:272
@ roFILE
Definition ipj/iface/Namespace.h:274
@ roPRINT
Definition ipj/iface/Namespace.h:278
@ roVIEW
Definition ipj/iface/Namespace.h:276
@ roSHORTCUT
Definition ipj/iface/Namespace.h:280
@ roSEND
Definition ipj/iface/Namespace.h:282
constexpr std::string_view FILE_PARTSTATE("PartState")
File name and extension used in the part directory to store changing screen positions.
constexpr int mtMAT_LASTENTRY(mtMAT_GAS)
Allows iteration.
constexpr std::string_view EXT_AREASTATE(".ascns")
Extension used for area state files.
constexpr std::string_view KEY_MAT_LONGITUDINAL("Longitudinal")
constexpr std::string_view KEY_CREATED("Created At")
EMaterialType
Enumerate type to identify a material.
Definition ipj/iface/Namespace.h:156
@ mtMAT_SOLID
Definition ipj/iface/Namespace.h:162
@ mtMAT_LIQUID
Definition ipj/iface/Namespace.h:160
@ mtMAT_GAS
Definition ipj/iface/Namespace.h:164
@ mtMAT_ALL
Definition ipj/iface/Namespace.h:158
_IPJ_FUNC QDateTime InspectStrToDateTime(const QString &str)
Converts an inspection date time string into a QDateTime value.
constexpr std::string_view SEC_SCANS("Scans")
constexpr std::string_view SUBDIR_PART("Part")
constexpr std::string_view KEY_TEMPLATE("Template")
constexpr std::string_view SEC_INSP_ANALYSIS("Analysis")
constexpr std::string_view SUBDIR_ELEMENT("Element")
constexpr std::string_view SEC_CFG_GENERAL("General")
Section and key for the system designation.
IniProfile::KeyValueMap KeyValues
Definition ipj/iface/Namespace.h:123
constexpr std::string_view EXT_AREASCAN(".ascn")
Extension used for area scan files.
constexpr std::string_view EXT_MATERIAL(".mater")
Extension used for material files.
_IPJ_FUNC void destroyProjectModule()
Deletes the project module if it was created.
constexpr std::string_view KEY_SCANAREA("Scan Area")
constexpr std::string_view KEY_INSP_PART("Part")
constexpr int ctCAL_LASTENTRY(ctCAL_POST+1)
Used as size and as last value to iterate towards.
ESystemPosition
Fixed system dependent axis positions.
Definition ipj/iface/Namespace.h:239
@ spSYSPOS_LOAD
Position for loading parts in to the system also used when switching off the system (out of the water...
Definition ipj/iface/Namespace.h:245
@ spSYSPOS_NONE
To indicate no position.
Definition ipj/iface/Namespace.h:241
@ spSYSPOS_PARK
Position to park at when an inspection completes.
Definition ipj/iface/Namespace.h:243
@ spSYSPOS_TOOL
Position to go to when a tool must be changed or modified.
Definition ipj/iface/Namespace.h:247
constexpr std::string_view KEY_MODIFIED("Modify Date")
constexpr std::string_view STR_VERSION("0.0")
constexpr std::string_view FILE_INSPECTION("Inspection")
File name used for storing the inspection information.
bool(* GenerateReportEvent)(ProjectData *data, QStringList *templates)
Type for registering the report generation event handler.
Definition ipj/iface/Namespace.h:150
_IPJ_FUNC ProjectModule * getProjectModule()
Creates the project module when called for.
constexpr std::string_view EXT_SETTINGS(".gisf")
Extension used for settings files.
_IPJ_FUNC EInspectionState GetInspectionState(const QString &state_name)
Gets the passed inspection state name as enumerate value.
constexpr std::string_view SUBDIR_TOOL("Tool")
constexpr std::string_view EXT_ELEMENT(".elem")
Extension used for element files.
constexpr std::string_view KEY_INSP_STATE("State")
constexpr int isLASTENTRY(isREJECTED+1)
Used as size and as last value to iterate towards.
constexpr std::string_view EXT_FILTERS(".fltr")
Extension used for filter files.
constexpr std::string_view KEY_INSP_FINALIZED("Finalized")
constexpr std::string_view KEY_SCANMETHOD("Scan Method")
constexpr std::string_view KEY_INSP_PROJECT("Project")
constexpr std::string_view KEY_INSP_APPUSER("Application User")
constexpr std::string_view KEY_SCANCOUNT("Scan Count")
constexpr std::string_view EXT_CALIB(".calib")
Extension used for part project calibration values.
constexpr std::string_view HLPCTX_SETUPFAIL("fail_setup_change")
Context string used in the set message boxes.
TEnvelope< IniProfile > IniEnvelope
Definition ipj/iface/Namespace.h:122
constexpr std::string_view EXT_INSPECTION(".insp")
Extension used for inspection profiles.
EInspectionState
States for results of an inspection.
Definition ipj/iface/Namespace.h:213
@ isACCEPTED
Inspection result was accepted.
Definition ipj/iface/Namespace.h:217
@ isUNKNOWN
Inspection has not been done yet.
Definition ipj/iface/Namespace.h:215
@ isREJECTED
Inspection result was rejected.
Definition ipj/iface/Namespace.h:219
constexpr std::string_view KEY_CFG_FILTERLISTGLOBAL("Filter List Global")
Global filter key.
constexpr std::string_view PROJECT_NAME_DELIM("@")
constexpr std::string_view SEC_INSP_AREA_PREFIX("ScanArea,")
constexpr std::string_view EXT_PROJECT(".iprj")
Extension used for project profiles.
constexpr std::string_view SEC_GENERAL("General")
constexpr std::string_view KEY_INSP_SCANUSER("User Name")
_IPJ_FUNC QString DateTimeToInspectStr(const QDateTime &dt)
Converts a TDateTime to an inspection date time string.
_IPJ_FUNC const char * GetCalibrationTypeName(ECalibrationType)
Returns the passed calibration type as a name.
constexpr std::string_view INSPECT_DATETIME_DELIM("<")
EMaterialType _IPJ_FUNC GetMaterialType(const QString &mat_type)
Gets the passed calibration type name as enumerate value.
bool(* TAddProjectPropertyPage)(PropertySheetDialog *sheet, const QString &ref_name)
Type for registering tool and element editor property pages.
Definition ipj/iface/Namespace.h:139
constexpr std::string_view SUBDIR_MATERIAL("Material")
constexpr std::string_view KEY_MAT_INFO("Information")
QFlags< EReportOption > ReportOptions
Reporting option flags.
Definition ipj/iface/Namespace.h:288
_IPJ_FUNC QString GetSystemPositionInfo(ESystemPosition sp)
Gets the current scan inspection state converted from the passed name.
_MISC_FUNC std::string filter(std::string str, const std::string &filter)
Filters all characters from the passed string and returns the resulting string.
constexpr std::string_view KEY_CREATOR("Created By")
constexpr std::string_view KEY_VERSION("Version")
_IPJ_FUNC QString GetReportOptionDescription(EReportOption ro)
Gets the option description of the passed style.
constexpr std::string_view SUBDIR_TEMPLATE("Template")
ECalibrationType
Type to identify a scan area type.
Definition ipj/iface/Namespace.h:187
@ ctCAL_NONE
Normal no calibration selected.
Definition ipj/iface/Namespace.h:189
@ ctCAL_PRE
Pre calibration.
Definition ipj/iface/Namespace.h:191
@ ctCAL_POST
Post calibration.
Definition ipj/iface/Namespace.h:193
constexpr std::string_view KEY_INSP_FINALIZEDATE("Finalize Date")
constexpr std::string_view SUBDIR_SETTINGS("Settings")
constexpr std::string_view SEC_TE_SELECTED("Selected")
_IPJ_FUNC ESystemPosition GetSystemPositionFromName(const QString &sp)
Gets the system position from the name.
constexpr std::string_view EXT_TOOL(".tool")
Extension used for tool files.