def configure_trigger(cam):
    '\n    This function configures the camera to use a trigger. First, trigger mode is\n    set to off in order to select the trigger source. Once the trigger source\n    has been selected, trigger mode is then enabled, which has the camera\n    capture only a single image upon the execution of the chosen trigger.\n\n     :param cam: Camera to configure trigger for.\n     :type cam: CameraPtr\n     :return: True if successful, False otherwise.\n     :rtype: bool\n    '
    result = True
    print('*** CONFIGURING TRIGGER ***\n')
    print('Note that if the application / user software triggers faster than frame time, the trigger may be dropped / skipped by the camera.\n')
    print('If several frames are needed per trigger, a more reliable alternative for such case, is to use the multi-frame mode.\n\n')
    if (CHOSEN_TRIGGER == TriggerType.SOFTWARE):
        print('Software trigger chosen ...')
    elif (CHOSEN_TRIGGER == TriggerType.HARDWARE):
        print('Hardware trigger chose ...')
    try:
        nodemap = cam.GetNodeMap()
        node_trigger_mode = PySpin.CEnumerationPtr(nodemap.GetNode('TriggerMode'))
        if ((not PySpin.IsAvailable(node_trigger_mode)) or (not PySpin.IsReadable(node_trigger_mode))):
            print('Unable to disable trigger mode (node retrieval). Aborting...')
            return False
        node_trigger_mode_off = node_trigger_mode.GetEntryByName('Off')
        if ((not PySpin.IsAvailable(node_trigger_mode_off)) or (not PySpin.IsReadable(node_trigger_mode_off))):
            print('Unable to disable trigger mode (enum entry retrieval). Aborting...')
            return False
        node_trigger_mode.SetIntValue(node_trigger_mode_off.GetValue())
        print('Trigger mode disabled...')
        node_trigger_selector = PySpin.CEnumerationPtr(nodemap.GetNode('TriggerSelector'))
        if ((not PySpin.IsAvailable(node_trigger_selector)) or (not PySpin.IsWritable(node_trigger_selector))):
            print('Unable to get trigger selector (node retrieval). Aborting...')
            return False
        node_trigger_selector_framestart = node_trigger_selector.GetEntryByName('FrameStart')
        if ((not PySpin.IsAvailable(node_trigger_selector_framestart)) or (not PySpin.IsReadable(node_trigger_selector_framestart))):
            print('Unable to set trigger selector (enum entry retrieval). Aborting...')
            return False
        node_trigger_selector.SetIntValue(node_trigger_selector_framestart.GetValue())
        print('Trigger selector set to frame start...')
        node_trigger_source = PySpin.CEnumerationPtr(nodemap.GetNode('TriggerSource'))
        if ((not PySpin.IsAvailable(node_trigger_source)) or (not PySpin.IsWritable(node_trigger_source))):
            print('Unable to get trigger source (node retrieval). Aborting...')
            return False
        if (CHOSEN_TRIGGER == TriggerType.SOFTWARE):
            node_trigger_source_software = node_trigger_source.GetEntryByName('Software')
            if ((not PySpin.IsAvailable(node_trigger_source_software)) or (not PySpin.IsReadable(node_trigger_source_software))):
                print('Unable to set trigger source (enum entry retrieval). Aborting...')
                return False
            node_trigger_source.SetIntValue(node_trigger_source_software.GetValue())
            print('Trigger source set to software...')
        elif (CHOSEN_TRIGGER == TriggerType.HARDWARE):
            node_trigger_source_hardware = node_trigger_source.GetEntryByName('Line0')
            if ((not PySpin.IsAvailable(node_trigger_source_hardware)) or (not PySpin.IsReadable(node_trigger_source_hardware))):
                print('Unable to set trigger source (enum entry retrieval). Aborting...')
                return False
            node_trigger_source.SetIntValue(node_trigger_source_hardware.GetValue())
            print('Trigger source set to hardware...')
        node_trigger_mode_on = node_trigger_mode.GetEntryByName('On')
        if ((not PySpin.IsAvailable(node_trigger_mode_on)) or (not PySpin.IsReadable(node_trigger_mode_on))):
            print('Unable to enable trigger mode (enum entry retrieval). Aborting...')
            return False
        node_trigger_mode.SetIntValue(node_trigger_mode_on.GetValue())
        print('Trigger mode turned back on...')
    except PySpin.SpinnakerException as ex:
        print(('Error: %s' % ex))
        return False
    return result
This function configures the camera to use a trigger. First, trigger mode is
set to off in order to select the trigger source. Once the trigger source
has been selected, trigger mode is then enabled, which has the camera
capture only a single image upon the execution of the chosen trigger.

 :param cam: Camera to configure trigger for.
 :type cam: CameraPtr
 :return: True if successful, False otherwise.
 :rtype: bool
def configure_trigger(cam):
    '\n    This function configures the camera to use a trigger. First, trigger mode is\n    set to off in order to select the trigger source. Once the trigger source\n    has been selected, trigger mode is then enabled, which has the camera\n    capture only a single image upon the execution of the chosen trigger.\n\n     :param cam: Camera to configure trigger for.\n     :type cam: CameraPtr\n     :return: True if successful, False otherwise.\n     :rtype: bool\n    '
    result = True
    print('*** CONFIGURING TRIGGER ***\n')
    print('Note that if the application / user software triggers faster than frame time, the trigger may be dropped / skipped by the camera.\n')
    print('If several frames are needed per trigger, a more reliable alternative for such case, is to use the multi-frame mode.\n\n')
    if (CHOSEN_TRIGGER == TriggerType.SOFTWARE):
        print('Software trigger chosen ...')
    elif (CHOSEN_TRIGGER == TriggerType.HARDWARE):
        print('Hardware trigger chose ...')
    try:
        nodemap = cam.GetNodeMap()
        node_trigger_mode = PySpin.CEnumerationPtr(nodemap.GetNode('TriggerMode'))
        if ((not PySpin.IsAvailable(node_trigger_mode)) or (not PySpin.IsReadable(node_trigger_mode))):
            print('Unable to disable trigger mode (node retrieval). Aborting...')
            return False
        node_trigger_mode_off = node_trigger_mode.GetEntryByName('Off')
        if ((not PySpin.IsAvailable(node_trigger_mode_off)) or (not PySpin.IsReadable(node_trigger_mode_off))):
            print('Unable to disable trigger mode (enum entry retrieval). Aborting...')
            return False
        node_trigger_mode.SetIntValue(node_trigger_mode_off.GetValue())
        print('Trigger mode disabled...')
        node_trigger_selector = PySpin.CEnumerationPtr(nodemap.GetNode('TriggerSelector'))
        if ((not PySpin.IsAvailable(node_trigger_selector)) or (not PySpin.IsWritable(node_trigger_selector))):
            print('Unable to get trigger selector (node retrieval). Aborting...')
            return False
        node_trigger_selector_framestart = node_trigger_selector.GetEntryByName('FrameStart')
        if ((not PySpin.IsAvailable(node_trigger_selector_framestart)) or (not PySpin.IsReadable(node_trigger_selector_framestart))):
            print('Unable to set trigger selector (enum entry retrieval). Aborting...')
            return False
        node_trigger_selector.SetIntValue(node_trigger_selector_framestart.GetValue())
        print('Trigger selector set to frame start...')
        node_trigger_source = PySpin.CEnumerationPtr(nodemap.GetNode('TriggerSource'))
        if ((not PySpin.IsAvailable(node_trigger_source)) or (not PySpin.IsWritable(node_trigger_source))):
            print('Unable to get trigger source (node retrieval). Aborting...')
            return False
        if (CHOSEN_TRIGGER == TriggerType.SOFTWARE):
            node_trigger_source_software = node_trigger_source.GetEntryByName('Software')
            if ((not PySpin.IsAvailable(node_trigger_source_software)) or (not PySpin.IsReadable(node_trigger_source_software))):
                print('Unable to set trigger source (enum entry retrieval). Aborting...')
                return False
            node_trigger_source.SetIntValue(node_trigger_source_software.GetValue())
            print('Trigger source set to software...')
        elif (CHOSEN_TRIGGER == TriggerType.HARDWARE):
            node_trigger_source_hardware = node_trigger_source.GetEntryByName('Line0')
            if ((not PySpin.IsAvailable(node_trigger_source_hardware)) or (not PySpin.IsReadable(node_trigger_source_hardware))):
                print('Unable to set trigger source (enum entry retrieval). Aborting...')
                return False
            node_trigger_source.SetIntValue(node_trigger_source_hardware.GetValue())
            print('Trigger source set to hardware...')
        node_trigger_mode_on = node_trigger_mode.GetEntryByName('On')
        if ((not PySpin.IsAvailable(node_trigger_mode_on)) or (not PySpin.IsReadable(node_trigger_mode_on))):
            print('Unable to enable trigger mode (enum entry retrieval). Aborting...')
            return False
        node_trigger_mode.SetIntValue(node_trigger_mode_on.GetValue())
        print('Trigger mode turned back on...')
    except PySpin.SpinnakerException as ex:
        print(('Error: %s' % ex))
        return False
    return result