The
tool_results
and
tool_results_by_names
fields contain tools that display in the job but allow access to them differently. For example,
tool_results
is a list of tools where each index already has a defined tool type. In cases where the tools are not yet supported by the engine, the index takes the value
null
. The tools are sorted in the order they display in the job.
tool_results_by_names
allows access to tools by their name, using dot notation and support from IntelliSense, so
tool_results_by_names .my_tool
is the correct syntax. In
tool_results_by_names
, only currently supported tools display after their names. When FlowBuilder uses multiple tools, each tool is accessible by its friendly name.
A friendly name might contain characters that are not valid as a part of the JavaScript variable name. In this case, all invalid characters are replaced with underscore characters. In some instances, two tools might have the same JavaScript name (for example, friendly names were
tool!
and
tool@
and both got translated to
tool_
). In this case, the red triangle with an exclamation mark displays on the top right side of the editor (right before the script enabling switch). The warning sign explains which tools have a naming collision and which friendly names can be changed.
The descriptions of both fields are generated dynamically during job editing. As a result, changing the tool or its order generates IntelliSense errors at the script editing stage.
Only incoming data from the following tools are supported:
Read Barcode
Read DPM
Read DPM & Barcode
Datacode
Anomaly Detection
Deep Learning OCR
Contrast
Locate Edge
Edge Detect
Edge Count
These tools share a common type and are displayed in the argument in the same order as in Aurora Focus.
The following code snippet describes the input argument in TypeScript. In a typical development process, it is recommended to use the field subtitles feature in the editor.
interface IJobInformationArguments {
name: string;
start_time: string;
acquisition_images_count: number;
metrics: IMetricsArgument;
}
interface IMetricsArguments {
trigger_counts: number;
trigger_overruns: number;
total_pass: number;
total_fail: number;
job_time_min: number;
job_time_max: number;
job_time_average: number;
}
The
job_success
field specifies whether the job was completed successfully. The script can override this value using an output structure.
interface IMainArguments {
tool_results: TOOL_RESULTS_TYPE[];
tool_results_by_names: TOOL_RESULTS_BY_NAMES_TYPE;
job_info: IJobInformationArguments;
job_success: boolean;
}
The following code snippet describes definitions for additional types.
The
IBarcodeResultArguments
interface in TypeScript defines the structure for barcode scanning results.
It includes the following properties:
time: number;
this is a number that indicates the time taken by a tool or process such as image acquisition.
tool_time: number;
similar to
time
, this is a number that might indicate the time taken by a tool or process.
success: boolean;
indicates whether a specific operation or process was successful (
true
) or not (
false
).
decode_time: number;
represents the time taken to decode a barcode.
decode_count: number;
represents the count of successful decodes.
decode_totalcount: number;
represents the total count of attempted decodes, successful or not.
decodes: IDecodeArguments[];
an array of objects that conform to the
IDecodeArguments
interface. Each element in this array represents a decoded result, and
IDecodeArguments
would be another interface that describes the structure of these decoded results.
unmatched_decodes: IDecodeArguments[];
as above but containing codes that do not match the pattern specified in the tool but have been detected.
statistics: IStatisticsArguments;
contains tools execution statistics accumulated between operations.
interface IBarcodeResultArguments {
time: number;
tool_time: number;
success: boolean;
decode_time: number;
decode_count: number;
decode_totalcount: number;
decodes: IDecodeArguments[];
}
The
IPointArguments
interface defines an object structure representing a point in a two-dimensional space. It includes two properties:
x
and
y
, both of which are numbers.
x: number;
expected to be a number representing the x-coordinate of a point in a two-dimensional space.
y: number;
a number representing the y-coordinate of the point.
interface IPointArguments {
x: number;
y: number;
}
The
IQualityGradeArguments
interface defines an object structure for representing a quality grade.
grade_: number;
a number representing the numerical value of the grade.
letter_grade: string;
a string representing the letter equivalent of the grade, such as A, B, or C.
interface IQualityGradeArguments {
grade_: number;
letter_grade: string;
}
The
IDecodeBQMArguments
interface in TypeScript defines the structure for an object representing barcode quality metrics (BQM). Each property typically involves quality grading, using the
IQualityGradeArguments
interface, which includes a numerical grade and a letter grade.
interface IDecodeBQMArguments {
overall_grade: IQualityGradeArguments;
decodability: IQualityGradeArguments | null;
decode: IQualityGradeArguments;
defects: IQualityGradeArguments | null;
minimum_edge_contrast: IQualityGradeArguments | null;
modulation: IQualityGradeArguments;
symbol_contrast: IQualityGradeArguments;
quiet_zone: IQualityGradeArguments | null;
left_quiet_zone: IQualityGradeArguments | null;
right_quiet_zone: IQualityGradeArguments | null;
wide_to_narrow_ratio: IQualityGradeArguments | null;
inter_char_gap_2_narrow: IQualityGradeArguments | null;
max_pixel_value_in_extended_area: number | null;
maximum_reflectance: IQualityGradeArguments | null;
minimum_reflectance: IQualityGradeArguments | null;
unused_error_correction: IQualityGradeArguments | null;
fixed_pattern_damage: IQualityGradeArguments | null;
axial_nonuniformity: IQualityGradeArguments | null;
grid_nonuniformity: IQualityGradeArguments | null;
contrast_uniformity: IQualityGradeArguments | null;
reflectance_margin: IQualityGradeArguments | null;
horizontal_print_growth: IQualityGradeArguments | null;
vertical_print_growth: IQualityGradeArguments | null;
}
IStatisticsArguments
defines the tool execution statistics, taking into account all iterations (including the current iteration).
total_pass : number;
total number of tool successes.
total_fail : number;
the total number of tool failures.
tool_time_min : number;
minimum tool-making time.
tool_time_max : number;
maximum tool-making time.
tool_time_average : number;
average execution time.
interface IStatisticsArguments {
total_pass: number;
total_fail: number;
tool_time_min: number;
tool_time_max: number;
tool_time_average: number;
}
The
IDecodeArguments
interface defines the structure of an object representing the result of a decoding process, such as decoding a barcode.
value: string;
represents the decoded value, such as the data extracted from a barcode.
raw_value: number[];
represents the decoded value, such as the data extracted from a barcode in ASCII codes.
symbology: string;
indicates the type or format of the decoded code, such as QR or Code128.
position: IPointArguments[];
an array of
IPointArguments
objects, each representing a point in two-dimensional space. It typically denotes the positions or corners of the decoded symbol within an image or a scanning field.
ppm: number | null;
represents pixel per module, which is used to measure barcode module density in the images being decoded. It can also be
null
, indicating that this information is not available or applicable.
score: IDecodeBQMArguments | null;
an object conforming to the
IDecodeBQMArguments
interface, representing the quality score of the decoding process. It can also be
null
, indicating that a score is not available or applicable.
interface IDecodeArguments {
value: string;
raw_value: number[];
symbology: string;
position: IPointArguments[];
ppm: number | null;
score: IDecodeBQMArguments | null;
}
The
IAnomalyDetectionResultArguments
interface in TypeScript defines the structure for anomaly detection results. It includes the following properties:
time: number;
a number that indicates the time taken by a tool or process, including image acquisition.
tool_time: number;
similar to time, this number indicates the time taken by a tool or process.
success: boolean;
indicates whether a specific operation or process was successful (true) or not (false).
statistics: IStatisticsArguments;
contains tools execution statistics accumulated between operations.
valid: boolean;
indicates whether an image is considered valid (true) or not (false).
score: number;
represents the score of an image.
confident: boolean;
indicates whether a result is considered confident (true) or not (false).
roi: IPointArguments[];
an array of IPointArguments objects, each representing a point in two-dimensional space. It typically denotes the positions or corners of the tool region of interest.
interface IAnomalyDetectionResultArguments {
time: number;
tool_time: number;
success: boolean;
statistics: IStatisticsArguments;
valid: boolean;
score: number;
confident: boolean;
roi: IPointArguments[];
}
The
IDeepLearningOcrResultArguments
interface in TypeScript defines the structure for deep learning-based OCR results. It includes the following properties:
time: number;
this is a number that might indicate the time taken by a tool or process such as image acquisition.
tool_time: number;
similar to time, this number might indicate the time taken by a tool or process.
success: boolean;
indicates whether a specific operation or process was successful (true) or not (false).
characters: ICharacterResultArguments[];
an array of ICharacterResultArguments objects, each representing a decoded character.
ocr_result: string;
represents the decoded characters.
statistics: IStatisticsArguments;
contains tools execution statistics accumulated between operations.
interface IDeepLearningOcrResultArguments {
time: number;
tool_time: number;
success: boolean;
characters: ICharacterResultArguments[];
ocr_result: string;
statistics: IStatisticsArguments;
}
The
ICharacterResultArguments
interface defines an object structure representing a decoded character. It includes the following properties:
value: string;
represents the confidence character.
roi: IPointArguments[];
an array of IPointArguments objects, each representing a point in a two-dimensional space. It typically denotes the positions or corners of the decoded character.
confidence: number;
represents the confidence of the character.
height: number;
represents the height of the character.
interface ICharacterResultArguments {
value: string;
roi: IPointArguments[];
confidence: number;
height: number;
}
The
IContrastResultArguments
interface in TypeScript defines the structure for contrast results. It includes the following properties:
time: number;
this number indicates the time taken by a tool or process including image acquisition.
tool_time: number;
similar to time, this number indicates the time taken by a tool or process.
success: boolean;
indicates whether a specific operation or process was successful (true) or not (false).
value: number;
indicates contrast value.
minimum_threshold: number;
indicates the minimum threshold value set in the tool configuration.
maximum_threshold: number;
indicates the maximum threshold value set in the tool configuration.
minimum_calculation_value: number;
indicates minimum pixel value.
maximum_calculation_value: number;
indicates maximum pixel value.
statistics: IStatisticsArguments;
contains tools execution statistics accumulated between operations.
interface IContrastResultArguments {
time: number;
tool_time: number;
success: boolean;
value: number;
minimum_threshold: number;
maximum_threshold: number;
minimum_calculation_value: number;
maximum_calculation_value: number;
statistics: IStatisticsArguments;
}
The
IEdgeResultArguments
interface in TypeScript defines the structure for edge detection results. It includes the following properties:
time: number;
this number indicates the time taken by a tool or process including image acquisition.
tool_time: number;
similar to time, this number indicates the time taken by a tool or process.
success: boolean;
indicates whether a specific operation or process was successful (true) or not (false).
edge_count: number;
indicates the number of detected edges.
line_segments: ILineArguments[];
an array of ILineArguments objects, each representing a line in two-dimensional space.
statistics: IStatisticsArguments;
contains tools execution statistics accumulated between operations.
interface IEdgeResultArguments {
time: number;
tool_time: number;
success: boolean;
edge_count: number;
line_segments: ILineArguments[];
statistics: IStatisticsArguments;
}
The
ILineArguments
interface defines an object structure representing a line in a two-dimensional space. It includes two properties: point1 and point2, both of which are IPointArguments.
point1: IPointArguments;
represents the line start point.
point2: IPointArguments;
represents the line end point.
interface ILineArguments {
point1: IPointArguments;
point2: IPointArguments;
}