Table of contents

Setting Methods - CaptureVisionRouter Class

Method Description
init_settings Loads and initializes a template from a string.
init_settings_from_file Loads and initializes a template from a file.
output_settings Exports a specific CaptureVisionTemplate to a string.
output_settings_to_file Exports a specific CaptureVisionTemplate to a file.
get_simplified_settings Retrieves a SimplifiedCaptureVisionSettings object for a specific CaptureVisionTemplate.
update_settings Updates a CaptureVisionTemplate with SimplifiedCaptureVisionSettings object.
reset_settings Resets all templates to factory settings.

init_settings

Loads and initializes a template from a string.

def init_settings(self, content: str) -> Tuple[int, str]:

Parameters

content The string containing the template.

Return Value

Returns a tuple containing following elements:

  • error_code <int>: The error code indicating the status of the operation.
  • error_message <str>: A descriptive message explaining the error.

See Also

EnumErrorCode

init_settings_from_file

Loads and initializes a template from a file.

def init_settings_from_file(self, file_path: str) -> Tuple[int, str]:

Parameters

file_path The path to the file containing the template.

Return Value

Returns a tuple containing following elements:

  • error_code <int>: The error code indicating the status of the operation.
  • error_message <str>: A descriptive message explaining the error.

See Also

EnumErrorCode

output_settings

Exports a specific template to a string.

def output_settings(self, template_name: str, include_default_values: bool = False) -> Tuple[int, str, str]:

Parameters

template_name The name of the CaptureVisionTemplate to be exported.

include_default_values Specifies whether to include default values in the exported template.

Remarks

  • It is supported to export all loaded templates by specifying the template_name as ‘*’.
  • There are two types of CaptureVisionTemplate: the preset ones which come with the SDK and the custom ones that get initialized when the user calls init_settings / init_settings_from_file.
  • When using a custom template, the parameter template_name should be the name of the CaptureVisionTemplate object in the JSON template file.
  • Please be aware that the preset CaptureVisionTemplates will be overwritten should the user call init_settings / init_settings_from_file and pass his own settings.
  • If parameter template_name is not specified, the preset one named ‘Default’ will be used. However, if the preset ones have been overwritten as described above, the first CaptureVisionTemplate from the user’s own settings will be used instead.

Return Value

Returns a tuple containing following elements:

  • error_code <int>: The error code indicating the status of the operation.
  • error_message <str>: A descriptive message explaining the error.
  • template_content <str>: A string containing the exported template.

See Also

EnumErrorCode

output_settings_to_file

Exports a specific template to a file.

def output_settings_to_file(self, template_name: str, file_path: str, include_default_values: bool = False) -> Tuple[int, str]:

Parameters

template_name The name of the template to be exported.

file_path The path to the output file.

include_default_values Specifies whether to include default values in the exported template.

Remarks

  • It is supported to export all loaded templates by specifying the template_name as ‘*’.
  • There are two types of CaptureVisionTemplate: the preset ones which come with the SDK and the custom ones that get initialized when the user calls init_settings / init_settings_from_file.
  • When using a custom template, the parameter template_name should be the name of the CaptureVisionTemplate object in the JSON template file.
  • Please be aware that the preset CaptureVisionTemplates will be overwritten should the user call init_settings / init_settings_from_file and pass his own settings.
  • If parameter template_name is not specified, the preset one named ‘Default’ will be used. However, if the preset ones have been overwritten as described above, the first CaptureVisionTemplate from the user’s own settings will be used instead.

Return Value

Returns a tuple containing following elements:

  • error_code <int>: The error code indicating the status of the operation.
  • error_message <str>: A descriptive message explaining the error.

See Also

EnumErrorCode

get_simplified_settings

Retrieves a simplified version of the capture settings for a specific template.

def get_simplified_settings(self, template_name: str) -> Tuple[int, str, SimplifiedCaptureVisionSettings]:

Parameters

template_name The name of the template.

Remarks

  • There are two types of CaptureVisionTemplate: the preset ones which come with the SDK and the custom ones that get initialized when the user calls init_settings / init_settings_from_file.
  • When using a custom template, the parameter template_name should be the name of the CaptureVisionTemplate object in the JSON template file.
  • Please be aware that the preset CaptureVisionTemplates will be overwritten should the user call init_settings / init_settings_from_file and pass his own settings.
  • If parameter template_name is not specified, the preset one named ‘Default’ will be used. However, if the preset ones have been overwritten as described above, the first CaptureVisionTemplate from the user’s own settings will be used instead.

Return Value

Returns a tuple containing following elements:

  • error_code <int>: The error code indicating the status of the operation.
  • error_message <str>: A descriptive message explaining the error.
  • settings <SimplifiedCaptureVisionSettings>: A SimplifiedCaptureVisionSettings object containing all settings.

See Also

EnumErrorCode

SimplifiedCaptureVisionSettings

update_settings

Updates a template with simplified capture settings.

def update_settings(self, template_name: str, settings: SimplifiedCaptureVisionSettings) -> Tuple[int, str]:

Parameters

template_name The name of the template to be updated.

settings A SimplifiedCaptureVisionSettings object.

Remarks

  • There are two types of CaptureVisionTemplate: the preset ones which come with the SDK and the custom ones that get initialized when the user calls init_settings / init_settings_from_file.
  • When using a custom template, the parameter template_name should be the name of the CaptureVisionTemplate object in the JSON template file.
  • Please be aware that the preset CaptureVisionTemplates will be overwritten should the user call init_settings / init_settings_from_file and pass his own settings.
  • If parameter template_name is not specified, the preset one named ‘Default’ will be used. However, if the preset ones have been overwritten as described above, the first CaptureVisionTemplate from the user’s own settings will be used instead.

Return Value

Returns a tuple containing following elements:

  • error_code <int>: The error code indicating the status of the operation.
  • error_message <str>: A descriptive message explaining the error.

See Also

EnumErrorCode

SimplifiedCaptureVisionSettings

reset_settings

Resets all templates to factory settings.

def reset_settings(self) -> Tuple[int, str]:

Return Value

Returns a tuple containing following elements:

  • error_code <int>: The error code indicating the status of the operation.
  • error_message <str>: A descriptive message explaining the error.

See Also

EnumErrorCode

Is this page helpful?

YesYes NoNo

In this article: