68 # pragma warning(push)
69 # pragma warning(disable : 4251)
82 static constexpr
const char *path{
"" };
85 static constexpr
const char *name{
"CameraState" };
88 static constexpr
const char *description{
89 R
"description(Information about camera connection state, temperatures, etc.)description"
92 static constexpr
size_t version{ 2 };
102 static constexpr std::array<uint8_t, 3> binaryId{
'c',
's',
't' };
114 static constexpr
const char *path{
"Available" };
117 static constexpr
const char *name{
"Available" };
120 static constexpr
const char *description{
121 R
"description(Flag if camera is physically connected to the computer, but not connected in software. When the camera is in this state, you can call connect().)description"
132 return {
false,
true };
150 explicit operator bool()
const
158 return m_value == other.m_value;
164 return m_value != other.m_value;
174 void setFromString(
const std::string &value);
176 bool m_value{
false };
178 friend struct DataModel::Detail::Befriend<
Available>;
189 static constexpr
const char *path{
"Connected" };
192 static constexpr
const char *name{
"Connected" };
195 static constexpr
const char *description{
196 R
"description(Flag if camera is connected in software)description"
207 return {
false,
true };
225 explicit operator bool()
const
233 return m_value == other.m_value;
239 return m_value != other.m_value;
249 void setFromString(
const std::string &value);
251 bool m_value{
false };
253 friend struct DataModel::Detail::Befriend<
Connected>;
264 static constexpr
const char *path{
"Temperature" };
267 static constexpr
const char *name{
"Temperature" };
270 static constexpr
const char *description{ R
"description(Current temperature(s))description" };
280 static constexpr
const char *path{
"Temperature/DMD" };
283 static constexpr
const char *name{
"DMD" };
286 static constexpr
const char *description{ R
"description(DMD temperature)description" };
294 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
301 explicit constexpr
DMD(
double value)
314 return m_value == other.m_value;
320 return m_value != other.m_value;
326 return m_value < other.m_value;
332 return m_value > other.m_value;
342 void setFromString(
const std::string &value);
344 double m_value{ 0.0 };
346 friend struct DataModel::Detail::Befriend<
DMD>;
357 static constexpr
const char *path{
"Temperature/General" };
360 static constexpr
const char *name{
"General" };
363 static constexpr
const char *description{ R
"description(General temperature)description" };
371 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
391 return m_value == other.m_value;
397 return m_value != other.m_value;
403 return m_value < other.m_value;
409 return m_value > other.m_value;
419 void setFromString(
const std::string &value);
421 double m_value{ 0.0 };
423 friend struct DataModel::Detail::Befriend<
General>;
434 static constexpr
const char *path{
"Temperature/LED" };
437 static constexpr
const char *name{
"LED" };
440 static constexpr
const char *description{ R
"description(LED temperature)description" };
448 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
455 explicit constexpr
LED(
double value)
468 return m_value == other.m_value;
474 return m_value != other.m_value;
480 return m_value < other.m_value;
486 return m_value > other.m_value;
496 void setFromString(
const std::string &value);
498 double m_value{ 0.0 };
500 friend struct DataModel::Detail::Befriend<
LED>;
511 static constexpr
const char *path{
"Temperature/Lens" };
514 static constexpr
const char *name{
"Lens" };
517 static constexpr
const char *description{ R
"description(Lens temperature)description" };
525 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
532 explicit constexpr
Lens(
double value)
545 return m_value == other.m_value;
551 return m_value != other.m_value;
557 return m_value < other.m_value;
563 return m_value > other.m_value;
573 void setFromString(
const std::string &value);
575 double m_value{ 0.0 };
577 friend struct DataModel::Detail::Befriend<
Lens>;
588 static constexpr
const char *path{
"Temperature/PCB" };
591 static constexpr
const char *name{
"PCB" };
594 static constexpr
const char *description{ R
"description(PCB temperature)description" };
602 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
609 explicit constexpr
PCB(
double value)
622 return m_value == other.m_value;
628 return m_value != other.m_value;
634 return m_value < other.m_value;
640 return m_value > other.m_value;
650 void setFromString(
const std::string &value);
652 double m_value{ 0.0 };
654 friend struct DataModel::Detail::Befriend<
PCB>;
682 template<
typename... Args,
683 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
684 typename std::enable_if<
685 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
686 typename std::decay<Args>::type...>::value,
689 template<typename... Args>
693 using namespace Zivid::Detail::TypeTraits;
695 static_assert(AllArgsDecayedAreUnique<Args...>::value,
696 "Found duplicate types among the arguments passed to Temperature(...). "
697 "Types should be listed at most once.");
699 set(std::forward<Args>(args)...);
717 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
719 template<typename... Args>
723 using namespace Zivid::Detail::TypeTraits;
725 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
726 static_assert(AllArgsAreDescendantNodes::value,
727 "All arguments passed to set(...) must be descendant nodes.");
729 static_assert(AllArgsDecayedAreUnique<Args...>::value,
730 "Found duplicate types among the arguments passed to set(...). "
731 "Types should be listed at most once.");
733 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
752 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
754 template<typename... Args>
758 using namespace Zivid::Detail::TypeTraits;
760 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
761 static_assert(AllArgsAreDescendantNodes::value,
762 "All arguments passed to copyWith(...) must be descendant nodes.");
764 static_assert(AllArgsDecayedAreUnique<Args...>::value,
765 "Found duplicate types among the arguments passed to copyWith(...). "
766 "Types should be listed at most once.");
769 copy.set(std::forward<Args>(args)...);
869 typename std::enable_if<std::is_same<T, CameraState::Temperature::DMD>::value,
int>::type = 0>
876 typename std::enable_if<std::is_same<T, CameraState::Temperature::General>::value,
int>::type = 0>
883 typename std::enable_if<std::is_same<T, CameraState::Temperature::LED>::value,
int>::type = 0>
890 typename std::enable_if<std::is_same<T, CameraState::Temperature::Lens>::value,
int>::type = 0>
897 typename std::enable_if<std::is_same<T, CameraState::Temperature::PCB>::value,
int>::type = 0>
903 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
909 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
915 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
921 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
927 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
971 void setFromString(
const std::string &value);
973 void setFromString(
const std::string &fullPath,
const std::string &value);
975 std::string getString(
const std::string &fullPath)
const;
983 friend struct DataModel::Detail::Befriend<
Temperature>;
1022 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
1023 typename std::enable_if<
1024 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::value,
1027 template<typename... Args>
1031 using namespace Zivid::Detail::TypeTraits;
1033 static_assert(AllArgsDecayedAreUnique<Args...>::value,
1034 "Found duplicate types among the arguments passed to CameraState(...). "
1035 "Types should be listed at most once.");
1037 set(std::forward<Args>(args)...);
1058 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
1060 template<typename... Args>
1064 using namespace Zivid::Detail::TypeTraits;
1066 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1067 static_assert(AllArgsAreDescendantNodes::value,
1068 "All arguments passed to set(...) must be descendant nodes.");
1070 static_assert(AllArgsDecayedAreUnique<Args...>::value,
1071 "Found duplicate types among the arguments passed to set(...). "
1072 "Types should be listed at most once.");
1074 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
1096 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
1098 template<typename... Args>
1102 using namespace Zivid::Detail::TypeTraits;
1104 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1105 static_assert(AllArgsAreDescendantNodes::value,
1106 "All arguments passed to copyWith(...) must be descendant nodes.");
1108 static_assert(AllArgsDecayedAreUnique<Args...>::value,
1109 "Found duplicate types among the arguments passed to copyWith(...). "
1110 "Types should be listed at most once.");
1113 copy.set(std::forward<Args>(args)...);
1132 m_available = value;
1151 m_connected = value;
1158 return m_temperature;
1164 return m_temperature;
1170 m_temperature = value;
1177 m_temperature.
set(value);
1184 m_temperature.
set(value);
1191 m_temperature.
set(value);
1198 m_temperature.
set(value);
1205 m_temperature.
set(value);
1209 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Available>::value,
int>::type = 0>
1215 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Connected>::value,
int>::type = 0>
1221 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Temperature>::value,
int>::type = 0>
1224 return m_temperature;
1227 template<
typename T,
1228 typename std::enable_if<std::is_same<T, CameraState::Temperature::DMD>::value,
int>::type = 0>
1234 template<
typename T,
1235 typename std::enable_if<std::is_same<T, CameraState::Temperature::General>::value,
int>::type = 0>
1241 template<
typename T,
1242 typename std::enable_if<std::is_same<T, CameraState::Temperature::LED>::value,
int>::type = 0>
1248 template<
typename T,
1249 typename std::enable_if<std::is_same<T, CameraState::Temperature::Lens>::value,
int>::type = 0>
1255 template<
typename T,
1256 typename std::enable_if<std::is_same<T, CameraState::Temperature::PCB>::value,
int>::type = 0>
1262 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1268 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1274 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1277 return m_temperature;
1281 template<
typename F>
1290 template<
typename F>
1314 void save(
const std::string &fileName)
const;
1317 void load(
const std::string &fileName);
1320 void setFromString(
const std::string &value);
1322 void setFromString(
const std::string &fullPath,
const std::string &value);
1324 std::string getString(
const std::string &fullPath)
const;
1330 friend struct DataModel::Detail::Befriend<
CameraState>;
1335 struct CameraState::Version<2>
1344 # pragma warning(pop)
1348 # if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
1352 struct tuple_size<
Zivid::CameraState::Temperature> : integral_constant<size_t, 5>
1356 struct tuple_element<i,
Zivid::CameraState::Temperature>
1358 static_assert(i < tuple_size<Zivid::CameraState::Temperature>::value,
"Index must be less than 5");
1361 = decltype(declval<Zivid::CameraState::Temperature>().get<i>());
1365 struct tuple_size<
Zivid::CameraState> : integral_constant<size_t, 3>
1369 struct tuple_element<i,
Zivid::CameraState>
1371 static_assert(i < tuple_size<Zivid::CameraState>::value,
"Index must be less than 3");
1374 = decltype(declval<Zivid::CameraState>().get<i>());
#define ZIVID_CORE_EXPORT
Definition: CoreExport.h:57
Flag if camera is physically connected to the computer, but not connected in software....
Definition: CameraState.h:108
static const Available no
Off/disabled.
Definition: CameraState.h:127
bool operator==(const Available &other) const
Comparison operator
Definition: CameraState.h:156
std::string toString() const
Get the value as string
friend std::ostream & operator<<(std::ostream &stream, const Available &value)
Operator to serialize the value to a stream
Definition: CameraState.h:168
bool ValueType
The type of the underlying value
Definition: CameraState.h:125
static const Available yes
On/enabled.
Definition: CameraState.h:126
bool operator!=(const Available &other) const
Comparison operator
Definition: CameraState.h:162
constexpr Available(bool value)
Constructor
Definition: CameraState.h:139
bool value() const
Get the value
static std::set< bool > validValues()
All valid values of Available
Definition: CameraState.h:130
Available()=default
Default constructor
Flag if camera is connected in software
Definition: CameraState.h:183
Connected()=default
Default constructor
static const Connected yes
On/enabled.
Definition: CameraState.h:201
static std::set< bool > validValues()
All valid values of Connected
Definition: CameraState.h:205
static const Connected no
Off/disabled.
Definition: CameraState.h:202
bool operator!=(const Connected &other) const
Comparison operator
Definition: CameraState.h:237
friend std::ostream & operator<<(std::ostream &stream, const Connected &value)
Operator to serialize the value to a stream
Definition: CameraState.h:243
constexpr Connected(bool value)
Constructor
Definition: CameraState.h:214
bool value() const
Get the value
std::string toString() const
Get the value as string
bool operator==(const Connected &other) const
Comparison operator
Definition: CameraState.h:231
bool ValueType
The type of the underlying value
Definition: CameraState.h:200
DMD temperature
Definition: CameraState.h:274
bool operator>(const DMD &other) const
Comparison operator
Definition: CameraState.h:330
std::string toString() const
Get the value as string
double value() const
Get the value
bool operator!=(const DMD &other) const
Comparison operator
Definition: CameraState.h:318
bool operator<(const DMD &other) const
Comparison operator
Definition: CameraState.h:324
friend std::ostream & operator<<(std::ostream &stream, const DMD &value)
Operator to serialize the value to a stream
Definition: CameraState.h:336
double ValueType
The type of the underlying value
Definition: CameraState.h:289
static constexpr Range< double > validRange()
The range of valid values for DMD
Definition: CameraState.h:292
constexpr DMD(double value)
Constructor
Definition: CameraState.h:301
bool operator==(const DMD &other) const
Comparison operator
Definition: CameraState.h:312
DMD()=default
Default constructor
General temperature
Definition: CameraState.h:351
static constexpr Range< double > validRange()
The range of valid values for General
Definition: CameraState.h:369
double ValueType
The type of the underlying value
Definition: CameraState.h:366
std::string toString() const
Get the value as string
double value() const
Get the value
bool operator<(const General &other) const
Comparison operator
Definition: CameraState.h:401
constexpr General(double value)
Constructor
Definition: CameraState.h:378
bool operator==(const General &other) const
Comparison operator
Definition: CameraState.h:389
General()=default
Default constructor
bool operator!=(const General &other) const
Comparison operator
Definition: CameraState.h:395
bool operator>(const General &other) const
Comparison operator
Definition: CameraState.h:407
friend std::ostream & operator<<(std::ostream &stream, const General &value)
Operator to serialize the value to a stream
Definition: CameraState.h:413
LED temperature
Definition: CameraState.h:428
std::string toString() const
Get the value as string
bool operator<(const LED &other) const
Comparison operator
Definition: CameraState.h:478
double value() const
Get the value
LED()=default
Default constructor
constexpr LED(double value)
Constructor
Definition: CameraState.h:455
bool operator!=(const LED &other) const
Comparison operator
Definition: CameraState.h:472
bool operator==(const LED &other) const
Comparison operator
Definition: CameraState.h:466
bool operator>(const LED &other) const
Comparison operator
Definition: CameraState.h:484
friend std::ostream & operator<<(std::ostream &stream, const LED &value)
Operator to serialize the value to a stream
Definition: CameraState.h:490
double ValueType
The type of the underlying value
Definition: CameraState.h:443
static constexpr Range< double > validRange()
The range of valid values for LED
Definition: CameraState.h:446
Lens temperature
Definition: CameraState.h:505
double ValueType
The type of the underlying value
Definition: CameraState.h:520
bool operator==(const Lens &other) const
Comparison operator
Definition: CameraState.h:543
Lens()=default
Default constructor
double value() const
Get the value
bool operator>(const Lens &other) const
Comparison operator
Definition: CameraState.h:561
bool operator!=(const Lens &other) const
Comparison operator
Definition: CameraState.h:549
friend std::ostream & operator<<(std::ostream &stream, const Lens &value)
Operator to serialize the value to a stream
Definition: CameraState.h:567
std::string toString() const
Get the value as string
constexpr Lens(double value)
Constructor
Definition: CameraState.h:532
static constexpr Range< double > validRange()
The range of valid values for Lens
Definition: CameraState.h:523
bool operator<(const Lens &other) const
Comparison operator
Definition: CameraState.h:555
PCB temperature
Definition: CameraState.h:582
bool operator!=(const PCB &other) const
Comparison operator
Definition: CameraState.h:626
constexpr PCB(double value)
Constructor
Definition: CameraState.h:609
PCB()=default
Default constructor
bool operator==(const PCB &other) const
Comparison operator
Definition: CameraState.h:620
friend std::ostream & operator<<(std::ostream &stream, const PCB &value)
Operator to serialize the value to a stream
Definition: CameraState.h:644
static constexpr Range< double > validRange()
The range of valid values for PCB
Definition: CameraState.h:600
double value() const
Get the value
bool operator>(const PCB &other) const
Comparison operator
Definition: CameraState.h:638
double ValueType
The type of the underlying value
Definition: CameraState.h:597
std::string toString() const
Get the value as string
bool operator<(const PCB &other) const
Comparison operator
Definition: CameraState.h:632
Current temperature(s)
Definition: CameraState.h:258
DMD & dmd()
Get DMD
Definition: CameraState.h:780
const CameraState::Temperature::Lens & get() const
Definition: CameraState.h:891
LED & led()
Get LED
Definition: CameraState.h:818
const DMD & dmd() const
Get DMD
Definition: CameraState.h:774
const PCB & pcb() const
Get PCB
Definition: CameraState.h:850
const CameraState::Temperature::General & get() const
Definition: CameraState.h:877
bool operator!=(const Temperature &other) const
Inequality operator
Temperature & set(const General &value)
Set General
Definition: CameraState.h:805
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: CameraState.h:935
Temperature(Args &&...args)
Constructor taking variadic number of arguments
Definition: CameraState.h:691
std::string toString() const
Get the value as string
bool operator==(const Temperature &other) const
Equality operator
Temperature & set(const LED &value)
Set LED
Definition: CameraState.h:824
Temperature copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition: CameraState.h:756
General & general()
Get General
Definition: CameraState.h:799
const LED & led() const
Get LED
Definition: CameraState.h:812
void set(Args &&...args)
Set multiple arguments
Definition: CameraState.h:721
const General & general() const
Get General
Definition: CameraState.h:793
const CameraState::Temperature::PCB & get() const
Definition: CameraState.h:898
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: CameraState.h:946
Temperature & set(const Lens &value)
Set Lens
Definition: CameraState.h:843
Temperature & set(const DMD &value)
Set DMD
Definition: CameraState.h:786
const Lens & lens() const
Get Lens
Definition: CameraState.h:831
Temperature & set(const PCB &value)
Set PCB
Definition: CameraState.h:862
Temperature()
Default constructor
Lens & lens()
Get Lens
Definition: CameraState.h:837
friend std::ostream & operator<<(std::ostream &stream, const Temperature &value)
Operator to send the value as string to a stream
Definition: CameraState.h:965
PCB & pcb()
Get PCB
Definition: CameraState.h:856
const CameraState::Temperature::DMD & get() const
Definition: CameraState.h:870
std::tuple< CameraState::Temperature::DMD, CameraState::Temperature::General, CameraState::Temperature::LED, CameraState::Temperature::Lens, CameraState::Temperature::PCB > Descendants
Definition: CameraState.h:661
const CameraState::Temperature::LED & get() const
Definition: CameraState.h:884
Information about camera connection state, temperatures, etc.
Definition: CameraState.h:76
Available & isAvailable()
Get Available
Definition: CameraState.h:1124
const CameraState::Connected & get() const
Definition: CameraState.h:1216
CameraState copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition: CameraState.h:1100
void load(const std::string &fileName)
Load from the given file
CameraState(const std::string &fileName)
Construct CameraState by loading from file
CameraState & set(const Available &value)
Set Available
Definition: CameraState.h:1130
std::string toString() const
Get the value as string
CameraState & set(const Temperature::LED &value)
Set Temperature::LED
Definition: CameraState.h:1189
const CameraState::Temperature::PCB & get() const
Definition: CameraState.h:1257
friend std::ostream & operator<<(std::ostream &stream, const CameraState &value)
Operator to send the value as string to a stream
Definition: CameraState.h:1308
const CameraState::Temperature & get() const
Definition: CameraState.h:1222
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: CameraState.h:1291
void save(const std::string &fileName) const
Save to the given file
const CameraState::Temperature::General & get() const
Definition: CameraState.h:1236
const Connected & isConnected() const
Get Connected
Definition: CameraState.h:1137
const CameraState::Temperature::Lens & get() const
Definition: CameraState.h:1250
const Temperature & temperature() const
Get Temperature
Definition: CameraState.h:1156
CameraState & set(const Temperature::DMD &value)
Set Temperature::DMD
Definition: CameraState.h:1175
CameraState & set(const Temperature::Lens &value)
Set Temperature::Lens
Definition: CameraState.h:1196
bool operator!=(const CameraState &other) const
Inequality operator
const CameraState::Temperature::DMD & get() const
Definition: CameraState.h:1229
CameraState & set(const Connected &value)
Set Connected
Definition: CameraState.h:1149
Connected & isConnected()
Get Connected
Definition: CameraState.h:1143
CameraState & set(const Temperature::General &value)
Set Temperature::General
Definition: CameraState.h:1182
bool operator==(const CameraState &other) const
Equality operator
CameraState()
Default constructor
Temperature & temperature()
Get Temperature
Definition: CameraState.h:1162
CameraState & set(const Temperature &value)
Set Temperature
Definition: CameraState.h:1168
CameraState(Args &&...args)
Constructor taking variadic number of arguments
Definition: CameraState.h:1029
CameraState & set(const Temperature::PCB &value)
Set Temperature::PCB
Definition: CameraState.h:1203
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter
Definition: CameraState.h:1282
void set(Args &&...args)
Set multiple arguments
Definition: CameraState.h:1062
const CameraState::Available & get() const
Definition: CameraState.h:1210
const CameraState::Temperature::LED & get() const
Definition: CameraState.h:1243
const Available & isAvailable() const
Get Available
Definition: CameraState.h:1118
std::tuple< CameraState::Available, CameraState::Connected, CameraState::Temperature, CameraState::Temperature::DMD, CameraState::Temperature::General, CameraState::Temperature::LED, CameraState::Temperature::Lens, CameraState::Temperature::PCB > Descendants
Definition: CameraState.h:993
Class describing a range of values for a given type T
Definition: Range.h:58
NodeType
Definition: NodeType.h:56
The main Zivid namespace. All Zivid code is found here
Definition: Application.h:55