112 # pragma warning(push)
113 # pragma warning(disable : 4251)
126 static constexpr
const char *path{
"" };
129 static constexpr
const char *name{
"CameraState" };
132 static constexpr
const char *description{
133 R
"description(Information about camera connection state, temperatures, etc.)description"
136 static constexpr
size_t version{ 2 };
146 static constexpr std::array<uint8_t, 3> binaryId{
'c',
's',
't' };
158 static constexpr
const char *path{
"Available" };
161 static constexpr
const char *name{
"Available" };
164 static constexpr
const char *description{
165 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"
176 return {
false,
true };
194 explicit operator bool()
const
202 return m_value == other.m_value;
208 return m_value != other.m_value;
218 void setFromString(
const std::string &value);
220 bool m_value{
false };
222 friend struct DataModel::Detail::Befriend<
Available>;
233 static constexpr
const char *path{
"Connected" };
236 static constexpr
const char *name{
"Connected" };
239 static constexpr
const char *description{
240 R
"description(Flag if camera is connected in software)description"
251 return {
false,
true };
269 explicit operator bool()
const
277 return m_value == other.m_value;
283 return m_value != other.m_value;
293 void setFromString(
const std::string &value);
295 bool m_value{
false };
297 friend struct DataModel::Detail::Befriend<
Connected>;
308 static constexpr
const char *path{
"Temperature" };
311 static constexpr
const char *name{
"Temperature" };
314 static constexpr
const char *description{ R
"description(Current temperature(s))description" };
324 static constexpr
const char *path{
"Temperature/DMD" };
327 static constexpr
const char *name{
"DMD" };
330 static constexpr
const char *description{ R
"description(DMD temperature)description" };
338 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
345 explicit constexpr
DMD(
double value)
358 return m_value == other.m_value;
364 return m_value != other.m_value;
370 return m_value < other.m_value;
376 return m_value > other.m_value;
386 void setFromString(
const std::string &value);
388 double m_value{ 0.0 };
390 friend struct DataModel::Detail::Befriend<
DMD>;
401 static constexpr
const char *path{
"Temperature/General" };
404 static constexpr
const char *name{
"General" };
407 static constexpr
const char *description{ R
"description(General temperature)description" };
415 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
435 return m_value == other.m_value;
441 return m_value != other.m_value;
447 return m_value < other.m_value;
453 return m_value > other.m_value;
463 void setFromString(
const std::string &value);
465 double m_value{ 0.0 };
467 friend struct DataModel::Detail::Befriend<
General>;
478 static constexpr
const char *path{
"Temperature/LED" };
481 static constexpr
const char *name{
"LED" };
484 static constexpr
const char *description{ R
"description(LED temperature)description" };
492 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
499 explicit constexpr
LED(
double value)
512 return m_value == other.m_value;
518 return m_value != other.m_value;
524 return m_value < other.m_value;
530 return m_value > other.m_value;
540 void setFromString(
const std::string &value);
542 double m_value{ 0.0 };
544 friend struct DataModel::Detail::Befriend<
LED>;
555 static constexpr
const char *path{
"Temperature/Lens" };
558 static constexpr
const char *name{
"Lens" };
561 static constexpr
const char *description{ R
"description(Lens temperature)description" };
569 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
576 explicit constexpr
Lens(
double value)
589 return m_value == other.m_value;
595 return m_value != other.m_value;
601 return m_value < other.m_value;
607 return m_value > other.m_value;
617 void setFromString(
const std::string &value);
619 double m_value{ 0.0 };
621 friend struct DataModel::Detail::Befriend<
Lens>;
632 static constexpr
const char *path{
"Temperature/PCB" };
635 static constexpr
const char *name{
"PCB" };
638 static constexpr
const char *description{ R
"description(PCB temperature)description" };
646 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
653 explicit constexpr
PCB(
double value)
666 return m_value == other.m_value;
672 return m_value != other.m_value;
678 return m_value < other.m_value;
684 return m_value > other.m_value;
694 void setFromString(
const std::string &value);
696 double m_value{ 0.0 };
698 friend struct DataModel::Detail::Befriend<
PCB>;
726 template<
typename... Args,
727 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
728 typename std::enable_if<
729 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
730 typename std::decay<Args>::type...>::value,
733 template<typename... Args>
737 using namespace Zivid::Detail::TypeTraits;
739 static_assert(AllArgsDecayedAreUnique<Args...>::value,
740 "Found duplicate types among the arguments passed to Temperature(...). "
741 "Types should be listed at most once.");
743 set(std::forward<Args>(args)...);
761 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
763 template<typename... Args>
767 using namespace Zivid::Detail::TypeTraits;
769 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
770 static_assert(AllArgsAreDescendantNodes::value,
771 "All arguments passed to set(...) must be descendant nodes.");
773 static_assert(AllArgsDecayedAreUnique<Args...>::value,
774 "Found duplicate types among the arguments passed to set(...). "
775 "Types should be listed at most once.");
777 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
796 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
798 template<typename... Args>
802 using namespace Zivid::Detail::TypeTraits;
804 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
805 static_assert(AllArgsAreDescendantNodes::value,
806 "All arguments passed to copyWith(...) must be descendant nodes.");
808 static_assert(AllArgsDecayedAreUnique<Args...>::value,
809 "Found duplicate types among the arguments passed to copyWith(...). "
810 "Types should be listed at most once.");
813 copy.set(std::forward<Args>(args)...);
913 typename std::enable_if<std::is_same<T, CameraState::Temperature::DMD>::value,
int>::type = 0>
920 typename std::enable_if<std::is_same<T, CameraState::Temperature::General>::value,
int>::type = 0>
927 typename std::enable_if<std::is_same<T, CameraState::Temperature::LED>::value,
int>::type = 0>
934 typename std::enable_if<std::is_same<T, CameraState::Temperature::Lens>::value,
int>::type = 0>
941 typename std::enable_if<std::is_same<T, CameraState::Temperature::PCB>::value,
int>::type = 0>
947 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
953 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
959 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
965 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
971 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
1015 void setFromString(
const std::string &value);
1017 void setFromString(
const std::string &fullPath,
const std::string &value);
1019 std::string getString(
const std::string &fullPath)
const;
1027 friend struct DataModel::Detail::Befriend<
Temperature>;
1066 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
1067 typename std::enable_if<
1068 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::value,
1071 template<typename... Args>
1075 using namespace Zivid::Detail::TypeTraits;
1077 static_assert(AllArgsDecayedAreUnique<Args...>::value,
1078 "Found duplicate types among the arguments passed to CameraState(...). "
1079 "Types should be listed at most once.");
1081 set(std::forward<Args>(args)...);
1102 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
1104 template<typename... Args>
1108 using namespace Zivid::Detail::TypeTraits;
1110 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1111 static_assert(AllArgsAreDescendantNodes::value,
1112 "All arguments passed to set(...) must be descendant nodes.");
1114 static_assert(AllArgsDecayedAreUnique<Args...>::value,
1115 "Found duplicate types among the arguments passed to set(...). "
1116 "Types should be listed at most once.");
1118 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
1140 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
1142 template<typename... Args>
1146 using namespace Zivid::Detail::TypeTraits;
1148 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1149 static_assert(AllArgsAreDescendantNodes::value,
1150 "All arguments passed to copyWith(...) must be descendant nodes.");
1152 static_assert(AllArgsDecayedAreUnique<Args...>::value,
1153 "Found duplicate types among the arguments passed to copyWith(...). "
1154 "Types should be listed at most once.");
1157 copy.set(std::forward<Args>(args)...);
1176 m_available = value;
1195 m_connected = value;
1202 return m_temperature;
1208 return m_temperature;
1214 m_temperature = value;
1221 m_temperature.
set(value);
1228 m_temperature.
set(value);
1235 m_temperature.
set(value);
1242 m_temperature.
set(value);
1249 m_temperature.
set(value);
1253 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Available>::value,
int>::type = 0>
1259 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Connected>::value,
int>::type = 0>
1265 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Temperature>::value,
int>::type = 0>
1268 return m_temperature;
1271 template<
typename T,
1272 typename std::enable_if<std::is_same<T, CameraState::Temperature::DMD>::value,
int>::type = 0>
1278 template<
typename T,
1279 typename std::enable_if<std::is_same<T, CameraState::Temperature::General>::value,
int>::type = 0>
1285 template<
typename T,
1286 typename std::enable_if<std::is_same<T, CameraState::Temperature::LED>::value,
int>::type = 0>
1292 template<
typename T,
1293 typename std::enable_if<std::is_same<T, CameraState::Temperature::Lens>::value,
int>::type = 0>
1299 template<
typename T,
1300 typename std::enable_if<std::is_same<T, CameraState::Temperature::PCB>::value,
int>::type = 0>
1306 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1312 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1318 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1321 return m_temperature;
1325 template<
typename F>
1334 template<
typename F>
1358 void save(
const std::string &fileName)
const;
1361 void load(
const std::string &fileName);
1364 void setFromString(
const std::string &value);
1366 void setFromString(
const std::string &fullPath,
const std::string &value);
1368 std::string getString(
const std::string &fullPath)
const;
1374 friend struct DataModel::Detail::Befriend<
CameraState>;
1379 struct CameraState::Version<2>
1388 # pragma warning(pop)
1392 # if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
1396 struct tuple_size<
Zivid::CameraState::Temperature> : integral_constant<size_t, 5>
1400 struct tuple_element<i,
Zivid::CameraState::Temperature>
1402 static_assert(i < tuple_size<Zivid::CameraState::Temperature>::value,
"Index must be less than 5");
1405 = decltype(declval<Zivid::CameraState::Temperature>().get<i>());
1409 struct tuple_size<
Zivid::CameraState> : integral_constant<size_t, 3>
1413 struct tuple_element<i,
Zivid::CameraState>
1415 static_assert(i < tuple_size<Zivid::CameraState>::value,
"Index must be less than 3");
1418 = decltype(declval<Zivid::CameraState>().get<i>());
#define ZIVID_CORE_EXPORT
Definition: CoreExport.h:101
Flag if camera is physically connected to the computer, but not connected in software....
Definition: CameraState.h:152
static const Available no
Off/disabled.
Definition: CameraState.h:171
bool operator==(const Available &other) const
Comparison operator
Definition: CameraState.h:200
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:212
bool ValueType
The type of the underlying value
Definition: CameraState.h:169
static const Available yes
On/enabled.
Definition: CameraState.h:170
bool operator!=(const Available &other) const
Comparison operator
Definition: CameraState.h:206
constexpr Available(bool value)
Constructor
Definition: CameraState.h:183
bool value() const
Get the value
static std::set< bool > validValues()
All valid values of Available
Definition: CameraState.h:174
Available()=default
Default constructor
Flag if camera is connected in software
Definition: CameraState.h:227
Connected()=default
Default constructor
static const Connected yes
On/enabled.
Definition: CameraState.h:245
static std::set< bool > validValues()
All valid values of Connected
Definition: CameraState.h:249
static const Connected no
Off/disabled.
Definition: CameraState.h:246
bool operator!=(const Connected &other) const
Comparison operator
Definition: CameraState.h:281
friend std::ostream & operator<<(std::ostream &stream, const Connected &value)
Operator to serialize the value to a stream
Definition: CameraState.h:287
constexpr Connected(bool value)
Constructor
Definition: CameraState.h:258
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:275
bool ValueType
The type of the underlying value
Definition: CameraState.h:244
DMD temperature
Definition: CameraState.h:318
bool operator>(const DMD &other) const
Comparison operator
Definition: CameraState.h:374
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:362
bool operator<(const DMD &other) const
Comparison operator
Definition: CameraState.h:368
friend std::ostream & operator<<(std::ostream &stream, const DMD &value)
Operator to serialize the value to a stream
Definition: CameraState.h:380
double ValueType
The type of the underlying value
Definition: CameraState.h:333
static constexpr Range< double > validRange()
The range of valid values for DMD
Definition: CameraState.h:336
constexpr DMD(double value)
Constructor
Definition: CameraState.h:345
bool operator==(const DMD &other) const
Comparison operator
Definition: CameraState.h:356
DMD()=default
Default constructor
General temperature
Definition: CameraState.h:395
static constexpr Range< double > validRange()
The range of valid values for General
Definition: CameraState.h:413
double ValueType
The type of the underlying value
Definition: CameraState.h:410
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:445
constexpr General(double value)
Constructor
Definition: CameraState.h:422
bool operator==(const General &other) const
Comparison operator
Definition: CameraState.h:433
General()=default
Default constructor
bool operator!=(const General &other) const
Comparison operator
Definition: CameraState.h:439
bool operator>(const General &other) const
Comparison operator
Definition: CameraState.h:451
friend std::ostream & operator<<(std::ostream &stream, const General &value)
Operator to serialize the value to a stream
Definition: CameraState.h:457
LED temperature
Definition: CameraState.h:472
std::string toString() const
Get the value as string
bool operator<(const LED &other) const
Comparison operator
Definition: CameraState.h:522
double value() const
Get the value
LED()=default
Default constructor
constexpr LED(double value)
Constructor
Definition: CameraState.h:499
bool operator!=(const LED &other) const
Comparison operator
Definition: CameraState.h:516
bool operator==(const LED &other) const
Comparison operator
Definition: CameraState.h:510
bool operator>(const LED &other) const
Comparison operator
Definition: CameraState.h:528
friend std::ostream & operator<<(std::ostream &stream, const LED &value)
Operator to serialize the value to a stream
Definition: CameraState.h:534
double ValueType
The type of the underlying value
Definition: CameraState.h:487
static constexpr Range< double > validRange()
The range of valid values for LED
Definition: CameraState.h:490
Lens temperature
Definition: CameraState.h:549
double ValueType
The type of the underlying value
Definition: CameraState.h:564
bool operator==(const Lens &other) const
Comparison operator
Definition: CameraState.h:587
Lens()=default
Default constructor
double value() const
Get the value
bool operator>(const Lens &other) const
Comparison operator
Definition: CameraState.h:605
bool operator!=(const Lens &other) const
Comparison operator
Definition: CameraState.h:593
friend std::ostream & operator<<(std::ostream &stream, const Lens &value)
Operator to serialize the value to a stream
Definition: CameraState.h:611
std::string toString() const
Get the value as string
constexpr Lens(double value)
Constructor
Definition: CameraState.h:576
static constexpr Range< double > validRange()
The range of valid values for Lens
Definition: CameraState.h:567
bool operator<(const Lens &other) const
Comparison operator
Definition: CameraState.h:599
PCB temperature
Definition: CameraState.h:626
bool operator!=(const PCB &other) const
Comparison operator
Definition: CameraState.h:670
constexpr PCB(double value)
Constructor
Definition: CameraState.h:653
PCB()=default
Default constructor
bool operator==(const PCB &other) const
Comparison operator
Definition: CameraState.h:664
friend std::ostream & operator<<(std::ostream &stream, const PCB &value)
Operator to serialize the value to a stream
Definition: CameraState.h:688
static constexpr Range< double > validRange()
The range of valid values for PCB
Definition: CameraState.h:644
double value() const
Get the value
bool operator>(const PCB &other) const
Comparison operator
Definition: CameraState.h:682
double ValueType
The type of the underlying value
Definition: CameraState.h:641
std::string toString() const
Get the value as string
bool operator<(const PCB &other) const
Comparison operator
Definition: CameraState.h:676
Current temperature(s)
Definition: CameraState.h:302
DMD & dmd()
Get DMD
Definition: CameraState.h:824
const CameraState::Temperature::Lens & get() const
Definition: CameraState.h:935
LED & led()
Get LED
Definition: CameraState.h:862
const DMD & dmd() const
Get DMD
Definition: CameraState.h:818
const PCB & pcb() const
Get PCB
Definition: CameraState.h:894
const CameraState::Temperature::General & get() const
Definition: CameraState.h:921
bool operator!=(const Temperature &other) const
Inequality operator
Temperature & set(const General &value)
Set General
Definition: CameraState.h:849
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:979
Temperature(Args &&...args)
Constructor taking variadic number of arguments
Definition: CameraState.h:735
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:868
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:800
General & general()
Get General
Definition: CameraState.h:843
const LED & led() const
Get LED
Definition: CameraState.h:856
void set(Args &&...args)
Set multiple arguments
Definition: CameraState.h:765
const General & general() const
Get General
Definition: CameraState.h:837
const CameraState::Temperature::PCB & get() const
Definition: CameraState.h:942
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: CameraState.h:990
Temperature & set(const Lens &value)
Set Lens
Definition: CameraState.h:887
Temperature & set(const DMD &value)
Set DMD
Definition: CameraState.h:830
const Lens & lens() const
Get Lens
Definition: CameraState.h:875
Temperature & set(const PCB &value)
Set PCB
Definition: CameraState.h:906
Temperature()
Default constructor
Lens & lens()
Get Lens
Definition: CameraState.h:881
friend std::ostream & operator<<(std::ostream &stream, const Temperature &value)
Operator to send the value as string to a stream
Definition: CameraState.h:1009
PCB & pcb()
Get PCB
Definition: CameraState.h:900
const CameraState::Temperature::DMD & get() const
Definition: CameraState.h:914
std::tuple< CameraState::Temperature::DMD, CameraState::Temperature::General, CameraState::Temperature::LED, CameraState::Temperature::Lens, CameraState::Temperature::PCB > Descendants
Definition: CameraState.h:705
const CameraState::Temperature::LED & get() const
Definition: CameraState.h:928
Information about camera connection state, temperatures, etc.
Definition: CameraState.h:120
Available & isAvailable()
Get Available
Definition: CameraState.h:1168
const CameraState::Connected & get() const
Definition: CameraState.h:1260
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:1144
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:1174
std::string toString() const
Get the value as string
CameraState & set(const Temperature::LED &value)
Set Temperature::LED
Definition: CameraState.h:1233
const CameraState::Temperature::PCB & get() const
Definition: CameraState.h:1301
friend std::ostream & operator<<(std::ostream &stream, const CameraState &value)
Operator to send the value as string to a stream
Definition: CameraState.h:1352
const CameraState::Temperature & get() const
Definition: CameraState.h:1266
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter
Definition: CameraState.h:1335
void save(const std::string &fileName) const
Save to the given file
const CameraState::Temperature::General & get() const
Definition: CameraState.h:1280
const Connected & isConnected() const
Get Connected
Definition: CameraState.h:1181
const CameraState::Temperature::Lens & get() const
Definition: CameraState.h:1294
const Temperature & temperature() const
Get Temperature
Definition: CameraState.h:1200
CameraState & set(const Temperature::DMD &value)
Set Temperature::DMD
Definition: CameraState.h:1219
CameraState & set(const Temperature::Lens &value)
Set Temperature::Lens
Definition: CameraState.h:1240
bool operator!=(const CameraState &other) const
Inequality operator
const CameraState::Temperature::DMD & get() const
Definition: CameraState.h:1273
CameraState & set(const Connected &value)
Set Connected
Definition: CameraState.h:1193
Connected & isConnected()
Get Connected
Definition: CameraState.h:1187
CameraState & set(const Temperature::General &value)
Set Temperature::General
Definition: CameraState.h:1226
bool operator==(const CameraState &other) const
Equality operator
CameraState()
Default constructor
Temperature & temperature()
Get Temperature
Definition: CameraState.h:1206
CameraState & set(const Temperature &value)
Set Temperature
Definition: CameraState.h:1212
CameraState(Args &&...args)
Constructor taking variadic number of arguments
Definition: CameraState.h:1073
CameraState & set(const Temperature::PCB &value)
Set Temperature::PCB
Definition: CameraState.h:1247
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:1326
void set(Args &&...args)
Set multiple arguments
Definition: CameraState.h:1106
const CameraState::Available & get() const
Definition: CameraState.h:1254
const CameraState::Temperature::LED & get() const
Definition: CameraState.h:1287
const Available & isAvailable() const
Get Available
Definition: CameraState.h:1162
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:1037
Class describing a range of values for a given type T
Definition: Range.h:102
NodeType
Definition: NodeType.h:100
The main Zivid namespace. All Zivid code is found here
Definition: Application.h:99