![]() |
ctrlX Data Layer API for Python
3.3.0
The ctrlX Data Layer API allows access to the ctrlX Data Layer with Python
|
Public Member Functions | |
def | __init__ (self, C_DLR_VARIANT c_variant=None) |
def | __del__ (self) |
def | __enter__ (self) |
def | __exit__ (self, exc_type, exc_val, exc_tb) |
Result | check_convert (self, VariantType datatype) |
def | clone (self) |
def | close (self) |
typing.List[bool] | get_array_bool8 (self) |
typing.List[datetime.datetime] | get_array_datetime (self) |
typing.List[float] | get_array_float32 (self) |
typing.List[float] | get_array_float64 (self) |
typing.List[int] | get_array_int16 (self) |
typing.List[int] | get_array_int32 (self) |
typing.List[int] | get_array_int64 (self) |
typing.List[int] | get_array_int8 (self) |
typing.List[str] | get_array_string (self) |
typing.List[int] | get_array_uint16 (self) |
typing.List[int] | get_array_uint32 (self) |
typing.List[int] | get_array_uint64 (self) |
typing.List[int] | get_array_uint8 (self) |
bool | get_bool8 (self) |
int | get_count (self) |
bytearray | get_data (self) |
datetime.datetime | get_datetime (self) |
bytearray | get_flatbuffers (self) |
float | get_float32 (self) |
float | get_float64 (self) |
def | get_handle (self) |
int | get_int16 (self) |
int | get_int32 (self) |
int | get_int64 (self) |
int | get_int8 (self) |
int | get_size (self) |
str | get_string (self) |
VariantType | get_type (self) |
int | get_uint16 (self) |
int | get_uint32 (self) |
int | get_uint64 (self) |
int | get_uint8 (self) |
Result | set_array_bool8 (self, typing.List[bool] data) |
Result | set_array_datetime (self, typing.List[datetime.datetime] data) |
Result | set_array_float32 (self, typing.List[float] data) |
Result | set_array_float64 (self, typing.List[float] data) |
Result | set_array_int16 (self, typing.List[int] data) |
Result | set_array_int32 (self, typing.List[int] data) |
Result | set_array_int64 (self, typing.List[int] data) |
Result | set_array_int8 (self, typing.List[int] data) |
Result | set_array_string (self, typing.List[str] data) |
Result | set_array_timestamp (self, typing.List[int] data) |
Result | set_array_uint16 (self, typing.List[int] data) |
Result | set_array_uint32 (self, typing.List[int] data) |
Result | set_array_uint64 (self, typing.List[int] data) |
Result | set_array_uint8 (self, typing.List[int] data) |
Result | set_bool8 (self, bool data) |
Result | set_datetime (self, datetime dt) |
Result | set_flatbuffers (self, bytearray data) |
Result | set_float32 (self, float data) |
Result | set_float64 (self, float data) |
Result | set_int16 (self, int data) |
Result | set_int32 (self, int data) |
Result | set_int64 (self, int data) |
Result | set_int8 (self, int data) |
Result | set_string (self, str data) |
Result | set_timestamp (self, int data) |
Result | set_uint16 (self, int data) |
Result | set_uint32 (self, int data) |
Result | set_uint64 (self, int data) |
Result | set_uint8 (self, int data) |
Static Public Member Functions | |
def | copy (C_DLR_VARIANT c_variant) |
datetime | from_filetime (filetime) |
int | to_filetime (datetime dt) |
Variant is a container for a many types of data.
Hint see python context manager for instance handling
Definition at line 150 of file variant.py.
Result check_convert | ( | self, | |
VariantType | datatype | ||
) |
Checks whether the variant can be converted to another type.
Definition at line 233 of file variant.py.
References Variant._variant.
Referenced by Variant.get_array_bool8(), Variant.get_array_float32(), Variant.get_array_float64(), Variant.get_array_int16(), Variant.get_array_int32(), Variant.get_array_int64(), Variant.get_array_int8(), Variant.get_array_string(), Variant.get_array_uint16(), Variant.get_array_uint32(), Variant.get_array_uint64(), Variant.get_array_uint8(), Variant.get_flatbuffers(), and Variant.get_string().
def clone | ( | self | ) |
clones the content of a variant to another variant
Definition at line 256 of file variant.py.
References Variant._variant.
|
static |
copies the content of a variant to another variant
Definition at line 244 of file variant.py.
Referenced by Variant.set_array_datetime().
|
static |
convert filetime to datetime
filetime | (FILETIME) 64 bit 100ns since 1.1.1601 (UTC) |
Definition at line 689 of file variant.py.
typing.List[bool] get_array_bool8 | ( | self | ) |
Returns the array of int8 if the type is an array of int8 otherwise null.
Definition at line 372 of file variant.py.
References Variant._variant, and Variant.check_convert().
typing.List[datetime.datetime] get_array_datetime | ( | self | ) |
datetime objects as timestamp (FILETIME) 64 bit 100ns since 1.1.1601 (UTC)
Definition at line 531 of file variant.py.
References Variant.get_array_uint64().
typing.List[float] get_array_float32 | ( | self | ) |
Returns the array of float if the type is an array of float otherwise null.
Definition at line 491 of file variant.py.
References Variant._variant, and Variant.check_convert().
typing.List[float] get_array_float64 | ( | self | ) |
Returns the array of double if the type is an array of double otherwise null.
Definition at line 504 of file variant.py.
References Variant._variant, and Variant.check_convert().
typing.List[int] get_array_int16 | ( | self | ) |
Returns the array of int16 if the type is an array of int16 otherwise null.
Definition at line 412 of file variant.py.
References Variant._variant, and Variant.check_convert().
typing.List[int] get_array_int32 | ( | self | ) |
Returns the array of int32 if the type is an array of int32 otherwise null.
Definition at line 438 of file variant.py.
References Variant._variant, and Variant.check_convert().
typing.List[int] get_array_int64 | ( | self | ) |
Returns the array of int64 if the type is an array of int64 otherwise null.
Definition at line 464 of file variant.py.
References Variant._variant, and Variant.check_convert().
typing.List[int] get_array_int8 | ( | self | ) |
Returns the array of int8 if the type is an array of int8 otherwise null.
Definition at line 386 of file variant.py.
References Variant._variant, and Variant.check_convert().
typing.List[str] get_array_string | ( | self | ) |
Returns the type of the variant.
Definition at line 517 of file variant.py.
References Variant._variant, and Variant.check_convert().
typing.List[int] get_array_uint16 | ( | self | ) |
Returns the array of uint16 if the type is an array of uint16 otherwise null.
Definition at line 425 of file variant.py.
References Variant._variant, and Variant.check_convert().
typing.List[int] get_array_uint32 | ( | self | ) |
Returns the array of uint32 if the type is an array of uint32 otherwise null.
Definition at line 451 of file variant.py.
References Variant._variant, and Variant.check_convert().
typing.List[int] get_array_uint64 | ( | self | ) |
Returns the array of uint64 if the type is an array of uint64 otherwise null.
Definition at line 477 of file variant.py.
References Variant._variant, and Variant.check_convert().
Referenced by Variant.get_array_datetime().
typing.List[int] get_array_uint8 | ( | self | ) |
Returns the array of uint8 if the type is an array of uint8 otherwise null.
Definition at line 399 of file variant.py.
References Variant._variant, and Variant.check_convert().
bool get_bool8 | ( | self | ) |
Returns the value of the variant as a bool (auto convert if possible) otherwise 0.
Definition at line 263 of file variant.py.
References Variant._variant.
int get_count | ( | self | ) |
Returns the count of elements in the variant (scalar data types = 1, array = count of elements in array)
Definition at line 226 of file variant.py.
References Variant._variant.
bytearray get_data | ( | self | ) |
Returns the pointer to the data of the variant.
Definition at line 209 of file variant.py.
References Variant._variant.
Referenced by Variant.get_flatbuffers().
datetime.datetime get_datetime | ( | self | ) |
datetime object as timestamp (FILETIME) 64 bit 100ns since 1.1.1601 (UTC)
Definition at line 364 of file variant.py.
References Variant.get_uint64().
bytearray get_flatbuffers | ( | self | ) |
Returns the flatbuffers if the type is a flatbuffers otherwise null.
Definition at line 353 of file variant.py.
References Variant.check_convert(), Response.get_data(), _Request.get_data(), NotifyItemPublish.get_data(), NotifyItem.get_data(), and Variant.get_data().
float get_float32 | ( | self | ) |
Returns the value of the variant as a float (auto convert if possible) otherwise 0.
Definition at line 326 of file variant.py.
References Variant._variant.
float get_float64 | ( | self | ) |
Returns the value of the variant as a double (auto convert if possible) otherwise 0.
Definition at line 333 of file variant.py.
References Variant._variant.
int get_int16 | ( | self | ) |
Returns the value of the variant as an int16 (auto convert if possible) otherwise 0.
Definition at line 284 of file variant.py.
References Variant._variant.
int get_int32 | ( | self | ) |
Returns the value of the variant as an int32 (auto convert if possible) otherwise 0.
Definition at line 298 of file variant.py.
References Variant._variant.
int get_int64 | ( | self | ) |
Returns the value of the variant as an int64 (auto convert if possible) otherwise 0.
Definition at line 312 of file variant.py.
References Variant._variant.
int get_int8 | ( | self | ) |
Returns the value of the variant as an int8 (auto convert if possible) otherwise 0.
Definition at line 270 of file variant.py.
References Variant._variant.
int get_size | ( | self | ) |
Definition at line 219 of file variant.py.
References Variant._variant.
str get_string | ( | self | ) |
Returns the array of bool8 if the type is an array of bool otherwise null.
Definition at line 340 of file variant.py.
References Variant._variant, and Variant.check_convert().
VariantType get_type | ( | self | ) |
Returns the type of the variant.
Definition at line 202 of file variant.py.
References Variant._variant.
int get_uint16 | ( | self | ) |
Returns the value of the variant as an uint16 (auto convert if possible) otherwise 0.
Definition at line 291 of file variant.py.
References Variant._variant.
int get_uint32 | ( | self | ) |
Returns the value of the variant as an Uint32 (auto convert if possible) otherwise 0.
Definition at line 305 of file variant.py.
References Variant._variant.
int get_uint64 | ( | self | ) |
Returns the value of the variant as an uint64 (auto convert if possible) otherwise 0.
Definition at line 319 of file variant.py.
References Variant._variant.
Referenced by Variant.get_datetime().
int get_uint8 | ( | self | ) |
Returns the value of the variant as an uint8 (auto convert if possible) otherwise 0.
Definition at line 277 of file variant.py.
References Variant._variant.
Result set_array_bool8 | ( | self, | |
typing.List[bool] | data | ||
) |
Set array of bool8.
Definition at line 711 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_array_datetime | ( | self, | |
typing.List[datetime.datetime] | data | ||
) |
Set array of datetime.
Definition at line 881 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, Variant.copy(), and Variant.set_array_timestamp().
Result set_array_float32 | ( | self, | |
typing.List[float] | data | ||
) |
Set array of float32.
Definition at line 828 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_array_float64 | ( | self, | |
typing.List[float] | data | ||
) |
Set array of float64.
Definition at line 841 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_array_int16 | ( | self, | |
typing.List[int] | data | ||
) |
Set array of int16.
Definition at line 750 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_array_int32 | ( | self, | |
typing.List[int] | data | ||
) |
Set array of int32.
Definition at line 776 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_array_int64 | ( | self, | |
typing.List[int] | data | ||
) |
Set array of int64.
Definition at line 802 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_array_int8 | ( | self, | |
typing.List[int] | data | ||
) |
Set array of int8.
Definition at line 724 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_array_string | ( | self, | |
typing.List[str] | data | ||
) |
Set array of strings.
Definition at line 854 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_array_timestamp | ( | self, | |
typing.List[int] | data | ||
) |
Set array of timestamp (uint64)
Definition at line 868 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Referenced by Variant.set_array_datetime().
Result set_array_uint16 | ( | self, | |
typing.List[int] | data | ||
) |
Set array of uint16.
Definition at line 763 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_array_uint32 | ( | self, | |
typing.List[int] | data | ||
) |
Set array of uint32.
Definition at line 789 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_array_uint64 | ( | self, | |
typing.List[int] | data | ||
) |
Set array of uint64.
Definition at line 815 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_array_uint8 | ( | self, | |
typing.List[int] | data | ||
) |
Set array of uint8.
Definition at line 737 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_bool8 | ( | self, | |
bool | data | ||
) |
Set a bool value.
Definition at line 539 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_datetime | ( | self, | |
datetime | dt | ||
) |
Set a timestamp value as datetime object.
dt | datetime object |
Definition at line 676 of file variant.py.
References NotifyInfoPublish.set_timestamp(), and Variant.set_timestamp().
Result set_flatbuffers | ( | self, | |
bytearray | data | ||
) |
Set a flatbuffers.
Definition at line 648 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_float32 | ( | self, | |
float | data | ||
) |
Set a float value.
Definition at line 620 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_float64 | ( | self, | |
float | data | ||
) |
Set a double value.
Definition at line 629 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_int16 | ( | self, | |
int | data | ||
) |
Set an int16 value.
Definition at line 566 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_int32 | ( | self, | |
int | data | ||
) |
Set an int32 value.
Definition at line 584 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_int64 | ( | self, | |
int | data | ||
) |
Set an int64 value.
Definition at line 602 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_int8 | ( | self, | |
int | data | ||
) |
Set an int8 value.
Definition at line 548 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_string | ( | self, | |
str | data | ||
) |
Set a string.
Definition at line 638 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_uint16 | ( | self, | |
int | data | ||
) |
Set a uint16 value.
Definition at line 575 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_uint32 | ( | self, | |
int | data | ||
) |
Set a uint32 value.
Definition at line 593 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_uint64 | ( | self, | |
int | data | ||
) |
Set a uint64 value.
Definition at line 611 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
Result set_uint8 | ( | self, | |
int | data | ||
) |
Set a uint8 value.
Definition at line 557 of file variant.py.
References Client.__closed, Provider.__closed, ProviderNode.__closed, SubscriptionAsync.__closed, SubscriptionSync.__closed, System.__closed, Variant.__closed, and Variant._variant.
|
static |
convert datetime to filetime
dt | datetime to convert |
Definition at line 702 of file variant.py.