malcolm.modules.ADCore.parts

class malcolm.modules.ADCore.parts.DetectorDriverPart(name: Anno(name='APartName', typ=<class 'str'>, description='The name of the Part within the Controller'), mri: Anno(name='AMri', typ=<class 'str'>, description='Malcolm resource id of child object'), soft_trigger_modes: Optional[Union[Anno(name='ASoftTriggerModes', typ=<class 'str'>, description='List of trigger modes that do not use hardware triggers'), Sequence[str]]] = None, multiple_image_mode: Anno(name='AMultipleImageMode', typ=<class 'str'>, description='Name of image mode for taking multiple images') = 'Multiple', main_dataset_useful: Anno(name='AMainDatasetUseful', typ=<class 'bool'>, description='Is main detector dataset useful to publish in DatasetTable?') = True, runs_on_windows: Anno(name='APartRunsOnWindows', typ=<class 'bool'>, description='Is the IOC this part connects to running on Windows?') = False, required_version: Optional[Anno(name='AVersionRequirement', typ=<class 'str'>, description='Minimum required version for compatibility')] = None, min_acquire_period: Anno(name='AMinAcquirePeriod', typ=<class 'float'>, description='Minimum acquire period the detector is capable of') = 0.0)[source]
Parameters
  • name (str) – The name of the Part within the Controller

  • mri (str) – Malcolm resource id of child object

  • soft_trigger_modes (str) – List of trigger modes that do not use hardware triggers

  • multiple_image_mode (str) – Name of image mode for taking multiple images

  • main_dataset_useful (bool) – Is main detector dataset useful to publish in DatasetTable?

  • runs_on_windows (bool) – Is the IOC this part connects to running on Windows?

  • required_version (str) – Minimum required version for compatibility

  • min_acquire_period (float) – Minimum acquire period the detector is capable of

on_validate(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks'), generator: Anno(name='AGenerator', typ=<class 'scanpointgenerator.core.compoundgenerator.CompoundGenerator'>, description='Generator instance providing specification for scan'), frames_per_step: Anno(name='ADetectorFramesPerStep', typ=<class 'int'>, description='Frames per detector step') = 1) Optional[Union[Anno(name='AParameterTweakInfos', typ=<class 'malcolm.modules.scanning.infos.ParameterTweakInfo'>, description='Parameters that need to be changed to make them compatible'), Sequence[malcolm.modules.scanning.infos.ParameterTweakInfo], malcolm.modules.scanning.infos.ParameterTweakInfo]][source]
Parameters
  • context (Context) – Context that should be used to perform operations on child blocks

  • generator (CompoundGenerator) – Generator instance providing specification for scan

  • frames_per_step (int) – Frames per detector step

Returns

Parameters that need to be changed to make them compatible

Return type

ParameterTweakInfo

on_reset(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks')) None[source]
Parameters

context (Context) – Context that should be used to perform operations on child blocks

on_report_status() Optional[Union[Anno(name='AInfos', typ=<class 'malcolm.core.info.Info'>, description='Infos about current Part status to be passed to other parts'), Sequence[malcolm.core.info.Info], malcolm.core.info.Info]][source]
Returns

Infos about current Part status to be passed to other parts

Return type

Info

on_seek(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks'), completed_steps: Anno(name='ACompletedSteps', typ=<class 'int'>, description='Number of steps already completed'), steps_to_do: Anno(name='AStepsToDo', typ=<class 'int'>, description='Number of steps we should configure for'), part_info: Anno(name='APartInfo', typ=(<class 'str'>, annotypes._array.Array[malcolm.core.info.Info]), description='The Infos returned from other Parts'), generator: Anno(name='AGenerator', typ=<class 'scanpointgenerator.core.compoundgenerator.CompoundGenerator'>, description='Generator instance providing specification for scan'), fileDir: Anno(name='AFileDir', typ=<class 'str'>, description='Directory to write data to'), breakpoints: Optional[Anno(name='ABreakpoints', typ=<class 'numpy.int32'>, description='List of points at which the run will return in Armed state')] = None, **kwargs: Any) None[source]
Parameters
  • context (Context) – Context that should be used to perform operations on child blocks

  • completed_steps (int) – Number of steps already completed

  • steps_to_do (int) – Number of steps we should configure for

  • part_info – The Infos returned from other Parts

  • generator (CompoundGenerator) – Generator instance providing specification for scan

  • fileDir (str) – Directory to write data to

  • breakpoints (int32) – List of points at which the run will return in Armed state

on_configure(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks'), completed_steps: Anno(name='ACompletedSteps', typ=<class 'int'>, description='Number of steps already completed'), steps_to_do: Anno(name='AStepsToDo', typ=<class 'int'>, description='Number of steps we should configure for'), part_info: Anno(name='APartInfo', typ=(<class 'str'>, annotypes._array.Array[malcolm.core.info.Info]), description='The Infos returned from other Parts'), generator: Anno(name='AGenerator', typ=<class 'scanpointgenerator.core.compoundgenerator.CompoundGenerator'>, description='Generator instance providing specification for scan'), fileDir: Anno(name='AFileDir', typ=<class 'str'>, description='Directory to write data to'), breakpoints: Optional[Anno(name='ABreakpoints', typ=<class 'numpy.int32'>, description='List of points at which the run will return in Armed state')] = None, **kwargs: Any) None[source]
Parameters
  • context (Context) – Context that should be used to perform operations on child blocks

  • completed_steps (int) – Number of steps already completed

  • steps_to_do (int) – Number of steps we should configure for

  • part_info – The Infos returned from other Parts

  • generator (CompoundGenerator) – Generator instance providing specification for scan

  • fileDir (str) – Directory to write data to

  • breakpoints (int32) – List of points at which the run will return in Armed state

on_run(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks')) None[source]
Parameters

context (Context) – Context that should be used to perform operations on child blocks

on_post_run_armed(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks'), completed_steps: Anno(name='ACompletedSteps', typ=<class 'int'>, description='Number of steps already completed'), steps_to_do: Anno(name='AStepsToDo', typ=<class 'int'>, description='Number of steps we should configure for'), part_info: Anno(name='APartInfo', typ=(<class 'str'>, annotypes._array.Array[malcolm.core.info.Info]), description='The Infos returned from other Parts'), generator: Anno(name='AGenerator', typ=<class 'scanpointgenerator.core.compoundgenerator.CompoundGenerator'>, description='Generator instance providing specification for scan'), breakpoints: Optional[Anno(name='ABreakpoints', typ=<class 'numpy.int32'>, description='List of points at which the run will return in Armed state')] = None) None[source]
Parameters
  • context (Context) – Context that should be used to perform operations on child blocks

  • completed_steps (int) – Number of steps already completed

  • steps_to_do (int) – Number of steps we should configure for

  • part_info – The Infos returned from other Parts

  • generator (CompoundGenerator) – Generator instance providing specification for scan

  • breakpoints (int32) – List of points at which the run will return in Armed state

on_abort(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks')) None[source]
Parameters

context (Context) – Context that should be used to perform operations on child blocks

class malcolm.modules.ADCore.parts.FilepathTranslatorPart(name: Anno(name='APartName', typ=<class 'str'>, description='The name of the Part within the Controller'), initial_windows_drive_letter: Anno(name='ADriveLetter', typ=<class 'str'>, description='Letter assigned to the windows drive mount'), initial_path_prefix: Anno(name='APathPrefix', typ=<class 'str'>, description='The first bit of the file path (i.e. /dls for /dls/i18/...)') = '/dls', initial_network_prefix: Anno(name='ANetworkPrefix', typ=<class 'str'>, description='The path prefix if it is a network mount (e.g. //dc)') = '')[source]
Parameters
  • name (str) – The name of the Part within the Controller

  • initial_windows_drive_letter (str) – Letter assigned to the windows drive mount

  • initial_path_prefix (str) – The first bit of the file path (i.e. /dls for /dls/i18/…)

  • initial_network_prefix (str) – The path prefix if it is a network mount (e.g. //dc)

on_report_status() Optional[Union[Anno(name='AInfos', typ=<class 'malcolm.core.info.Info'>, description='Infos about current Part status to be passed to other parts'), Sequence[malcolm.core.info.Info], malcolm.core.info.Info]][source]
Returns

Infos about current Part status to be passed to other parts

Return type

Info

class malcolm.modules.ADCore.parts.HDFWriterPart(name: Anno(name='APartName', typ=<class 'str'>, description='The name of the Part within the Controller'), mri: Anno(name='AMri', typ=<class 'str'>, description='Malcolm resource id of child object'), runs_on_windows: Anno(name='APartRunsOnWindows', typ=<class 'bool'>, description='Is the IOC this part connects to running on Windows?') = False, write_all_nd_attributes: Anno(name='AWriteAllNDAttributes', typ=<class 'bool'>, description='Toggle writing of all ND attributes to HDF file') = True, remove_demand_positions_from_xml: Anno(name='ARemoveDemandXml', typ=<class 'bool'>, description='Toggle whether demand positions are in XML') = False, required_version: Optional[Anno(name='AVersionRequirement', typ=<class 'str'>, description='Minimum required version for compatibility')] = None)[source]

Part for controlling an hdf_writer_block in a Device

Parameters
  • name (str) – The name of the Part within the Controller

  • mri (str) – Malcolm resource id of child object

  • runs_on_windows (bool) – Is the IOC this part connects to running on Windows?

  • write_all_nd_attributes (bool) – Toggle writing of all ND attributes to HDF file

  • remove_demand_positions_from_xml (bool) – Toggle whether demand positions are in XML

  • required_version (str) – Minimum required version for compatibility

on_validate(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks')) None[source]
Parameters

context (Context) – Context that should be used to perform operations on child blocks

on_reset(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks')) None[source]
Parameters

context (Context) – Context that should be used to perform operations on child blocks

on_configure(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks'), completed_steps: Anno(name='ACompletedSteps', typ=<class 'int'>, description='Number of steps already completed'), steps_to_do: Anno(name='AStepsToDo', typ=<class 'int'>, description='Number of steps we should configure for'), part_info: Anno(name='APartInfo', typ=(<class 'str'>, annotypes._array.Array[malcolm.core.info.Info]), description='The Infos returned from other Parts'), generator: Anno(name='AGenerator', typ=<class 'scanpointgenerator.core.compoundgenerator.CompoundGenerator'>, description='Generator instance providing specification for scan'), fileDir: Anno(name='AFileDir', typ=<class 'str'>, description='Directory to write data to'), formatName: Anno(name='AFormatName', typ=<class 'str'>, description='Argument for fileTemplate, normally filename without extension') = 'det', fileTemplate: Anno(name='AFileTemplate', typ=<class 'str'>, description='Printf style template to generate filename relative to fileDir.\nArguments are:\n  1) %s: the value of formatName') = '%s.h5') Optional[Union[Anno(name='AInfos', typ=<class 'malcolm.core.info.Info'>, description='Infos about current Part status to be passed to other parts'), Sequence[malcolm.core.info.Info], malcolm.core.info.Info]][source]
Parameters
  • context (Context) – Context that should be used to perform operations on child blocks

  • completed_steps (int) – Number of steps already completed

  • steps_to_do (int) – Number of steps we should configure for

  • part_info – The Infos returned from other Parts

  • generator (CompoundGenerator) – Generator instance providing specification for scan

  • fileDir (str) – Directory to write data to

  • formatName (str) – Argument for fileTemplate, normally filename without extension

  • fileTemplate (str) – Printf style template to generate filename relative to fileDir. Arguments are: 1) %s: the value of formatName

Returns

Infos about current Part status to be passed to other parts

Return type

Info

on_seek(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks'), completed_steps: Anno(name='ACompletedSteps', typ=<class 'int'>, description='Number of steps already completed'), steps_to_do: Anno(name='AStepsToDo', typ=<class 'int'>, description='Number of steps we should configure for')) None[source]
Parameters
  • context (Context) – Context that should be used to perform operations on child blocks

  • completed_steps (int) – Number of steps already completed

  • steps_to_do (int) – Number of steps we should configure for

on_run(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks')) None[source]
Parameters

context (Context) – Context that should be used to perform operations on child blocks

on_post_run_ready(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks')) None[source]
Parameters

context (Context) – Context that should be used to perform operations on child blocks

on_abort(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks')) None[source]
Parameters

context (Context) – Context that should be used to perform operations on child blocks

class malcolm.modules.ADCore.parts.PositionLabellerPart(name: Anno(name='APartName', typ=<class 'str'>, description='The name of the Part within the Controller'), mri: Anno(name='AMri', typ=<class 'str'>, description='Malcolm resource id of child object'), initial_visibility: Optional[Anno(name='AInitialVisibility', typ=<class 'bool'>, description='Whether the part is initially visible with no config loaded, None means only if child Source/Sink Ports connect to another Block')] = None, stateful: Anno(name='AStateful', typ=<class 'bool'>, description='If the child is a StatefulController then this should be True') = True)[source]

Part for controlling a position_labeller_block in a scan

Parameters
  • name (str) – The name of the Part within the Controller

  • mri (str) – Malcolm resource id of child object

  • initial_visibility (bool) – Whether the part is initially visible with no config loaded, None means only if child Source/Sink Ports connect to another Block

  • stateful (bool) – If the child is a StatefulController then this should be True

on_reset(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks')) None[source]
Parameters

context (Context) – Context that should be used to perform operations on child blocks

on_configure(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks'), completed_steps: Anno(name='ACompletedSteps', typ=<class 'int'>, description='Number of steps already completed'), steps_to_do: Anno(name='AStepsToDo', typ=<class 'int'>, description='Number of steps we should configure for'), generator: Anno(name='AGenerator', typ=<class 'scanpointgenerator.core.compoundgenerator.CompoundGenerator'>, description='Generator instance providing specification for scan')) None[source]
Parameters
  • context (Context) – Context that should be used to perform operations on child blocks

  • completed_steps (int) – Number of steps already completed

  • steps_to_do (int) – Number of steps we should configure for

  • generator (CompoundGenerator) – Generator instance providing specification for scan

on_run(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks')) None[source]
Parameters

context (Context) – Context that should be used to perform operations on child blocks

on_abort(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks')) None[source]
Parameters

context (Context) – Context that should be used to perform operations on child blocks

on_post_run_armed(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks'), steps_to_do: Anno(name='AStepsToDo', typ=<class 'int'>, description='Number of steps we should configure for')) None[source]
Parameters
  • context (Context) – Context that should be used to perform operations on child blocks

  • steps_to_do (int) – Number of steps we should configure for

on_seek(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks'), completed_steps: Anno(name='ACompletedSteps', typ=<class 'int'>, description='Number of steps already completed'), steps_to_do: Anno(name='AStepsToDo', typ=<class 'int'>, description='Number of steps we should configure for')) None[source]
Parameters
  • context (Context) – Context that should be used to perform operations on child blocks

  • completed_steps (int) – Number of steps already completed

  • steps_to_do (int) – Number of steps we should configure for

class malcolm.modules.ADCore.parts.StatsPluginPart(name: Anno(name='APartName', typ=<class 'str'>, description='The name of the Part within the Controller'), mri: Anno(name='AMri', typ=<class 'str'>, description='Malcolm resource id of child object'), statistic: Anno(name='AStatsName', typ=<enum 'StatisticsName'>, description='Which statistic to capture') = StatisticsName.SUM, runs_on_windows: Anno(name='APartRunsOnWindows', typ=<class 'bool'>, description='Is the IOC this part connects to running on Windows?') = False)[source]

Part for controlling a stats_plugin_block in a Device

Parameters
  • name (str) – The name of the Part within the Controller

  • mri (str) – Malcolm resource id of child object

  • statistic (StatisticsName) – Which statistic to capture

  • runs_on_windows (bool) – Is the IOC this part connects to running on Windows?

on_report_status() Optional[Union[Anno(name='AInfos', typ=<class 'malcolm.core.info.Info'>, description='Infos about current Part status to be passed to other parts'), Sequence[malcolm.core.info.Info], malcolm.core.info.Info]][source]
Returns

Infos about current Part status to be passed to other parts

Return type

Info

on_configure(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks'), part_info: Anno(name='APartInfo', typ=(<class 'str'>, annotypes._array.Array[malcolm.core.info.Info]), description='The Infos returned from other Parts'), fileDir: Anno(name='AFileDir', typ=<class 'str'>, description='Directory to write data to')) None[source]
Parameters
  • context (Context) – Context that should be used to perform operations on child blocks

  • part_info – The Infos returned from other Parts

  • fileDir (str) – Directory to write data to

on_reset(context: Anno(name='AContext', typ=<class 'malcolm.core.context.Context'>, description='Context that should be used to perform operations on child blocks')) None[source]
Parameters

context (Context) – Context that should be used to perform operations on child blocks