PythonOceanDirect
1.31.0
OceanDirect Python API
|
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 | |
Definition at line 29 of file OceanDirectAPI.py.
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.
def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.__getattr__ | ( | self, | |
name | |||
) |
Definition at line 74 of file OceanDirectAPI.py.
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.
[in] | ipAddress | The ip address as string (ex: "10.20.30.100" ) of the device to be opened. |
[in] | deviceType | The device type could be OceanFX or OceanHDX. This is case sensitive. |
Definition at line 226 of file OceanDirectAPI.py.
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.
[in] | ipAddressStr | The ip address of the device to be opened. |
[in] | deviceTypeStr | The device type could be OceanFX or OceanHDX. This is case sensitive. |
Definition at line 142 of file OceanDirectAPI.py.
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.
[in] | device_type | The name of a type of device. This can be one of the following: QE-PRO, STS. |
[in] | bus_path | The 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] | baud | The baud rate. See device manual for supported baud rate. |
Definition at line 319 of file OceanDirectAPI.py.
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.
[in] | device_id | The id of the device to be closed. |
Definition at line 163 of file OceanDirectAPI.py.
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.
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().
Definition at line 187 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.find_usb_devices | ( | self | ) |
Finds all available Ocean devices by scanning on USB for devices with Ocean drivers.
Definition at line 211 of file OceanDirectAPI.py.
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.
[in] | serial_num | The device serial number. |
Definition at line 296 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.get_api_rc_version_number | ( | self | ) |
Definition at line 97 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.get_api_version_numbers | ( | self | ) |
Return OceanDirect api version information.
Definition at line 108 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.get_device_ids | ( | self | ) |
Return a list of device ids from devices that were both probe or manually added.
Definition at line 273 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.get_number_devices | ( | self | ) |
Returns the number of devices available.
Definition at line 257 of file OceanDirectAPI.py.
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.
[in] | dev_id | The id of a device. |
Definition at line 339 of file OceanDirectAPI.py.
def Python.oceandirect.OceanDirectAPI.OceanDirectAPI.list_all_devices | ( | self | ) |
Lists defined details of all active devices.
Definition at line 174 of file OceanDirectAPI.py.
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.
[in] | device_id | The device id. |
Definition at line 124 of file OceanDirectAPI.py.
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.
Python.oceandirect.OceanDirectAPI.OceanDirectAPI.device_ids |
Definition at line 287 of file OceanDirectAPI.py.
|
static |
Definition at line 64 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.OceanDirectAPI.num_devices |
Definition at line 265 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.OceanDirectAPI.tcpip_devices |
Definition at line 197 of file OceanDirectAPI.py.
Python.oceandirect.OceanDirectAPI.OceanDirectAPI.usb_devices |
Definition at line 204 of file OceanDirectAPI.py.