Wasatch.NET 2.4.14
.NET application driver for Wasatch Photonics spectrometers
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Properties | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
WasatchNET.Driver Class Reference
Inheritance diagram for WasatchNET.Driver:
[legend]
Collaboration diagram for WasatchNET.Driver:
[legend]

Public Member Functions

void closeAllSpectrometers ()
 Automatically called as part of application shutdown (can be called manually).
 
MultiChannelWrapper getMultiChannelWrapper ()
 Gets a custom Wrapper object provided to automate multi-channel operations.
 
int getNumberOfSpectrometers ()
 How many Wasatch USB spectrometers were found.
 
Spectrometer getSpectrometer (int index)
 Obtains a reference to the specified spectrometer, performing any prelimary "open" / instantiation steps required to leave the spectrometer fully ready for use.
 
int openAllSpectrometers ()
 Iterate over all discoverable Wasatch Photonics USB spectrometers, and return the number found. Individual spectrometers can then be accessed via the getSpectrometer(index) call.
 
int openMockSpectrometer (uint pixels)
 
void closeAllSpectrometers ()
 Automatically called as part of application shutdown (can be called manually).
 
MultiChannelWrapper getMultiChannelWrapper ()
 Gets a custom Wrapper object provided to automate multi-channel operations.
 
int getNumberOfSpectrometers ()
 How many Wasatch USB spectrometers were found.
 
Spectrometer getSpectrometer (int index)
 Obtains a reference to the specified spectrometer, performing any prelimary "open" / instantiation steps required to leave the spectrometer fully ready for use.
 
int openAllSpectrometers ()
 Iterate over all discoverable Wasatch Photonics USB spectrometers, and return the number found. Individual spectrometers can then be accessed via the getSpectrometer(index) call.
 

Static Public Member Functions

static Driver getInstance ()
 Get a handle to the Driver Singleton. Idempotent (can be called repeatedly with no side-effects).
 

Properties

Logger logger = Logger.getInstance() [get]
 
string version [get]
 
- Properties inherited from WasatchNET.IDriver
Logger logger [get]
 
string version [get]
 

Private Member Functions

void attemptReset (object sender)
 
 Driver ()
 
static IntPtr LoadLibrary (string lpFileName)
 
void logDevice (UsbRegistry usbRegistry)
 
void logNameValuePairs (string[] pairs, string prefix=" ")
 
void OnUsbError (object sender, UsbError e)
 
 ~Driver ()
 

Static Private Member Functions

static bool CheckLibrary (string fileName)
 

Private Attributes

bool opened = false
 
int resetCount = 0
 
List< Spectrometerspectrometers = new List<Spectrometer>()
 
bool suppressErrors = false
 
SpectrometerUptime uptime = new SpectrometerUptime()
 

Static Private Attributes

static Driver instance = new Driver()
 
const int MAX_RESETS = 3
 

Constructor & Destructor Documentation

◆ Driver()

WasatchNET.Driver.Driver ( )
inlineprivate

◆ ~Driver()

WasatchNET.Driver.~Driver ( )
inlineprivate

Member Function Documentation

◆ attemptReset()

void WasatchNET.Driver.attemptReset ( object  sender)
inlineprivate

◆ CheckLibrary()

static bool WasatchNET.Driver.CheckLibrary ( string  fileName)
inlinestaticprivate

◆ closeAllSpectrometers()

void WasatchNET.Driver.closeAllSpectrometers ( )
inline

Automatically called as part of application shutdown (can be called manually).

Implements WasatchNET.IDriver.

◆ getInstance()

static Driver WasatchNET.Driver.getInstance ( )
inlinestatic

Get a handle to the Driver Singleton. Idempotent (can be called repeatedly with no side-effects).

Returns
reference to the Driver Singleton

◆ getMultiChannelWrapper()

MultiChannelWrapper WasatchNET.Driver.getMultiChannelWrapper ( )
inline

Gets a custom Wrapper object provided to automate multi-channel operations.

Returns
a MultiChannelWrapper

Implements WasatchNET.IDriver.

◆ getNumberOfSpectrometers()

int WasatchNET.Driver.getNumberOfSpectrometers ( )
inline

How many Wasatch USB spectrometers were found.

Returns
number of enumerated Wasatch spectrometers

Implements WasatchNET.IDriver.

◆ getSpectrometer()

Spectrometer WasatchNET.Driver.getSpectrometer ( int  index)
inline

Obtains a reference to the specified spectrometer, performing any prelimary "open" / instantiation steps required to leave the spectrometer fully ready for use.

Parameters
indexzero-indexed (should be less than the value returned by openAllSpectrometers() / getNumberOfSpectrometers())

Spectrometers are deterministically ordered by (model, serialNumber) for repeatability.

Returns
a reference to the requested Spectrometer object, or null on error

Implements WasatchNET.IDriver.

◆ LoadLibrary()

static IntPtr WasatchNET.Driver.LoadLibrary ( string  lpFileName)
private

◆ logDevice()

void WasatchNET.Driver.logDevice ( UsbRegistry  usbRegistry)
inlineprivate

◆ logNameValuePairs()

void WasatchNET.Driver.logNameValuePairs ( string[]  pairs,
string  prefix = "  " 
)
inlineprivate

◆ OnUsbError()

void WasatchNET.Driver.OnUsbError ( object  sender,
UsbError  e 
)
inlineprivate

◆ openAllSpectrometers()

int WasatchNET.Driver.openAllSpectrometers ( )
inline

Iterate over all discoverable Wasatch Photonics USB spectrometers, and return the number found. Individual spectrometers can then be accessed via the getSpectrometer(index) call.

If called multiple times during an application session WITHOUT calling closeAllSpectrometers() in between, will only add/open "new" spectrometers which have been "hotplugged" since the previous call.

It is unclear how reliable this method will be on subsequent calls if a previously-opened spectrometer has been power-cycled or otherwise reset, but not formally "closed" via Spectrometer.close() or Driver.closeAllSpectrometers().

Returns
number of Wasatch Photonics USB spectrometers found

Implements WasatchNET.IDriver.

◆ openMockSpectrometer()

int WasatchNET.Driver.openMockSpectrometer ( uint  pixels)
inline

Member Data Documentation

◆ instance

Driver WasatchNET.Driver.instance = new Driver()
staticprivate

◆ MAX_RESETS

const int WasatchNET.Driver.MAX_RESETS = 3
staticprivate

◆ opened

bool WasatchNET.Driver.opened = false
private

◆ resetCount

int WasatchNET.Driver.resetCount = 0
private

◆ spectrometers

List<Spectrometer> WasatchNET.Driver.spectrometers = new List<Spectrometer>()
private

◆ suppressErrors

bool WasatchNET.Driver.suppressErrors = false
private

◆ uptime

SpectrometerUptime WasatchNET.Driver.uptime = new SpectrometerUptime()
private

Property Documentation

◆ logger

Logger WasatchNET.Driver.logger = Logger.getInstance()
get

Implements WasatchNET.IDriver.

◆ version

string WasatchNET.Driver.version
get

Implements WasatchNET.IDriver.


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