Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
CustomFields.h
Go to the documentation of this file.
1#pragma once
2
3#include "Namespace.h"
5#include "gii/gen/Variable.h"
6#include "misc/gen/Sustain.h"
7
8namespace sf
9{
10
11class CustomFields final : public VariableHandler
12{
13 public:
15 CustomFields(PartInspection* pi, const std::string& prefix, id_type id_offset, id_type id_range);
16
18 ~CustomFields() override;
19
21 bool setExport(bool exported);
22
24 bool isExported() const;
25
28 bool isComplete() const;
29
31 void setComplete(bool yn);
32
34 int getCount() const;
35
37 void swap(int index1, int index2);
38
40 void add();
41
43 void add(const std::string& name, const std::string& setup);
44
46 void clear();
47
49 std::string getName(int index) const;
50
52 std::string getSetup(int index) const;
53
55 void storeConfig(IniProfile* ini, bool rd);
56
58 void storeConfig(bool rd);
59
61 bool storeValues(bool rd);
62
65
67 bool isDirty() const;
68
70 void setDirty(bool dirty);
71
73 void getStrings(KeyValues& list);
74
76 void setStrings(const KeyValues& list);
77
78 protected:
80 void variableEventHandler(EEvent event, const Variable& caller, Variable& link, bool same_inst) override;
81
83 bool sustain(const timespec& ts);
84
85 private:
87 TSustain<CustomFields> _sustainEntry;
89 Variable::PtrVector _varList;
91 id_type _idOffset, _idRange;
93 std::string _namePrefix;
95 bool _dirty;
97 bool _isExported;
99 bool _isComplete;
101 bool _changed;
103 PartInspection* _partInspection;
104};
105
106}// namespace sf
Definition CustomFields.h:12
std::string getSetup(int index) const
Returns the setup of the variable.
void setComplete(bool yn)
Set or resets the complete flag.
int getCount() const
Returns the amount of entries.
void setStrings(const KeyValues &list)
Sets the configuration from strings.
void setDirty(bool dirty)
Sets or resets the dirty flag.
void clear()
Flushes the list.
void add(const std::string &name, const std::string &setup)
Adds an entry to the list.
void add()
Adds an empty entry to the list.
CustomFields(PartInspection *pi, const std::string &prefix, id_type id_offset, id_type id_range)
Initializing constructor.
bool isDirty() const
Checks if a value was modified.
bool isExported() const
Checks if variables are exported.
bool storeValues(bool rd)
Write the custom values to the inspection file.
bool setExport(bool exported)
Sets the variables to be exported.
~CustomFields() override
Virtual overridden destructor.
void swap(int index1, int index2)
Swaps two entries.
void storeConfig(bool rd)
Stores the configuration from the default module profile.
bool sustain(const timespec &ts)
HAndler called by the sustain hook.
void variableEventHandler(EEvent event, const Variable &caller, Variable &link, bool same_inst) override
Handler for the variables.
void storeConfig(IniProfile *ini, bool rd)
Stores the configuration from the given profile.
void getStrings(KeyValues &list)
Gets the configuration in strings.
bool isComplete() const
Checks if during the last reading of values some are not filled in. This is always the case with new ...
void setDefaults()
Gets the filed values to their default value.
std::string getName(int index) const
Returns the name of the field.
unsigned long long id_type
Type used for the identifying integer (64-bits).
Definition InformationBase.h:30
Class for reading and writing ini-profiles.
Definition IniProfile.h:17
Definition PartInspection.h:11
Template to make the sustain system call a class method regularly.
Definition Sustain.h:184
Base class used for giving a Variable instance access to a member functions of a derived class....
Definition VariableHandler.h:14
EEvent
Events send to the handler set with sf::Variable::setHandler.
Definition VariableTypes.h:130
Class for creating and referencing global or local created parameters or settings called variables....
Definition Variable.h:16
Definition Application.h:10
IniProfile::KeyValueMap KeyValues
Definition ipj/iface/Namespace.h:123