Abstract Classes¶
Abstract parameter¶
-
class
alphalogic_api.objects.parameter.
AbstractParameter
¶ AbstractParameter implements ParameterService service (see rpc.proto)
-
clear
()¶ Remove all predefined values from the ‘choices’ argument of the parameter
-
desc
()¶ Return parameter description
Return type: unicode
-
display_name
()¶ Return parameter display name
Return type: unicode
-
enums
()¶ Get the predefined enumeration of values from the ‘choices’ argument of the parameter
Return type: List of values of long, float, datetime, bool or unicode type in a tuple as (value1, value2, value3 ….)
-
get
()¶ Get parameter value
Return type: long, float, datetime, bool or unicode
-
has_enum
(enum_name)¶ Return True if parameter has a predefined enumeration of values
Return type: bool
-
is_bool
()¶ Return True if parameter value type is bool
Return type: bool
-
is_common
()¶ Return True if parameter type is Visible.common
Return type: bool
-
is_datetime
()¶ Return True if parameter value type is datetime
Return type: bool
-
is_double
()¶ Return True if parameter value type is double
Return type: bool
Return True if parameter type is Visible.hidden
Return type: bool
-
is_licensed
()¶ Return True if parameter is the license key parameter
Return type: bool
-
is_list
()¶ Return True if parameter value type is list
Return type: bool
-
is_long
()¶ Return True if parameter value type is long
Return type: bool
-
is_map
()¶ Return True if parameter value type is map
Return type: bool
-
is_read_only
()¶ Return True if parameter access type is Access.read_only
Return type: bool
-
is_read_write
()¶ Return True if parameter access type is Access.read_write
Return type: bool
-
is_runtime
()¶ Return True if parameter type is Visible.runtime
Return type: bool
-
is_setup
()¶ Return True if parameter type is Visible.setup
Return type: bool
-
is_string
()¶ Return True if parameter value type is string
Return type: bool
-
name
()¶ Return parameter name
Return type: unicode
-
owner
()¶ Return ID of the parameter’s owner
Return type: uint64
-
set
(value)¶ Set parameter value
Parameters: value – The value type: long, float, datetime, bool or unicode
-
set_common
()¶ Set parameter type to Visible.common
-
set_desc
(desc)¶ Set parameter description
Parameters: desc – unicode
-
set_display_name
(display_name)¶ Set parameter display name
Parameters: display_name – unicode
-
set_enum
(value, enum_name)¶ Add/replace enumeration member – a pair (value, name) – for the ‘choices’ argument of the parameter
Parameters: - value – The value type: long, float, datetime, bool or unicode
- enum_name – enumeration member name
-
set_enums
(values)¶ Add/replace multiple enumeration members for the ‘choices’ argument of the parameter
Parameters: values – An array of values can be one of the following: - List of values of long, float, datetime, bool or unicode type in a tuple as (value1, value2, value3 ….)
- List of enumeration members in a tuple of tuples as ((value1, ‘enum_name1’), (value2, ‘enum_name2’), …)
Set parameter type to Visible.hidden
-
set_licensed
()¶ Set the license key parameter
-
set_list
()¶ Set value_type LIST
-
set_read_only
()¶ Set parameter access type to Access.read_only
-
set_read_write
()¶ Set parameter access type to Access.read_write
-
set_runtime
()¶ Set parameter type to Visible.runtime
-
set_setup
()¶ Set parameter type to Visible.setup
-
Abstract event¶
-
class
alphalogic_api.objects.event.
AbstractEvent
¶ AbstractEvent implements EventService service (see rpc.proto)
-
argument
(name_argument)¶ Return event argument with value by argument name
Parameters: name_argument – event argument name Return type: name/value pair as a tuple (argument name, argument value)
-
argument_list
()¶ Return list of event arguments
Return type: list of event argument names
-
clear
()¶ Remove event arguments
-
desc
()¶ Return event description
Return type: unicode
-
display_name
()¶ Return event display name
Return type: unicode
-
emit
(**kwargs)¶ - Emit event with the current UTC time.In order to use timestamp other than the current UTC time, you should call set_time function with required timestamp before executing emit function.
Parameters: kwargs – name/value pairs of event arguments separated by commas, each argument name followed by an equal sign
-
is_blocker
()¶ Return True if event severity is blocker
Return type: bool
-
is_critical
()¶ Return True if event severity is critical
Return type: bool
-
is_major
()¶ Return True if event severity is major
Return type: bool
-
is_minor
()¶ Return True if event severity is minor
Return type: bool
-
is_trivial
()¶ Return True if event severity is trivial
Return type: bool
-
name
()¶ Return event name
Return type: unicode
-
owner
()¶ Return ID of the event’s owner
Return type: uint64
-
set_argument_value
(name_arg, value)¶ Set argument value
Parameters: - name_arg – event argument name
- value – event argument value
-
set_blocker
()¶ Set event severity to blocker
-
set_critical
()¶ Set event severity to critical
-
set_desc
(desc)¶ Set event description
Parameters: desc – unicode
-
set_display_name
(display_name)¶ Set event display name
Parameters: display_name – unicode
-
set_major
()¶ Set event severity to major
-
set_minor
()¶ Set event severity to minor
-
set_time
(timestamp)¶ Set event time (UTC)
Parameters: timestamp – int(time.time() * 1000) (мс)
-
set_trivial
()¶ Set event severity to trivial
-
update_or_create_argument
(name_arg, value)¶ Add event argument / overwrite argument value
Parameters: - name_arg – event argument name
- value – event argument value
-
Abstract command¶
-
class
alphalogic_api.objects.command.
AbstractCommand
¶ AbstractCommand implements CommandService service (see rpc.proto)
-
argument
(name_argument)¶ Return command argument with value by argument name
Parameters: name_argument – command argument name Return type: name/value pair as a tuple (argument name, argument value)
-
argument_list
()¶ Return list of command arguments
Return type: list of command argument names
-
clear
()¶ Remove command arguments
-
desc
()¶ Return command description
Return type: unicode
-
display_name
()¶ Return command display name
Return type: unicode
-
is_bool
()¶ Return True if command return type is bool
Return type: bool
-
is_datetime
()¶ Return True if command return type is datetime
Return type: bool
-
is_double
()¶ Return True if command return type is double
Return type: bool
-
is_list
()¶ Return True if command return type is list
Return type: bool
-
is_long
()¶ Return True if command return type is long
Return type: bool
-
is_map
()¶ Return True if command return type is map
Return type: bool
-
is_string
()¶ Return True if command return type is string
Return type: bool
-
name
()¶ Return command name
Return type: unicode
-
owner
()¶ Return ID of the command’s owner
Return type: uint64
-
set_desc
(desc)¶ Set command description
Parameters: desc – unicode
-
set_display_name
(display_name)¶ Set command display name
Parameters: display_name – unicode
-
set_exception
(reason)¶ Set exception in command. Information about exception will be called for adapter’s side.
Parameters: reason – state unicode string
-
set_result
(value)¶ Set command return value
Parameters: value – The value type: long, float, datetime, bool or unicode
-
update_or_create_argument
(name_arg, value)¶ Add command argument / overwrite argument value
Parameters: - name_arg – command argument name
- value – command argument value
-
Command¶
-
class
alphalogic_api.objects.command.
Command
(device, function)¶ - Class Command is used in command decorator.Class Command inherits all data elements and methods from
AbstractCommand
.Parameters: - device – has
Object
type - function – executed function
-
call_function
()¶ Call function when command executed
Return type: The return type depends on the function code
- device – has