40 @ingroup NUMBER_MESSAGE_PY
41 @brief Base class for INDI / Nyx number properties.
46 def __init__(self, ptr = None):
54 @ingroup NUMBER_MESSAGE_PY
55 @brief INDI / Nyx `int32_t` number property.
60 def __init__(self, name: str, label: str |
None, fmt: str, min: int, max: int, step: int, value: int):
62 @brief Allocates a new INDI / Nyx `int32_t` number property.
64 @param name Property name.
65 @param label Property label.
66 @param fmt Printf-style formatting string (%[flags][width]d).
67 @param min Range min, ignored if min == max.
68 @param max Range max, ignored if min == max.
69 @param step Step size, ignored if step == 0.
70 @param value Initial `int32_t` value.
73 super().
__init__(bind.lib.nyx_number_prop_new_int(
74 bind.as_bytes(name, allow_none =
False),
75 bind.as_bytes(label, allow_none =
False),
76 bind.as_bytes(fmt, allow_none =
False),
85 @obj.nyx_callback(bind.nyx_callback_int_t)
86 def _nyx_callback_func(self, _vector, _prop, new_value, old_value) -> bool:
93 def value(self) -> int:
95 @property NyxNumberIntProp::value
96 @brief Gets / sets the value of this property object.
101 return bind.lib.nyx_number_prop_get_int(self.
ptr)
106 def value(self, value: int) ->
None:
108 bind.lib.nyx_number_prop_set_int(
117 @ingroup NUMBER_MESSAGE_PY
118 @brief INDI / Nyx `uint32_t` number property.
123 def __init__(self, name: str, label: str |
None, fmt: str, min: int, max: int, step: int, value: int):
125 @brief Allocates a new INDI / Nyx `uint32_t` number property.
127 @param name Property name.
128 @param label Property label.
129 @param fmt Printf-style formatting string (%[flags][width]{uoxX}).
130 @param min Range min, ignored if min == max.
131 @param max Range max, ignored if min == max.
132 @param step Step size, ignored if step == 0.
133 @param value Initial `uint32_t` value.
136 super().
__init__(bind.lib.nyx_number_prop_new_uint(
137 bind.as_bytes(name, allow_none =
False),
138 bind.as_bytes(label, allow_none =
True),
139 bind.as_bytes(fmt, allow_none =
False),
148 @obj.nyx_callback(bind.nyx_callback_uint_t)
149 def _nyx_callback_func(self, _vector, _prop, new_value, old_value) -> bool:
156 def value(self) -> int:
158 @property NyxNumberUIntProp::value
159 @brief Gets the value of this property object.
164 return bind.lib.nyx_number_prop_get_uint(self.
ptr)
169 def value(self, value: int) ->
None:
171 bind.lib.nyx_number_prop_set_uint(
180 @ingroup NUMBER_MESSAGE_PY
181 @brief INDI / Nyx `int64_t` number property.
186 def __init__(self, name: str, label: str |
None, fmt: str, min: int, max: int, step: int, value: int):
188 @brief Allocates a new INDI / Nyx `int64_t` number property.
190 @param name Property name.
191 @param label Property label.
192 @param fmt Printf-style formatting string (%[flags][width]ld).
193 @param min Range min, ignored if min == max.
194 @param max Range max, ignored if min == max.
195 @param step Step size, ignored if step == 0.
196 @param value Initial `int64_t` value.
199 super().
__init__(bind.lib.nyx_number_prop_new_long(
200 bind.as_bytes(name, allow_none =
False),
201 bind.as_bytes(label, allow_none =
True),
202 bind.as_bytes(fmt, allow_none =
False),
211 @obj.nyx_callback(bind.nyx_callback_long_t)
212 def _nyx_callback_func(self, _vector, _prop, new_value, old_value) -> bool:
219 def value(self) -> int:
221 @property NyxNumberLongProp::value
222 @brief Gets the value of this property object.
227 return bind.lib.nyx_number_prop_get_long(self.
ptr)
232 def value(self, value: int) ->
None:
234 bind.lib.nyx_number_prop_set_long(
243 @ingroup NUMBER_MESSAGE_PY
244 @brief INDI / Nyx `uint64_t` number property.
249 def __init__(self, name: str, label: str |
None, fmt: str, min: int, max: int, step: int, value: int):
251 @brief Allocates a new INDI / Nyx `uint64_t` number property.
253 @param name Property name.
254 @param label Property label.
255 @param fmt Printf-style formatting string (%[flags][width]l{uoxX}).
256 @param min Range min, ignored if min == max.
257 @param max Range max, ignored if min == max.
258 @param step Step size, ignored if step == 0.
259 @param value Initial `uint64_t` value.
262 super().
__init__(bind.lib.nyx_number_prop_new_ulong(
263 bind.as_bytes(name, allow_none =
False),
264 bind.as_bytes(label, allow_none =
True),
265 bind.as_bytes(fmt, allow_none =
False),
274 @obj.nyx_callback(bind.nyx_callback_ulong_t)
275 def _nyx_callback_func(self, _vector, _prop, new_value, old_value) -> bool:
282 def value(self) -> int:
284 @property NyxNumberULongProp::value
285 @brief Gets the value of this property object.
290 return bind.lib.nyx_number_prop_get_ulong(self.
ptr)
295 def value(self, value: int) ->
None:
297 bind.lib.nyx_number_prop_set_ulong(
306 @ingroup NUMBER_MESSAGE_PY
307 @brief INDI / Nyx `double` number property.
312 def __init__(self, name: str, label: str |
None, fmt: str, min: float, max: float, step: float, value: float):
314 @brief Allocates a new INDI / Nyx `double` number property.
316 @param name Property name.
317 @param label Property label.
318 @param fmt Printf-style formatting string (%[flags][width]l?{fFeEgGaAm}).
319 @param min Range min, ignored if min == max.
320 @param max Range max, ignored if min == max.
321 @param step Step size, ignored if step == 0.
322 @param value Initial `double` value.
325 super().
__init__(bind.lib.nyx_number_prop_new_double(
326 bind.as_bytes(name, allow_none =
False),
327 bind.as_bytes(label, allow_none =
True),
328 bind.as_bytes(fmt, allow_none =
False),
337 @obj.nyx_callback(bind.nyx_callback_double_t)
338 def _nyx_callback_func(self, _vector, _prop, new_value, old_value) -> bool:
345 def value(self) -> float:
347 @property NyxNumberDoubleProp::value
348 @brief Gets the value of this property object.
353 return bind.lib.nyx_number_prop_get_double(self.
ptr)
358 def value(self, value: float) ->
None:
360 bind.lib.nyx_number_prop_set_double(
378 getter = enums.NyxState.to_int,
379 setter = enums.NyxState.to_str,
384 getter = enums.NyxPerm.to_int,
385 setter = enums.NyxPerm.to_str,
389 @ingroup NUMBER_MESSAGE_PY
390 @brief INDI / Nyx number vector.
397 @brief Allocates a new INDI / Nyx number vector.
399 @param device Device name.
400 @param name Vector name.
401 @param state Vector state.
402 @param perm Vector permissions.
403 @param props Properties.
404 @param opts Options (group, label, hints, timeout, message).
409 super().
__init__(bind.lib.nyx_number_vector_new(
410 bind.as_bytes(device, allow_none =
False),
411 bind.as_bytes(name, allow_none =
False),
412 enums.NyxState.to_int(state),
413 enums.NyxPerm.to_int(perm),
425 if not isinstance(prop, NyxNumberProp):
427 raise TypeError(
'Expected NyxNumberProp')
429 children.append(prop)
433 @obj.nyx_callback(bind.nyx_callback_vector_t)
434 def _nyx_callback_func(self, _vector: json.
json_dict.NyxDict, modified: bool) ->
None:
440__all__ = [name
for name
in globals()
if name.lower().startswith(
'nyx')]
_dispatch_callbacks(self, *args)
__init__(self, str name, str|None label, str fmt, int min, int max, int step, int value)
Allocates a new INDI / Nyx uint64_t number property.
__init__(self, str name, str|None label, str fmt, int min, int max, int step, int value)
Allocates a new INDI / Nyx int32_t number property.
__init__(self, str name, str|None label, str fmt, float min, float max, float step, float value)
Allocates a new INDI / Nyx double number property.
__init__(self, str name, str|None label, str fmt, int min, int max, int step, int value)
Allocates a new INDI / Nyx uint32_t number property.
__init__(self, str device, str name, enums.NyxState|int|str state, enums.NyxPerm|int|str perm, typing.Iterable[NyxNumberProp] props, **typing.Any opts)
Allocates a new INDI / Nyx number vector.
__init__(self, str name, str|None label, str fmt, int min, int max, int step, int value)
Allocates a new INDI / Nyx int64_t number property.
INDI / Nyx double number property.
INDI / Nyx int32_t number property.
INDI / Nyx int64_t number property.
Base class for INDI / Nyx number properties.
INDI / Nyx uint32_t number property.
INDI / Nyx uint64_t number property.
INDI / Nyx number vector.