69# pragma warning(disable : 4251)
85 static constexpr const char *path{
"" };
88 static constexpr const char *name{
"CameraState" };
91 static constexpr const char *description{
92 R
"description(Information about camera connection state, temperatures, etc.)description"
95 static constexpr size_t version{ 6 };
105 static constexpr std::array<uint8_t, 3> binaryId{
'c',
's',
't' };
122 static constexpr const char *path{
"Available" };
125 static constexpr const char *name{
"Available" };
128 static constexpr const char *description{
129 R
"description(Flag if camera is physically connected to the computer and is available for use, but not connected in
130software. This corresponds to the Status enums `available` or `firmwareUpdateRequired`. Zivid
131recommends to use the Status enum instead of this bool.
143 return {
false,
true };
161 explicit operator bool()
const
169 return m_value == other.m_value;
175 return m_value != other.m_value;
185 void setFromString(
const std::string &value);
187 bool m_value{
false };
189 friend struct DataModel::Detail::Befriend<
Available>;
204 static constexpr const char *path{
"Connected" };
207 static constexpr const char *name{
"Connected" };
210 static constexpr const char *description{
211 R
"description(Flag if camera is connected in software. This bool is true when the Status value is `connected`. Zivid
212recommends to use the Status enum instead of this bool.
224 return {
false,
true };
242 explicit operator bool()
const
250 return m_value == other.m_value;
256 return m_value != other.m_value;
266 void setFromString(
const std::string &value);
268 bool m_value{
false };
270 friend struct DataModel::Detail::Befriend<
Connected>;
283 static constexpr const char *path{
"InaccessibleReason" };
286 static constexpr const char *name{
"InaccessibleReason" };
289 static constexpr const char *description{
290 R
"description(If the camera status is `inaccessible`, then this enum value will give you the reason.)description"
296 ipConflictWithAnotherCamera,
297 ipConflictWithLocalNetworkAdapter,
299 ipInMultipleLocalSubnets
309 return { ValueType::ipConflictWithAnotherCamera,
310 ValueType::ipConflictWithLocalNetworkAdapter,
311 ValueType::ipNotInLocalSubnet,
312 ValueType::ipInMultipleLocalSubnets };
320 : m_opt{ verifyValue(value) }
347 return m_opt == other.m_opt;
353 return m_opt != other.m_opt;
363 void setFromString(
const std::string &value);
365 constexpr ValueType
static verifyValue(
const ValueType &value)
367 return value == ValueType::ipConflictWithAnotherCamera
368 || value == ValueType::ipConflictWithLocalNetworkAdapter
369 || value == ValueType::ipNotInLocalSubnet || value == ValueType::ipInMultipleLocalSubnets
371 :
throw std::invalid_argument{
372 "Invalid value: InaccessibleReason{ "
373 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value)) +
" }"
377 Zivid::DataModel::Detail::Optional<ValueType> m_opt;
392 static constexpr const char *path{
"Network" };
395 static constexpr const char *name{
"Network" };
398 static constexpr const char *description{ R
"description(Current network state)description" };
410 static constexpr const char *path{
"Network/IPV4" };
413 static constexpr const char *name{
"IPV4" };
416 static constexpr const char *description{ R
"description(Current IPv4 protocol state)description" };
428 static constexpr const char *path{
"Network/IPV4/Address" };
431 static constexpr const char *name{
"Address" };
434 static constexpr const char *description{ R
"description(Current IPv4 address)description" };
442 return { 0, std::numeric_limits<ValueType::size_type>::max() };
450 : m_value{ std::move(value) }
462 return m_value == other.m_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;
492 return m_value >= other.m_value;
502 void setFromString(
const std::string &value);
504 std::string m_value{};
506 friend struct DataModel::Detail::Befriend<
Address>;
509 using Descendants = std::tuple<CameraState::Network::IPV4::Address>;
528 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
529 typename std::enable_if<
530 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::
534 template<typename... Args>
538 using namespace Zivid::Detail::TypeTraits;
541 AllArgsDecayedAreUnique<Args...>::value,
542 "Found duplicate types among the arguments passed to IPV4(...). "
543 "Types should be listed at most once.");
545 set(std::forward<Args>(args)...);
559 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
561 template<typename... Args>
565 using namespace Zivid::Detail::TypeTraits;
567 using AllArgsAreDescendantNodes =
568 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
570 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
573 AllArgsDecayedAreUnique<Args...>::value,
574 "Found duplicate types among the arguments passed to set(...). "
575 "Types should be listed at most once.");
577 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
592 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
594 template<typename... Args>
598 using namespace Zivid::Detail::TypeTraits;
600 using AllArgsAreDescendantNodes =
601 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
603 AllArgsAreDescendantNodes::value,
604 "All arguments passed to copyWith(...) must be descendant nodes.");
607 AllArgsDecayedAreUnique<Args...>::value,
608 "Found duplicate types among the arguments passed to copyWith(...). "
609 "Types should be listed at most once.");
612 copy.
set(std::forward<Args>(args)...);
637 typename std::enable_if<std::is_same<T, CameraState::Network::IPV4::Address>::value,
int>::type = 0>
643 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
679 void setFromString(
const std::string &value);
681 void setFromString(
const std::string &fullPath,
const std::string &value);
683 std::string getString(
const std::string &fullPath)
const;
687 friend struct DataModel::Detail::Befriend<
IPV4>;
690 using Descendants = std::tuple<CameraState::Network::IPV4, CameraState::Network::IPV4::Address>;
710 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
711 typename std::enable_if<
712 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::
716 template<typename... Args>
720 using namespace Zivid::Detail::TypeTraits;
723 AllArgsDecayedAreUnique<Args...>::value,
724 "Found duplicate types among the arguments passed to Network(...). "
725 "Types should be listed at most once.");
727 set(std::forward<Args>(args)...);
742 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
744 template<typename... Args>
748 using namespace Zivid::Detail::TypeTraits;
750 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
752 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
755 AllArgsDecayedAreUnique<Args...>::value,
756 "Found duplicate types among the arguments passed to set(...). "
757 "Types should be listed at most once.");
759 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
775 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
777 template<typename... Args>
781 using namespace Zivid::Detail::TypeTraits;
783 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
785 AllArgsAreDescendantNodes::value,
786 "All arguments passed to copyWith(...) must be descendant nodes.");
789 AllArgsDecayedAreUnique<Args...>::value,
790 "Found duplicate types among the arguments passed to copyWith(...). "
791 "Types should be listed at most once.");
794 copy.
set(std::forward<Args>(args)...);
826 typename std::enable_if<std::is_same<T, CameraState::Network::IPV4>::value,
int>::type = 0>
834 typename std::enable_if<std::is_same<T, CameraState::Network::IPV4::Address>::value,
int>::type = 0>
840 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
876 void setFromString(
const std::string &value);
878 void setFromString(
const std::string &fullPath,
const std::string &value);
880 std::string getString(
const std::string &fullPath)
const;
884 friend struct DataModel::Detail::Befriend<
Network>;
930 static constexpr const char *path{
"Status" };
933 static constexpr const char *name{
"Status" };
936 static constexpr const char *description{
937 R
"description(This enum describes the current status of this camera. The enum can have the following values:
939* `inaccessible`: The camera was discovered, but the SDK is not able to connect to this camera. This can
940 be because the IP settings of the camera and the PC are not compatible, or because there are several
941 cameras with the same IP connected to your PC. The `InaccessibleReason` enum will give you more
942 details about why this camera is not accessible. The network configuration of the camera can be changed
943 using the ZividNetworkCameraConfigurator CLI tool. See the knowledge base for more information.
945* `busy`: The camera is currently in use by another process. This can be a different process on the same
946 PC, or on a different PC if the camera is shared on a network.
948* `applyingNetworkConfiguration`: The camera network configuration is being changed by the current process.
950* `firmwareUpdateRequired`: The camera is accessible, but requires a firmware update before you can connect
953* `updatingFirmware`: The camera firmware is currently being updated in the current process.
955* `available`: The camera is available for use by the current process. This means that you can invoke
956 camera.connect() on this camera.
958* `connecting`: The camera is currently connecting in the current process.
960* `connected`: The camera is connected in the current process. This means camera.connect() has successfully
961 completed and you can capture using this camera.
963* `disconnecting`: The camera is currently disconnecting in the current process. When disconnection has
964 completed, the camera will normally go back to the `available` state.
966* `disappeared`: The camera was found earlier, but it can no longer be found. The connection between the
967 PC and the camera may be disrupted, or the camera may have lost power. When in `disappeared` state, the
968 camera will not be returned from `Application::cameras()`. The camera will go back to one of the other
969 states if the camera is later found again.
978 applyingNetworkConfiguration,
979 firmwareUpdateRequired,
1001 return { ValueType::inaccessible,
1003 ValueType::applyingNetworkConfiguration,
1004 ValueType::firmwareUpdateRequired,
1005 ValueType::updatingFirmware,
1006 ValueType::available,
1007 ValueType::connecting,
1008 ValueType::connected,
1009 ValueType::disconnecting,
1010 ValueType::disappeared };
1018 : m_value{ verifyValue(value) }
1036 return m_value == other.m_value;
1042 return m_value != other.m_value;
1052 void setFromString(
const std::string &value);
1054 constexpr ValueType
static verifyValue(
const ValueType &value)
1056 return value == ValueType::inaccessible || value == ValueType::busy
1057 || value == ValueType::applyingNetworkConfiguration
1058 || value == ValueType::firmwareUpdateRequired || value == ValueType::updatingFirmware
1059 || value == ValueType::available || value == ValueType::connecting
1060 || value == ValueType::connected || value == ValueType::disconnecting
1061 || value == ValueType::disappeared
1063 :
throw std::invalid_argument{
1064 "Invalid value: Status{ "
1065 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value)) +
" }"
1071 friend struct DataModel::Detail::Befriend<
Status>;
1084 static constexpr const char *path{
"Temperature" };
1087 static constexpr const char *name{
"Temperature" };
1090 static constexpr const char *description{ R
"description(Current temperature(s))description" };
1102 static constexpr const char *path{
"Temperature/DMD" };
1105 static constexpr const char *name{
"DMD" };
1108 static constexpr const char *description{ R
"description(DMD temperature)description" };
1116 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
1123 explicit constexpr DMD(
double value)
1136 return m_value == other.m_value;
1142 return m_value != other.m_value;
1148 return m_value < other.m_value;
1154 return m_value > other.m_value;
1160 return m_value <= other.m_value;
1166 return m_value >= other.m_value;
1176 void setFromString(
const std::string &value);
1178 double m_value{ 0.0 };
1180 friend struct DataModel::Detail::Befriend<
DMD>;
1193 static constexpr const char *path{
"Temperature/General" };
1196 static constexpr const char *name{
"General" };
1199 static constexpr const char *description{ R
"description(General temperature)description" };
1207 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
1227 return m_value == other.m_value;
1233 return m_value != other.m_value;
1239 return m_value < other.m_value;
1245 return m_value > other.m_value;
1251 return m_value <= other.m_value;
1257 return m_value >= other.m_value;
1267 void setFromString(
const std::string &value);
1269 double m_value{ 0.0 };
1271 friend struct DataModel::Detail::Befriend<
General>;
1284 static constexpr const char *path{
"Temperature/LED" };
1287 static constexpr const char *name{
"LED" };
1290 static constexpr const char *description{ R
"description(LED temperature)description" };
1298 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
1305 explicit constexpr LED(
double value)
1318 return m_value == other.m_value;
1324 return m_value != other.m_value;
1330 return m_value < other.m_value;
1336 return m_value > other.m_value;
1342 return m_value <= other.m_value;
1348 return m_value >= other.m_value;
1358 void setFromString(
const std::string &value);
1360 double m_value{ 0.0 };
1362 friend struct DataModel::Detail::Befriend<
LED>;
1375 static constexpr const char *path{
"Temperature/Lens" };
1378 static constexpr const char *name{
"Lens" };
1381 static constexpr const char *description{ R
"description(Lens temperature)description" };
1389 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
1396 explicit constexpr Lens(
double value)
1409 return m_value == other.m_value;
1415 return m_value != other.m_value;
1421 return m_value < other.m_value;
1427 return m_value > other.m_value;
1433 return m_value <= other.m_value;
1439 return m_value >= other.m_value;
1449 void setFromString(
const std::string &value);
1451 double m_value{ 0.0 };
1453 friend struct DataModel::Detail::Befriend<
Lens>;
1466 static constexpr const char *path{
"Temperature/PCB" };
1469 static constexpr const char *name{
"PCB" };
1472 static constexpr const char *description{ R
"description(PCB temperature)description" };
1480 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
1487 explicit constexpr PCB(
double value)
1500 return m_value == other.m_value;
1506 return m_value != other.m_value;
1512 return m_value < other.m_value;
1518 return m_value > other.m_value;
1524 return m_value <= other.m_value;
1530 return m_value >= other.m_value;
1540 void setFromString(
const std::string &value);
1542 double m_value{ 0.0 };
1544 friend struct DataModel::Detail::Befriend<
PCB>;
1575 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
1576 typename std::enable_if<
1577 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::
1581 template<typename... Args>
1585 using namespace Zivid::Detail::TypeTraits;
1588 AllArgsDecayedAreUnique<Args...>::value,
1589 "Found duplicate types among the arguments passed to Temperature(...). "
1590 "Types should be listed at most once.");
1592 set(std::forward<Args>(args)...);
1610 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
1612 template<typename... Args>
1616 using namespace Zivid::Detail::TypeTraits;
1618 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1620 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
1623 AllArgsDecayedAreUnique<Args...>::value,
1624 "Found duplicate types among the arguments passed to set(...). "
1625 "Types should be listed at most once.");
1627 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
1646 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
1648 template<typename... Args>
1652 using namespace Zivid::Detail::TypeTraits;
1654 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1656 AllArgsAreDescendantNodes::value,
1657 "All arguments passed to copyWith(...) must be descendant nodes.");
1660 AllArgsDecayedAreUnique<Args...>::value,
1661 "Found duplicate types among the arguments passed to copyWith(...). "
1662 "Types should be listed at most once.");
1665 copy.
set(std::forward<Args>(args)...);
1766 typename std::enable_if<std::is_same<T, CameraState::Temperature::DMD>::value,
int>::type = 0>
1774 typename std::enable_if<std::is_same<T, CameraState::Temperature::General>::value,
int>::type = 0>
1782 typename std::enable_if<std::is_same<T, CameraState::Temperature::LED>::value,
int>::type = 0>
1790 typename std::enable_if<std::is_same<T, CameraState::Temperature::Lens>::value,
int>::type = 0>
1798 typename std::enable_if<std::is_same<T, CameraState::Temperature::PCB>::value,
int>::type = 0>
1804 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1810 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1816 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1822 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
1828 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
1835 template<
typename F>
1846 template<
typename F>
1872 void setFromString(
const std::string &value);
1874 void setFromString(
const std::string &fullPath,
const std::string &value);
1876 std::string getString(
const std::string &fullPath)
const;
1884 friend struct DataModel::Detail::Befriend<
Temperature>;
1948 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
1949 typename std::enable_if<
1950 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::value,
1953 template<typename... Args>
1957 using namespace Zivid::Detail::TypeTraits;
1960 AllArgsDecayedAreUnique<Args...>::value,
1961 "Found duplicate types among the arguments passed to CameraState(...). "
1962 "Types should be listed at most once.");
1964 set(std::forward<Args>(args)...);
1990 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
1992 template<typename... Args>
1996 using namespace Zivid::Detail::TypeTraits;
1998 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2000 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
2003 AllArgsDecayedAreUnique<Args...>::value,
2004 "Found duplicate types among the arguments passed to set(...). "
2005 "Types should be listed at most once.");
2007 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
2034 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
2036 template<typename... Args>
2040 using namespace Zivid::Detail::TypeTraits;
2042 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2044 AllArgsAreDescendantNodes::value,
"All arguments passed to copyWith(...) must be descendant nodes.");
2047 AllArgsDecayedAreUnique<Args...>::value,
2048 "Found duplicate types among the arguments passed to copyWith(...). "
2049 "Types should be listed at most once.");
2052 copy.
set(std::forward<Args>(args)...);
2071 m_available = value;
2090 m_connected = value;
2097 return m_inaccessibleReason;
2103 return m_inaccessibleReason;
2109 m_inaccessibleReason = value;
2135 m_network.
set(value);
2142 m_network.
set(value);
2168 return m_temperature;
2174 return m_temperature;
2180 m_temperature = value;
2187 m_temperature.
set(value);
2194 m_temperature.
set(value);
2201 m_temperature.
set(value);
2208 m_temperature.
set(value);
2215 m_temperature.
set(value);
2219 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Available>::value,
int>::type = 0>
2225 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Connected>::value,
int>::type = 0>
2233 typename std::enable_if<std::is_same<T, CameraState::InaccessibleReason>::value,
int>::type = 0>
2236 return m_inaccessibleReason;
2239 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Network>::value,
int>::type = 0>
2245 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Network::IPV4>::value,
int>::type = 0>
2253 typename std::enable_if<std::is_same<T, CameraState::Network::IPV4::Address>::value,
int>::type = 0>
2259 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Status>::value,
int>::type = 0>
2265 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Temperature>::value,
int>::type = 0>
2268 return m_temperature;
2273 typename std::enable_if<std::is_same<T, CameraState::Temperature::DMD>::value,
int>::type = 0>
2281 typename std::enable_if<std::is_same<T, CameraState::Temperature::General>::value,
int>::type = 0>
2289 typename std::enable_if<std::is_same<T, CameraState::Temperature::LED>::value,
int>::type = 0>
2297 typename std::enable_if<std::is_same<T, CameraState::Temperature::Lens>::value,
int>::type = 0>
2305 typename std::enable_if<std::is_same<T, CameraState::Temperature::PCB>::value,
int>::type = 0>
2311 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2317 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2323 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
2326 return m_inaccessibleReason;
2329 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
2335 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
2341 template<size_t i, typename std::enable_if<i == 5, int>::type = 0>
2344 return m_temperature;
2348 template<
typename F>
2353 f(m_inaccessibleReason);
2360 template<
typename F>
2365 f(m_inaccessibleReason);
2387 void save(
const std::string &fileName)
const;
2390 void load(
const std::string &fileName);
2393 void setFromString(
const std::string &value);
2395 void setFromString(
const std::string &fullPath,
const std::string &value);
2397 std::string getString(
const std::string &fullPath)
const;
2406 friend struct DataModel::Detail::Befriend<
CameraState>;
2420 struct CameraState::Version<6>
2422 using Type = CameraState;
2429# pragma warning(pop)
2433# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
2438 struct tuple_size<
Zivid::CameraState::Network> : integral_constant<size_t, 1>
2442 struct tuple_element<i,
Zivid::CameraState::Network>
2444 static_assert(i < tuple_size<Zivid::CameraState::Network>::value,
"Index must be less than 1");
2447 =
decltype(declval<Zivid::CameraState::Network>().get<i>());
2451 struct tuple_size<
Zivid::CameraState::Network::IPV4> : integral_constant<size_t, 1>
2455 struct tuple_element<i,
Zivid::CameraState::Network::IPV4>
2457 static_assert(i < tuple_size<Zivid::CameraState::Network::IPV4>::value,
"Index must be less than 1");
2460 =
decltype(declval<Zivid::CameraState::Network::IPV4>().get<i>());
2464 struct tuple_size<
Zivid::CameraState::Temperature> : integral_constant<size_t, 5>
2468 struct tuple_element<i,
Zivid::CameraState::Temperature>
2470 static_assert(i < tuple_size<Zivid::CameraState::Temperature>::value,
"Index must be less than 5");
2473 =
decltype(declval<Zivid::CameraState::Temperature>().get<i>());
2477 struct tuple_size<
Zivid::CameraState> : integral_constant<size_t, 6>
2481 struct tuple_element<i,
Zivid::CameraState>
2483 static_assert(i < tuple_size<Zivid::CameraState>::value,
"Index must be less than 6");
2486 =
decltype(declval<Zivid::CameraState>().get<i>());
2495#if defined(__has_include) && !defined(NO_DOC)
2496# if __has_include("Zivid/CameraStateInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
2497# include "Zivid/CameraStateInternal.h"
#define ZIVID_NODISCARD
Definition Attributes.h:49
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
Flag if camera is physically connected to the computer and is available for use, but not connected in...
Definition CameraState.h:116
static std::set< bool > validValues()
All valid values of Available.
Definition CameraState.h:141
static const Available no
Off/disabled.
Definition CameraState.h:138
bool operator==(const Available &other) const
Comparison operator.
Definition CameraState.h:167
std::string toString() const
Get the value as string.
bool ValueType
The type of the underlying value.
Definition CameraState.h:136
static const Available yes
On/enabled.
Definition CameraState.h:137
friend std::ostream & operator<<(std::ostream &stream, const Available &value)
Operator to serialize the value to a stream.
Definition CameraState.h:179
bool operator!=(const Available &other) const
Comparison operator.
Definition CameraState.h:173
constexpr Available(bool value)
Constructor.
Definition CameraState.h:150
bool value() const
Get the value.
Available()=default
Default constructor.
Flag if camera is connected in software. This bool is true when the Status value is connected....
Definition CameraState.h:198
Connected()=default
Default constructor.
static const Connected yes
On/enabled.
Definition CameraState.h:218
static const Connected no
Off/disabled.
Definition CameraState.h:219
bool operator!=(const Connected &other) const
Comparison operator.
Definition CameraState.h:254
constexpr Connected(bool value)
Constructor.
Definition CameraState.h:231
bool value() const
Get the value.
std::string toString() const
Get the value as string.
friend std::ostream & operator<<(std::ostream &stream, const Connected &value)
Operator to serialize the value to a stream.
Definition CameraState.h:260
static std::set< bool > validValues()
All valid values of Connected.
Definition CameraState.h:222
bool operator==(const Connected &other) const
Comparison operator.
Definition CameraState.h:248
bool ValueType
The type of the underlying value.
Definition CameraState.h:217
If the camera status is inaccessible, then this enum value will give you the reason.
Definition CameraState.h:277
static const InaccessibleReason ipNotInLocalSubnet
ipNotInLocalSubnet
Definition CameraState.h:303
constexpr InaccessibleReason(ValueType value)
Constructor.
Definition CameraState.h:319
bool hasValue() const
Check if the value is set.
static const InaccessibleReason ipConflictWithAnotherCamera
ipConflictWithAnotherCamera
Definition CameraState.h:301
friend std::ostream & operator<<(std::ostream &stream, const InaccessibleReason::ValueType &value)
Operator to serialize ValueType to a stream.
Definition CameraState.h:339
bool operator==(const InaccessibleReason &other) const
Comparison operator.
Definition CameraState.h:345
std::string toString() const
Get the value as string.
friend std::ostream & operator<<(std::ostream &stream, const InaccessibleReason &value)
Operator to serialize the value to a stream.
Definition CameraState.h:357
static const InaccessibleReason ipConflictWithLocalNetworkAdapter
ipConflictWithLocalNetworkAdapter
Definition CameraState.h:302
InaccessibleReason()=default
Default constructor.
static const InaccessibleReason ipInMultipleLocalSubnets
ipInMultipleLocalSubnets
Definition CameraState.h:304
ValueType
The type of the underlying value.
Definition CameraState.h:295
ValueType value() const
Get the value.
void reset()
Reset the node to unset state.
bool operator!=(const InaccessibleReason &other) const
Comparison operator.
Definition CameraState.h:351
static std::set< ValueType > validValues()
All valid values of InaccessibleReason.
Definition CameraState.h:307
Current IPv4 address.
Definition CameraState.h:422
Address()=default
Default constructor.
bool operator<(const Address &other) const
Comparison operator.
Definition CameraState.h:472
bool operator==(const Address &other) const
Comparison operator.
Definition CameraState.h:460
bool operator<=(const Address &other) const
Comparison operator.
Definition CameraState.h:484
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Address.
Definition CameraState.h:440
bool operator>(const Address &other) const
Comparison operator.
Definition CameraState.h:478
bool operator!=(const Address &other) const
Comparison operator.
Definition CameraState.h:466
const std::string & value() const
Get the value.
friend std::ostream & operator<<(std::ostream &stream, const Address &value)
Operator to serialize the value to a stream.
Definition CameraState.h:496
bool operator>=(const Address &other) const
Comparison operator.
Definition CameraState.h:490
Address(std::string value)
Constructor.
Definition CameraState.h:449
std::string toString() const
Get the value as string.
std::string ValueType
The type of the underlying value.
Definition CameraState.h:437
Current IPv4 protocol state.
Definition CameraState.h:404
IPV4()
Default constructor.
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:563
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:651
const Address & address() const
Get Address.
Definition CameraState.h:617
friend std::ostream & operator<<(std::ostream &stream, const IPV4 &value)
Operator to send the value as string to a stream.
Definition CameraState.h:673
IPV4 copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraState.h:596
const CameraState::Network::IPV4::Address & get() const
Definition CameraState.h:638
bool operator==(const IPV4 &other) const
Equality operator.
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:658
IPV4 & set(const Address &value)
Set Address.
Definition CameraState.h:629
std::string toString() const
Get the value as string.
std::tuple< CameraState::Network::IPV4::Address > Descendants
Definition CameraState.h:509
Address & address()
Get Address.
Definition CameraState.h:623
bool operator!=(const IPV4 &other) const
Inequality operator.
Current network state.
Definition CameraState.h:386
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:746
std::tuple< CameraState::Network::IPV4, CameraState::Network::IPV4::Address > Descendants
Definition CameraState.h:690
std::string toString() const
Get the value as string.
friend std::ostream & operator<<(std::ostream &stream, const Network &value)
Operator to send the value as string to a stream.
Definition CameraState.h:870
bool operator==(const Network &other) const
Equality operator.
Network()
Default constructor.
Network & set(const IPV4 &value)
Set IPV4.
Definition CameraState.h:811
Network copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraState.h:779
const CameraState::Network::IPV4::Address & get() const
Definition CameraState.h:835
const CameraState::Network::IPV4 & get() const
Definition CameraState.h:827
Network & set(const IPV4::Address &value)
Set IPV4::Address.
Definition CameraState.h:818
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:855
IPV4 & ipv4()
Get IPV4.
Definition CameraState.h:805
bool operator!=(const Network &other) const
Inequality operator.
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:848
const IPV4 & ipv4() const
Get IPV4.
Definition CameraState.h:799
This enum describes the current status of this camera. The enum can have the following values:
Definition CameraState.h:924
constexpr Status(ValueType value)
Constructor.
Definition CameraState.h:1017
static std::set< ValueType > validValues()
All valid values of Status.
Definition CameraState.h:999
static const Status connected
connected
Definition CameraState.h:994
static const Status disconnecting
disconnecting
Definition CameraState.h:995
static const Status inaccessible
inaccessible
Definition CameraState.h:987
std::string toString() const
Get the value as string.
ValueType
The type of the underlying value.
Definition CameraState.h:975
static const Status applyingNetworkConfiguration
applyingNetworkConfiguration
Definition CameraState.h:989
friend std::ostream & operator<<(std::ostream &stream, const Status &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1046
static const Status firmwareUpdateRequired
firmwareUpdateRequired
Definition CameraState.h:990
ValueType value() const
Get the value.
bool operator!=(const Status &other) const
Comparison operator.
Definition CameraState.h:1040
static const Status connecting
connecting
Definition CameraState.h:993
bool operator==(const Status &other) const
Comparison operator.
Definition CameraState.h:1034
static const Status busy
busy
Definition CameraState.h:988
Status()=default
Default constructor.
static const Status available
available
Definition CameraState.h:992
static const Status updatingFirmware
updatingFirmware
Definition CameraState.h:991
static const Status disappeared
disappeared
Definition CameraState.h:996
friend std::ostream & operator<<(std::ostream &stream, const Status::ValueType &value)
Operator to serialize ValueType to a stream.
Definition CameraState.h:1028
DMD temperature.
Definition CameraState.h:1096
bool operator>(const DMD &other) const
Comparison operator.
Definition CameraState.h:1152
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:1140
bool operator<(const DMD &other) const
Comparison operator.
Definition CameraState.h:1146
bool operator>=(const DMD &other) const
Comparison operator.
Definition CameraState.h:1164
double ValueType
The type of the underlying value.
Definition CameraState.h:1111
bool operator<=(const DMD &other) const
Comparison operator.
Definition CameraState.h:1158
friend std::ostream & operator<<(std::ostream &stream, const DMD &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1170
constexpr DMD(double value)
Constructor.
Definition CameraState.h:1123
bool operator==(const DMD &other) const
Comparison operator.
Definition CameraState.h:1134
static constexpr Range< double > validRange()
The range of valid values for DMD.
Definition CameraState.h:1114
DMD()=default
Default constructor.
General temperature.
Definition CameraState.h:1187
double ValueType
The type of the underlying value.
Definition CameraState.h:1202
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:1237
constexpr General(double value)
Constructor.
Definition CameraState.h:1214
static constexpr Range< double > validRange()
The range of valid values for General.
Definition CameraState.h:1205
bool operator==(const General &other) const
Comparison operator.
Definition CameraState.h:1225
General()=default
Default constructor.
bool operator<=(const General &other) const
Comparison operator.
Definition CameraState.h:1249
bool operator!=(const General &other) const
Comparison operator.
Definition CameraState.h:1231
bool operator>(const General &other) const
Comparison operator.
Definition CameraState.h:1243
friend std::ostream & operator<<(std::ostream &stream, const General &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1261
bool operator>=(const General &other) const
Comparison operator.
Definition CameraState.h:1255
LED temperature.
Definition CameraState.h:1278
bool operator<=(const LED &other) const
Comparison operator.
Definition CameraState.h:1340
std::string toString() const
Get the value as string.
bool operator<(const LED &other) const
Comparison operator.
Definition CameraState.h:1328
double value() const
Get the value.
LED()=default
Default constructor.
constexpr LED(double value)
Constructor.
Definition CameraState.h:1305
friend std::ostream & operator<<(std::ostream &stream, const LED &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1352
bool operator!=(const LED &other) const
Comparison operator.
Definition CameraState.h:1322
bool operator==(const LED &other) const
Comparison operator.
Definition CameraState.h:1316
bool operator>=(const LED &other) const
Comparison operator.
Definition CameraState.h:1346
bool operator>(const LED &other) const
Comparison operator.
Definition CameraState.h:1334
static constexpr Range< double > validRange()
The range of valid values for LED.
Definition CameraState.h:1296
double ValueType
The type of the underlying value.
Definition CameraState.h:1293
Lens temperature.
Definition CameraState.h:1369
double ValueType
The type of the underlying value.
Definition CameraState.h:1384
bool operator==(const Lens &other) const
Comparison operator.
Definition CameraState.h:1407
Lens()=default
Default constructor.
bool operator<=(const Lens &other) const
Comparison operator.
Definition CameraState.h:1431
double value() const
Get the value.
bool operator>(const Lens &other) const
Comparison operator.
Definition CameraState.h:1425
bool operator!=(const Lens &other) const
Comparison operator.
Definition CameraState.h:1413
bool operator>=(const Lens &other) const
Comparison operator.
Definition CameraState.h:1437
std::string toString() const
Get the value as string.
constexpr Lens(double value)
Constructor.
Definition CameraState.h:1396
static constexpr Range< double > validRange()
The range of valid values for Lens.
Definition CameraState.h:1387
bool operator<(const Lens &other) const
Comparison operator.
Definition CameraState.h:1419
friend std::ostream & operator<<(std::ostream &stream, const Lens &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1443
PCB temperature.
Definition CameraState.h:1460
bool operator!=(const PCB &other) const
Comparison operator.
Definition CameraState.h:1504
constexpr PCB(double value)
Constructor.
Definition CameraState.h:1487
static constexpr Range< double > validRange()
The range of valid values for PCB.
Definition CameraState.h:1478
bool operator>=(const PCB &other) const
Comparison operator.
Definition CameraState.h:1528
PCB()=default
Default constructor.
bool operator<=(const PCB &other) const
Comparison operator.
Definition CameraState.h:1522
friend std::ostream & operator<<(std::ostream &stream, const PCB &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1534
bool operator==(const PCB &other) const
Comparison operator.
Definition CameraState.h:1498
double value() const
Get the value.
bool operator>(const PCB &other) const
Comparison operator.
Definition CameraState.h:1516
double ValueType
The type of the underlying value.
Definition CameraState.h:1475
std::string toString() const
Get the value as string.
bool operator<(const PCB &other) const
Comparison operator.
Definition CameraState.h:1510
Current temperature(s)
Definition CameraState.h:1078
DMD & dmd()
Get DMD.
Definition CameraState.h:1676
Temperature & set(const General &value)
Set General.
Definition CameraState.h:1701
const PCB & pcb() const
Get PCB.
Definition CameraState.h:1746
const CameraState::Temperature::Lens & get() const
Definition CameraState.h:1791
Temperature & set(const Lens &value)
Set Lens.
Definition CameraState.h:1739
const CameraState::Temperature::DMD & get() const
Definition CameraState.h:1767
const CameraState::Temperature::PCB & get() const
Definition CameraState.h:1799
const CameraState::Temperature::General & get() const
Definition CameraState.h:1775
Temperature & set(const PCB &value)
Set PCB.
Definition CameraState.h:1758
const General & general() const
Get General.
Definition CameraState.h:1689
bool operator!=(const Temperature &other) const
Inequality operator.
const LED & led() const
Get LED.
Definition CameraState.h:1708
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:1836
friend std::ostream & operator<<(std::ostream &stream, const Temperature &value)
Operator to send the value as string to a stream.
Definition CameraState.h:1866
Temperature & set(const LED &value)
Set LED.
Definition CameraState.h:1720
std::string toString() const
Get the value as string.
LED & led()
Get LED.
Definition CameraState.h:1714
bool operator==(const Temperature &other) const
Equality operator.
const Lens & lens() const
Get Lens.
Definition CameraState.h:1727
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:1650
General & general()
Get General.
Definition CameraState.h:1695
std::tuple< CameraState::Temperature::DMD, CameraState::Temperature::General, CameraState::Temperature::LED, CameraState::Temperature::Lens, CameraState::Temperature::PCB > Descendants
Definition CameraState.h:1547
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:1614
const DMD & dmd() const
Get DMD.
Definition CameraState.h:1670
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:1847
const CameraState::Temperature::LED & get() const
Definition CameraState.h:1783
Lens & lens()
Get Lens.
Definition CameraState.h:1733
Temperature()
Default constructor.
Temperature & set(const DMD &value)
Set DMD.
Definition CameraState.h:1682
PCB & pcb()
Get PCB.
Definition CameraState.h:1752
Information about camera connection state, temperatures, etc.
Definition CameraState.h:79
static ZIVID_NODISCARD CameraState fromSerialized(const std::string &value)
Construct a new CameraState instance from a previously serialized string.
const Temperature & temperature() const
Get Temperature.
Definition CameraState.h:2166
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:2038
const CameraState::Network::IPV4 & get() const
Definition CameraState.h:2246
const CameraState::Temperature::Lens & get() const
Definition CameraState.h:2298
void load(const std::string &fileName)
Load from the given file.
CameraState(const std::string &fileName)
Construct CameraState by loading from file.
std::string serialize() const
Serialize to a string.
CameraState & set(const Temperature &value)
Set Temperature.
Definition CameraState.h:2178
const CameraState::Connected & get() const
Definition CameraState.h:2226
Temperature & temperature()
Get Temperature.
Definition CameraState.h:2172
const CameraState::Temperature::General & get() const
Definition CameraState.h:2282
std::string toString() const
Get the value as string.
CameraState & set(const Network &value)
Set Network.
Definition CameraState.h:2126
const CameraState::Status & get() const
Definition CameraState.h:2260
const CameraState::InaccessibleReason & get() const
Definition CameraState.h:2234
const CameraState::Available & get() const
Definition CameraState.h:2220
const CameraState::Network::IPV4::Address & get() const
Definition CameraState.h:2254
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:2361
void save(const std::string &fileName) const
Save to the given file.
const CameraState::Network & get() const
Definition CameraState.h:2240
const CameraState::Temperature::PCB & get() const
Definition CameraState.h:2306
CameraState & set(const Temperature::PCB &value)
Set Temperature::PCB.
Definition CameraState.h:2213
const InaccessibleReason & inaccessibleReason() const
Get InaccessibleReason.
Definition CameraState.h:2095
const CameraState::Temperature::LED & get() const
Definition CameraState.h:2290
CameraState & set(const Temperature::General &value)
Set Temperature::General.
Definition CameraState.h:2192
friend std::ostream & operator<<(std::ostream &stream, const CameraState &value)
Operator to send the value as string to a stream.
Definition CameraState.h:2381
bool operator!=(const CameraState &other) const
Inequality operator.
CameraState & set(const Network::IPV4 &value)
Set Network::IPV4.
Definition CameraState.h:2133
CameraState & set(const Network::IPV4::Address &value)
Set Network::IPV4::Address.
Definition CameraState.h:2140
std::tuple< CameraState::Available, CameraState::Connected, CameraState::InaccessibleReason, CameraState::Network, CameraState::Network::IPV4, CameraState::Network::IPV4::Address, CameraState::Status, CameraState::Temperature, CameraState::Temperature::DMD, CameraState::Temperature::General, CameraState::Temperature::LED, CameraState::Temperature::Lens, CameraState::Temperature::PCB > Descendants
Definition CameraState.h:1887
Status & status()
Get Status.
Definition CameraState.h:2153
const Available & isAvailable() const
Get Available.
Definition CameraState.h:2057
const Status & status() const
Get Status.
Definition CameraState.h:2147
Connected & isConnected()
Get Connected.
Definition CameraState.h:2082
CameraState & set(const Temperature::Lens &value)
Set Temperature::Lens.
Definition CameraState.h:2206
CameraState & set(const Available &value)
Set Available.
Definition CameraState.h:2069
CameraState & set(const Temperature::DMD &value)
Set Temperature::DMD.
Definition CameraState.h:2185
bool operator==(const CameraState &other) const
Equality operator.
CameraState()
Default constructor.
CameraState & set(const Status &value)
Set Status.
Definition CameraState.h:2159
CameraState & set(const InaccessibleReason &value)
Set InaccessibleReason.
Definition CameraState.h:2107
CameraState & set(const Connected &value)
Set Connected.
Definition CameraState.h:2088
Network & network()
Get Network.
Definition CameraState.h:2120
CameraState(Args &&...args)
Constructor taking variadic number of arguments.
Definition CameraState.h:1955
const CameraState::Temperature & get() const
Definition CameraState.h:2266
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:2349
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:1994
InaccessibleReason & inaccessibleReason()
Get InaccessibleReason.
Definition CameraState.h:2101
CameraState & set(const Temperature::LED &value)
Set Temperature::LED.
Definition CameraState.h:2199
const CameraState::Temperature::DMD & get() const
Definition CameraState.h:2274
const Network & network() const
Get Network.
Definition CameraState.h:2114
const Connected & isConnected() const
Get Connected.
Definition CameraState.h:2076
Available & isAvailable()
Get Available.
Definition CameraState.h:2063
Class describing a range of values for a given type T.
Definition Range.h:73
NodeType
Definition NodeType.h:55
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:56