beeper?: IBeepBeeper | BeeperStatusResult;
Value | Description |
|---|---|
Beeper.beep()
| This function triggers a beeper with a specified duration, tone, and volume. Helper objects, BeeperVolumeResult, BeeperToneResult, and BeeperDurationResult, can be used to specify these. |
Beeper.off()
| Does not trigger the beeper; it’s independent of job_success. |
Beeper.device_settings()
| Triggers the beeper with parameters specified in the General Settings tab in Aurora Focus. |
/**
* Beep if the overall grade is not good enough.
* @param {IMainArguments} input_result - object with results of the job.
* @returns {IMainResult} - object defining outputs per interface.
*/
export function onResults(input_result) {
const decodes = input_result.tool_results_by_names.Read_Barcode.decodes;
const bad_decodes = decodes.filter(decode => decode.score === null ||
decode.score.overall_grade.grade < 3)
const bad_values = bad_decodes.map(decode => decode.value + ", grade: " +
decode.score?.overall_grade.grade);
if (bad_values.length > 0) {
console.error("Codes with bad grades: ", bad_values.join(" "))
return {
beeper: Beeper.beep(BeeperVolumeResult.HIGH, BeeperToneResult.MEDIUM,
BeeperDurationResult.MEDIUM)
};
} else {
return {
beeper: Beeper.off()
};
}
}