PythonOceanDirect  1.31.0
OceanDirect Python API
Classes | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Python.oceandirect.OceanDirectAPI.OceanDirectAPI Class Reference

Classes

class  __OceanDirectSingleton
 

Public Member Functions

def __init__ (self)
 
def __getattr__ (self, name)
 
def decode_error (self, errno, caller)
 
def get_api_rc_version_number (self)
 
def get_api_version_numbers (self)
 Return OceanDirect api version information. More...
 
def open_device (self, device_id)
 Attach to a device discovered by probe_devices or get_device_ids. More...
 
def add_network_device (self, ipAddressStr, deviceTypeStr)
 Manually create an instance of the network attached device and then open it using the openDevice() function. More...
 
def close_device (self, device_id)
 Detach from the device indicated by device_id. More...
 
def list_all_devices (self)
 Lists defined details of all active devices. More...
 
def shutdown (self)
 Closes the connection to OceanDirectAPI. More...
 
def find_devices (self)
 Finds all available Ocean devices by scanning on USB for devices with Ocean drivers, finding devices that respond to UDP multicast (FX and HDX), and also returning IDs for any TCP-enabled devices that have been manually specified using addTCPDeviceLocation(). More...
 
def find_usb_devices (self)
 Finds all available Ocean devices by scanning on USB for devices with Ocean drivers. More...
 
def add_network_device (self, ipAddress, deviceType)
 Manually create an instance of the network attached device and then open it using the openDevice() function. More...
 
def get_number_devices (self)
 Returns the number of devices available. More...
 
def get_device_ids (self)
 Return a list of device ids from devices that were both probe or manually added. More...
 
def from_serial_number (self, serial_num)
 Return a spectrometer object associated with device id. More...
 
def add_rs232_device (self, device_type, bus_path, baud)
 Adds a device connected via RS 232 to the device list. More...
 
def get_serial_number (self, dev_id)
 Gets the serial number of a specified device. More...
 

Public Attributes

 tcpip_devices
 
 usb_devices
 
 num_devices
 
 device_ids
 

Static Public Attributes

 instance
 

Detailed Description

Definition at line 29 of file OceanDirectAPI.py.

Constructor & Destructor Documentation

◆ __init__()

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.__init__ (   self)
Loads and initializes the OceanDirect dll and initializes internal variables.

Definition at line 66 of file OceanDirectAPI.py.

Member Function Documentation

◆ __getattr__()

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.__getattr__ (   self,
  name 
)

Definition at line 74 of file OceanDirectAPI.py.

◆ add_network_device() [1/2]

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.add_network_device (   self,
  ipAddress,
  deviceType 
)

Manually create an instance of the network attached device and then open it using the openDevice() function.

It is the responsiblitiy of the user to ensure that the device exist and configured properly.

Parameters
[in]ipAddressThe ip address as string (ex: "10.20.30.100" ) of the device to be opened.
[in]deviceTypeThe device type could be OceanFX or OceanHDX. This is case sensitive.
Returns
The device id.

Definition at line 226 of file OceanDirectAPI.py.

◆ add_network_device() [2/2]

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.add_network_device (   self,
  ipAddressStr,
  deviceTypeStr 
)

Manually create an instance of the network attached device and then open it using the openDevice() function.

It is the responsiblitiy of the user to ensure that the device exist and configured properly.

Parameters
[in]ipAddressStrThe ip address of the device to be opened.
[in]deviceTypeStrThe device type could be OceanFX or OceanHDX. This is case sensitive.

Definition at line 142 of file OceanDirectAPI.py.

◆ add_rs232_device()

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.add_rs232_device (   self,
  device_type,
  bus_path,
  baud 
)

Adds a device connected via RS 232 to the device list.

Untested.

Parameters
[in]device_typeThe name of a type of device. This can be one of the following: QE-PRO, STS.
[in]bus_pathThe location of the device on the RS232 bus. This will be a platform-specific location. Under Windows, this may be COM1, COM2, etc. Under Linux, this might be /dev/ttyS0, /dev/ttyS1,
[in]baudThe baud rate. See device manual for supported baud rate.

Definition at line 319 of file OceanDirectAPI.py.

◆ close_device()

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.close_device (   self,
  device_id 
)

Detach from the device indicated by device_id.

This persists the device for later use.

Parameters
[in]device_idThe id of the device to be closed.

Definition at line 163 of file OceanDirectAPI.py.

◆ decode_error()

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.decode_error (   self,
  errno,
  caller 
)
OceanDirectAPI returns an error code if something goes wrong. This function will decode
that error to a readable string.

@param errno: The error code generated by OceanDirect api.
:type errno: int
@param caller: The caller which produces the error code. Use for debugging purposes only.
:type caller: str

Definition at line 77 of file OceanDirectAPI.py.

◆ find_devices()

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.find_devices (   self)

Finds all available Ocean devices by scanning on USB for devices with Ocean drivers, finding devices that respond to UDP multicast (FX and HDX), and also returning IDs for any TCP-enabled devices that have been manually specified using addTCPDeviceLocation().

Returns
Number of devices found.

Definition at line 187 of file OceanDirectAPI.py.

◆ find_usb_devices()

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.find_usb_devices (   self)

Finds all available Ocean devices by scanning on USB for devices with Ocean drivers.

Returns
Number of devices found.

Definition at line 211 of file OceanDirectAPI.py.

◆ from_serial_number()

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.from_serial_number (   self,
  serial_num 
)

Return a spectrometer object associated with device id.

User should not call this function. This function is used internally in OceanDirect.

Parameters
[in]serial_numThe device serial number.
Returns
The spectrometer object if found, None otherwise.

Definition at line 296 of file OceanDirectAPI.py.

◆ get_api_rc_version_number()

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.get_api_rc_version_number (   self)

Definition at line 97 of file OceanDirectAPI.py.

◆ get_api_version_numbers()

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.get_api_version_numbers (   self)

Return OceanDirect api version information.

Returns
An integer tuple of major, minor, and point value.

Definition at line 108 of file OceanDirectAPI.py.

◆ get_device_ids()

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.get_device_ids (   self)

Return a list of device ids from devices that were both probe or manually added.

Returns
List of device id's.

Definition at line 273 of file OceanDirectAPI.py.

◆ get_number_devices()

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.get_number_devices (   self)

Returns the number of devices available.

Returns
The number of connected(discovered) devices.

Definition at line 257 of file OceanDirectAPI.py.

◆ get_serial_number()

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.get_serial_number (   self,
  dev_id 
)

Gets the serial number of a specified device.

This is used internally to find the desired device.

Parameters
[in]dev_idThe id of a device.
Returns
The device serial number if found, None otherwise.

Definition at line 339 of file OceanDirectAPI.py.

◆ list_all_devices()

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.list_all_devices (   self)

Lists defined details of all active devices.

Definition at line 174 of file OceanDirectAPI.py.

◆ open_device()

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.open_device (   self,
  device_id 
)

Attach to a device discovered by probe_devices or get_device_ids.

It also saves it to a map keyed off of the device id.

Parameters
[in]device_idThe device id.
Returns
The device object.

Definition at line 124 of file OceanDirectAPI.py.

◆ shutdown()

def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.shutdown (   self)

Closes the connection to OceanDirectAPI.

This is the last to be called before the program terminates.

Definition at line 181 of file OceanDirectAPI.py.

Member Data Documentation

◆ device_ids

Python.oceandirect.OceanDirectAPI.OceanDirectAPI.device_ids

Definition at line 287 of file OceanDirectAPI.py.

◆ instance

Python.oceandirect.OceanDirectAPI.OceanDirectAPI.instance
static

Definition at line 64 of file OceanDirectAPI.py.

◆ num_devices

Python.oceandirect.OceanDirectAPI.OceanDirectAPI.num_devices

Definition at line 265 of file OceanDirectAPI.py.

◆ tcpip_devices

Python.oceandirect.OceanDirectAPI.OceanDirectAPI.tcpip_devices

Definition at line 197 of file OceanDirectAPI.py.

◆ usb_devices

Python.oceandirect.OceanDirectAPI.OceanDirectAPI.usb_devices

Definition at line 204 of file OceanDirectAPI.py.