Using AutoTRASSIR in scripts

To respond to AutoTRASSIR events use the activate_on_lpr_events() function

def f(ev):
    message("Unique event number: %s" % ev.id)
    message("Number: %s" % ev.plate)
    message("Recognition confidence: %s" % ev.quality)
    message("Country: %s" % ev.country)
    message("Template: %s" % ev.tpl)
    message("Time of entry into frame: %s" % ev.time_enter)
    message("Time of best view: %s" % ev.time_bestview)
    message("Time of departure from frame: %s" % ev.time_leave)
    message("Channel identifier: %s" % ev.channel)
    message("Server identifier: %s" % ev.server)
    message("Speed (if using radar): %s" % ev.radar_speed)
    message("Found on lists: %s" % ev.found_on_lists)
    message("Flags: %x" % ev.flags)
activate_on_lpr_events(f) 

You can apply bitwise logic to the flags using "&" and the LPR_* constants.

def f(ev):
    message("Vehicle license plate number: %s" % ev.plate)
    if ev.flags & LPR_UP: message("Heading up from the camera")
    if ev.flags & LPR_DOWN: message("Heading down from the camera")
    if ev.flags & LPR_BLACKLIST: message("On the blacklist")
    if ev.flags & LPR_WHITELIST: message("On the whitelist")
    if ev.flags & LPR_INFO: message("On the informational list")
    if ev.flags & LPR_EXT_DB_ERROR: message("External database error")
    if ev.flags & LPR_CORRECTED: message("Number corrected by operator")
activate_on_lpr_events(f)