68# pragma warning(disable : 4251)
84 static constexpr const char *path{
"" };
87 static constexpr const char *name{
"CameraState" };
90 static constexpr const char *description{
91 R
"description(Information about camera connection state, temperatures, etc.)description"
94 static constexpr size_t version{ 5 };
104 static constexpr std::array<uint8_t, 3> binaryId{
'c',
's',
't' };
121 static constexpr const char *path{
"Available" };
124 static constexpr const char *name{
"Available" };
127 static constexpr const char *description{
128 R
"description(Flag if camera is physically connected to the computer and is available for use, but not connected in
129software. This corresponds to the Status enums `available` or `firmwareUpdateRequired`. Zivid
130recommends to use the Status enum instead of this bool.
142 return {
false,
true };
160 explicit operator bool()
const
168 return m_value == other.m_value;
174 return m_value != other.m_value;
184 void setFromString(
const std::string &value);
186 bool m_value{
false };
188 friend struct DataModel::Detail::Befriend<
Available>;
203 static constexpr const char *path{
"Connected" };
206 static constexpr const char *name{
"Connected" };
209 static constexpr const char *description{
210 R
"description(Flag if camera is connected in software. This bool is true when the Status value is `connected`. Zivid
211recommends to use the Status enum instead of this bool.
223 return {
false,
true };
241 explicit operator bool()
const
249 return m_value == other.m_value;
255 return m_value != other.m_value;
265 void setFromString(
const std::string &value);
267 bool m_value{
false };
269 friend struct DataModel::Detail::Befriend<
Connected>;
282 static constexpr const char *path{
"InaccessibleReason" };
285 static constexpr const char *name{
"InaccessibleReason" };
288 static constexpr const char *description{
289 R
"description(If the camera status is `inaccessible`, then this enum value will give you the reason.)description"
295 ipConflictWithAnotherCamera,
296 ipConflictWithLocalNetworkAdapter,
298 ipInMultipleLocalSubnets
308 return { ValueType::ipConflictWithAnotherCamera,
309 ValueType::ipConflictWithLocalNetworkAdapter,
310 ValueType::ipNotInLocalSubnet,
311 ValueType::ipInMultipleLocalSubnets };
319 : m_opt{ verifyValue(value) }
346 return m_opt == other.m_opt;
352 return m_opt != other.m_opt;
362 void setFromString(
const std::string &value);
364 constexpr ValueType
static verifyValue(
const ValueType &value)
366 return value == ValueType::ipConflictWithAnotherCamera
367 || value == ValueType::ipConflictWithLocalNetworkAdapter
368 || value == ValueType::ipNotInLocalSubnet || value == ValueType::ipInMultipleLocalSubnets
370 :
throw std::invalid_argument{
371 "Invalid value: InaccessibleReason{ "
372 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value)) +
" }"
376 Zivid::DataModel::Detail::Optional<ValueType> m_opt;
391 static constexpr const char *path{
"Network" };
394 static constexpr const char *name{
"Network" };
397 static constexpr const char *description{ R
"description(Current network state)description" };
409 static constexpr const char *path{
"Network/IPV4" };
412 static constexpr const char *name{
"IPV4" };
415 static constexpr const char *description{ R
"description(Current IPv4 protocol state)description" };
427 static constexpr const char *path{
"Network/IPV4/Address" };
430 static constexpr const char *name{
"Address" };
433 static constexpr const char *description{ R
"description(Current IPv4 address)description" };
441 return { 0, std::numeric_limits<ValueType::size_type>::max() };
449 : m_value{ std::move(value) }
461 return m_value == other.m_value;
467 return m_value != other.m_value;
473 return m_value < other.m_value;
479 return m_value > other.m_value;
485 return m_value <= other.m_value;
491 return m_value >= other.m_value;
501 void setFromString(
const std::string &value);
503 std::string m_value{};
505 friend struct DataModel::Detail::Befriend<
Address>;
508 using Descendants = std::tuple<CameraState::Network::IPV4::Address>;
527 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
528 typename std::enable_if<
529 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::
533 template<typename... Args>
537 using namespace Zivid::Detail::TypeTraits;
540 AllArgsDecayedAreUnique<Args...>::value,
541 "Found duplicate types among the arguments passed to IPV4(...). "
542 "Types should be listed at most once.");
544 set(std::forward<Args>(args)...);
558 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
560 template<typename... Args>
564 using namespace Zivid::Detail::TypeTraits;
566 using AllArgsAreDescendantNodes =
567 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
569 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
572 AllArgsDecayedAreUnique<Args...>::value,
573 "Found duplicate types among the arguments passed to set(...). "
574 "Types should be listed at most once.");
576 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
591 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
593 template<typename... Args>
597 using namespace Zivid::Detail::TypeTraits;
599 using AllArgsAreDescendantNodes =
600 AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
602 AllArgsAreDescendantNodes::value,
603 "All arguments passed to copyWith(...) must be descendant nodes.");
606 AllArgsDecayedAreUnique<Args...>::value,
607 "Found duplicate types among the arguments passed to copyWith(...). "
608 "Types should be listed at most once.");
611 copy.
set(std::forward<Args>(args)...);
636 typename std::enable_if<std::is_same<T, CameraState::Network::IPV4::Address>::value,
int>::type = 0>
642 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
678 void setFromString(
const std::string &value);
680 void setFromString(
const std::string &fullPath,
const std::string &value);
682 std::string getString(
const std::string &fullPath)
const;
686 friend struct DataModel::Detail::Befriend<
IPV4>;
689 using Descendants = std::tuple<CameraState::Network::IPV4, CameraState::Network::IPV4::Address>;
709 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
710 typename std::enable_if<
711 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::
715 template<typename... Args>
719 using namespace Zivid::Detail::TypeTraits;
722 AllArgsDecayedAreUnique<Args...>::value,
723 "Found duplicate types among the arguments passed to Network(...). "
724 "Types should be listed at most once.");
726 set(std::forward<Args>(args)...);
741 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
743 template<typename... Args>
747 using namespace Zivid::Detail::TypeTraits;
749 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
751 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
754 AllArgsDecayedAreUnique<Args...>::value,
755 "Found duplicate types among the arguments passed to set(...). "
756 "Types should be listed at most once.");
758 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
774 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
776 template<typename... Args>
780 using namespace Zivid::Detail::TypeTraits;
782 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
784 AllArgsAreDescendantNodes::value,
785 "All arguments passed to copyWith(...) must be descendant nodes.");
788 AllArgsDecayedAreUnique<Args...>::value,
789 "Found duplicate types among the arguments passed to copyWith(...). "
790 "Types should be listed at most once.");
793 copy.
set(std::forward<Args>(args)...);
825 typename std::enable_if<std::is_same<T, CameraState::Network::IPV4>::value,
int>::type = 0>
833 typename std::enable_if<std::is_same<T, CameraState::Network::IPV4::Address>::value,
int>::type = 0>
839 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
875 void setFromString(
const std::string &value);
877 void setFromString(
const std::string &fullPath,
const std::string &value);
879 std::string getString(
const std::string &fullPath)
const;
883 friend struct DataModel::Detail::Befriend<
Network>;
927 static constexpr const char *path{
"Status" };
930 static constexpr const char *name{
"Status" };
933 static constexpr const char *description{
934 R
"description(This enum describes the current status of this camera. The enum can have the following values:
936* `inaccessible`: The camera was discovered, but the SDK is not able to connect to this camera. This can
937 be because the IP settings of the camera and the PC are not compatible, or because there are several
938 cameras with the same IP connected to your PC. The `InaccessibleReason` enum will give you more
939 details about why this camera is not accessible. The network configuration of the camera can be changed
940 using the ZividNetworkCameraConfigurator CLI tool. See the knowledge base for more information.
942* `busy`: The camera is currently in use by another process. This can be a different process on the same
943 PC, or on a different PC if the camera is shared on a network.
945* `firmwareUpdateRequired`: The camera is accessible, but requires a firmware update before you can connect
948* `updatingFirmware`: The camera firmware is currently being updated in the current process.
950* `available`: The camera is available for use by the current process. This means that you can invoke
951 camera.connect() on this camera.
953* `connecting`: The camera is currently connecting in the current process.
955* `connected`: The camera is connected in the current process. This means camera.connect() has successfully
956 completed and you can capture using this camera.
958* `disconnecting`: The camera is currently disconnecting in the current process. When disconnection has
959 completed, the camera will normally go back to the `available` state.
961* `disappeared`: The camera was found earlier, but it can no longer be found. The connection between the
962 PC and the camera may be disrupted, or the camera may have lost power. When in `disappeared` state, the
963 camera will not be returned from `Application::cameras()`. The camera will go back to one of the other
964 states if the camera is later found again.
973 firmwareUpdateRequired,
994 return { ValueType::inaccessible, ValueType::busy, ValueType::firmwareUpdateRequired,
995 ValueType::updatingFirmware, ValueType::available, ValueType::connecting,
996 ValueType::connected, ValueType::disconnecting, ValueType::disappeared };
1004 : m_value{ verifyValue(value) }
1022 return m_value == other.m_value;
1028 return m_value != other.m_value;
1038 void setFromString(
const std::string &value);
1040 constexpr ValueType
static verifyValue(
const ValueType &value)
1042 return value == ValueType::inaccessible || value == ValueType::busy
1043 || value == ValueType::firmwareUpdateRequired || value == ValueType::updatingFirmware
1044 || value == ValueType::available || value == ValueType::connecting
1045 || value == ValueType::connected || value == ValueType::disconnecting
1046 || value == ValueType::disappeared
1048 :
throw std::invalid_argument{
1049 "Invalid value: Status{ "
1050 + std::to_string(
static_cast<std::underlying_type<ValueType>::type
>(value)) +
" }"
1056 friend struct DataModel::Detail::Befriend<
Status>;
1069 static constexpr const char *path{
"Temperature" };
1072 static constexpr const char *name{
"Temperature" };
1075 static constexpr const char *description{ R
"description(Current temperature(s))description" };
1087 static constexpr const char *path{
"Temperature/DMD" };
1090 static constexpr const char *name{
"DMD" };
1093 static constexpr const char *description{ R
"description(DMD temperature)description" };
1101 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
1108 explicit constexpr DMD(
double value)
1121 return m_value == other.m_value;
1127 return m_value != other.m_value;
1133 return m_value < other.m_value;
1139 return m_value > other.m_value;
1145 return m_value <= other.m_value;
1151 return m_value >= other.m_value;
1161 void setFromString(
const std::string &value);
1163 double m_value{ 0.0 };
1165 friend struct DataModel::Detail::Befriend<
DMD>;
1178 static constexpr const char *path{
"Temperature/General" };
1181 static constexpr const char *name{
"General" };
1184 static constexpr const char *description{ R
"description(General temperature)description" };
1192 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
1212 return m_value == other.m_value;
1218 return m_value != other.m_value;
1224 return m_value < other.m_value;
1230 return m_value > other.m_value;
1236 return m_value <= other.m_value;
1242 return m_value >= other.m_value;
1252 void setFromString(
const std::string &value);
1254 double m_value{ 0.0 };
1256 friend struct DataModel::Detail::Befriend<
General>;
1269 static constexpr const char *path{
"Temperature/LED" };
1272 static constexpr const char *name{
"LED" };
1275 static constexpr const char *description{ R
"description(LED temperature)description" };
1283 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
1290 explicit constexpr LED(
double value)
1303 return m_value == other.m_value;
1309 return m_value != other.m_value;
1315 return m_value < other.m_value;
1321 return m_value > other.m_value;
1327 return m_value <= other.m_value;
1333 return m_value >= other.m_value;
1343 void setFromString(
const std::string &value);
1345 double m_value{ 0.0 };
1347 friend struct DataModel::Detail::Befriend<
LED>;
1360 static constexpr const char *path{
"Temperature/Lens" };
1363 static constexpr const char *name{
"Lens" };
1366 static constexpr const char *description{ R
"description(Lens temperature)description" };
1374 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
1381 explicit constexpr Lens(
double value)
1394 return m_value == other.m_value;
1400 return m_value != other.m_value;
1406 return m_value < other.m_value;
1412 return m_value > other.m_value;
1418 return m_value <= other.m_value;
1424 return m_value >= other.m_value;
1434 void setFromString(
const std::string &value);
1436 double m_value{ 0.0 };
1438 friend struct DataModel::Detail::Befriend<
Lens>;
1451 static constexpr const char *path{
"Temperature/PCB" };
1454 static constexpr const char *name{
"PCB" };
1457 static constexpr const char *description{ R
"description(PCB temperature)description" };
1465 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
1472 explicit constexpr PCB(
double value)
1485 return m_value == other.m_value;
1491 return m_value != other.m_value;
1497 return m_value < other.m_value;
1503 return m_value > other.m_value;
1509 return m_value <= other.m_value;
1515 return m_value >= other.m_value;
1525 void setFromString(
const std::string &value);
1527 double m_value{ 0.0 };
1529 friend struct DataModel::Detail::Befriend<
PCB>;
1560 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
1561 typename std::enable_if<
1562 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::
1566 template<typename... Args>
1570 using namespace Zivid::Detail::TypeTraits;
1573 AllArgsDecayedAreUnique<Args...>::value,
1574 "Found duplicate types among the arguments passed to Temperature(...). "
1575 "Types should be listed at most once.");
1577 set(std::forward<Args>(args)...);
1595 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
1597 template<typename... Args>
1601 using namespace Zivid::Detail::TypeTraits;
1603 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1605 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
1608 AllArgsDecayedAreUnique<Args...>::value,
1609 "Found duplicate types among the arguments passed to set(...). "
1610 "Types should be listed at most once.");
1612 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
1631 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
1633 template<typename... Args>
1637 using namespace Zivid::Detail::TypeTraits;
1639 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1641 AllArgsAreDescendantNodes::value,
1642 "All arguments passed to copyWith(...) must be descendant nodes.");
1645 AllArgsDecayedAreUnique<Args...>::value,
1646 "Found duplicate types among the arguments passed to copyWith(...). "
1647 "Types should be listed at most once.");
1650 copy.
set(std::forward<Args>(args)...);
1751 typename std::enable_if<std::is_same<T, CameraState::Temperature::DMD>::value,
int>::type = 0>
1759 typename std::enable_if<std::is_same<T, CameraState::Temperature::General>::value,
int>::type = 0>
1767 typename std::enable_if<std::is_same<T, CameraState::Temperature::LED>::value,
int>::type = 0>
1775 typename std::enable_if<std::is_same<T, CameraState::Temperature::Lens>::value,
int>::type = 0>
1783 typename std::enable_if<std::is_same<T, CameraState::Temperature::PCB>::value,
int>::type = 0>
1789 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1795 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1801 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1807 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
1813 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
1820 template<
typename F>
1831 template<
typename F>
1857 void setFromString(
const std::string &value);
1859 void setFromString(
const std::string &fullPath,
const std::string &value);
1861 std::string getString(
const std::string &fullPath)
const;
1869 friend struct DataModel::Detail::Befriend<
Temperature>;
1919 typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0,
1920 typename std::enable_if<
1921 Zivid::Detail::TypeTraits::AllArgsAreInTuple<
Descendants,
typename std::decay<Args>::type...>::value,
1924 template<typename... Args>
1928 using namespace Zivid::Detail::TypeTraits;
1931 AllArgsDecayedAreUnique<Args...>::value,
1932 "Found duplicate types among the arguments passed to CameraState(...). "
1933 "Types should be listed at most once.");
1935 set(std::forward<Args>(args)...);
1961 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 2,
int>::type = 0>
1963 template<typename... Args>
1967 using namespace Zivid::Detail::TypeTraits;
1969 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1971 AllArgsAreDescendantNodes::value,
"All arguments passed to set(...) must be descendant nodes.");
1974 AllArgsDecayedAreUnique<Args...>::value,
1975 "Found duplicate types among the arguments passed to set(...). "
1976 "Types should be listed at most once.");
1978 Zivid::DataModel::Detail::invokeSetWithEachArgument(*
this, std::forward<Args>(args)...);
2005 template<
typename... Args,
typename std::enable_if<
sizeof...(Args) >= 1,
int>::type = 0>
2007 template<typename... Args>
2011 using namespace Zivid::Detail::TypeTraits;
2013 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
2015 AllArgsAreDescendantNodes::value,
"All arguments passed to copyWith(...) must be descendant nodes.");
2018 AllArgsDecayedAreUnique<Args...>::value,
2019 "Found duplicate types among the arguments passed to copyWith(...). "
2020 "Types should be listed at most once.");
2023 copy.
set(std::forward<Args>(args)...);
2042 m_available = value;
2061 m_connected = value;
2068 return m_inaccessibleReason;
2074 return m_inaccessibleReason;
2080 m_inaccessibleReason = value;
2106 m_network.
set(value);
2113 m_network.
set(value);
2139 return m_temperature;
2145 return m_temperature;
2151 m_temperature = value;
2158 m_temperature.
set(value);
2165 m_temperature.
set(value);
2172 m_temperature.
set(value);
2179 m_temperature.
set(value);
2186 m_temperature.
set(value);
2190 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Available>::value,
int>::type = 0>
2196 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Connected>::value,
int>::type = 0>
2204 typename std::enable_if<std::is_same<T, CameraState::InaccessibleReason>::value,
int>::type = 0>
2207 return m_inaccessibleReason;
2210 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Network>::value,
int>::type = 0>
2216 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Network::IPV4>::value,
int>::type = 0>
2224 typename std::enable_if<std::is_same<T, CameraState::Network::IPV4::Address>::value,
int>::type = 0>
2230 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Status>::value,
int>::type = 0>
2236 template<typename T, typename std::enable_if<std::is_same<T, CameraState::Temperature>::value,
int>::type = 0>
2239 return m_temperature;
2244 typename std::enable_if<std::is_same<T, CameraState::Temperature::DMD>::value,
int>::type = 0>
2252 typename std::enable_if<std::is_same<T, CameraState::Temperature::General>::value,
int>::type = 0>
2260 typename std::enable_if<std::is_same<T, CameraState::Temperature::LED>::value,
int>::type = 0>
2268 typename std::enable_if<std::is_same<T, CameraState::Temperature::Lens>::value,
int>::type = 0>
2276 typename std::enable_if<std::is_same<T, CameraState::Temperature::PCB>::value,
int>::type = 0>
2282 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
2288 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
2294 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
2297 return m_inaccessibleReason;
2300 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
2306 template<size_t i, typename std::enable_if<i == 4, int>::type = 0>
2312 template<size_t i, typename std::enable_if<i == 5, int>::type = 0>
2315 return m_temperature;
2319 template<
typename F>
2324 f(m_inaccessibleReason);
2331 template<
typename F>
2336 f(m_inaccessibleReason);
2358 void save(
const std::string &fileName)
const;
2361 void load(
const std::string &fileName);
2364 void setFromString(
const std::string &value);
2366 void setFromString(
const std::string &fullPath,
const std::string &value);
2368 std::string getString(
const std::string &fullPath)
const;
2377 friend struct DataModel::Detail::Befriend<
CameraState>;
2391 struct CameraState::Version<5>
2393 using Type = CameraState;
2400# pragma warning(pop)
2404# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
2409 struct tuple_size<
Zivid::CameraState::Network> : integral_constant<size_t, 1>
2413 struct tuple_element<i,
Zivid::CameraState::Network>
2415 static_assert(i < tuple_size<Zivid::CameraState::Network>::value,
"Index must be less than 1");
2418 =
decltype(declval<Zivid::CameraState::Network>().get<i>());
2422 struct tuple_size<
Zivid::CameraState::Network::IPV4> : integral_constant<size_t, 1>
2426 struct tuple_element<i,
Zivid::CameraState::Network::IPV4>
2428 static_assert(i < tuple_size<Zivid::CameraState::Network::IPV4>::value,
"Index must be less than 1");
2431 =
decltype(declval<Zivid::CameraState::Network::IPV4>().get<i>());
2435 struct tuple_size<
Zivid::CameraState::Temperature> : integral_constant<size_t, 5>
2439 struct tuple_element<i,
Zivid::CameraState::Temperature>
2441 static_assert(i < tuple_size<Zivid::CameraState::Temperature>::value,
"Index must be less than 5");
2444 =
decltype(declval<Zivid::CameraState::Temperature>().get<i>());
2448 struct tuple_size<
Zivid::CameraState> : integral_constant<size_t, 6>
2452 struct tuple_element<i,
Zivid::CameraState>
2454 static_assert(i < tuple_size<Zivid::CameraState>::value,
"Index must be less than 6");
2457 =
decltype(declval<Zivid::CameraState>().get<i>());
2466#if defined(__has_include) && !defined(NO_DOC)
2467# if __has_include("Zivid/CameraStateInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
2468# include "Zivid/CameraStateInternal.h"
#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:115
static std::set< bool > validValues()
All valid values of Available.
Definition CameraState.h:140
static const Available no
Off/disabled.
Definition CameraState.h:137
bool operator==(const Available &other) const
Comparison operator.
Definition CameraState.h:166
std::string toString() const
Get the value as string.
bool ValueType
The type of the underlying value.
Definition CameraState.h:135
static const Available yes
On/enabled.
Definition CameraState.h:136
friend std::ostream & operator<<(std::ostream &stream, const Available &value)
Operator to serialize the value to a stream.
Definition CameraState.h:178
bool operator!=(const Available &other) const
Comparison operator.
Definition CameraState.h:172
constexpr Available(bool value)
Constructor.
Definition CameraState.h:149
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:197
Connected()=default
Default constructor.
static const Connected yes
On/enabled.
Definition CameraState.h:217
static const Connected no
Off/disabled.
Definition CameraState.h:218
bool operator!=(const Connected &other) const
Comparison operator.
Definition CameraState.h:253
constexpr Connected(bool value)
Constructor.
Definition CameraState.h:230
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:259
static std::set< bool > validValues()
All valid values of Connected.
Definition CameraState.h:221
bool operator==(const Connected &other) const
Comparison operator.
Definition CameraState.h:247
bool ValueType
The type of the underlying value.
Definition CameraState.h:216
If the camera status is inaccessible, then this enum value will give you the reason.
Definition CameraState.h:276
static const InaccessibleReason ipNotInLocalSubnet
ipNotInLocalSubnet
Definition CameraState.h:302
constexpr InaccessibleReason(ValueType value)
Constructor.
Definition CameraState.h:318
bool hasValue() const
Check if the value is set.
static const InaccessibleReason ipConflictWithAnotherCamera
ipConflictWithAnotherCamera
Definition CameraState.h:300
friend std::ostream & operator<<(std::ostream &stream, const InaccessibleReason::ValueType &value)
Operator to serialize ValueType to a stream.
Definition CameraState.h:338
bool operator==(const InaccessibleReason &other) const
Comparison operator.
Definition CameraState.h:344
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:356
static const InaccessibleReason ipConflictWithLocalNetworkAdapter
ipConflictWithLocalNetworkAdapter
Definition CameraState.h:301
InaccessibleReason()=default
Default constructor.
static const InaccessibleReason ipInMultipleLocalSubnets
ipInMultipleLocalSubnets
Definition CameraState.h:303
ValueType
The type of the underlying value.
Definition CameraState.h:294
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:350
static std::set< ValueType > validValues()
All valid values of InaccessibleReason.
Definition CameraState.h:306
Current IPv4 address.
Definition CameraState.h:421
Address()=default
Default constructor.
bool operator<(const Address &other) const
Comparison operator.
Definition CameraState.h:471
bool operator==(const Address &other) const
Comparison operator.
Definition CameraState.h:459
bool operator<=(const Address &other) const
Comparison operator.
Definition CameraState.h:483
static constexpr Range< ValueType::size_type > validSize()
The valid sizes for Address.
Definition CameraState.h:439
bool operator>(const Address &other) const
Comparison operator.
Definition CameraState.h:477
bool operator!=(const Address &other) const
Comparison operator.
Definition CameraState.h:465
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:495
bool operator>=(const Address &other) const
Comparison operator.
Definition CameraState.h:489
Address(std::string value)
Constructor.
Definition CameraState.h:448
std::string toString() const
Get the value as string.
std::string ValueType
The type of the underlying value.
Definition CameraState.h:436
Current IPv4 protocol state.
Definition CameraState.h:403
IPV4()
Default constructor.
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:562
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:650
const Address & address() const
Get Address.
Definition CameraState.h:616
friend std::ostream & operator<<(std::ostream &stream, const IPV4 &value)
Operator to send the value as string to a stream.
Definition CameraState.h:672
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:595
const CameraState::Network::IPV4::Address & get() const
Definition CameraState.h:637
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:657
IPV4 & set(const Address &value)
Set Address.
Definition CameraState.h:628
std::string toString() const
Get the value as string.
std::tuple< CameraState::Network::IPV4::Address > Descendants
Definition CameraState.h:508
Address & address()
Get Address.
Definition CameraState.h:622
bool operator!=(const IPV4 &other) const
Inequality operator.
Current network state.
Definition CameraState.h:385
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:745
std::tuple< CameraState::Network::IPV4, CameraState::Network::IPV4::Address > Descendants
Definition CameraState.h:689
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:869
bool operator==(const Network &other) const
Equality operator.
Network()
Default constructor.
Network & set(const IPV4 &value)
Set IPV4.
Definition CameraState.h:810
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:778
const CameraState::Network::IPV4::Address & get() const
Definition CameraState.h:834
const CameraState::Network::IPV4 & get() const
Definition CameraState.h:826
Network & set(const IPV4::Address &value)
Set IPV4::Address.
Definition CameraState.h:817
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:854
IPV4 & ipv4()
Get IPV4.
Definition CameraState.h:804
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:847
const IPV4 & ipv4() const
Get IPV4.
Definition CameraState.h:798
This enum describes the current status of this camera. The enum can have the following values:
Definition CameraState.h:921
constexpr Status(ValueType value)
Constructor.
Definition CameraState.h:1003
static std::set< ValueType > validValues()
All valid values of Status.
Definition CameraState.h:992
static const Status connected
connected
Definition CameraState.h:987
static const Status disconnecting
disconnecting
Definition CameraState.h:988
static const Status inaccessible
inaccessible
Definition CameraState.h:981
std::string toString() const
Get the value as string.
ValueType
The type of the underlying value.
Definition CameraState.h:970
friend std::ostream & operator<<(std::ostream &stream, const Status &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1032
static const Status firmwareUpdateRequired
firmwareUpdateRequired
Definition CameraState.h:983
ValueType value() const
Get the value.
bool operator!=(const Status &other) const
Comparison operator.
Definition CameraState.h:1026
static const Status connecting
connecting
Definition CameraState.h:986
bool operator==(const Status &other) const
Comparison operator.
Definition CameraState.h:1020
static const Status busy
busy
Definition CameraState.h:982
Status()=default
Default constructor.
static const Status available
available
Definition CameraState.h:985
static const Status updatingFirmware
updatingFirmware
Definition CameraState.h:984
static const Status disappeared
disappeared
Definition CameraState.h:989
friend std::ostream & operator<<(std::ostream &stream, const Status::ValueType &value)
Operator to serialize ValueType to a stream.
Definition CameraState.h:1014
DMD temperature.
Definition CameraState.h:1081
bool operator>(const DMD &other) const
Comparison operator.
Definition CameraState.h:1137
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:1125
bool operator<(const DMD &other) const
Comparison operator.
Definition CameraState.h:1131
bool operator>=(const DMD &other) const
Comparison operator.
Definition CameraState.h:1149
double ValueType
The type of the underlying value.
Definition CameraState.h:1096
bool operator<=(const DMD &other) const
Comparison operator.
Definition CameraState.h:1143
friend std::ostream & operator<<(std::ostream &stream, const DMD &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1155
constexpr DMD(double value)
Constructor.
Definition CameraState.h:1108
bool operator==(const DMD &other) const
Comparison operator.
Definition CameraState.h:1119
static constexpr Range< double > validRange()
The range of valid values for DMD.
Definition CameraState.h:1099
DMD()=default
Default constructor.
General temperature.
Definition CameraState.h:1172
double ValueType
The type of the underlying value.
Definition CameraState.h:1187
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:1222
constexpr General(double value)
Constructor.
Definition CameraState.h:1199
static constexpr Range< double > validRange()
The range of valid values for General.
Definition CameraState.h:1190
bool operator==(const General &other) const
Comparison operator.
Definition CameraState.h:1210
General()=default
Default constructor.
bool operator<=(const General &other) const
Comparison operator.
Definition CameraState.h:1234
bool operator!=(const General &other) const
Comparison operator.
Definition CameraState.h:1216
bool operator>(const General &other) const
Comparison operator.
Definition CameraState.h:1228
friend std::ostream & operator<<(std::ostream &stream, const General &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1246
bool operator>=(const General &other) const
Comparison operator.
Definition CameraState.h:1240
LED temperature.
Definition CameraState.h:1263
bool operator<=(const LED &other) const
Comparison operator.
Definition CameraState.h:1325
std::string toString() const
Get the value as string.
bool operator<(const LED &other) const
Comparison operator.
Definition CameraState.h:1313
double value() const
Get the value.
LED()=default
Default constructor.
constexpr LED(double value)
Constructor.
Definition CameraState.h:1290
friend std::ostream & operator<<(std::ostream &stream, const LED &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1337
bool operator!=(const LED &other) const
Comparison operator.
Definition CameraState.h:1307
bool operator==(const LED &other) const
Comparison operator.
Definition CameraState.h:1301
bool operator>=(const LED &other) const
Comparison operator.
Definition CameraState.h:1331
bool operator>(const LED &other) const
Comparison operator.
Definition CameraState.h:1319
static constexpr Range< double > validRange()
The range of valid values for LED.
Definition CameraState.h:1281
double ValueType
The type of the underlying value.
Definition CameraState.h:1278
Lens temperature.
Definition CameraState.h:1354
double ValueType
The type of the underlying value.
Definition CameraState.h:1369
bool operator==(const Lens &other) const
Comparison operator.
Definition CameraState.h:1392
Lens()=default
Default constructor.
bool operator<=(const Lens &other) const
Comparison operator.
Definition CameraState.h:1416
double value() const
Get the value.
bool operator>(const Lens &other) const
Comparison operator.
Definition CameraState.h:1410
bool operator!=(const Lens &other) const
Comparison operator.
Definition CameraState.h:1398
bool operator>=(const Lens &other) const
Comparison operator.
Definition CameraState.h:1422
std::string toString() const
Get the value as string.
constexpr Lens(double value)
Constructor.
Definition CameraState.h:1381
static constexpr Range< double > validRange()
The range of valid values for Lens.
Definition CameraState.h:1372
bool operator<(const Lens &other) const
Comparison operator.
Definition CameraState.h:1404
friend std::ostream & operator<<(std::ostream &stream, const Lens &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1428
PCB temperature.
Definition CameraState.h:1445
bool operator!=(const PCB &other) const
Comparison operator.
Definition CameraState.h:1489
constexpr PCB(double value)
Constructor.
Definition CameraState.h:1472
static constexpr Range< double > validRange()
The range of valid values for PCB.
Definition CameraState.h:1463
bool operator>=(const PCB &other) const
Comparison operator.
Definition CameraState.h:1513
PCB()=default
Default constructor.
bool operator<=(const PCB &other) const
Comparison operator.
Definition CameraState.h:1507
friend std::ostream & operator<<(std::ostream &stream, const PCB &value)
Operator to serialize the value to a stream.
Definition CameraState.h:1519
bool operator==(const PCB &other) const
Comparison operator.
Definition CameraState.h:1483
double value() const
Get the value.
bool operator>(const PCB &other) const
Comparison operator.
Definition CameraState.h:1501
double ValueType
The type of the underlying value.
Definition CameraState.h:1460
std::string toString() const
Get the value as string.
bool operator<(const PCB &other) const
Comparison operator.
Definition CameraState.h:1495
Current temperature(s)
Definition CameraState.h:1063
DMD & dmd()
Get DMD.
Definition CameraState.h:1661
Temperature & set(const General &value)
Set General.
Definition CameraState.h:1686
const PCB & pcb() const
Get PCB.
Definition CameraState.h:1731
const CameraState::Temperature::Lens & get() const
Definition CameraState.h:1776
Temperature & set(const Lens &value)
Set Lens.
Definition CameraState.h:1724
const CameraState::Temperature::DMD & get() const
Definition CameraState.h:1752
const CameraState::Temperature::PCB & get() const
Definition CameraState.h:1784
const CameraState::Temperature::General & get() const
Definition CameraState.h:1760
Temperature & set(const PCB &value)
Set PCB.
Definition CameraState.h:1743
const General & general() const
Get General.
Definition CameraState.h:1674
bool operator!=(const Temperature &other) const
Inequality operator.
const LED & led() const
Get LED.
Definition CameraState.h:1693
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:1821
friend std::ostream & operator<<(std::ostream &stream, const Temperature &value)
Operator to send the value as string to a stream.
Definition CameraState.h:1851
Temperature & set(const LED &value)
Set LED.
Definition CameraState.h:1705
std::string toString() const
Get the value as string.
LED & led()
Get LED.
Definition CameraState.h:1699
bool operator==(const Temperature &other) const
Equality operator.
const Lens & lens() const
Get Lens.
Definition CameraState.h:1712
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:1635
General & general()
Get General.
Definition CameraState.h:1680
std::tuple< CameraState::Temperature::DMD, CameraState::Temperature::General, CameraState::Temperature::LED, CameraState::Temperature::Lens, CameraState::Temperature::PCB > Descendants
Definition CameraState.h:1532
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:1599
const DMD & dmd() const
Get DMD.
Definition CameraState.h:1655
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:1832
const CameraState::Temperature::LED & get() const
Definition CameraState.h:1768
Lens & lens()
Get Lens.
Definition CameraState.h:1718
Temperature()
Default constructor.
Temperature & set(const DMD &value)
Set DMD.
Definition CameraState.h:1667
PCB & pcb()
Get PCB.
Definition CameraState.h:1737
Information about camera connection state, temperatures, etc.
Definition CameraState.h:78
const Temperature & temperature() const
Get Temperature.
Definition CameraState.h:2137
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:2009
const CameraState::Network::IPV4 & get() const
Definition CameraState.h:2217
const CameraState::Temperature::Lens & get() const
Definition CameraState.h:2269
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 Temperature &value)
Set Temperature.
Definition CameraState.h:2149
const CameraState::Connected & get() const
Definition CameraState.h:2197
Temperature & temperature()
Get Temperature.
Definition CameraState.h:2143
const CameraState::Temperature::General & get() const
Definition CameraState.h:2253
std::string toString() const
Get the value as string.
CameraState & set(const Network &value)
Set Network.
Definition CameraState.h:2097
const CameraState::Status & get() const
Definition CameraState.h:2231
const CameraState::InaccessibleReason & get() const
Definition CameraState.h:2205
const CameraState::Available & get() const
Definition CameraState.h:2191
const CameraState::Network::IPV4::Address & get() const
Definition CameraState.h:2225
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraState.h:2332
void save(const std::string &fileName) const
Save to the given file.
const CameraState::Network & get() const
Definition CameraState.h:2211
const CameraState::Temperature::PCB & get() const
Definition CameraState.h:2277
CameraState & set(const Temperature::PCB &value)
Set Temperature::PCB.
Definition CameraState.h:2184
const InaccessibleReason & inaccessibleReason() const
Get InaccessibleReason.
Definition CameraState.h:2066
const CameraState::Temperature::LED & get() const
Definition CameraState.h:2261
CameraState & set(const Temperature::General &value)
Set Temperature::General.
Definition CameraState.h:2163
friend std::ostream & operator<<(std::ostream &stream, const CameraState &value)
Operator to send the value as string to a stream.
Definition CameraState.h:2352
bool operator!=(const CameraState &other) const
Inequality operator.
CameraState & set(const Network::IPV4 &value)
Set Network::IPV4.
Definition CameraState.h:2104
CameraState & set(const Network::IPV4::Address &value)
Set Network::IPV4::Address.
Definition CameraState.h:2111
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:1872
Status & status()
Get Status.
Definition CameraState.h:2124
const Available & isAvailable() const
Get Available.
Definition CameraState.h:2028
const Status & status() const
Get Status.
Definition CameraState.h:2118
Connected & isConnected()
Get Connected.
Definition CameraState.h:2053
CameraState & set(const Temperature::Lens &value)
Set Temperature::Lens.
Definition CameraState.h:2177
CameraState & set(const Available &value)
Set Available.
Definition CameraState.h:2040
CameraState & set(const Temperature::DMD &value)
Set Temperature::DMD.
Definition CameraState.h:2156
bool operator==(const CameraState &other) const
Equality operator.
CameraState()
Default constructor.
CameraState & set(const Status &value)
Set Status.
Definition CameraState.h:2130
CameraState & set(const InaccessibleReason &value)
Set InaccessibleReason.
Definition CameraState.h:2078
CameraState & set(const Connected &value)
Set Connected.
Definition CameraState.h:2059
Network & network()
Get Network.
Definition CameraState.h:2091
CameraState(Args &&...args)
Constructor taking variadic number of arguments.
Definition CameraState.h:1926
const CameraState::Temperature & get() const
Definition CameraState.h:2237
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:2320
void set(Args &&...args)
Set multiple arguments.
Definition CameraState.h:1965
InaccessibleReason & inaccessibleReason()
Get InaccessibleReason.
Definition CameraState.h:2072
CameraState & set(const Temperature::LED &value)
Set Temperature::LED.
Definition CameraState.h:2170
const CameraState::Temperature::DMD & get() const
Definition CameraState.h:2245
const Network & network() const
Get Network.
Definition CameraState.h:2085
const Connected & isConnected() const
Get Connected.
Definition CameraState.h:2047
Available & isAvailable()
Get Available.
Definition CameraState.h:2034
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:54