3#include "../global.hpp"
5#include "float_base_node.hpp"
8#include "_detail/ihas_value_config.hpp"
9#include "_detail/iconfigurable_register_node.hpp"
10#include "_detail/iconfigurable_command_node.hpp"
24 ,
public Private::IHasValueConfig<FloatBaseNodePtr>
42 return std::make_shared<FloatNode>(HandleGuard<Node>(
43 CExports::CreateGSFloatNodeTyped(name.data(),
static_cast<CExports::TGSNamespace
>(nameSpace))));
76 throw std::runtime_error(
"requested increment config type must be derived from FloatNode or "
93 "FloatNode or be of type double");
102 auto value = GetTerminalRegisterNode<FloatNode, FloatBaseNodePtr>(
103 this, [](
Node* node) {
104 return dynamic_cast<Private::IConfigurableRegisterNode*
>(node) ?
true :
false;
106 if (value ==
nullptr)
109 return value->AccessMode();
118 auto value = GetTerminalRegisterNode<FloatNode, FloatBaseNodePtr>(
119 this, [](
Node* node) {
return dynamic_cast<Private::IConfigurableRegisterNode*
>(node) ?
true :
false; });
120 if (value ==
nullptr)
123 return value->CacheMode();
132 auto value = GetTerminalRegisterNode<FloatNode, FloatBaseNodePtr>(
this, [](
Node* node) {
133 auto isRegisterNode =
dynamic_cast<Private::IConfigurableRegisterNode*
>(node);
134 auto isCommandNode =
dynamic_cast<Private::IConfigurableCommandNode*
>(node);
135 return (isRegisterNode || isCommandNode) ? true :
false;
137 if (value ==
nullptr)
140 return value->template PollingTime<Rep, Period>();
153 throw std::runtime_error(
"requested max config type must be derived from FloatNode or be "
172 "FloatNode or be of type double");
185 throw std::runtime_error(
"requested min config type must be derived from FloatNode or be "
204 "FloatNode or be of type double");
214 auto bufferSize = NativeCall<size_t>([&](
size_t& size) {
215 return CExports::GSNGetInfoAsStringTyped(
216 Handle(), CExports::TGSNodeInfo::GSNI_Unit,
reinterpret_cast<Char*
>(0), size);
219 bufferSize +=
sizeof(
Char);
222 return CExports::GSNGetInfoAsStringTyped(
223 Handle(), CExports::TGSNodeInfo::GSNI_Unit, buffer.data(), bufferSize);
226 return buffer.data() ?
String(buffer.data()) :
String();
292 throw std::runtime_error(
"requested value config type must be derived from FloatNode or be "
312 "FloatNode or be of type double");
316 template <>
inline double FloatNode::MaxConfig<double>()
const
321 template <>
inline void FloatNode::SetMaxConfig<double>(
const double& value)
326 template <>
inline double FloatNode::MinConfig<double>()
const
331 template <>
inline void FloatNode::SetMinConfig<double>(
const double& value)
336 template <>
inline double FloatNode::ValueConfig<double>()
const
341 template <>
inline double FloatNode::IncrementConfig<double>()
const
346 template <>
inline void FloatNode::SetIncrementConfig<double>(
const double& value)
351 template <>
inline void FloatNode::SetValueConfig<double>(
const double& value)
Represents a floating point number.
Definition: float_base_node.hpp:19
Represents a floating point number.
Definition: float_node.hpp:26
void SetDisplayPrecision(const double displayPrecision)
Sets the display precision of this node's value.
Definition: float_node.hpp:274
void SetMinConfig(const T &)
Sets the minimum configuration of this float node.
Definition: float_node.hpp:201
void SetMaxConfig(const T &)
Sets the maximum configuration of this float node.
Definition: float_node.hpp:169
T MaxConfig() const
Gets the maximum configuration of this float node.
Definition: float_node.hpp:151
void SetUnit(const String &unit)
Sets the unit of this node's value.
Definition: float_node.hpp:234
void SetIncrementConfig(const T &)
Sets the increment of this value.
Definition: float_node.hpp:90
String Unit() const
Gets the unit of this node's value.
Definition: float_node.hpp:212
void SetValueConfig(const T &)
Sets the value configuration of this float node.
Definition: float_node.hpp:309
T MinConfig() const
Gets the minimum configuration of this float node.
Definition: float_node.hpp:183
static FloatNodePtr Create(const String &name)
Creates a new FloatNode with the given name .
Definition: float_node.hpp:59
GenApi::CacheMode CacheMode() const override
Gets the cache mode by querying all ValueConfigs for it.
Definition: float_node.hpp:116
T ValueConfig() const
Gets the value configuration of this float node.
Definition: float_node.hpp:290
GenApi::AccessMode AccessMode() const override
Gets the access mode by querying all ValueConfigs for it.
Definition: float_node.hpp:100
double DisplayPrecision() const
Gets the current display precision value.
Definition: float_node.hpp:263
T IncrementConfig() const
Gets and sets the increment configuration of this float node.
Definition: float_node.hpp:74
static FloatNodePtr Create(const String &name, const GevServer::Namespace &nameSpace)
Creates a new FloatNode with the given name and nameSpace .
Definition: float_node.hpp:40
std::chrono::duration< Rep, Period > PollingTime() const
Gets the polling time by querying all ValueConfigs for it.
Definition: float_node.hpp:130
Basic GevServer node for device feature access.
Definition: decl_node.hpp:36
static GevServer::Namespace ParseNamespace(const String &name)
Gets the Namespace from the given name .
Definition: decl_node.hpp:567
static String ParseName(const String &name)
Gets the name part of the given node name .
Definition: decl_node.hpp:588
void * Handle() const noexcept
Classic API node handle.
Definition: decl_node.hpp:100
CacheMode
Defines how the value is cached.
Definition: genapi.hpp:220
@ NoCache
No caching used.
AccessMode
Access possibility of the node.
Definition: genapi.hpp:185
@ ReadWrite
Node can be read and written to.
Namespace
The possible name spaces a node can be in.
Definition: gevserver.hpp:147
@ DisplayPrecision
Accesses the float node's display precision configuration.
@ Unit
Accesses the unit of a node as string.
@ Value
Accesses the value configuration.
@ Max
Gets the maximum value.
@ Increment
Gets the increment.
@ Min
Gets the minimum value.
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24
char Char
Character type for wide characters or unicode characters.
Definition: string.hpp:70