Handler

class secsgem.secs.handler.SecsHandler(settings)[source]

Baseclass for creating Host/Equipment models. This layer contains the SECS functionality.

Inherit from this class and override required functions.

property settings: Settings

Get the setting object.

property protocol: Protocol

Get the connection for the handler.

enable()[source]

Enable the connection.

disable()[source]

Disable the connection.

send_response(*args, **kwargs)[source]

Wrapper for connections send_response function.

send_and_waitfor_response(*args, **kwargs)[source]

Wrapper for connections send_and_waitfor_response function.

send_stream_function(*args, **kwargs)[source]

Wrapper for connections send_stream_function function.

property events

Wrapper for connections events.

property callbacks

Property for callback handling.

register_stream_function(stream, function, callback)[source]

Register the function callback for stream and function.

Parameters:
  • stream (integer) – stream to register callback for

  • function (integer) – function to register callback for

  • callback (def callback(connection)) – method to call when stream and functions is received

unregister_stream_function(stream, function)[source]

Unregister the function callback for stream and function.

Parameters:
  • stream (integer) – stream to unregister callback for

  • function (integer) – function to register callback for

disable_ceids()[source]

Disable all Collection Events.

disable_ceid_reports()[source]

Disable all Collection Event Reports.

list_svs(svs=None)[source]

Get list of available Service Variables.

Returns:

available Service Variables

Return type:

list

request_svs(svs)[source]

Request contents of supplied Service Variables.

Parameters:

svs (list) – Service Variables to request

Returns:

values of requested Service Variables

Return type:

list

request_sv(sv_id)[source]

Request contents of one Service Variable.

Parameters:

sv_id (int) – id of Service Variable

Returns:

value of requested Service Variable

Return type:

various

list_ecs(ecs=None)[source]

Get list of available Equipment Constants.

Returns:

available Equipment Constants

Return type:

list

request_ecs(ecs)[source]

Request contents of supplied Equipment Constants.

Parameters:

ecs (list) – Equipment Constants to request

Returns:

values of requested Equipment Constants

Return type:

list

request_ec(ec_id)[source]

Request contents of one Equipment Constant.

Parameters:

ec_id (int) – id of Equipment Constant

Returns:

value of requested Equipment Constant

Return type:

various

set_ecs(ecs)[source]

Set contents of supplied Equipment Constants.

Parameters:

ecs (list) – list containing list of id / value pairs

set_ec(ec_id, value)[source]

Set contents of one Equipment Constant.

Parameters:
  • ec_id (int) – id of Equipment Constant

  • value (various) – new content of Equipment Constant

send_equipment_terminal(terminal_id, text)[source]

Set text to equipment terminal.

Parameters:
  • terminal_id (int) – ID of terminal

  • text (string) – text to send

are_you_there()[source]

Check if remote is still replying.

stream_function(stream, function)[source]

Get class for stream and function.

Parameters:
  • stream (int) – stream to get class for

  • function (int) – function to get class for

Return type:

type[SecsStreamFunction]

Returns:

class for function

property data_items: DataItems

Get class for stream and function.

Parameters:
  • stream – stream to get class for

  • function – function to get class for

Returns:

class for function