ENLIGHTEN
Cross-platform desktop GUI for Wasatch Photonics spectrometers
Loading...
Searching...
No Matches
reconnect_callbacks.ReconnectExample Class Reference
Collaboration diagram for reconnect_callbacks.ReconnectExample:
[legend]

Public Member Functions

 __init__ (self)
 
 alloc_buffers (self)
 
 device_reconnected (self, ids_peak.Device device, ids_peak.DeviceReconnectInformation reconnect_information)
 When a device that was opened by the same application instance regains connection after a previous disconnect the 'Reconnected' event is triggered.
 
 enable_reconnect (self)
 We enable the reconnect by writing to the ReconnectEnable node in the NodeMap of the System that our device is connected to.
 
 ensure_compatible_buffers_and_restart_acquisition (self, ids_peak.DeviceReconnectInformation reconnect_information)
 After a reconnect the PayloadSize might have changed, e.g.
 
 load_defaults (self)
 
 open_device (self)
 
 register_callbacks (self)
 Register the Devicemanager callbacks.
 
 revoke_buffers (self)
 
 run (self)
 
 run_acquisition_loop (self)
 Run the acquisition loop.
 
 set_roi (self)
 
 unregister_callbacks (self)
 Unregister the registered callbacks inside the Devicemanager.
 

Static Public Member Functions

 device_disconnected (ids_peak.DeviceDescriptor device)
 Only called if the reconnect is enabled and if the device was previously opened by this application instance.
 
 device_found (ids_peak.DeviceDescriptor device)
 The 'found' event is triggered if a new device is found upon calling DeviceManager.Update()
 
 device_lost (str key)
 The 'lost' event is only called for this application's opened devices if a device is closed explicitly or if connection is lost while the reconnect is disabled, otherwise the 'disconnected' event is triggered.
 

Public Attributes

bool acquisition_running = False
 
Optional[ids_peak.DataStream] data_stream = None
 
Optional[ids_peak.Device] device = None
 
ids_peak.DeviceManager device_disconnected_callback
 
ids_peak.DeviceManager device_disconnected_callback_handle
 
ids_peak.DeviceManager device_found_callback
 
ids_peak.DeviceManager device_found_callback_handle
 
ids_peak.DeviceManager device_lost_callback
 
ids_peak.DeviceManager device_lost_callback_handle
 
ids_peak.DeviceManager device_manager = ids_peak.DeviceManager.Instance()
 
ids_peak.DeviceManager device_reconnected_callback
 
ids_peak.DeviceManager device_reconnected_callback_handle
 
Optional[ids_peak.NodeMap] remote_nodemap = None
 

Constructor & Destructor Documentation

◆ __init__()

reconnect_callbacks.ReconnectExample.__init__ ( self)

Member Function Documentation

◆ alloc_buffers()

reconnect_callbacks.ReconnectExample.alloc_buffers ( self)

◆ device_disconnected()

reconnect_callbacks.ReconnectExample.device_disconnected ( ids_peak.DeviceDescriptor device)
static

Only called if the reconnect is enabled and if the device was previously opened by this application instance.

◆ device_found()

reconnect_callbacks.ReconnectExample.device_found ( ids_peak.DeviceDescriptor device)
static

The 'found' event is triggered if a new device is found upon calling DeviceManager.Update()

◆ device_lost()

reconnect_callbacks.ReconnectExample.device_lost ( str key)
static

The 'lost' event is only called for this application's opened devices if a device is closed explicitly or if connection is lost while the reconnect is disabled, otherwise the 'disconnected' event is triggered.

Other devices that were not opened or were opened by someone else still trigger a 'lost' event.

◆ device_reconnected()

reconnect_callbacks.ReconnectExample.device_reconnected ( self,
ids_peak.Device device,
ids_peak.DeviceReconnectInformation reconnect_information )

When a device that was opened by the same application instance regains connection after a previous disconnect the 'Reconnected' event is triggered.

The reconnect may (partially) fail, so we have to check the DeviceReconnectInformation class to know what steps are necessary to resume the acquistion.

◆ enable_reconnect()

reconnect_callbacks.ReconnectExample.enable_reconnect ( self)

We enable the reconnect by writing to the ReconnectEnable node in the NodeMap of the System that our device is connected to.

◆ ensure_compatible_buffers_and_restart_acquisition()

reconnect_callbacks.ReconnectExample.ensure_compatible_buffers_and_restart_acquisition ( self,
ids_peak.DeviceReconnectInformation reconnect_information )

After a reconnect the PayloadSize might have changed, e.g.

due to a reboot and the last parameter state not being saved in the starting UserSet. Here we check the PayloadSize and reallocate the buffers if we encounter a mismatch.

We also start the local and remote acquistion if necessary.

◆ load_defaults()

reconnect_callbacks.ReconnectExample.load_defaults ( self)

◆ open_device()

reconnect_callbacks.ReconnectExample.open_device ( self)

◆ register_callbacks()

reconnect_callbacks.ReconnectExample.register_callbacks ( self)

Register the Devicemanager callbacks.

Note: We have to store the callbacks, otherwise the callbacks will be unregistered because their lifetime is shorter than the device manager instance.

◆ revoke_buffers()

reconnect_callbacks.ReconnectExample.revoke_buffers ( self)

◆ run()

reconnect_callbacks.ReconnectExample.run ( self)

◆ run_acquisition_loop()

reconnect_callbacks.ReconnectExample.run_acquisition_loop ( self)

Run the acquisition loop.

The reconnect callback may abort this.

◆ set_roi()

reconnect_callbacks.ReconnectExample.set_roi ( self)

◆ unregister_callbacks()

reconnect_callbacks.ReconnectExample.unregister_callbacks ( self)

Unregister the registered callbacks inside the Devicemanager.

Member Data Documentation

◆ acquisition_running

bool reconnect_callbacks.ReconnectExample.acquisition_running = False

◆ data_stream

Optional[ids_peak.DataStream] reconnect_callbacks.ReconnectExample.data_stream = None

◆ device

Optional[ids_peak.Device] reconnect_callbacks.ReconnectExample.device = None

◆ device_disconnected_callback

ids_peak.DeviceManager reconnect_callbacks.ReconnectExample.device_disconnected_callback
Initial value:
= self.device_manager.DeviceDisconnectedCallback(
self.device_disconnected)

◆ device_disconnected_callback_handle

reconnect_callbacks.ReconnectExample.device_disconnected_callback_handle
Initial value:
= self.device_manager.RegisterDeviceDisconnectedCallback(
self.device_disconnected_callback)

◆ device_found_callback

ids_peak.DeviceManager reconnect_callbacks.ReconnectExample.device_found_callback
Initial value:
= self.device_manager.DeviceFoundCallback(
self.device_found)

◆ device_found_callback_handle

reconnect_callbacks.ReconnectExample.device_found_callback_handle
Initial value:
= self.device_manager.RegisterDeviceFoundCallback(
self.device_found_callback)

◆ device_lost_callback

ids_peak.DeviceManager reconnect_callbacks.ReconnectExample.device_lost_callback
Initial value:
= self.device_manager.DeviceLostCallback(
self.device_lost)

◆ device_lost_callback_handle

reconnect_callbacks.ReconnectExample.device_lost_callback_handle
Initial value:
= self.device_manager.RegisterDeviceLostCallback(
self.device_lost_callback)

◆ device_manager

ids_peak.DeviceManager reconnect_callbacks.ReconnectExample.device_manager = ids_peak.DeviceManager.Instance()

◆ device_reconnected_callback

ids_peak.DeviceManager reconnect_callbacks.ReconnectExample.device_reconnected_callback
Initial value:
= self.device_manager.DeviceReconnectedCallback(
self.device_reconnected)

◆ device_reconnected_callback_handle

reconnect_callbacks.ReconnectExample.device_reconnected_callback_handle
Initial value:
= self.device_manager.RegisterDeviceReconnectedCallback(
self.device_reconnected_callback)

◆ remote_nodemap

Optional[ids_peak.NodeMap] reconnect_callbacks.ReconnectExample.remote_nodemap = None

The documentation for this class was generated from the following file: