malcolm.modules.pva.controllers

class malcolm.modules.pva.controllers.BlockHandler(controller: malcolm.core.controller.Controller, field: Optional[str] = None)[source]
rpc(pv: p4p.server.cothread.SharedPV, op: p4p._p4p.ServerOperation)None[source]

Called each time a client issues a Remote Procedure Call operation on this Channel.

Parameters
  • pv (SharedPV) – The SharedPV which this Handler is associated with.

  • op (ServerOperation) – The operation being initiated.

put(pv: p4p.server.cothread.SharedPV, op: p4p._p4p.ServerOperation)None[source]

Called each time a client issues a Put operation on this Channel.

Parameters
  • pv (SharedPV) – The SharedPV which this Handler is associated with.

  • op (ServerOperation) – The operation being initiated.

onFirstConnect(pv: p4p.server.cothread.SharedPV)None[source]

Called when the first Client channel is created.

Parameters

pv (SharedPV) – The SharedPV which this Handler is associated with.

onLastDisconnect(pv: p4p.server.cothread.SharedPV)None[source]

Called when the last Client channel is closed.

Parameters

pv (SharedPV) – The SharedPV which this Handler is associated with.

class malcolm.modules.pva.controllers.PvaClientComms(mri: Anno(name='AMri', typ=<class 'str'>, description='The Malcolm Resource Identifier for the Block produced'), description: Anno(name='ADescription', typ=<class 'str'>, description='Description of the Block produced by the controller') = '')[source]

A class for a client to communicate with the server

Parameters
  • mri (str) – The Malcolm Resource Identifier for the Block produced

  • description (str) – Description of the Block produced by the controller

sync_proxy(mri, block)[source]

Abstract method telling the ClientComms to sync this proxy Block with its remote counterpart. Should wait until it is connected

Parameters
  • mri (str) – The mri for the remote block

  • block (BlockModel) – The local proxy Block to keep in sync

send_put(mri, attribute_name, value)[source]

Abstract method to dispatch a Put to the server

Parameters
  • mri (str) – The mri of the Block

  • attribute_name (str) – The name of the Attribute within the Block

  • value – The value to put

send_post(mri, method_name, **params)[source]

Abstract method to dispatch a Post to the server

Parameters
  • mri (str) – The mri of the Block

  • method_name (str) – The name of the Method within the Block

  • params – The parameters to send

Returns

The return results from the server

class malcolm.modules.pva.controllers.PvaServerComms(mri: Anno(name='AMri', typ=<class 'str'>, description='The Malcolm Resource Identifier for the Block produced'))[source]

A class for communication between pva client and server

Parameters

mri (str) – The Malcolm Resource Identifier for the Block produced

publish(published: Anno(name='APublished', typ=<class 'str'>, description='The list of currently published Controller mris'))None[source]
Parameters

published (str) – The list of currently published Controller mris

disconnect_pv_clients(mris: List[str])None[source]

Disconnect anyone listening to any of the given mris